@deepraxis/sdk 0.1.0 → 0.1.1-dev.13dab28
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/METHODS.md +48 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +169 -73
- package/dist/generated/sdk.gen.js +265 -26
- package/dist/generated/types.gen.d.ts +4436 -853
- package/dist/operations.generated.d.ts +808 -59
- package/dist/operations.generated.js +1305 -498
- package/dist/resources.generated.d.ts +246 -19
- package/dist/resources.generated.js +28 -0
- package/package.json +1 -1
|
@@ -221,6 +221,245 @@ export const unblockEndUser = (options) => (options.client ?? client).post({
|
|
|
221
221
|
url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock',
|
|
222
222
|
...options
|
|
223
223
|
});
|
|
224
|
+
/**
|
|
225
|
+
* List customers
|
|
226
|
+
*
|
|
227
|
+
* List the customers of a service agent, identified and anonymous, most recently seen first.
|
|
228
|
+
*
|
|
229
|
+
* Call this from your backend with your API key, or from the console. Customers follow Shopify Admin customers (list, retrieve, block, sign-out and data deletion of the people who use your storefront), so that experience applies. The list includes customers who signed in but have not started a session yet, and customers recorded under your own ids by embed tokens before customer sign-in existed; an id first seen that way is identified unless it starts with anon_. Unlike Shopify, a customer can be anonymous: a visitor admitted with the publishable key gets an anon_ id, and when it later signs in with anonymous_access_token it is merged: merged_into names the identified customer, and its sessions count toward that customer. Filter with q (a case-sensitive customer id prefix), type (identified or anonymous) and blocked (true or false). limit is 1 to 100, default 20; reuse next_page with the same filters and limit. A customer access token gets 404. Example: GET /agent/v1/agents/agent_example/customers?type=identified&blocked=false&limit=50.
|
|
230
|
+
*/
|
|
231
|
+
export const listCustomers = (options) => (options.client ?? client).get({
|
|
232
|
+
security: [{
|
|
233
|
+
key: 'BearerAuth',
|
|
234
|
+
scheme: 'bearer',
|
|
235
|
+
type: 'http'
|
|
236
|
+
}, {
|
|
237
|
+
key: 'ApiKeyAuth',
|
|
238
|
+
name: 'X-API-Key',
|
|
239
|
+
type: 'apiKey'
|
|
240
|
+
}],
|
|
241
|
+
url: '/agent/v1/agents/{agent_id}/customers',
|
|
242
|
+
...options
|
|
243
|
+
});
|
|
244
|
+
/**
|
|
245
|
+
* Delete customer data
|
|
246
|
+
*
|
|
247
|
+
* Delete a customer's data from one service agent after explicit confirmation.
|
|
248
|
+
*
|
|
249
|
+
* Develop only. Set confirm to the exact customer id; a missing or different confirm returns 400 naming the value to send. Returns 202 with a pending task id; poll the deletion endpoint. Concurrent requests reuse the unfinished task; retry DELETE after failure to resume it. Tokens are revoked and the customer is blocked before a seven-day recovery snapshot is verified; sessions including child sessions, conversation data, grants and feedback are then removed. A block that existed before stays; a temporary block is removed on success. File attachments are retained. Example: DELETE /agent/v1/agents/agent_example/customers/cus_8f2a91?confirm=cus_8f2a91.
|
|
250
|
+
*/
|
|
251
|
+
export const deleteCustomer = (options) => (options.client ?? client).delete({
|
|
252
|
+
security: [{
|
|
253
|
+
key: 'BearerAuth',
|
|
254
|
+
scheme: 'bearer',
|
|
255
|
+
type: 'http'
|
|
256
|
+
}, {
|
|
257
|
+
key: 'ApiKeyAuth',
|
|
258
|
+
name: 'X-API-Key',
|
|
259
|
+
type: 'apiKey'
|
|
260
|
+
}],
|
|
261
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}',
|
|
262
|
+
...options
|
|
263
|
+
});
|
|
264
|
+
/**
|
|
265
|
+
* Get customer
|
|
266
|
+
*
|
|
267
|
+
* Retrieve one customer of a service agent with its twenty most recently updated sessions.
|
|
268
|
+
*
|
|
269
|
+
* Use the customer id from the list or your own customer_id. An unknown customer returns 404 CUSTOMER_NOT_FOUND, and so does a customer access token. Unlike Shopify, an identified customer's session_count, cost and recent_sessions include the sessions of anonymous customers merged into it; the merged anonymous customer still shows its own sessions and its merged_into.
|
|
270
|
+
*/
|
|
271
|
+
export const getCustomer = (options) => (options.client ?? client).get({
|
|
272
|
+
security: [{
|
|
273
|
+
key: 'BearerAuth',
|
|
274
|
+
scheme: 'bearer',
|
|
275
|
+
type: 'http'
|
|
276
|
+
}, {
|
|
277
|
+
key: 'ApiKeyAuth',
|
|
278
|
+
name: 'X-API-Key',
|
|
279
|
+
type: 'apiKey'
|
|
280
|
+
}],
|
|
281
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}',
|
|
282
|
+
...options
|
|
283
|
+
});
|
|
284
|
+
/**
|
|
285
|
+
* Get customer deletion
|
|
286
|
+
*
|
|
287
|
+
* Poll the latest deletion task of a customer, including after its data has been removed.
|
|
288
|
+
*
|
|
289
|
+
* Use the same agent_id and customer id as the confirmed DELETE. Status is pending, snapshotting, deleting, done or failed. Counts are empty until a verified snapshot exists. snapshot_key is an operator recovery reference retained for seven days, not a download URL. A customer access token and a missing task return 404.
|
|
290
|
+
*/
|
|
291
|
+
export const getCustomerDeletion = (options) => (options.client ?? client).get({
|
|
292
|
+
security: [{
|
|
293
|
+
key: 'BearerAuth',
|
|
294
|
+
scheme: 'bearer',
|
|
295
|
+
type: 'http'
|
|
296
|
+
}, {
|
|
297
|
+
key: 'ApiKeyAuth',
|
|
298
|
+
name: 'X-API-Key',
|
|
299
|
+
type: 'apiKey'
|
|
300
|
+
}],
|
|
301
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/deletion',
|
|
302
|
+
...options
|
|
303
|
+
});
|
|
304
|
+
/**
|
|
305
|
+
* Block customer
|
|
306
|
+
*
|
|
307
|
+
* Block a customer and end every sign-in it has on this agent.
|
|
308
|
+
*
|
|
309
|
+
* Blocks the customer, then ends every live sign-in the way logout does: each access token is revoked and its open event streams close. From then on grant_codes, access_tokens, renew and new sessions for this customer return CUSTOMER_BLOCKED until you unblock it. Idempotent: a repeat keeps the first block time and revokes whatever is still live. If credential revocation fails the request returns 502 and the customer stays blocked; retry to finish. An unknown customer returns 404 CUSTOMER_NOT_FOUND.
|
|
310
|
+
*/
|
|
311
|
+
export const blockCustomer = (options) => (options.client ?? client).post({
|
|
312
|
+
security: [{
|
|
313
|
+
key: 'BearerAuth',
|
|
314
|
+
scheme: 'bearer',
|
|
315
|
+
type: 'http'
|
|
316
|
+
}, {
|
|
317
|
+
key: 'ApiKeyAuth',
|
|
318
|
+
name: 'X-API-Key',
|
|
319
|
+
type: 'apiKey'
|
|
320
|
+
}],
|
|
321
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/block',
|
|
322
|
+
...options
|
|
323
|
+
});
|
|
324
|
+
/**
|
|
325
|
+
* Unblock customer
|
|
326
|
+
*
|
|
327
|
+
* Allow a blocked customer to sign in and start sessions again.
|
|
328
|
+
*
|
|
329
|
+
* Idempotent. Access tokens revoked while the customer was blocked stay revoked; sign the customer in again with a new grant code. An unknown customer returns 404 CUSTOMER_NOT_FOUND.
|
|
330
|
+
*/
|
|
331
|
+
export const unblockCustomer = (options) => (options.client ?? client).post({
|
|
332
|
+
security: [{
|
|
333
|
+
key: 'BearerAuth',
|
|
334
|
+
scheme: 'bearer',
|
|
335
|
+
type: 'http'
|
|
336
|
+
}, {
|
|
337
|
+
key: 'ApiKeyAuth',
|
|
338
|
+
name: 'X-API-Key',
|
|
339
|
+
type: 'apiKey'
|
|
340
|
+
}],
|
|
341
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/unblock',
|
|
342
|
+
...options
|
|
343
|
+
});
|
|
344
|
+
/**
|
|
345
|
+
* Revoke customer tokens
|
|
346
|
+
*
|
|
347
|
+
* Sign a customer out everywhere without blocking it.
|
|
348
|
+
*
|
|
349
|
+
* Ends every live sign-in of the customer, revoking each access token and closing its open event streams; the customer can sign in again right away. Returns the number of access tokens this request revoked; a repeat returns 0. Credential revocation failure returns 502; retry to finish. An unknown customer returns 404 CUSTOMER_NOT_FOUND.
|
|
350
|
+
*/
|
|
351
|
+
export const revokeCustomerTokens = (options) => (options.client ?? client).post({
|
|
352
|
+
security: [{
|
|
353
|
+
key: 'BearerAuth',
|
|
354
|
+
scheme: 'bearer',
|
|
355
|
+
type: 'http'
|
|
356
|
+
}, {
|
|
357
|
+
key: 'ApiKeyAuth',
|
|
358
|
+
name: 'X-API-Key',
|
|
359
|
+
type: 'apiKey'
|
|
360
|
+
}],
|
|
361
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/revoke_tokens',
|
|
362
|
+
...options
|
|
363
|
+
});
|
|
364
|
+
/**
|
|
365
|
+
* Get agent appearance
|
|
366
|
+
*
|
|
367
|
+
* Read the saved chat appearance of a service agent.
|
|
368
|
+
*
|
|
369
|
+
* Agent Kit calls this from the page with a customer access token of this agent; your API key and console members can read it too. A token of another agent returns 404. The body is the same as the embed appearance read; a missing appearance returns the agent's own name and avatar only. Responses are private and cacheable for 60 seconds.
|
|
370
|
+
*/
|
|
371
|
+
export const getAgentAppearance = (options) => (options.client ?? client).get({
|
|
372
|
+
security: [{
|
|
373
|
+
key: 'BearerAuth',
|
|
374
|
+
scheme: 'bearer',
|
|
375
|
+
type: 'http'
|
|
376
|
+
}, {
|
|
377
|
+
key: 'ApiKeyAuth',
|
|
378
|
+
name: 'X-API-Key',
|
|
379
|
+
type: 'apiKey'
|
|
380
|
+
}],
|
|
381
|
+
url: '/agent/v1/agents/{agent_id}/appearance',
|
|
382
|
+
...options
|
|
383
|
+
});
|
|
384
|
+
/**
|
|
385
|
+
* Create customer grant code
|
|
386
|
+
*
|
|
387
|
+
* Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.
|
|
388
|
+
*
|
|
389
|
+
* Call this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget (US dollars, at most 2 decimals), system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {"customer_id":"cus_8f2a91","origin":"https://shop.example.com"}.
|
|
390
|
+
*/
|
|
391
|
+
export const createCustomerGrantCode = (options) => (options.client ?? client).post({
|
|
392
|
+
security: [{
|
|
393
|
+
key: 'BearerAuth',
|
|
394
|
+
scheme: 'bearer',
|
|
395
|
+
type: 'http'
|
|
396
|
+
}, {
|
|
397
|
+
key: 'ApiKeyAuth',
|
|
398
|
+
name: 'X-API-Key',
|
|
399
|
+
type: 'apiKey'
|
|
400
|
+
}],
|
|
401
|
+
url: '/agent/v1/agents/{agent_id}/customers/auth/grant_codes',
|
|
402
|
+
...options,
|
|
403
|
+
headers: {
|
|
404
|
+
'Content-Type': 'application/json',
|
|
405
|
+
...options.headers
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
/**
|
|
409
|
+
* Create customer access token
|
|
410
|
+
*
|
|
411
|
+
* Exchange a grant code, or the agent's publishable key for an anonymous visitor, for a customer access token that authorizes the agent's embedded sessions.
|
|
412
|
+
*
|
|
413
|
+
* No Authorization header is required: the grant code or the publishable key is the credential. Agent Kit calls this from the browser, so send the page Origin. With grant_code, the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, used, expired and other-agent codes all return the same 401 GRANT_CODE_INVALID. The sign-in starts now and lasts the code's max_session_seconds. Unlike Shopify, a visitor without an account gets a token too: send publishable_key instead and a new anonymous customer (anon_…) is created, bound to the request Origin, for 7 days. The access token lasts at most two hours and never outlives the sign-in; renew it with access_tokens/renew before expires_at. Both forms share the per-IP minute limit of anonymous issuance (default 20). Example body: {"grant_code":"cgc_…"}.
|
|
414
|
+
*/
|
|
415
|
+
export const createCustomerAccessToken = (options) => (options.client ?? client).post({
|
|
416
|
+
url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens',
|
|
417
|
+
...options,
|
|
418
|
+
headers: {
|
|
419
|
+
'Content-Type': 'application/json',
|
|
420
|
+
...options.headers
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
/**
|
|
424
|
+
* Renew customer access token
|
|
425
|
+
*
|
|
426
|
+
* Get a fresh customer access token in the same sign-in, authenticated with the current one.
|
|
427
|
+
*
|
|
428
|
+
* Send the current customer access token as the Bearer credential, with no body, a few minutes before expires_at. The new token keeps the version, budget, context, metadata and origin binding of the sign-in and lasts at most two hours, never past session_expires_at. Unlike Shopify, renewal does not revoke the presented token: it stays valid until its own expiry, so a reply that is streaming on it is not cut off. When less than 60 seconds of the sign-in remain, renewal returns 401 CUSTOMER_SESSION_EXPIRED; sign the customer in again with a new grant code from your backend. A token that was logged out or merged returns 401 ACCESS_TOKEN_REVOKED.
|
|
429
|
+
*/
|
|
430
|
+
export const renewCustomerAccessToken = (options) => (options.client ?? client).post({
|
|
431
|
+
security: [{
|
|
432
|
+
key: 'BearerAuth',
|
|
433
|
+
scheme: 'bearer',
|
|
434
|
+
type: 'http'
|
|
435
|
+
}, {
|
|
436
|
+
key: 'ApiKeyAuth',
|
|
437
|
+
name: 'X-API-Key',
|
|
438
|
+
type: 'apiKey'
|
|
439
|
+
}],
|
|
440
|
+
url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/renew',
|
|
441
|
+
...options
|
|
442
|
+
});
|
|
443
|
+
/**
|
|
444
|
+
* Log out customer
|
|
445
|
+
*
|
|
446
|
+
* Log the customer out by revoking the sign-in of the presented access token and every token issued in it.
|
|
447
|
+
*
|
|
448
|
+
* Send the current customer access token as the Bearer credential, with no body, when the customer logs out of your site. Every token of the sign-in, including renewed ones, stops working, and their live event streams close; the customer's conversations are kept. Returns 204. Calling it again with the same token returns 401 ACCESS_TOKEN_REVOKED, so treat that as already logged out.
|
|
449
|
+
*/
|
|
450
|
+
export const deleteCurrentCustomerAccessToken = (options) => (options.client ?? client).delete({
|
|
451
|
+
security: [{
|
|
452
|
+
key: 'BearerAuth',
|
|
453
|
+
scheme: 'bearer',
|
|
454
|
+
type: 'http'
|
|
455
|
+
}, {
|
|
456
|
+
key: 'ApiKeyAuth',
|
|
457
|
+
name: 'X-API-Key',
|
|
458
|
+
type: 'apiKey'
|
|
459
|
+
}],
|
|
460
|
+
url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/current',
|
|
461
|
+
...options
|
|
462
|
+
});
|
|
224
463
|
/**
|
|
225
464
|
* Exchange Hosted Code
|
|
226
465
|
*
|
|
@@ -316,9 +555,9 @@ export const revokeEmbedToken = (options) => (options.client ?? client).post({
|
|
|
316
555
|
...options
|
|
317
556
|
});
|
|
318
557
|
/**
|
|
319
|
-
*
|
|
558
|
+
* List Computers
|
|
320
559
|
*
|
|
321
|
-
*
|
|
560
|
+
* List the computers of your organization, archived ones included.
|
|
322
561
|
*
|
|
323
562
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
324
563
|
*/
|
|
@@ -336,9 +575,9 @@ export const computersList = (options) => (options?.client ?? client).get({
|
|
|
336
575
|
...options
|
|
337
576
|
});
|
|
338
577
|
/**
|
|
339
|
-
*
|
|
578
|
+
* Create Computer
|
|
340
579
|
*
|
|
341
|
-
*
|
|
580
|
+
* Create a durable computer: a named machine whose files outlive sessions, for personal agents.
|
|
342
581
|
*
|
|
343
582
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
344
583
|
*/
|
|
@@ -380,9 +619,9 @@ export const computersDelete = (options) => (options.client ?? client).delete({
|
|
|
380
619
|
...options
|
|
381
620
|
});
|
|
382
621
|
/**
|
|
383
|
-
*
|
|
622
|
+
* Get Computer
|
|
384
623
|
*
|
|
385
|
-
*
|
|
624
|
+
* Read one computer's status, storage use and sandbox id.
|
|
386
625
|
*
|
|
387
626
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
388
627
|
*/
|
|
@@ -400,9 +639,9 @@ export const computersRetrieve = (options) => (options.client ?? client).get({
|
|
|
400
639
|
...options
|
|
401
640
|
});
|
|
402
641
|
/**
|
|
403
|
-
*
|
|
642
|
+
* Update Computer
|
|
404
643
|
*
|
|
405
|
-
*
|
|
644
|
+
* Rename a computer.
|
|
406
645
|
*
|
|
407
646
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
408
647
|
*/
|
|
@@ -424,9 +663,9 @@ export const computersUpdate = (options) => (options.client ?? client).post({
|
|
|
424
663
|
}
|
|
425
664
|
});
|
|
426
665
|
/**
|
|
427
|
-
*
|
|
666
|
+
* Archive Computer
|
|
428
667
|
*
|
|
429
|
-
*
|
|
668
|
+
* Archive a computer: its files stay readable but new sessions cannot use it.
|
|
430
669
|
*
|
|
431
670
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
432
671
|
*/
|
|
@@ -469,9 +708,9 @@ export const computersAttachmentsCreate = (options) => (options.client ?? client
|
|
|
469
708
|
}
|
|
470
709
|
});
|
|
471
710
|
/**
|
|
472
|
-
*
|
|
711
|
+
* List Computer Files
|
|
473
712
|
*
|
|
474
|
-
*
|
|
713
|
+
* List the entries of one directory on a computer.
|
|
475
714
|
*
|
|
476
715
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
477
716
|
*/
|
|
@@ -489,9 +728,9 @@ export const computersFilesList = (options) => (options.client ?? client).get({
|
|
|
489
728
|
...options
|
|
490
729
|
});
|
|
491
730
|
/**
|
|
492
|
-
*
|
|
731
|
+
* Get Computer File Content
|
|
493
732
|
*
|
|
494
|
-
*
|
|
733
|
+
* Download the bytes of one file on a computer, up to 16 MiB, with single-range support.
|
|
495
734
|
*
|
|
496
735
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
497
736
|
*/
|
|
@@ -2479,7 +2718,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
|
|
|
2479
2718
|
/**
|
|
2480
2719
|
* Create agent
|
|
2481
2720
|
*
|
|
2482
|
-
* Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions.
|
|
2721
|
+
* Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}.
|
|
2483
2722
|
*/
|
|
2484
2723
|
export const agentsCreate = (options) => (options.client ?? client).post({
|
|
2485
2724
|
security: [{
|
|
@@ -2501,7 +2740,7 @@ export const agentsCreate = (options) => (options.client ?? client).post({
|
|
|
2501
2740
|
/**
|
|
2502
2741
|
* Get agent
|
|
2503
2742
|
*
|
|
2504
|
-
* Read one agent by id
|
|
2743
|
+
* Read one agent by id. The top level is the latest saved version, the editable head whose version you send back for optimistic concurrency; after a save with apply false it differs from active_version, and new sessions use active_version, which you read with version=active. With version, read a specific saved version. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so it can be sent back unchanged to agents.update. Use agents.versions.list to enumerate versions.
|
|
2505
2744
|
*/
|
|
2506
2745
|
export const agentsRetrieve = (options) => (options.client ?? client).get({
|
|
2507
2746
|
security: [{
|
|
@@ -2519,7 +2758,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
|
|
|
2519
2758
|
/**
|
|
2520
2759
|
* Update agent
|
|
2521
2760
|
*
|
|
2522
|
-
* Update an agent. Send the current version in the body for optimistic concurrency: a stale version returns 409, and an update that changes nothing keeps the version number. Any real change saves a new version. apply defaults to true and moves active_version to the new version, or to the latest when configuration is unchanged; apply false saves without applying. version_note optionally records up to 280 characters on a newly created version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated.
|
|
2761
|
+
* Update an agent. Send the current version in the body for optimistic concurrency: a stale version returns 409, and an update that changes nothing keeps the version number. Any real change saves a new version. apply defaults to true and moves active_version to the new version, or to the latest when configuration is unchanged; apply false saves without applying. version_note optionally records up to 280 characters on a newly created version; null means no note, and a note sent when the request changes nothing else returns 400 because a note is stored only with a new version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400.
|
|
2523
2762
|
*/
|
|
2524
2763
|
export const agentsUpdate = (options) => (options.client ?? client).post({
|
|
2525
2764
|
security: [{
|
|
@@ -2559,7 +2798,7 @@ export const agentsArchive = (options) => (options.client ?? client).post({
|
|
|
2559
2798
|
/**
|
|
2560
2799
|
* List agent versions
|
|
2561
2800
|
*
|
|
2562
|
-
* List the saved versions of one agent, in pages of at most 100 (default 20). Each item is the full agent definition at that version, so you can compare what changed between versions. Use agents.retrieve with version to read a single one; agent_id comes from agents.list or agents.create.
|
|
2801
|
+
* List the saved versions of one agent, in pages of at most 100 (default 20). Each item is the full agent definition at that version, so you can compare what changed between versions. active is true only for the item that new sessions use; active_version on each item is the agent-level value, kept for compatibility. Use agents.retrieve with version to read a single one; agent_id comes from agents.list or agents.create.
|
|
2563
2802
|
*/
|
|
2564
2803
|
export const agentsVersionsList = (options) => (options.client ?? client).get({
|
|
2565
2804
|
security: [{
|
|
@@ -2577,7 +2816,7 @@ export const agentsVersionsList = (options) => (options.client ?? client).get({
|
|
|
2577
2816
|
/**
|
|
2578
2817
|
* List sessions
|
|
2579
2818
|
*
|
|
2580
|
-
* List sessions of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Unlike Anthropic Managed Agents, only limit, page, agent_id and
|
|
2819
|
+
* List sessions of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Archived sessions are hidden unless include_archived is true. Unlike Anthropic Managed Agents, only limit, page, agent_id, deployment_id and include_archived are honored; the other filters declared here (agent_version, created_at ranges, memory_store_id, order, statuses) are not supported and return 400. Use the returned id with sessions.retrieve or sessions.events.list; pass next_page as page for the next page.
|
|
2581
2820
|
*/
|
|
2582
2821
|
export const sessionsList = (options) => (options?.client ?? client).get({
|
|
2583
2822
|
security: [{
|
|
@@ -2595,7 +2834,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
2595
2834
|
/**
|
|
2596
2835
|
* Create session
|
|
2597
2836
|
*
|
|
2598
|
-
* Create a session: one conversation with an agent. Pass agent as an agent id
|
|
2837
|
+
* Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive integer string of US cents ("2000" is USD 20.00); omitted budget defaults to "2000" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.
|
|
2599
2838
|
*/
|
|
2600
2839
|
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
2601
2840
|
security: [{
|
|
@@ -2801,7 +3040,7 @@ export const environmentsRetrieve = (options) => (options.client ?? client).get(
|
|
|
2801
3040
|
/**
|
|
2802
3041
|
* Update environment
|
|
2803
3042
|
*
|
|
2804
|
-
* Update the configuration of a tenant-owned cloud environment. Built-in environments are read-only. Package installation and limited networking are applied when a session's sandbox is created. Omitted fields keep their value.
|
|
3043
|
+
* Update the configuration of a tenant-owned cloud environment. Built-in environments are read-only. Package installation and limited networking are applied when a session's sandbox is created. Omitted fields keep their value. A changed config.template must name an available sandbox template, otherwise 400 lists the available ones.
|
|
2805
3044
|
*/
|
|
2806
3045
|
export const environmentsUpdate = (options) => (options.client ?? client).post({
|
|
2807
3046
|
security: [{
|
|
@@ -2823,7 +3062,7 @@ export const environmentsUpdate = (options) => (options.client ?? client).post({
|
|
|
2823
3062
|
/**
|
|
2824
3063
|
* Archive environment
|
|
2825
3064
|
*
|
|
2826
|
-
* Soft-archive a tenant-owned cloud environment so it can no longer be used to create new sessions. Built-in environments are read-only and cannot be archived.
|
|
3065
|
+
* Soft-archive a tenant-owned cloud environment so it can no longer be used to create new sessions. Built-in environments are read-only and cannot be archived. An environment that the active version of a non-archived agent uses as environment_id returns 409 RESOURCE_IN_USE naming the agents; point them at another environment first.
|
|
2827
3066
|
*/
|
|
2828
3067
|
export const environmentsArchive = (options) => (options.client ?? client).post({
|
|
2829
3068
|
security: [{
|
|
@@ -2859,7 +3098,7 @@ export const environmentsList = (options) => (options?.client ?? client).get({
|
|
|
2859
3098
|
/**
|
|
2860
3099
|
* Create environment
|
|
2861
3100
|
*
|
|
2862
|
-
* Create a tenant-owned cloud environment: a sandbox recipe (packages to install and networking policy) that sessions can select through environment_id. Package installation happens when the session's sandbox is created; a failed install terminates that session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. Limited networking is applied at sandbox creation. Unlike Anthropic Managed Agents, self_hosted environments, scope and cross-session package caching are not supported.
|
|
3101
|
+
* Create a tenant-owned cloud environment: a sandbox recipe (packages to install and networking policy) that sessions can select through environment_id. Package installation happens when the session's sandbox is created; a failed install terminates that session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. Limited networking is applied at sandbox creation. Unlike Anthropic Managed Agents, self_hosted environments, scope and cross-session package caching are not supported. config.template must name an available sandbox template, otherwise 400 lists the available ones.
|
|
2863
3102
|
*/
|
|
2864
3103
|
export const environmentsCreate = (options) => (options.client ?? client).post({
|
|
2865
3104
|
security: [{
|
|
@@ -3163,7 +3402,7 @@ export const skillsList = (options) => (options?.client ?? client).get({
|
|
|
3163
3402
|
/**
|
|
3164
3403
|
* Create skill
|
|
3165
3404
|
*
|
|
3166
|
-
* Upload a skill: a directory that contains SKILL.md, which the agent reads when it needs the skill. Send multipart/form-data with one files part per file, each file name being its path under one top-level directory (pdf/SKILL.md, pdf/scripts/run.py), and an optional display_name. SKILL.md frontmatter needs a description; name defaults to the directory name. Limits: 8 MB in total, at most 200 files, no .. segments, absolute paths or empty names; a violation returns 400 naming the path or field. The upload creates the skill and its first version, and versions are immutable. Attach the skill to an agent with `skills` on the agent.
|
|
3405
|
+
* Upload a skill: a directory that contains SKILL.md, which the agent reads when it needs the skill. Send multipart/form-data with one files part per file, each file name being its path under one top-level directory (pdf/SKILL.md, pdf/scripts/run.py), and an optional display_name. SKILL.md frontmatter needs a description; name defaults to the directory name and must be one folder name (1-255 characters, no "/", backslash or NUL, not "." or ".."), otherwise the upload returns 400 stating the allowed form. Limits: 8 MB in total, at most 200 files, no .. segments, absolute paths or empty names; a violation returns 400 naming the path or field. The upload creates the skill and its first version, and versions are immutable. Attach the skill to an agent with `skills` on the agent.
|
|
3167
3406
|
*/
|
|
3168
3407
|
export const skillsCreate = (options) => (options.client ?? client).post({
|
|
3169
3408
|
...formDataBodySerializer,
|
|
@@ -3186,7 +3425,7 @@ export const skillsCreate = (options) => (options.client ?? client).post({
|
|
|
3186
3425
|
/**
|
|
3187
3426
|
* Delete skill
|
|
3188
3427
|
*
|
|
3189
|
-
* Delete a skill
|
|
3428
|
+
* Delete a skill together with all of its versions. A skill that is still attached to an agent returns 409 RESOURCE_IN_USE naming up to 10 agent ids (the active or latest version of a non-archived agent counts); remove it from those agents first. Returns {id, type: skill_deleted}. skill_id comes from skills.create or skills.list.
|
|
3190
3429
|
*/
|
|
3191
3430
|
export const skillsDelete = (options) => (options.client ?? client).delete({
|
|
3192
3431
|
security: [{
|
|
@@ -3263,7 +3502,7 @@ export const skillsVersionsCreate = (options) => (options.client ?? client).post
|
|
|
3263
3502
|
/**
|
|
3264
3503
|
* Delete skill version
|
|
3265
3504
|
*
|
|
3266
|
-
* Soft-delete one version of a skill so it can no longer be read or downloaded; latest_version_id of the skill falls back to the newest remaining version. Returns {id, type: skill_version_deleted}. A skill
|
|
3505
|
+
* Soft-delete one version of a skill so it can no longer be read or downloaded; latest_version_id of the skill falls back to the newest remaining version. Returns {id, type: skill_version_deleted}. A skill keeps at least one version: deleting the last remaining version returns 409 SKILL_LAST_VERSION (delete the skill instead), so latest_version_id is never null. A version that a non-archived agent pins returns 409 RESOURCE_IN_USE naming the agents.
|
|
3267
3506
|
*/
|
|
3268
3507
|
export const skillsVersionsDelete = (options) => (options.client ?? client).delete({
|
|
3269
3508
|
security: [{
|