@deepraxis/sdk 0.1.1-dev.f44c601 → 0.1.1-dev.f5b174e

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.
@@ -929,6 +929,30 @@ export const listSessionRequests = (options) => (options.client ?? client).get({
929
929
  url: '/agent/v1/sessions/{session_id}/requests',
930
930
  ...options
931
931
  });
932
+ /**
933
+ * Create Session Dictation Stream (Extension)
934
+ *
935
+ * Open a dictation stream for a session and get the address to push microphone audio to.
936
+ *
937
+ * Own-face extension. The body is optional: hotwords (at most 50 words the recogniser should favour). Returns 201 { id, push_url, expires_at }: id is the stream id (mst_...), push_url a wss address, expires_at when the address stops accepting a new connection. The speech-to-text model is the agent's dictation_model, or the platform default when it names none. Once connected to push_url, send one text frame {"type":"start","format":"pcm_s16le","sample_rate":16000,"channels":1}, then binary PCM frames of at most 64 KiB, then {"type":"stop"}; the text frames you receive are partial, final, done (with audio_seconds and cost_usd) and error. Each final carries end_ms, where that sentence ends in the audio you sent: if the connection drops, send what comes after the last end_ms to a new dictation. You may connect ahead of time: the stream waits up to 5 minutes for start; after start it closes after 30 s without a frame, and it carries at most 10 minutes of audio. push_url carries a short-lived capability: treat it as a secret and do not store or log it. A session that is missing or not yours returns 404; a model that cannot transcribe a live stream returns 409 DICTATION_UNCONFIGURED; dictation not available in this environment returns 503 DICTATION_UNAVAILABLE; more than 50 hotwords or an unsupported field returns 400.
938
+ */
939
+ export const createSessionDictation = (options) => (options.client ?? client).post({
940
+ security: [{
941
+ key: 'BearerAuth',
942
+ scheme: 'bearer',
943
+ type: 'http'
944
+ }, {
945
+ key: 'ApiKeyAuth',
946
+ name: 'X-API-Key',
947
+ type: 'apiKey'
948
+ }],
949
+ url: '/agent/v1/sessions/{session_id}/dictations',
950
+ ...options,
951
+ headers: {
952
+ 'Content-Type': 'application/json',
953
+ ...options.headers
954
+ }
955
+ });
932
956
  /**
933
957
  * List Session Background Tasks (Extension)
934
958
  *
@@ -1138,7 +1162,7 @@ export const browserListSessions = (options) => (options?.client ?? client).get(
1138
1162
  /**
1139
1163
  * 创建浏览器会话
1140
1164
  *
1141
- * 创建云端 Chrome,返回自带凭证的 connectUrl。API 会话默认断开后结束;最长 6 小时。
1165
+ * 创建云端 Chrome,返回自带凭证的 connectUrl;它是一条完整 CDP 连接,真指针事件(触摸、拖拽、按坐标点击)从那里发送,页面动作接口只做按 ref 的语义动作。API 会话默认断开后结束;最长 6 小时。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
1142
1166
  */
1143
1167
  export const browserCreateSession = (options) => (options.client ?? client).post({
1144
1168
  security: [{
@@ -1188,7 +1212,7 @@ export const browserCloseSession = (options) => (options.client ?? client).post(
1188
1212
  /**
1189
1213
  * 读取调试地址
1190
1214
  *
1191
- * 读取当前会话及各标签页的实时观看地址和 CDP 连接地址。直接使用返回的完整链接,保留查询凭证;会话不在运行状态时 pages 为空,返回地址不代表会话仍可连接。
1215
+ * 读取当前会话及各标签页的实时观看地址和 CDP 连接地址。直接使用返回的完整链接,保留查询凭证;会话不在运行状态时 pages 为空,返回地址不代表会话仍可连接——会话结束后(进入释放或已释放),用返回的 wsUrl 建立 CDP 连接会得到 409 SESSION_ENDED。
1192
1216
  */
1193
1217
  export const browserGetDebug = (options) => (options.client ?? client).get({
1194
1218
  security: [{
@@ -1216,7 +1240,7 @@ export const browserListEvents = (options) => (options.client ?? client).get({
1216
1240
  /**
1217
1241
  * 执行页面动作
1218
1242
  *
1219
- * 在会话的浏览器里执行一个页面动作并返回结果,由浏览器服务执行,客户端不需要 Playwright。同一会话的动作按到达顺序串行执行,单个动作 30 秒内完成。先用 snapshot 读取页面:元素带 [ref=eN],click、fill、select 按 ref 操作;ref 只在最近一次快照里有效,页面跳转后失效(409 ACTION_REF_STALE,重新 snapshot)。省略 tab 时作用于当前标签页。
1243
+ * 在会话的浏览器里执行一个页面动作并返回结果,由浏览器服务执行,客户端不需要 Playwright。同一会话的动作按到达顺序串行执行,单个动作 30 秒内完成。先用 snapshot 读取页面:元素带 [ref=eN],click、fill、select 按 ref 操作;ref 只在最近一次快照里有效,页面跳转后失效(409 ACTION_REF_STALE,重新 snapshot)。省略 tab 时作用于当前标签页。动作都是语义动作:click、fill、select 按快照 ref 定位元素,scroll 派发滚轮事件;没有触摸、拖拽或按坐标点击,也没有按坐标派发指针事件的动作。页面必须收到真手指或指针事件(touchstart/touchmove/touchend、拖拽、按坐标点击)时,改用 CDP 连接:使用创建会话返回的 connectUrl,或 /browser/v1/connect 建立连接,再发送 Input.dispatchTouchEvent、Input.dispatchMouseEvent 等 CDP 命令。
1220
1244
  */
1221
1245
  export const browserRunPageAction = (options) => (options.client ?? client).post({
1222
1246
  security: [{
@@ -1376,7 +1400,7 @@ export const browserUpdateContext = (options) => (options.client ?? client).put(
1376
1400
  /**
1377
1401
  * 连接云端浏览器
1378
1402
  *
1379
- * CDP WebSocket:不填 session 或 name 时新开;session 连接已有会话;name 有就连接、没有就新开。session 与 name 不可同时提供。新建参数在连接已有会话时忽略。使用 Authorization: Bearer API_KEY,或直接使用创建会话返回的带 signingKey 的 connectUrl。连上后发送 CDP 命令 Praxis.getSession,获取 sessionId、liveViewUrl、consoleUrl。
1403
+ * CDP WebSocket:不填 session 或 name 时新开;session 连接已有会话;name 有就连接、没有就新开。session 与 name 不可同时提供。新建参数在连接已有会话时忽略。使用 Authorization: Bearer API_KEY,或直接使用创建会话返回的带 signingKey 的 connectUrl。连上后发送 CDP 命令 Praxis.getSession,获取 sessionId、liveViewUrl、consoleUrl。这是完整 CDP 连接:真手指或指针事件(Emulation.setTouchEmulationEnabled 加 Input.dispatchTouchEvent、拖拽用的 Input.dispatchMouseEvent)只能从这里发,页面动作接口只做按 ref 的语义动作。要挂指定登录态,可用 context 参数,或直接连接 sessions.create 返回的 connectUrl。
1380
1404
  */
1381
1405
  export const browserConnect = (options) => (options?.client ?? client).get({
1382
1406
  security: [{
@@ -2687,7 +2711,7 @@ export const getOrganizationNotificationsInbox = (options) => (options?.client ?
2687
2711
  /**
2688
2712
  * List the letters addressed to you
2689
2713
  *
2690
- * The letters this person received in this organization, newest first, as the notification center lists them (ADR-193 §5): the sender's display name (never an address or an internal id; an unknown sender answers 「某位成员」), the summary, 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.
2714
+ * 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.
2691
2715
  */
2692
2716
  export const listOrganizationNotificationLetters = (options) => (options?.client ?? client).get({
2693
2717
  security: [{
@@ -2763,7 +2787,7 @@ export const archiveOrganizationNotificationLetter = (options) => (options.clien
2763
2787
  /**
2764
2788
  * Your notification switches, and what they resolve to
2765
2789
  *
2766
- * This person's notification preferences in the organization behind the credential: their own per-category switches, the channels they unsubscribed from everywhere, the organization's layer (defaults, blocked channels, whether members may change their own switches, hidden categories), and for every offered channel the answer the five layers produce — which layer decided it (platform_mandatory, channel_opt_out, person, organization_default, platform_default). Severity never appears here because it never decides delivery. Read-only; no usage charge.
2790
+ * This person's notification preferences in the organization behind the credential: their own per-category switches, the channels they unsubscribed from everywhere, the organization's layer (defaults, blocked channels, whether members may change their own switches, hidden categories), and for every offered channel the answer the five layers produce — which layer decided it (platform_mandatory, channel_opt_out, person, organization_default, platform_default). Each catalog row also carries its severity (high/medium/low/none): it shapes the display only and never decides delivery (#4107). Read-only; no usage charge.
2767
2791
  */
2768
2792
  export const getOrganizationNotificationPreferences = (options) => (options?.client ?? client).get({
2769
2793
  security: [{
@@ -5107,7 +5131,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
5107
5131
  /**
5108
5132
  * Create deployment
5109
5133
  *
5110
- * Freeze session parameters as a deployment; this operation does not open a session. 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; credential injection is deferred to a later version. 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"}}.
5134
+ * 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; credential injection is deferred to a later version. 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"}}.
5111
5135
  */
5112
5136
  export const deploymentsCreate = (options) => (options.client ?? client).post({
5113
5137
  security: [{
@@ -5147,7 +5171,7 @@ export const deploymentsRetrieve = (options) => (options.client ?? client).get({
5147
5171
  /**
5148
5172
  * Update deployment
5149
5173
  *
5150
- * Partially update a deployment. Omitted fields keep their values; a supplied agent id re-pins the latest version, or supply a versioned reference. Metadata merges string values and deletes keys set to null. Null clears schedule, resources and description; name, environment_id and initial_events cannot be cleared. Archived deployments return 409. Overrides apply to new sessions; updating a schedule recalculates its next occurrence.
5174
+ * Partially update a deployment. Omitted fields keep their values. An agent reference with only an id makes the deployment follow the agent's active version from now on, so later agent saves carry through; name a version to pin it instead, and only a version that is applied (not one saved with apply false) may be pinned. Metadata merges string values and deletes keys set to null. Null clears schedule, resources and description; name, environment_id and initial_events cannot be cleared. Archived deployments return 409. Overrides apply to new sessions; updating a schedule recalculates its next occurrence.
5151
5175
  */
5152
5176
  export const deploymentsUpdate = (options) => (options.client ?? client).post({
5153
5177
  security: [{