@deepraxis/sdk 0.2.0-dev.47ce97a → 0.2.0-dev.49e9c46
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 +30 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +95 -17
- package/dist/generated/sdk.gen.js +242 -16
- package/dist/generated/types.gen.d.ts +1942 -48
- package/dist/helpers/browser-actions.d.ts +2 -0
- package/dist/helpers/browser-actions.js +2 -0
- package/dist/helpers/browser-connect.d.ts +10 -1
- package/dist/helpers/browser-connect.js +29 -6
- package/dist/helpers/browser-decisions.d.ts +2 -0
- package/dist/helpers/browser-decisions.js +7 -0
- package/dist/helpers/browser-documentation.d.ts +1 -1
- package/dist/helpers/browser-documentation.js +1 -0
- package/dist/operations.generated.js +505 -31
- package/dist/resources.generated.d.ts +107 -0
- package/dist/resources.generated.js +19 -0
- package/package.json +1 -1
|
@@ -558,7 +558,7 @@ export const computersRetrieve = (options) => (options.client ?? client).get({
|
|
|
558
558
|
/**
|
|
559
559
|
* Update Computer
|
|
560
560
|
*
|
|
561
|
-
* Rename a computer.
|
|
561
|
+
* Rename a computer, declare its environment, or drop that declaration without touching the machine.
|
|
562
562
|
*
|
|
563
563
|
* 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; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
|
|
564
564
|
*/
|
|
@@ -732,9 +732,9 @@ export const computersFilesConvert = (options) => (options.client ?? client).pos
|
|
|
732
732
|
*
|
|
733
733
|
* Resume the computer and issue a sandbox connection.
|
|
734
734
|
*
|
|
735
|
-
* Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id, plus
|
|
735
|
+
* Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id, plus tier (kept for compatibility: a Computer is one machine, so tier does not name a machine you can choose) and the lease that keeps the machine in service (lease_id, lease_expires_at; lease_id is null when no lease exists). Keep the lease while the connection stays open: renew it about every 20 seconds (POST .../leases/{lease_id}/renew) and release it on close (DELETE .../leases/{lease_id}). An unrenewed lease simply expires, and the machine is reclaimed only after that. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.
|
|
736
736
|
*
|
|
737
|
-
* Connect to a computer with a caller-held lease. Omit the body or send {}
|
|
737
|
+
* Connect to a computer with a caller-held lease. Omit the body or send {}: the optional need field is accepted for compatibility and changes nothing, because a Computer is one machine. Renew the lease while using the connection and release it with DELETE when finished.
|
|
738
738
|
*/
|
|
739
739
|
export const connectComputer = (options) => (options.client ?? client).post({
|
|
740
740
|
security: [{
|
|
@@ -1228,7 +1228,7 @@ export const browserListSessions = (options) => (options?.client ?? client).get(
|
|
|
1228
1228
|
/**
|
|
1229
1229
|
* 创建浏览器会话
|
|
1230
1230
|
*
|
|
1231
|
-
* 创建云端 Chrome,返回自带凭证的 connectUrl;带 name 时按名字幂等:本账户已有同名且 RUNNING(未在释放中)、挂载的登录态与本次相同(都没挂也算相同)的会话,就直接返回这个会话(HTTP 200,reused=true,不新开、不计费),同名但登录态不同返回 409 SESSION_NAME_IN_USE(消息写明已有会话的 id),同名会话已在释放或已结束则新开;不带 name 时每次都新开(HTTP 201,reused=false)。同一件事请固定一个会话名并复用,不要每步新开再关闭:频繁新开会话对网站来说像同一账号不断换新设备登录,容易触发风控。persist 写入租约仍只属于这一个会话。它是一条完整 CDP 连接,真指针事件(触摸、拖拽、按坐标点击)从那里发送,页面动作接口只做按 ref 的语义动作。API 会话默认断开后结束;最长 6
|
|
1231
|
+
* 创建云端 Chrome,返回自带凭证的 connectUrl;带 name 时按名字幂等:本账户已有同名且 RUNNING(未在释放中)、挂载的登录态与本次相同(都没挂也算相同)的会话,就直接返回这个会话(HTTP 200,reused=true,不新开、不计费),同名但登录态不同返回 409 SESSION_NAME_IN_USE(消息写明已有会话的 id),同名会话已在释放或已结束则新开;不带 name 时每次都新开(HTTP 201,reused=false)。同一件事请固定一个会话名并复用,不要每步新开再关闭:频繁新开会话对网站来说像同一账号不断换新设备登录,容易触发风控。persist 写入租约仍只属于这一个会话。它是一条完整 CDP 连接,真指针事件(触摸、拖拽、按坐标点击)从那里发送,页面动作接口只做按 ref 的语义动作。API 会话默认断开后结束;最长 6 小时。请求体里不认识的字段返回 400 INVALID_PARAMS 并写明字段名,不会被静默忽略;登录态写在 browserSettings.context({ id, persist }),写在顶层会被拒绝。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
|
|
1232
1232
|
*/
|
|
1233
1233
|
export const browserCreateSession = (options) => (options.client ?? client).post({
|
|
1234
1234
|
security: [{
|
|
@@ -1306,7 +1306,7 @@ export const browserListEvents = (options) => (options.client ?? client).get({
|
|
|
1306
1306
|
/**
|
|
1307
1307
|
* 执行页面动作
|
|
1308
1308
|
*
|
|
1309
|
-
* 在会话的浏览器里执行一个页面动作并返回结果,由浏览器服务执行,客户端不需要 Playwright。同一会话的动作按到达顺序串行执行,单个动作 30 秒内完成。先用 snapshot 读取页面:元素带 [ref=eN],click、fill、select 按 ref 操作;ref 只在最近一次快照里有效,页面跳转后失效(409 ACTION_REF_STALE,重新 snapshot)。省略 tab 时作用于当前标签页。动作都是语义动作:click、fill、select 按快照 ref 定位元素,scroll
|
|
1309
|
+
* 在会话的浏览器里执行一个页面动作并返回结果,由浏览器服务执行,客户端不需要 Playwright。同一会话的动作按到达顺序串行执行,单个动作 30 秒内完成。先用 snapshot 读取页面:元素带 [ref=eN],click、fill、select 按 ref 操作;ref 只在最近一次快照里有效,页面跳转后失效(409 ACTION_REF_STALE,重新 snapshot)。省略 tab 时作用于当前标签页。动作都是语义动作:click、fill、select 按快照 ref 定位元素,scroll 派发滚轮事件;网络层用 route、unroute、routes 拦截请求(对标 Playwright 的 context.route 与 CDP Fetch 域):规则挂在会话上,open、reload、新开标签页之后仍然有效,会话结束时清除,多条规则都匹配时后注册的优先;没有触摸、拖拽或按坐标点击,也没有按坐标派发指针事件的动作。页面必须收到真手指或指针事件(touchstart/touchmove/touchend、拖拽、按坐标点击)时,改用 CDP 连接:使用创建会话返回的 connectUrl,或 /browser/v1/connect 建立连接,再发送 Input.dispatchTouchEvent、Input.dispatchMouseEvent 等 CDP 命令。
|
|
1310
1310
|
*/
|
|
1311
1311
|
export const browserRunPageAction = (options) => (options.client ?? client).post({
|
|
1312
1312
|
security: [{
|
|
@@ -1559,7 +1559,7 @@ export const browserClaimByobPairing = (options) => (options.client ?? client).p
|
|
|
1559
1559
|
/**
|
|
1560
1560
|
* 连接云端浏览器
|
|
1561
1561
|
*
|
|
1562
|
-
* CDP WebSocket:不填 session 或 name 时新开;session 连接已有会话;name 有就连接、没有就新开。session 与 name 不可同时提供。新建参数在连接已有会话时忽略。使用 Authorization: Bearer API_KEY,或直接使用创建会话返回的带 signingKey 的 connectUrl。连上后发送 CDP 命令 Praxis.getSession,获取 sessionId、liveViewUrl、consoleUrl
|
|
1562
|
+
* CDP WebSocket:不填 session 或 name 时新开;session 连接已有会话;name 有就连接、没有就新开。session 与 name 不可同时提供。新建参数在连接已有会话时忽略。使用 Authorization: Bearer API_KEY,或直接使用创建会话返回的带 signingKey 的 connectUrl。连上后发送 CDP 命令 Praxis.getSession,获取 sessionId、liveViewUrl、consoleUrl(两者都是该会话在 Console 的会话页)。这是完整 CDP 连接:真手指或指针事件(Emulation.setTouchEmulationEnabled 加 Input.dispatchTouchEvent、拖拽用的 Input.dispatchMouseEvent)只能从这里发,页面动作接口只做按 ref 的语义动作。要挂指定登录态,可用 context 参数,或直接连接 sessions.create 返回的 connectUrl。
|
|
1563
1563
|
*/
|
|
1564
1564
|
export const browserConnect = (options) => (options?.client ?? client).get({
|
|
1565
1565
|
security: [{
|
|
@@ -1577,7 +1577,7 @@ export const browserConnect = (options) => (options?.client ?? client).get({
|
|
|
1577
1577
|
/**
|
|
1578
1578
|
* 打开实时浏览器画面
|
|
1579
1579
|
*
|
|
1580
|
-
*
|
|
1580
|
+
* 旧版 debug 返回的带 t 凭证的地址,凭证在有效期内时跳转到该会话在 Console 的会话页。debug 现在直接返回 Console 会话页地址,新代码不要拼这个地址。
|
|
1581
1581
|
*/
|
|
1582
1582
|
export const browserLiveView = (options) => (options.client ?? client).get({
|
|
1583
1583
|
security: [{
|
|
@@ -3165,7 +3165,7 @@ export const createOrganizationFeedbackMessage = (options) => (options.client ??
|
|
|
3165
3165
|
/**
|
|
3166
3166
|
* List Organization Costs
|
|
3167
3167
|
*
|
|
3168
|
-
* Billed cost per time bucket per group (AWS GetCostAndUsage shape). Buckets are whole
|
|
3168
|
+
* Billed cost per time bucket per group (AWS GetCostAndUsage shape). Buckets are whole hour or day periods in time_zone (UTC by default); a window is answered over the aligned envelope covering it. Amounts are exact decimal strings in the currency the organization was charged in (BillingCurrency, CNY or USD); a group charged in two currencies is two results. estimated is always false: charges are final when they are recorded. Windows span at most 93 days; longer ranges belong to the charges export.
|
|
3169
3169
|
*
|
|
3170
3170
|
*/
|
|
3171
3171
|
export const listOrganizationCosts = (options) => (options.client ?? client).get({
|
|
@@ -3184,7 +3184,7 @@ export const listOrganizationCosts = (options) => (options.client ?? client).get
|
|
|
3184
3184
|
/**
|
|
3185
3185
|
* List Organization Usage
|
|
3186
3186
|
*
|
|
3187
|
-
* Consumed quantity per time bucket per group. Buckets are whole
|
|
3187
|
+
* Consumed quantity per time bucket per group. Buckets are whole hour or day periods in time_zone (UTC by default) covering the requested window. Each result carries exactly one ConsumedQuantity + ConsumedUnit — quantities of different units are never added together.
|
|
3188
3188
|
*
|
|
3189
3189
|
*/
|
|
3190
3190
|
export const listOrganizationUsage = (options) => (options.client ?? client).get({
|
|
@@ -3276,9 +3276,9 @@ export const getOrganizationNotificationsInbox = (options) => (options?.client ?
|
|
|
3276
3276
|
...options
|
|
3277
3277
|
});
|
|
3278
3278
|
/**
|
|
3279
|
-
* List the letters addressed to you
|
|
3279
|
+
* List the letters addressed to you, or the ones you sent
|
|
3280
3280
|
*
|
|
3281
|
-
* The letters this person received in this organization, newest first, as the notification center lists them (ADR-193 §5, #4107): the sender, the summary and the whole body are the copy this reader receives — every human:/agent: address is rendered as the directory's display name, and one the directory cannot name reads 「未知成员」, never an address or an internal id. Also the kind, when it arrived, whether it is read, and one line saying why it reached this person. The address is the credential's own and is never a request field. Details stay whole in body; open one by its id. Pass next_cursor unchanged as cursor; null ends the list. Read-only; no usage charge.
|
|
3281
|
+
* The letters this person received (or, with direction=sent, wrote) in this organization, newest first, as the notification center lists them (ADR-193 §5, #4107): the sender, the summary and the whole body are the copy this reader receives — every human:/agent: address is rendered as the directory's display name, and one the directory cannot name reads 「未知成员」, never an address or an internal id. Also the kind, when it arrived, whether it is read, and one line saying why it reached this person. The address is the credential's own and is never a request field. Details stay whole in body; open one by its id. Pass next_cursor unchanged as cursor; null ends the list. Read-only; no usage charge.
|
|
3282
3282
|
*/
|
|
3283
3283
|
export const listOrganizationNotificationLetters = (options) => (options?.client ?? client).get({
|
|
3284
3284
|
security: [{
|
|
@@ -3293,6 +3293,28 @@ export const listOrganizationNotificationLetters = (options) => (options?.client
|
|
|
3293
3293
|
url: '/organization/v1/notifications/letters',
|
|
3294
3294
|
...options
|
|
3295
3295
|
});
|
|
3296
|
+
/**
|
|
3297
|
+
* Send a letter to a person or an agent
|
|
3298
|
+
*
|
|
3299
|
+
* Write one letter to a member or an agent of this organization, for an automation script or an outside caller that needs to reach someone, or to leave itself an alarm: a letter to your own address is allowed and arrives at its deliver_at. The sender is the credential's own and is never a request field — a person writes as themselves, an agent as itself, and an automation run (a scheduled or service-started one included) as the platform's automation sender with the run recorded in the letter's source; a `sender` in the body is ignored. Any other credential (an organization API key, an application) has no address to write from and is refused with 403. The recipient must belong to this organization: a person or agent of another organization answers 404 without saying whether it exists. A letter to a person needs a summary of at most 60 characters — one sentence saying what the reader must do or know; a longer one is refused, never cut. An agent's letter may leave summary out and the first line of body stands in. Repeating the same letter (same recipient, kind, thread, body and time) returns the same id and writes it once. Usage charge: none.
|
|
3300
|
+
*/
|
|
3301
|
+
export const createOrganizationNotificationLetter = (options) => (options.client ?? client).post({
|
|
3302
|
+
security: [{
|
|
3303
|
+
key: 'BearerAuth',
|
|
3304
|
+
scheme: 'bearer',
|
|
3305
|
+
type: 'http'
|
|
3306
|
+
}, {
|
|
3307
|
+
key: 'ApiKeyAuth',
|
|
3308
|
+
name: 'X-API-Key',
|
|
3309
|
+
type: 'apiKey'
|
|
3310
|
+
}],
|
|
3311
|
+
url: '/organization/v1/notifications/letters',
|
|
3312
|
+
...options,
|
|
3313
|
+
headers: {
|
|
3314
|
+
'Content-Type': 'application/json',
|
|
3315
|
+
...options.headers
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3296
3318
|
/**
|
|
3297
3319
|
* Open one of your letters by its id
|
|
3298
3320
|
*
|
|
@@ -3369,6 +3391,100 @@ export const archiveOrganizationNotificationLetter = (options) => (options.clien
|
|
|
3369
3391
|
url: '/organization/v1/notifications/letters/{id}:archive',
|
|
3370
3392
|
...options
|
|
3371
3393
|
});
|
|
3394
|
+
/**
|
|
3395
|
+
* List your bell messages
|
|
3396
|
+
*
|
|
3397
|
+
* The calling person's bell messages in this organization, newest first: the inbox tab by default, or the archive tab with archived=1. The person is always the credential's own; the request cannot name another member. Pass nextPageToken unchanged as page for the next page; it is absent on the last one. Read-only; no usage charge.
|
|
3398
|
+
*/
|
|
3399
|
+
export const listOrganizationNotificationMessages = (options) => (options?.client ?? client).get({
|
|
3400
|
+
security: [{
|
|
3401
|
+
key: 'BearerAuth',
|
|
3402
|
+
scheme: 'bearer',
|
|
3403
|
+
type: 'http'
|
|
3404
|
+
}, {
|
|
3405
|
+
key: 'ApiKeyAuth',
|
|
3406
|
+
name: 'X-API-Key',
|
|
3407
|
+
type: 'apiKey'
|
|
3408
|
+
}],
|
|
3409
|
+
url: '/organization/v1/notifications/messages',
|
|
3410
|
+
...options
|
|
3411
|
+
});
|
|
3412
|
+
/**
|
|
3413
|
+
* Delete one of your bell messages
|
|
3414
|
+
*
|
|
3415
|
+
* Delete one of the calling person's own bell messages for good. A message that is not theirs — another person's, another organization's — answers 404 exactly as one that does not exist, and nothing is deleted. Deleting a message does not delete the letter or notice it announced. No usage charge.
|
|
3416
|
+
*/
|
|
3417
|
+
export const deleteOrganizationNotificationMessage = (options) => (options.client ?? client).delete({
|
|
3418
|
+
security: [{
|
|
3419
|
+
key: 'BearerAuth',
|
|
3420
|
+
scheme: 'bearer',
|
|
3421
|
+
type: 'http'
|
|
3422
|
+
}, {
|
|
3423
|
+
key: 'ApiKeyAuth',
|
|
3424
|
+
name: 'X-API-Key',
|
|
3425
|
+
type: 'apiKey'
|
|
3426
|
+
}],
|
|
3427
|
+
url: '/organization/v1/notifications/messages/{name}',
|
|
3428
|
+
...options
|
|
3429
|
+
});
|
|
3430
|
+
/**
|
|
3431
|
+
* Open one of your bell messages
|
|
3432
|
+
*
|
|
3433
|
+
* One bell message of the calling person by its name. A message that is not theirs — another person's, another organization's — answers 404 exactly as one that does not exist, without saying which. Read-only; no usage charge.
|
|
3434
|
+
*/
|
|
3435
|
+
export const getOrganizationNotificationMessage = (options) => (options.client ?? client).get({
|
|
3436
|
+
security: [{
|
|
3437
|
+
key: 'BearerAuth',
|
|
3438
|
+
scheme: 'bearer',
|
|
3439
|
+
type: 'http'
|
|
3440
|
+
}, {
|
|
3441
|
+
key: 'ApiKeyAuth',
|
|
3442
|
+
name: 'X-API-Key',
|
|
3443
|
+
type: 'apiKey'
|
|
3444
|
+
}],
|
|
3445
|
+
url: '/organization/v1/notifications/messages/{name}',
|
|
3446
|
+
...options
|
|
3447
|
+
});
|
|
3448
|
+
/**
|
|
3449
|
+
* Mark one of your bell messages read or archived
|
|
3450
|
+
*
|
|
3451
|
+
* Change the read or archived flag of one of the calling person's own bell messages and return it. Name at least one flag. Reading a message also tells the notification still waiting on it, so it is not emailed later as unread. A message that is not theirs answers 404 like one that does not exist. No usage charge.
|
|
3452
|
+
*/
|
|
3453
|
+
export const updateOrganizationNotificationMessage = (options) => (options.client ?? client).post({
|
|
3454
|
+
security: [{
|
|
3455
|
+
key: 'BearerAuth',
|
|
3456
|
+
scheme: 'bearer',
|
|
3457
|
+
type: 'http'
|
|
3458
|
+
}, {
|
|
3459
|
+
key: 'ApiKeyAuth',
|
|
3460
|
+
name: 'X-API-Key',
|
|
3461
|
+
type: 'apiKey'
|
|
3462
|
+
}],
|
|
3463
|
+
url: '/organization/v1/notifications/messages/{name}',
|
|
3464
|
+
...options,
|
|
3465
|
+
headers: {
|
|
3466
|
+
'Content-Type': 'application/json',
|
|
3467
|
+
...options.headers
|
|
3468
|
+
}
|
|
3469
|
+
});
|
|
3470
|
+
/**
|
|
3471
|
+
* Mark all your unread bell messages read
|
|
3472
|
+
*
|
|
3473
|
+
* Mark every unread, unarchived bell message of the calling person in this organization as read, and tell the notifications still waiting on them. Nothing of anyone else's is touched. Returns how many messages changed; 0 when there was nothing unread. No usage charge.
|
|
3474
|
+
*/
|
|
3475
|
+
export const readAllOrganizationNotificationMessages = (options) => (options?.client ?? client).post({
|
|
3476
|
+
security: [{
|
|
3477
|
+
key: 'BearerAuth',
|
|
3478
|
+
scheme: 'bearer',
|
|
3479
|
+
type: 'http'
|
|
3480
|
+
}, {
|
|
3481
|
+
key: 'ApiKeyAuth',
|
|
3482
|
+
name: 'X-API-Key',
|
|
3483
|
+
type: 'apiKey'
|
|
3484
|
+
}],
|
|
3485
|
+
url: '/organization/v1/notifications/messages:readAll',
|
|
3486
|
+
...options
|
|
3487
|
+
});
|
|
3372
3488
|
/**
|
|
3373
3489
|
* Your notification switches, and what they resolve to
|
|
3374
3490
|
*
|
|
@@ -3935,6 +4051,24 @@ export const getByodPairing = (options) => (options.client ?? client).get({
|
|
|
3935
4051
|
url: '/sandbox/v1/byod/pairings/{code}',
|
|
3936
4052
|
...options
|
|
3937
4053
|
});
|
|
4054
|
+
/**
|
|
4055
|
+
* Read which device claimed your pairing
|
|
4056
|
+
*
|
|
4057
|
+
* Read one of your organization's own pairings: its code, its deadline and the device that claimed it. Poll it after showing the QR payload to learn that this very code was claimed, instead of guessing from the device list: claimed_device is null until a phone taps Allow, then it is the device that code registered (a phone that was paired before is reused, so it is the same device id). Unlike getByodPairing this call is authenticated and organization-scoped. An unknown code and another organization's code both answer 404, so the answer never reveals that a foreign pairing exists. Example: GET /sandbox/v1/byod/pairings/K7M4PQRS/status returns {code:'K7M4PQRS',expires_at:'2026-11-22T13:10:00.000Z',claimed_device:null}.
|
|
4058
|
+
*/
|
|
4059
|
+
export const getByodPairingStatus = (options) => (options.client ?? client).get({
|
|
4060
|
+
security: [{
|
|
4061
|
+
key: 'BearerAuth',
|
|
4062
|
+
scheme: 'bearer',
|
|
4063
|
+
type: 'http'
|
|
4064
|
+
}, {
|
|
4065
|
+
key: 'ApiKeyAuth',
|
|
4066
|
+
name: 'X-API-Key',
|
|
4067
|
+
type: 'apiKey'
|
|
4068
|
+
}],
|
|
4069
|
+
url: '/sandbox/v1/byod/pairings/{code}/status',
|
|
4070
|
+
...options
|
|
4071
|
+
});
|
|
3938
4072
|
/**
|
|
3939
4073
|
* Claim a pairing and register the phone
|
|
3940
4074
|
*
|
|
@@ -5178,7 +5312,7 @@ export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
|
5178
5312
|
/**
|
|
5179
5313
|
* Update session
|
|
5180
5314
|
*
|
|
5181
|
-
* Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived;
|
|
5315
|
+
* Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; secrets reach the session's machine as environment variables and are matched against its MCP servers. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
|
|
5182
5316
|
*/
|
|
5183
5317
|
export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
5184
5318
|
security: [{
|
|
@@ -5334,7 +5468,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
5334
5468
|
/**
|
|
5335
5469
|
* Create session
|
|
5336
5470
|
*
|
|
5337
|
-
* 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 (node22 for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. The retired "light" returns 400 naming the two forms that work: "node22", or null for no machine. 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.
|
|
5471
|
+
* 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 (node22 for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. The retired "light" returns 400 naming the two forms that work: "node22", or null for no machine. 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. vault_ids (at most 50, owned by the organization, not archived) adds vaults to the agent's own vault_ids, the ones its department or organization rule grants attach, and the session carries both sets from creation; sessions.update replaces the session's own set later. The secrets of those vaults reach the session's machine as environment variables named after the secret, in every command it runs, and are matched against its MCP servers; a service agent's session skips OAuth credentials and secrets that declare allowed_hosts, and names the platform login owns are never taken. allowed_hosts does not limit what a command does with an exported value. A session with no machine has no environment. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" 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. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.
|
|
5338
5472
|
*/
|
|
5339
5473
|
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
5340
5474
|
security: [{
|
|
@@ -5714,7 +5848,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
|
|
|
5714
5848
|
/**
|
|
5715
5849
|
* Create deployment
|
|
5716
5850
|
*
|
|
5717
|
-
* Freeze session parameters as a deployment; this operation does not open a session. An agent reference with only an id follows the agent's active version: each run uses the version in effect at that moment, so a later agent save reaches the next run with no edit here. Name a version to pin it; only a version that is applied can be pinned, so a save made with apply false is refused with 409 AGENT_VERSION_NOT_APPLIED. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. environment_id and target are alternatives: send at least one of them; target:{type:"computer"} is for general agents and needs no environment_id, while target:{type:"environment"} still requires one. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived;
|
|
5851
|
+
* Freeze session parameters as a deployment; this operation does not open a session. An agent reference with only an id follows the agent's active version: each run uses the version in effect at that moment, so a later agent save reaches the next run with no edit here. Name a version to pin it; only a version that is applied can be pinned, so a save made with apply false is refused with 409 AGENT_VERSION_NOT_APPLIED. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. environment_id and target are alternatives: send at least one of them; target:{type:"computer"} is for general agents and needs no environment_id, while target:{type:"environment"} still requires one. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; secrets reach the session's machine as environment variables and are matched against its MCP servers. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400. Example, a weekly cron deployment on the agent's computer: {"agent":"agent_123","name":"weekly report","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Write the weekly report."}]}],"target":{"type":"computer"},"schedule":{"type":"cron","expression":"0 9 * * 1","timezone":"America/Los_Angeles"}}.
|
|
5718
5852
|
*/
|
|
5719
5853
|
export const deploymentsCreate = (options) => (options.client ?? client).post({
|
|
5720
5854
|
security: [{
|
|
@@ -12610,7 +12744,7 @@ export const devopsUnitsFetch = (options) => (options.client ?? client).post({
|
|
|
12610
12744
|
/**
|
|
12611
12745
|
* Push a unit's branch
|
|
12612
12746
|
*
|
|
12613
|
-
* Publish the unit's local commits to the remote for the change: the machine itself holds no git credential and cannot reach the remote, so this verb is the way work done on a unit lands. ref says what to push — branch for the change's own branch, wip for this unit's own refs/praxis/wip/<change>, or a full ref name; anything else (the default branch, another change's branch, a tag, another unit's wip ref) is refused with 400 PUSH_REF_FORBIDDEN and nothing is pushed. expectedHead is the commit you believe the remote branch is at now; DevOps checks it before signing anything, and a remote that has moved since answers 409 HEAD_MOVED with nothing pushed,
|
|
12747
|
+
* Publish the unit's local commits to the remote for the change: the machine itself holds no git credential and cannot reach the remote, so this verb is the way work done on a unit lands. ref says what to push — branch for the change's own branch, wip for this unit's own refs/praxis/wip/<change>, or a full ref name; anything else (the default branch, another change's branch, a tag, another unit's wip ref) is refused with 400 PUSH_REF_FORBIDDEN and nothing is pushed. expectedHead is the commit you believe the remote branch is at now; DevOps checks it before signing anything, and a remote that has moved since answers 409 HEAD_MOVED with nothing pushed, naming the head it is at now in the message and in details.remoteHead. Read the starting value from the unit's git.remoteHead (fetch first when someone else may have pushed). For branch the call also takes a lease on that head, so the push cannot silently overwrite work that landed in between; wip is this change's own ref and is force-pushed. On success the answer is pushedSha, the commit that landed. Commit inside the machine first, through the sandbox instance API — this verb pushes commits, it does not create them. The unit must be available with a machine and a checkout, or the call answers 409 UNIT_INVALID_STATE; a push that git refuses inside the machine answers with the cause in the error message and in details.detail (the last 4000 characters of git's output, credentials redacted) and details.exitCode (git's exit code): 409 PUSH_REJECTED_BY_HOOK when a pre-push hook such as lefthook rejected it, so read the hook output, fix the content and push again, 409 PUSH_REJECTED_NON_FAST_FORWARD when the remote moved ahead, so fetch and reconcile, 409 HEAD_MOVED when the lease on expectedHead no longer holds, and 500 PUSH_FAILED for anything else. Do not retry the same push unchanged.
|
|
12614
12748
|
*/
|
|
12615
12749
|
export const devopsUnitsPush = (options) => (options.client ?? client).post({
|
|
12616
12750
|
security: [{
|
|
@@ -13775,6 +13909,98 @@ export const mediaDesignVoice = (options) => (options.client ?? client).post({
|
|
|
13775
13909
|
...options.headers
|
|
13776
13910
|
}
|
|
13777
13911
|
});
|
|
13912
|
+
/**
|
|
13913
|
+
* List works
|
|
13914
|
+
*
|
|
13915
|
+
* List the works of a library as summaries, most recently changed first: id, kind, title, series, cover_url, item_count, missing_count and updated_at. Filter with kind and series (for example all platform versions of one story), match the title with q, and continue with next_cursor.
|
|
13916
|
+
*/
|
|
13917
|
+
export const mediaListWorks = (options) => (options.client ?? client).get({
|
|
13918
|
+
security: [{
|
|
13919
|
+
key: 'media-BearerAuth',
|
|
13920
|
+
scheme: 'bearer',
|
|
13921
|
+
type: 'http'
|
|
13922
|
+
}],
|
|
13923
|
+
url: '/media/v1/libraries/{library_id}/works',
|
|
13924
|
+
...options
|
|
13925
|
+
});
|
|
13926
|
+
/**
|
|
13927
|
+
* Create work
|
|
13928
|
+
*
|
|
13929
|
+
* Create a work in a library: a gallery (图文), an article (长文), a product listing (商品图组) or a general work (blocks, 通用作品, Editor.js saved data whose image blocks name library assets in data.asset_id) that orders references to assets of this same library and adds a title and text. Upload or generate the pictures first, then send kind and body. In an article an inline image is written  where it should appear. Every asset the body names must be a live image or sticker of this library (a gallery item may also be a video), or the request is refused naming every bad reference and nothing is saved. Price, stock and other unknown fields are refused. Several platform versions of one story are several works with the same series. A work copies no file and changes no asset; creating one is free. Answers 201 with the work. Example: POST /media/v1/libraries/default/works with {"kind":"gallery","series":"ai-diary-01","body":{"title":"AI 创业第一天就踩坑","items":[{"asset_id":"<asset id>"}]}}.
|
|
13930
|
+
*/
|
|
13931
|
+
export const mediaCreateWork = (options) => (options.client ?? client).post({
|
|
13932
|
+
security: [{
|
|
13933
|
+
key: 'media-BearerAuth',
|
|
13934
|
+
scheme: 'bearer',
|
|
13935
|
+
type: 'http'
|
|
13936
|
+
}],
|
|
13937
|
+
url: '/media/v1/libraries/{library_id}/works',
|
|
13938
|
+
...options,
|
|
13939
|
+
headers: {
|
|
13940
|
+
'Content-Type': 'application/json',
|
|
13941
|
+
...options.headers
|
|
13942
|
+
}
|
|
13943
|
+
});
|
|
13944
|
+
/**
|
|
13945
|
+
* Delete work
|
|
13946
|
+
*
|
|
13947
|
+
* Delete a work. Only the work goes: every asset it named stays in the library unchanged.
|
|
13948
|
+
*/
|
|
13949
|
+
export const mediaDeleteWork = (options) => (options.client ?? client).delete({
|
|
13950
|
+
security: [{
|
|
13951
|
+
key: 'media-BearerAuth',
|
|
13952
|
+
scheme: 'bearer',
|
|
13953
|
+
type: 'http'
|
|
13954
|
+
}],
|
|
13955
|
+
url: '/media/v1/libraries/{library_id}/works/{work_id}',
|
|
13956
|
+
...options
|
|
13957
|
+
});
|
|
13958
|
+
/**
|
|
13959
|
+
* Get work
|
|
13960
|
+
*
|
|
13961
|
+
* Read one work with its body, custom fields, revision and missing (asset ids deleted since; the body keeps them in place). Add expand=assets to receive every referenced asset’s type, short-lived url, thumbnail_url and size in the same answer, which is what a publish script needs to send the work out. Use work_id from creation or listing.
|
|
13962
|
+
*/
|
|
13963
|
+
export const mediaGetWork = (options) => (options.client ?? client).get({
|
|
13964
|
+
security: [{
|
|
13965
|
+
key: 'media-BearerAuth',
|
|
13966
|
+
scheme: 'bearer',
|
|
13967
|
+
type: 'http'
|
|
13968
|
+
}],
|
|
13969
|
+
url: '/media/v1/libraries/{library_id}/works/{work_id}',
|
|
13970
|
+
...options
|
|
13971
|
+
});
|
|
13972
|
+
/**
|
|
13973
|
+
* Update work
|
|
13974
|
+
*
|
|
13975
|
+
* Change a work. body replaces the whole body and is checked like a new one; series replaces the series and null clears it; custom is a JSON Merge Patch (RFC 7396), so a script writing back its published link and numbers sends only its own keys and never erases keys another script wrote, and null removes a key. Send if_revision with the revision you read to apply the change only if nobody changed the work since; otherwise the answer is 409 REVISION_CONFLICT. Example: PATCH /media/v1/libraries/default/works/<work id> with {"custom":{"published_url":"https://…","stats":{"likes":120}}}.
|
|
13976
|
+
*/
|
|
13977
|
+
export const mediaUpdateWork = (options) => (options.client ?? client).patch({
|
|
13978
|
+
security: [{
|
|
13979
|
+
key: 'media-BearerAuth',
|
|
13980
|
+
scheme: 'bearer',
|
|
13981
|
+
type: 'http'
|
|
13982
|
+
}],
|
|
13983
|
+
url: '/media/v1/libraries/{library_id}/works/{work_id}',
|
|
13984
|
+
...options,
|
|
13985
|
+
headers: {
|
|
13986
|
+
'Content-Type': 'application/json',
|
|
13987
|
+
...options.headers
|
|
13988
|
+
}
|
|
13989
|
+
});
|
|
13990
|
+
/**
|
|
13991
|
+
* List works using an asset
|
|
13992
|
+
*
|
|
13993
|
+
* List the works whose body names one asset, as work summaries, most recently changed first. Check it before deleting an asset: the delete is never blocked, and those works would then show the asset as missing.
|
|
13994
|
+
*/
|
|
13995
|
+
export const mediaListAssetWorks = (options) => (options.client ?? client).get({
|
|
13996
|
+
security: [{
|
|
13997
|
+
key: 'media-BearerAuth',
|
|
13998
|
+
scheme: 'bearer',
|
|
13999
|
+
type: 'http'
|
|
14000
|
+
}],
|
|
14001
|
+
url: '/media/v1/libraries/{library_id}/assets/{asset_id}/works',
|
|
14002
|
+
...options
|
|
14003
|
+
});
|
|
13778
14004
|
/**
|
|
13779
14005
|
* List types
|
|
13780
14006
|
*
|
|
@@ -17087,7 +17313,7 @@ export const vaultListVaults = (options) => (options?.client ?? client).get({
|
|
|
17087
17313
|
/**
|
|
17088
17314
|
* Create vault
|
|
17089
17315
|
*
|
|
17090
|
-
* Create an empty, active vault to hold credentials for your account, with a display name and optional metadata. Use its returned id as vault_id when creating secrets or OAuth authorizations.
|
|
17316
|
+
* Create an empty, active vault to hold credentials for your account, with a display name and optional metadata. Use its returned id as vault_id when creating secrets or OAuth authorizations. A session carries its agent's vaults (agent vault_ids, which a department or organization rule's grants also write) plus its own vault_ids, at most 50 together, and it matches their credentials against its MCP servers, so a stored static or oauth credential serves as vault-backed MCP authentication, and it exports their secrets to its machine as environment variables named after the secret, with real values (a service agent's session leaves out OAuth credentials and secrets that declare allowed_hosts; allowed_hosts does not limit what a command does with an exported value). Application vault references are also unavailable; praxis_vault_ref version bindings and secret writes with a vault source return 501, so creating a vault does not yet enable either consumer.
|
|
17091
17317
|
*/
|
|
17092
17318
|
export const vaultCreateVault = (options) => (options.client ?? client).post({
|
|
17093
17319
|
security: [{
|