@deepraxis/sdk 0.2.0-dev.6ed6b94 → 0.2.0-dev.7278e86

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.
@@ -117,6 +117,24 @@ export const listAgentInboxLetters = (options) => (options.client ?? client).get
117
117
  url: '/agent/v1/agents/{agent_id}/inbox/letters',
118
118
  ...options
119
119
  });
120
+ /**
121
+ * List the Claude Code sessions already on a device
122
+ *
123
+ * List the Claude Code sessions that already exist on a person's paired machine for a directory bound to this BYOA agent (started in a terminal, not on the platform), newest first, so one can be continued from the platform: pick an id and create a session with runtime.resume_session_id set to it (runtime.type device, the same device_id and cwd). Only the person who paired the device may ask. cwd is required and must be the directory exactly as the device registered it and bound it to this agent. Pass next_cursor back as cursor for the next page; null means the last page.
124
+ */
125
+ export const listAgentDeviceLocalSessions = (options) => (options.client ?? client).get({
126
+ security: [{
127
+ key: 'BearerAuth',
128
+ scheme: 'bearer',
129
+ type: 'http'
130
+ }, {
131
+ key: 'ApiKeyAuth',
132
+ name: 'X-API-Key',
133
+ type: 'apiKey'
134
+ }],
135
+ url: '/agent/v1/agents/{agent_id}/devices/{device_id}/local-sessions',
136
+ ...options
137
+ });
120
138
  /**
121
139
  * Create a login intent for the calling agent
122
140
  *
@@ -1210,7 +1228,7 @@ export const browserListSessions = (options) => (options?.client ?? client).get(
1210
1228
  /**
1211
1229
  * 创建浏览器会话
1212
1230
  *
1213
- * 创建云端 Chrome,返回自带凭证的 connectUrl;它是一条完整 CDP 连接,真指针事件(触摸、拖拽、按坐标点击)从那里发送,页面动作接口只做按 ref 的语义动作。API 会话默认断开后结束;最长 6 小时。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
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 小时。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
1214
1232
  */
1215
1233
  export const browserCreateSession = (options) => (options.client ?? client).post({
1216
1234
  security: [{
@@ -1445,6 +1463,99 @@ export const browserUpdateContext = (options) => (options.client ?? client).put(
1445
1463
  ...options.headers
1446
1464
  }
1447
1465
  });
1466
+ /**
1467
+ * 创建浏览器配对码
1468
+ *
1469
+ * 为一个要接入的 Chrome 或 Edge 创建 8 位配对码,一次性、10 分钟有效;把它交给用户,由用户在浏览器扩展里输入或由 Console 直接交给扩展,用户点「允许」后配对完成。需要组织已开通 BYOB,否则返回 501 PROVIDER_UNSUPPORTED。
1470
+ */
1471
+ export const browserCreateByobPairing = (options) => (options?.client ?? client).post({
1472
+ security: [{
1473
+ key: 'BrowserBearer',
1474
+ scheme: 'bearer',
1475
+ type: 'http'
1476
+ }],
1477
+ url: '/browser/v1/byob/pairings',
1478
+ ...options
1479
+ });
1480
+ /**
1481
+ * 列出自带浏览器
1482
+ *
1483
+ * 分页列出当前组织已配对且未断开的自带浏览器,按 ID 升序。将 nextCursor 原样传入读取下一页,直到其为 null。
1484
+ */
1485
+ export const browserListByobBrowsers = (options) => (options?.client ?? client).get({
1486
+ security: [{
1487
+ key: 'BrowserBearer',
1488
+ scheme: 'bearer',
1489
+ type: 'http'
1490
+ }],
1491
+ url: '/browser/v1/byob/browsers',
1492
+ ...options
1493
+ });
1494
+ /**
1495
+ * 读取自带浏览器
1496
+ *
1497
+ * 读取当前组织的指定自带浏览器,包括已断开的(revoked_at 不为 null)。不存在或不属于当前组织时返回 404 BROWSER_NOT_FOUND。
1498
+ */
1499
+ export const browserGetByobBrowser = (options) => (options.client ?? client).get({
1500
+ security: [{
1501
+ key: 'BrowserBearer',
1502
+ scheme: 'bearer',
1503
+ type: 'http'
1504
+ }],
1505
+ url: '/browser/v1/byob/browsers/{browser_id}',
1506
+ ...options
1507
+ });
1508
+ /**
1509
+ * 更新自带浏览器的名称、授权智能体与允许站点
1510
+ *
1511
+ * 更新自带浏览器的名称、授权智能体或允许站点,只改请求里出现的字段;granted_agents 和 allowed_sites 整体替换原列表。已断开的浏览器返回 410 BROWSER_REVOKED,需要重新配对。
1512
+ */
1513
+ export const browserUpdateByobBrowser = (options) => (options.client ?? client).patch({
1514
+ security: [{
1515
+ key: 'BrowserBearer',
1516
+ scheme: 'bearer',
1517
+ type: 'http'
1518
+ }],
1519
+ url: '/browser/v1/byob/browsers/{browser_id}',
1520
+ ...options,
1521
+ headers: {
1522
+ 'Content-Type': 'application/json',
1523
+ ...options.headers
1524
+ }
1525
+ });
1526
+ /**
1527
+ * 断开自带浏览器
1528
+ *
1529
+ * 断开自带浏览器:撤销它的授权,之后没有任何智能体能再驱动它,要用必须重新配对。可重复调用,结果相同;功能开关关闭时也能断开。
1530
+ */
1531
+ export const browserDisconnectByobBrowser = (options) => (options.client ?? client).post({
1532
+ security: [{
1533
+ key: 'BrowserBearer',
1534
+ scheme: 'bearer',
1535
+ type: 'http'
1536
+ }],
1537
+ url: '/browser/v1/byob/browsers/{browser_id}/disconnect',
1538
+ ...options
1539
+ });
1540
+ /**
1541
+ * 读取浏览器配对授权页信息
1542
+ *
1543
+ * 扩展的授权页读取配对码对应的组织与发起人,让用户确认后再点「允许」。不需要 API Key,配对码就是凭证;码不存在、已过期、已使用一律返回 404 PAIRING_NOT_FOUND,不区分原因。
1544
+ */
1545
+ export const browserReadByobPairing = (options) => (options.client ?? client).get({ url: '/browser/v1/byob/pairings/{code}', ...options });
1546
+ /**
1547
+ * 认领浏览器配对码
1548
+ *
1549
+ * 用户点「允许」后,扩展用配对码认领一次,登记这个浏览器并取得 browser_id 和要拨入的 link_url。不需要 API Key,配对码就是凭证,只能使用一次;码不存在、已过期、已使用一律返回 404 PAIRING_NOT_FOUND。请求体不合格时返回 400 且不消耗配对码。
1550
+ */
1551
+ export const browserClaimByobPairing = (options) => (options.client ?? client).post({
1552
+ url: '/browser/v1/byob/pairings/{code}/claim',
1553
+ ...options,
1554
+ headers: {
1555
+ 'Content-Type': 'application/json',
1556
+ ...options.headers
1557
+ }
1558
+ });
1448
1559
  /**
1449
1560
  * 连接云端浏览器
1450
1561
  *