@deepraxis/sdk 0.1.1-dev.47b94f1 → 0.1.1-dev.486af34

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.
@@ -626,6 +626,31 @@ export const computersFilesContent = (options) => (options.client ?? client).get
626
626
  url: '/agent/v1/computers/{computer_id}/files/content',
627
627
  ...options
628
628
  });
629
+ /**
630
+ * Write computer file content
631
+ *
632
+ * Write the bytes of one existing file on a computer, only if the file is still the version you read.
633
+ *
634
+ * Send the raw bytes as the body (at most 16 MiB) and the version you edited in `If-Match`: the `version` field of the file listing (`<size>-<mtimeMs>`). The file must already exist; the write replaces it whole and keeps its permissions. A request without `If-Match` answers 428 FILE_VERSION_REQUIRED and nothing is written. When the file has changed since that version, the answer is 412 FILE_VERSION_MISMATCH with `error.current_version`, and nothing is written: read the file again, redo the edit and write with the new version. The version is checked against the file's current size and modification time, then the content digest is bound into the write itself, so a change that lands while the bytes are being written is refused instead of overwritten. Paths under /attachments and /skills are read-only (403 READ_ONLY). A successful write answers the new path, size, mtime and version; use that version for the next write.
635
+ */
636
+ export const updateComputerFileContent = (options) => (options.client ?? client).put({
637
+ bodySerializer: null,
638
+ security: [{
639
+ key: 'BearerAuth',
640
+ scheme: 'bearer',
641
+ type: 'http'
642
+ }, {
643
+ key: 'ApiKeyAuth',
644
+ name: 'X-API-Key',
645
+ type: 'apiKey'
646
+ }],
647
+ url: '/agent/v1/computers/{computer_id}/files/content',
648
+ ...options,
649
+ headers: {
650
+ 'Content-Type': 'application/octet-stream',
651
+ ...options.headers
652
+ }
653
+ });
629
654
  /**
630
655
  * Preview a computer file
631
656
  *
@@ -904,6 +929,30 @@ export const listSessionRequests = (options) => (options.client ?? client).get({
904
929
  url: '/agent/v1/sessions/{session_id}/requests',
905
930
  ...options
906
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
+ });
907
956
  /**
908
957
  * List Session Background Tasks (Extension)
909
958
  *
@@ -1113,7 +1162,7 @@ export const browserListSessions = (options) => (options?.client ?? client).get(
1113
1162
  /**
1114
1163
  * 创建浏览器会话
1115
1164
  *
1116
- * 创建云端 Chrome,返回自带凭证的 connectUrl。API 会话默认断开后结束;最长 6 小时。
1165
+ * 创建云端 Chrome,返回自带凭证的 connectUrl;它是一条完整 CDP 连接,真指针事件(触摸、拖拽、按坐标点击)从那里发送,页面动作接口只做按 ref 的语义动作。API 会话默认断开后结束;最长 6 小时。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
1117
1166
  */
1118
1167
  export const browserCreateSession = (options) => (options.client ?? client).post({
1119
1168
  security: [{
@@ -1163,7 +1212,7 @@ export const browserCloseSession = (options) => (options.client ?? client).post(
1163
1212
  /**
1164
1213
  * 读取调试地址
1165
1214
  *
1166
- * 读取当前会话及各标签页的实时观看地址和 CDP 连接地址。直接使用返回的完整链接,保留查询凭证;会话不在运行状态时 pages 为空,返回地址不代表会话仍可连接。
1215
+ * 读取当前会话及各标签页的实时观看地址和 CDP 连接地址。直接使用返回的完整链接,保留查询凭证;会话不在运行状态时 pages 为空,返回地址不代表会话仍可连接——会话结束后(进入释放或已释放),用返回的 wsUrl 建立 CDP 连接会得到 409 SESSION_ENDED。
1167
1216
  */
1168
1217
  export const browserGetDebug = (options) => (options.client ?? client).get({
1169
1218
  security: [{
@@ -1191,7 +1240,7 @@ export const browserListEvents = (options) => (options.client ?? client).get({
1191
1240
  /**
1192
1241
  * 执行页面动作
1193
1242
  *
1194
- * 在会话的浏览器里执行一个页面动作并返回结果,由浏览器服务执行,客户端不需要 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 命令。
1195
1244
  */
1196
1245
  export const browserRunPageAction = (options) => (options.client ?? client).post({
1197
1246
  security: [{
@@ -1351,7 +1400,7 @@ export const browserUpdateContext = (options) => (options.client ?? client).put(
1351
1400
  /**
1352
1401
  * 连接云端浏览器
1353
1402
  *
1354
- * 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。
1355
1404
  */
1356
1405
  export const browserConnect = (options) => (options?.client ?? client).get({
1357
1406
  security: [{
@@ -1429,9 +1478,10 @@ export const browserSeleniumUnsupported = (options) => (options?.client ?? clien
1429
1478
  /**
1430
1479
  * List files
1431
1480
  *
1432
- * List live files owned by your tenant, optionally filtered by purpose or session scope_id. Results default to descending creation order with a limit of 10000. Page using after or before with a file ID from the list; these cursors are mutually exclusive. Deleted and expired files are excluded.
1481
+ * List live files owned by your tenant, optionally filtered by purpose, session scope_id or up to 100 file ids. Results default to descending creation order with a limit of 10000. Page using after or before with a file ID from the list; these cursors are mutually exclusive. Deleted and expired files are excluded.
1433
1482
  */
1434
1483
  export const fileListFiles = (options) => (options?.client ?? client).get({
1484
+ querySerializer: { parameters: { ids: { array: { explode: false } } } },
1435
1485
  security: [{
1436
1486
  key: 'BearerAuth',
1437
1487
  scheme: 'bearer',
@@ -2641,11 +2691,11 @@ export const exportOrganizationCharges = (options) => (options.client ?? client)
2641
2691
  ...options
2642
2692
  });
2643
2693
  /**
2644
- * List departments
2694
+ * Your inbox counts for the notification bell
2645
2695
  *
2646
- * Lists the departments of your organization's tree, including the root department; use it to find a department id or to walk the tree one level at a time with parent_id. Dissolved departments are included unless you filter status=active. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/departments?status=active.
2696
+ * Bell-badge counts for the calling person in the organization behind your credential: notices not yet read and not yet seen. The person is always the credential's own; the request cannot name another member. Read-only; no usage charge.
2647
2697
  */
2648
- export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
2698
+ export const getOrganizationNotificationsInbox = (options) => (options?.client ?? client).get({
2649
2699
  security: [{
2650
2700
  key: 'BearerAuth',
2651
2701
  scheme: 'bearer',
@@ -2655,15 +2705,15 @@ export const listOrganizationDepartments = (options) => (options?.client ?? clie
2655
2705
  name: 'X-API-Key',
2656
2706
  type: 'apiKey'
2657
2707
  }],
2658
- url: '/organization/v1/departments',
2708
+ url: '/organization/v1/notifications/inbox',
2659
2709
  ...options
2660
2710
  });
2661
2711
  /**
2662
- * Establish a department
2712
+ * List the letters addressed to you
2663
2713
  *
2664
- * Creates a department under an existing active parent department; use it to grow the tree, and use reorganize to rename or move one that already exists. order defaults to one after the last active sibling. The new department has no head position and no charter: open a position in it, then designate that position as head. Requires an organization owner or admin, or the head of the parent department or of a department above it. Errors: 400 INVALID_PARAMS for a missing or empty name, a name over 100 characters, an unknown body field or an active sibling with the same name; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND when the parent does not exist; 409 DEPARTMENT_DISSOLVED when the parent is dissolved. Example body: {"parent_id":"dept_123","name":"Support"}.
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.
2665
2715
  */
2666
- export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
2716
+ export const listOrganizationNotificationLetters = (options) => (options?.client ?? client).get({
2667
2717
  security: [{
2668
2718
  key: 'BearerAuth',
2669
2719
  scheme: 'bearer',
@@ -2673,19 +2723,15 @@ export const establishOrganizationDepartment = (options) => (options.client ?? c
2673
2723
  name: 'X-API-Key',
2674
2724
  type: 'apiKey'
2675
2725
  }],
2676
- url: '/organization/v1/departments',
2677
- ...options,
2678
- headers: {
2679
- 'Content-Type': 'application/json',
2680
- ...options.headers
2681
- }
2726
+ url: '/organization/v1/notifications/letters',
2727
+ ...options
2682
2728
  });
2683
2729
  /**
2684
- * Get a department
2730
+ * Mark one of your letters read
2685
2731
  *
2686
- * Reads one department with its head position id and its charter, including the charter revision you need before amending the charter. Read-only. Errors: 404 DEPARTMENT_NOT_FOUND when the id is not a department of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
2732
+ * Mark one letter addressed to you as read, together with the bell notice it wrote, so the platform does not email it later as unread. The mailbox is the credential's own — an agent credential reads its own agent mailbox, never its owner's — and the request names only the letter. Repeating the call changes nothing and keeps the first read time. A letter that is not in your mailbox in this organization, or does not exist, answers 404 the same way. Returns how many delivered letters you still have unread. No usage charge.
2687
2733
  */
2688
- export const getOrganizationDepartment = (options) => (options.client ?? client).get({
2734
+ export const readOrganizationNotificationLetter = (options) => (options.client ?? client).post({
2689
2735
  security: [{
2690
2736
  key: 'BearerAuth',
2691
2737
  scheme: 'bearer',
@@ -2695,15 +2741,15 @@ export const getOrganizationDepartment = (options) => (options.client ?? client)
2695
2741
  name: 'X-API-Key',
2696
2742
  type: 'apiKey'
2697
2743
  }],
2698
- url: '/organization/v1/departments/{id}',
2744
+ url: '/organization/v1/notifications/letters/{id}:read',
2699
2745
  ...options
2700
2746
  });
2701
2747
  /**
2702
- * Reorganize a department
2748
+ * Mark all your letters read
2703
2749
  *
2704
- * Renames a department, moves it under another parent, or changes its sort order; send at least one of parent_id, name and order. Sub-departments and positions move with it. Requires an organization owner or admin. The root department is the organization itself: its name is the organization's name and cannot be changed here (rename the organization in its settings), and it can never be moved, but its order can change. Errors: 400 INVALID_PARAMS when no field is given, a name is empty or over 100 characters, or a department already has that name under the same parent; 400 DEPARTMENT_CYCLE when the new parent is the department itself or one of its descendants; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND for the department or the new parent; 409 DEPARTMENT_DISSOLVED when either is dissolved; 409 DEPARTMENT_ROOT_IMMUTABLE when parent_id or name is sent for the root.
2750
+ * Mark every delivered letter in your own mailbox in this organization as read, with their bell notices; give kind to read only letters of that kind. Nothing in another mailbox is touched. Letters still scheduled are not delivered yet and stay as they are. Returns how many delivered letters you still have unread. No usage charge.
2705
2751
  */
2706
- export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
2752
+ export const readAllOrganizationNotificationLetters = (options) => (options?.client ?? client).post({
2707
2753
  security: [{
2708
2754
  key: 'BearerAuth',
2709
2755
  scheme: 'bearer',
@@ -2713,19 +2759,19 @@ export const reorganizeOrganizationDepartment = (options) => (options.client ??
2713
2759
  name: 'X-API-Key',
2714
2760
  type: 'apiKey'
2715
2761
  }],
2716
- url: '/organization/v1/departments/{id}',
2762
+ url: '/organization/v1/notifications/letters:readAll',
2717
2763
  ...options,
2718
2764
  headers: {
2719
2765
  'Content-Type': 'application/json',
2720
- ...options.headers
2766
+ ...options?.headers
2721
2767
  }
2722
2768
  });
2723
2769
  /**
2724
- * Dissolve a department
2770
+ * Archive one of your letters
2725
2771
  *
2726
- * Dissolves an empty department: it leaves the active tree, keeps its record for history, and takes no new sub-departments or positions. This API has no operation to reopen it. Requires an organization owner or admin. The department must have no active sub-department and no position that is not closed; dissolve or close those first. Takes no body. Errors: 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_NOT_EMPTY while an active sub-department or an unclosed position remains; 409 DEPARTMENT_ROOT_IMMUTABLE for the root; 409 DEPARTMENT_DISSOLVED when it is already dissolved.
2772
+ * Archive one letter addressed to you: it leaves the default letters list (ask for archived=true to see archived ones) and is marked read, with its bell notice. Repeating the call changes nothing and keeps the first archive time. A letter that is not in your mailbox in this organization, or does not exist, answers 404 the same way. Returns how many delivered letters you still have unread. No usage charge.
2727
2773
  */
2728
- export const dissolveOrganizationDepartment = (options) => (options.client ?? client).post({
2774
+ export const archiveOrganizationNotificationLetter = (options) => (options.client ?? client).post({
2729
2775
  security: [{
2730
2776
  key: 'BearerAuth',
2731
2777
  scheme: 'bearer',
@@ -2735,37 +2781,15 @@ export const dissolveOrganizationDepartment = (options) => (options.client ?? cl
2735
2781
  name: 'X-API-Key',
2736
2782
  type: 'apiKey'
2737
2783
  }],
2738
- url: '/organization/v1/departments/{id}/dissolve',
2784
+ url: '/organization/v1/notifications/letters/{id}:archive',
2739
2785
  ...options
2740
2786
  });
2741
2787
  /**
2742
- * Amend a department charter
2743
- *
2744
- * Replaces the charter of a department: free-text rules that apply to the department and are inherited by every department below it. Send the charter.revision you last read as expected_revision (0 when the department has no charter yet); each successful amendment raises the revision by one. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for text over 2000 characters or a non-integer expected_revision; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_DISSOLVED; 409 REVISION_CONFLICT when the charter moved on, so get the department again, merge your change and retry with its revision.
2745
- */
2746
- export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
2747
- security: [{
2748
- key: 'BearerAuth',
2749
- scheme: 'bearer',
2750
- type: 'http'
2751
- }, {
2752
- key: 'ApiKeyAuth',
2753
- name: 'X-API-Key',
2754
- type: 'apiKey'
2755
- }],
2756
- url: '/organization/v1/departments/{id}/charter',
2757
- ...options,
2758
- headers: {
2759
- 'Content-Type': 'application/json',
2760
- ...options.headers
2761
- }
2762
- });
2763
- /**
2764
- * List jobs
2788
+ * Your notification switches, and what they resolve to
2765
2789
  *
2766
- * Lists the jobs of your organization ordered by code; use it to find the job_id to open positions from. Retired jobs are included unless you filter status=active. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
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
- export const listOrganizationJobs = (options) => (options?.client ?? client).get({
2792
+ export const getOrganizationNotificationPreferences = (options) => (options?.client ?? client).get({
2769
2793
  security: [{
2770
2794
  key: 'BearerAuth',
2771
2795
  scheme: 'bearer',
@@ -2775,15 +2799,15 @@ export const listOrganizationJobs = (options) => (options?.client ?? client).get
2775
2799
  name: 'X-API-Key',
2776
2800
  type: 'apiKey'
2777
2801
  }],
2778
- url: '/organization/v1/jobs',
2802
+ url: '/organization/v1/notifications/preferences',
2779
2803
  ...options
2780
2804
  });
2781
2805
  /**
2782
- * Define a job
2806
+ * Change your notification switches
2783
2807
  *
2784
- * Creates a job: a reusable template of duties and methods that is copied onto each position opened from it. The new job starts at revision 1 and status active. code is your own unique key for the job inside the organization. level_ids restricts the levels positions of this job may carry (empty or omitted allows any level). Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty or duplicate code, a name over 100 characters, text over 4000 characters or an unknown body field; 403 PERMISSION_DENIED; 404 JOB_LEVEL_NOT_FOUND when a level id does not exist. Example body: {"code":"support-agent","name":"Support agent","duties":"Answer customer tickets."}.
2808
+ * Set this person's own notification switches in this organization. Refused with INVALID_PARAMS for an unknown category, a channel the category does not declare, or a channel this deployment has no provider for (nothing is stored that could not take effect); NOT_CONFIGURABLE for a category nobody configures; CRITICAL_CHANNELS_OFF when a critical category would be left with every offered channel off; ORGANIZATION_LOCKED when the organization does not let members change their own switches. A channel the organization blocked is still storable — the block decides, the switch stays theirs.
2785
2809
  */
2786
- export const defineOrganizationJob = (options) => (options.client ?? client).post({
2810
+ export const updateOrganizationNotificationPreferences = (options) => (options.client ?? client).post({
2787
2811
  security: [{
2788
2812
  key: 'BearerAuth',
2789
2813
  scheme: 'bearer',
@@ -2793,7 +2817,7 @@ export const defineOrganizationJob = (options) => (options.client ?? client).pos
2793
2817
  name: 'X-API-Key',
2794
2818
  type: 'apiKey'
2795
2819
  }],
2796
- url: '/organization/v1/jobs',
2820
+ url: '/organization/v1/notifications/preferences',
2797
2821
  ...options,
2798
2822
  headers: {
2799
2823
  'Content-Type': 'application/json',
@@ -2801,11 +2825,11 @@ export const defineOrganizationJob = (options) => (options.client ?? client).pos
2801
2825
  }
2802
2826
  });
2803
2827
  /**
2804
- * Get a job
2828
+ * The organization's notification layer
2805
2829
  *
2806
- * Reads one job with its current revision, which you need before revising it. Read-only. Errors: 404 JOB_NOT_FOUND when the id is not a job of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
2830
+ * The organization's own preference layer: its per-category defaults for members who said nothing, the channels it blocks for everyone, whether members may change their own switches, and the non-critical categories it keeps off members' pages. Any member may read it; only an owner or admin may change it. A critical category can never be hidden, because hiding it would hide a channel nobody may switch off.
2807
2831
  */
2808
- export const getOrganizationJob = (options) => (options.client ?? client).get({
2832
+ export const getOrganizationNotificationDefaults = (options) => (options?.client ?? client).get({
2809
2833
  security: [{
2810
2834
  key: 'BearerAuth',
2811
2835
  scheme: 'bearer',
@@ -2815,15 +2839,15 @@ export const getOrganizationJob = (options) => (options.client ?? client).get({
2815
2839
  name: 'X-API-Key',
2816
2840
  type: 'apiKey'
2817
2841
  }],
2818
- url: '/organization/v1/jobs/{id}',
2842
+ url: '/organization/v1/notifications/organization_default',
2819
2843
  ...options
2820
2844
  });
2821
2845
  /**
2822
- * Revise a job
2846
+ * Set the organization's notification layer
2823
2847
  *
2824
- * Changes the name, duties, methods or allowed levels of a job; send expected_revision and at least one of those fields. Positions already opened keep their own copy and level, and only positions opened afterwards use the revised text. level_ids replaces the whole list. Each success raises the job revision by one. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when no field is given or a value breaks its limits; 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND when a level id does not exist; 409 REVISION_CONFLICT when the job moved on, so get the job again and retry with its revision.
2848
+ * Change the organization's notification layer. Requires an organization owner or admin role; a member answers 403. Refused with INVALID_PARAMS for an unknown or non-configurable category, a channel the category does not declare, or a hidden critical category. Blocking a channel silences it for every member, and a critical category's mandatory channel still reaches people (ADR-193 §4 layer 1); setting member_may_change false makes these defaults final for members.
2825
2849
  */
2826
- export const reviseOrganizationJob = (options) => (options.client ?? client).patch({
2850
+ export const updateOrganizationNotificationDefaults = (options) => (options.client ?? client).post({
2827
2851
  security: [{
2828
2852
  key: 'BearerAuth',
2829
2853
  scheme: 'bearer',
@@ -2833,7 +2857,7 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
2833
2857
  name: 'X-API-Key',
2834
2858
  type: 'apiKey'
2835
2859
  }],
2836
- url: '/organization/v1/jobs/{id}',
2860
+ url: '/organization/v1/notifications/organization_default',
2837
2861
  ...options,
2838
2862
  headers: {
2839
2863
  'Content-Type': 'application/json',
@@ -2841,11 +2865,11 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
2841
2865
  }
2842
2866
  });
2843
2867
  /**
2844
- * Retire a job
2868
+ * Your own notification delivery records
2845
2869
  *
2846
- * Retires a job so no new position can be opened from it; positions already opened are unchanged. Retiring a job that is already retired returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND.
2870
+ * This person's delivery records in this organization, newest first: channel, status, the reason nothing was sent, the address a mail actually went to, and a carrier's verdict for a sent sms. The recipient is always the credential's own. Records are kept 30 days. Pass next_page unchanged as page; null ends the list. Read-only; no usage charge.
2847
2871
  */
2848
- export const retireOrganizationJob = (options) => (options.client ?? client).post({
2872
+ export const listOrganizationNotificationDeliveries = (options) => (options?.client ?? client).get({
2849
2873
  security: [{
2850
2874
  key: 'BearerAuth',
2851
2875
  scheme: 'bearer',
@@ -2855,15 +2879,15 @@ export const retireOrganizationJob = (options) => (options.client ?? client).pos
2855
2879
  name: 'X-API-Key',
2856
2880
  type: 'apiKey'
2857
2881
  }],
2858
- url: '/organization/v1/jobs/{id}/retire',
2882
+ url: '/organization/v1/notifications/deliveries',
2859
2883
  ...options
2860
2884
  });
2861
2885
  /**
2862
- * List job ladders
2886
+ * Upgrade to a full sandbox
2863
2887
  *
2864
- * Lists the job ladders of your organization, oldest first, each with its levels in ascending order; use it to find the level ids for jobs and positions. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
2888
+ * Move a light sandbox to a full environment when its capabilities are insufficient. Stops active processes and terminals, migrates files, and preserves the sandbox ID and name. Reconnect with the new envdAccessToken. A failed migration preserves source files but does not restart terminated processes.
2865
2889
  */
2866
- export const listOrganizationLadders = (options) => (options?.client ?? client).get({
2890
+ export const upgradeSandbox = (options) => (options.client ?? client).post({
2867
2891
  security: [{
2868
2892
  key: 'BearerAuth',
2869
2893
  scheme: 'bearer',
@@ -2873,15 +2897,19 @@ export const listOrganizationLadders = (options) => (options?.client ?? client).
2873
2897
  name: 'X-API-Key',
2874
2898
  type: 'apiKey'
2875
2899
  }],
2876
- url: '/organization/v1/ladders',
2877
- ...options
2900
+ url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
2901
+ ...options,
2902
+ headers: {
2903
+ 'Content-Type': 'application/json',
2904
+ ...options.headers
2905
+ }
2878
2906
  });
2879
2907
  /**
2880
- * Define a job ladder
2908
+ * Extend a running sandbox without shortening its deadline
2881
2909
  *
2882
- * Creates a job ladder: a named, ordered set of job levels such as junior to senior. Each level gets its own id (lvl_...), which jobs and positions refer to. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, an empty levels array, two levels with the same order or an unknown body field; 403 PERMISSION_DENIED. Example body: {"name":"Support","levels":[{"name":"Junior","order":1},{"name":"Senior","order":2}]}.
2910
+ * Extend a running sandbox only when it needs a later expiry; this never resumes a paused sandbox. Timeout is seconds from now, not added to the prior deadline, and must be 900, 1800 or 3600. Returns 409 for paused, expired, or non-extending requests.
2883
2911
  */
2884
- export const defineOrganizationLadder = (options) => (options.client ?? client).post({
2912
+ export const extendSandbox = (options) => (options.client ?? client).post({
2885
2913
  security: [{
2886
2914
  key: 'BearerAuth',
2887
2915
  scheme: 'bearer',
@@ -2891,7 +2919,7 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
2891
2919
  name: 'X-API-Key',
2892
2920
  type: 'apiKey'
2893
2921
  }],
2894
- url: '/organization/v1/ladders',
2922
+ url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
2895
2923
  ...options,
2896
2924
  headers: {
2897
2925
  'Content-Type': 'application/json',
@@ -2899,11 +2927,11 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
2899
2927
  }
2900
2928
  });
2901
2929
  /**
2902
- * Get a job ladder
2930
+ * List live processes and retained observations
2903
2931
  *
2904
- * Reads one job ladder with its levels in ascending order. Read-only. Errors: 404 LADDER_NOT_FOUND when the id is not a ladder of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
2932
+ * Inspect live processes and retained observations; this does not start a command. Praxis observation, not complete provider history. Only a witnessed exit event establishes exitCode; disconnects and restarts leave gaps and unknown state. Output retains at most 1 MiB/1024 chunks per process and 4 MiB/4096 chunks per instance across 256 observations. Truncation is explicit. Output data is base64; timestamps are Unix milliseconds. Reading never resumes a paused sandbox.
2905
2933
  */
2906
- export const getOrganizationLadder = (options) => (options.client ?? client).get({
2934
+ export const listObservedProcesses = (options) => (options.client ?? client).get({
2907
2935
  security: [{
2908
2936
  key: 'BearerAuth',
2909
2937
  scheme: 'bearer',
@@ -2913,15 +2941,15 @@ export const getOrganizationLadder = (options) => (options.client ?? client).get
2913
2941
  name: 'X-API-Key',
2914
2942
  type: 'apiKey'
2915
2943
  }],
2916
- url: '/organization/v1/ladders/{id}',
2944
+ url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
2917
2945
  ...options
2918
2946
  });
2919
2947
  /**
2920
- * Revise a job ladder
2948
+ * Read bounded observed process output
2921
2949
  *
2922
- * Replaces all levels of a ladder with the array you send. A level with an id keeps that id and takes the new name and order, a level without an id is created, and an existing level you leave out is deleted. A level cannot be deleted while an open position or a job's level_ids still refers to it; first regrade those positions or revise those jobs. Send name to rename the ladder; leave it out to keep the name. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty levels array, duplicate order values, a level id sent twice or a level that is still referenced; 403 PERMISSION_DENIED; 404 LADDER_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND when a level id does not belong to this ladder.
2950
+ * Read retained stdout and stderr chunks for a processID returned by processes.list. Praxis observation, not complete provider history. Only a witnessed exit event establishes exitCode; disconnects and restarts leave gaps and unknown state. Output retains at most 1 MiB/1024 chunks per process and 4 MiB/4096 chunks per instance across 256 observations. Truncation is explicit. Output data is base64; timestamps are Unix milliseconds. Reading never resumes a paused sandbox.
2923
2951
  */
2924
- export const reviseOrganizationLadder = (options) => (options.client ?? client).put({
2952
+ export const getObservedProcessOutput = (options) => (options.client ?? client).get({
2925
2953
  security: [{
2926
2954
  key: 'BearerAuth',
2927
2955
  scheme: 'bearer',
@@ -2931,19 +2959,15 @@ export const reviseOrganizationLadder = (options) => (options.client ?? client).
2931
2959
  name: 'X-API-Key',
2932
2960
  type: 'apiKey'
2933
2961
  }],
2934
- url: '/organization/v1/ladders/{id}',
2935
- ...options,
2936
- headers: {
2937
- 'Content-Type': 'application/json',
2938
- ...options.headers
2939
- }
2962
+ url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
2963
+ ...options
2940
2964
  });
2941
2965
  /**
2942
- * List positions
2966
+ * Start a task whose output is pushed off the machine while it runs
2943
2967
  *
2944
- * Lists positions across the organization ordered by department and then number, vacant ones included; narrow it with department_id, job_id, status or is_head. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean is_head or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/positions?department_id=dept_123&status=active.
2968
+ * Run a long command whose output you will read back afterwards, including after the sandbox is deleted, instead of holding one connection open. Use this for builds, test runs and batch jobs; use commands.run for a short command whose output you want inline. The machine's resident daemon pushes the task's stdout/stderr to Praxis storage as it is produced, so the log survives the sandbox (seven days) and can be read in ranges with sandboxes.tasks.log; no vendor exec channel is involved. The command and the shipping credential travel to the daemon in its process environment, never in argv, so neither appears in the machine's process list. Only a full sandbox whose daemon advertises log-ship can run a task; any other machine returns PROVIDER_UNSUPPORTED with the reason. Returns 201 with the task id; starting is not waiting — poll the log to follow the task, and the final marker's exitCode for how it ended.
2945
2969
  */
2946
- export const listOrganizationPositions = (options) => (options?.client ?? client).get({
2970
+ export const startSandboxTask = (options) => (options.client ?? client).post({
2947
2971
  security: [{
2948
2972
  key: 'BearerAuth',
2949
2973
  scheme: 'bearer',
@@ -2953,15 +2977,19 @@ export const listOrganizationPositions = (options) => (options?.client ?? client
2953
2977
  name: 'X-API-Key',
2954
2978
  type: 'apiKey'
2955
2979
  }],
2956
- url: '/organization/v1/positions',
2957
- ...options
2980
+ url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
2981
+ ...options,
2982
+ headers: {
2983
+ 'Content-Type': 'application/json',
2984
+ ...options.headers
2985
+ }
2958
2986
  });
2959
2987
  /**
2960
- * Open positions
2988
+ * Read a range of a task's pushed output
2961
2989
  *
2962
- * Opens one or more vacant positions in a department, optionally from a job: the job's name becomes the title and its duties and methods are copied onto each position. Without job_id a title is required. Positions get consecutive numbers in the department that are never reused. Open a position and then hire into it; the root department's head position already exists and is held by the organization's owner, seated automatically when the organization is first used. request_id makes the call idempotent: repeating it returns the first result and opens nothing more. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for a count outside 1 to 100, a missing request_id or an unknown body field; 400 POSITION_NAME_REQUIRED without job_id and title; 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND, JOB_NOT_FOUND, JOB_LEVEL_NOT_FOUND or POSITION_NOT_FOUND; 409 DEPARTMENT_DISSOLVED, JOB_RETIRED or POSITION_CLOSED (the reports_to target). Example body: {"department_id":"dept_123","job_id":"jpr_123","count":2,"request_id":"open-support-2026-11"}.
2990
+ * Follow a task started with sandboxes.tasks.start, or read it long after its sandbox is gone. This reads Praxis storage and never the machine, so the answer is the same whether the sandbox is running, paused or deleted; the log is kept for seven days. Read in ranges: pass the previous answer's nextOffset as offset to continue, and stop when done is true. done means the final marker exists and the whole stream has been read, and only then do exitCode and size carry the task's outcome. text is UTF-8 decoded by bytes and backs up to a whole character when a cut would split one, so a page never ends mid-character; size, offset and nextOffset all count bytes. Ownership comes from the sandbox's index row while it exists and from the record written when the task started once it does not, so a sandbox id you own keeps answering after the sandbox is deleted. A task that was never started, or one belonging to another organization, returns NOT_FOUND.
2963
2991
  */
2964
- export const openOrganizationPositions = (options) => (options.client ?? client).post({
2992
+ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
2965
2993
  security: [{
2966
2994
  key: 'BearerAuth',
2967
2995
  scheme: 'bearer',
@@ -2971,37 +2999,89 @@ export const openOrganizationPositions = (options) => (options.client ?? client)
2971
2999
  name: 'X-API-Key',
2972
3000
  type: 'apiKey'
2973
3001
  }],
2974
- url: '/organization/v1/positions',
2975
- ...options,
2976
- headers: {
2977
- 'Content-Type': 'application/json',
2978
- ...options.headers
2979
- }
3002
+ url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
3003
+ ...options
2980
3004
  });
2981
3005
  /**
2982
- * Get a position
3006
+ * Kill sandbox
2983
3007
  *
2984
- * Reads one position with its derived effective_reports_to line. Read-only. Errors: 404 POSITION_NOT_FOUND when the id is not a position of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3008
+ * Kill a sandbox: stop it and release its resources for good. Use it when you are done with the sandbox; to keep its state for later use pause it instead with pauseSandbox. Success answers 204 with no body, and a killed sandbox answers 404 afterwards.
2985
3009
  */
2986
- export const getOrganizationPosition = (options) => (options.client ?? client).get({
2987
- security: [{
2988
- key: 'BearerAuth',
3010
+ export const deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
3011
+ security: [
3012
+ {
3013
+ key: 'sandbox-ApiKeyAuth',
3014
+ name: 'X-API-Key',
3015
+ type: 'apiKey'
3016
+ },
3017
+ {
3018
+ key: 'sandbox-AuthProviderBearerAuth',
2989
3019
  scheme: 'bearer',
2990
3020
  type: 'http'
2991
- }, {
2992
- key: 'ApiKeyAuth',
3021
+ },
3022
+ {
3023
+ key: 'sandbox-AuthProviderTeamAuth',
3024
+ name: 'X-Team-ID',
3025
+ type: 'apiKey'
3026
+ },
3027
+ { name: 'X-Admin-Token', type: 'apiKey' },
3028
+ {
3029
+ key: 'sandbox-AdminTeamAuth',
3030
+ name: 'X-Team-ID',
3031
+ type: 'apiKey'
3032
+ },
3033
+ {
3034
+ key: 'sandbox-AdminJWTAuth',
3035
+ scheme: 'bearer',
3036
+ type: 'http'
3037
+ }
3038
+ ],
3039
+ url: '/sandbox/v1/sandboxes/{sandboxID}',
3040
+ ...options
3041
+ });
3042
+ /**
3043
+ * Sandbox
3044
+ *
3045
+ * Read one sandbox: its state (running or paused), template, resources, start time and expiry (endAt), plus the access token for its data plane when it is running. Use it to poll the state or the remaining lifetime of a sandbox; to find sandboxes use listSandboxes. An unknown id or another team's sandbox answers 404.
3046
+ */
3047
+ export const getSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).get({
3048
+ security: [
3049
+ {
3050
+ key: 'sandbox-ApiKeyAuth',
2993
3051
  name: 'X-API-Key',
2994
3052
  type: 'apiKey'
2995
- }],
2996
- url: '/organization/v1/positions/{id}',
3053
+ },
3054
+ {
3055
+ key: 'sandbox-AuthProviderBearerAuth',
3056
+ scheme: 'bearer',
3057
+ type: 'http'
3058
+ },
3059
+ {
3060
+ key: 'sandbox-AuthProviderTeamAuth',
3061
+ name: 'X-Team-ID',
3062
+ type: 'apiKey'
3063
+ },
3064
+ { name: 'X-Admin-Token', type: 'apiKey' },
3065
+ {
3066
+ key: 'sandbox-AdminTeamAuth',
3067
+ name: 'X-Team-ID',
3068
+ type: 'apiKey'
3069
+ },
3070
+ {
3071
+ key: 'sandbox-AdminJWTAuth',
3072
+ scheme: 'bearer',
3073
+ type: 'http'
3074
+ }
3075
+ ],
3076
+ url: '/sandbox/v1/sandboxes/{sandboxID}',
2997
3077
  ...options
2998
3078
  });
2999
3079
  /**
3000
- * Revise a position
3080
+ * Rename a sandbox
3001
3081
  *
3002
- * Changes the title, duties or methods of one position; the job it was opened from is not touched, and the position's own copy is what changes. Sending no field returns the position unchanged. Requires an organization owner or admin, or the head of the position's department or of a department above it. A frozen position can still be revised. Errors: 400 INVALID_PARAMS for an empty title, a title over 100 characters or text over 4000 characters; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED.
3082
+ * Rename your sandbox. Names are trimmed, must contain 1–64 characters after trimming, and must be unique within your team. Only name may be changed. Returns the updated sandbox detail, as GET does. Killed or unavailable sandboxes return 404.
3003
3083
  */
3004
- export const reviseOrganizationPosition = (options) => (options.client ?? client).patch({
3084
+ export const renameSandbox = (options) => (options.client ?? client).patch({
3005
3085
  security: [{
3006
3086
  key: 'BearerAuth',
3007
3087
  scheme: 'bearer',
@@ -3011,7 +3091,7 @@ export const reviseOrganizationPosition = (options) => (options.client ?? client
3011
3091
  name: 'X-API-Key',
3012
3092
  type: 'apiKey'
3013
3093
  }],
3014
- url: '/organization/v1/positions/{id}',
3094
+ url: '/sandbox/v1/sandboxes/{sandboxID}',
3015
3095
  ...options,
3016
3096
  headers: {
3017
3097
  'Content-Type': 'application/json',
@@ -3019,11 +3099,13 @@ export const reviseOrganizationPosition = (options) => (options.client ?? client
3019
3099
  }
3020
3100
  });
3021
3101
  /**
3022
- * Close a position
3102
+ * Act on a phone sandbox's screen
3023
3103
  *
3024
- * Closes a vacant position for good; its number stays used and the record stays for history. A closed head position stops being the head, so the department has no head until you designate another. Closing a closed position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_OCCUPIED while someone still holds the position.
3104
+ * See and operate an android sandbox's phone screen: take a screenshot, read the UI hierarchy to get a ref for each node, then tap a node or a screen point, long-press, swipe, scroll, type text, press a key, open or close an app, open a URL, or wait. Use it to drive and automate a mobile app on a phone sandbox created with templateID "android"; those machines have no terminal or file API, so drive the screen with this operation and run shell commands with commands.run. Start with a snapshot to learn what is on screen and to mint the refs the tap-like actions use; a ref names a node in the latest snapshot only, so after a newer snapshot, or after an action that changed the screen, take a fresh snapshot — a stale ref is refused with INVALID_PARAMS. The phone runs one action at a time, so actions on one sandbox are serial: send the next only after the previous call returns. A phone that has just been created may not have connected yet and answers 503 SERVICE_UNAVAILABLE with Retry-After: 2; retry after that delay (measured on develop: the sandbox is created in about 45 s and the phone program connects about 15 s later). Text is entered through the phone's own input, which supports ASCII only, so typing non-ASCII text into a Chinese app is not supported and answers INVALID_PARAMS. A linux sandbox has no screen and answers CAPABILITY_UNSUPPORTED.
3105
+ *
3106
+ * The same path is the caller's action socket: send GET with the standard WebSocket upgrade headers instead of POST and drive many actions over one connection. The server answers {"type":"ready","instanceId":"<id>"} first, then every frame {"id":"<your correlation id>","action":{…}} (an action of the same shape as this operation's body, at most 64 characters of id) is answered by its own id, in submission order, as {"id":"…","result":{…}} or {"id":"…","error":{"code":"…","message":"…","retryable":true}}. At most 8 actions may be in flight on one connection (the next answers RATE_LIMITED), and 10 malformed frames in a row close the connection 1008. Authentication is the caller's own (an organization API key), never the phone's token. Closing the connection ends only that client's view: actions already accepted are answered, and the phone stays connected. Before the handshake, a phone that is still being built or has not connected yet answers 503 DEVICE_NOT_READY with the state it is in and Retry-After: 2.
3025
3107
  */
3026
- export const closeOrganizationPosition = (options) => (options.client ?? client).post({
3108
+ export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
3027
3109
  security: [{
3028
3110
  key: 'BearerAuth',
3029
3111
  scheme: 'bearer',
@@ -3033,33 +3115,19 @@ export const closeOrganizationPosition = (options) => (options.client ?? client)
3033
3115
  name: 'X-API-Key',
3034
3116
  type: 'apiKey'
3035
3117
  }],
3036
- url: '/organization/v1/positions/{id}/close',
3037
- ...options
3038
- });
3039
- /**
3040
- * Freeze a position
3041
- *
3042
- * Freezes a vacant position to keep it without using it, for example while hiring is paused; unfreeze brings it back. Freezing a frozen position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED; 409 POSITION_OCCUPIED while someone still holds the position.
3043
- */
3044
- export const freezeOrganizationPosition = (options) => (options.client ?? client).post({
3045
- security: [{
3046
- key: 'BearerAuth',
3047
- scheme: 'bearer',
3048
- type: 'http'
3049
- }, {
3050
- key: 'ApiKeyAuth',
3051
- name: 'X-API-Key',
3052
- type: 'apiKey'
3053
- }],
3054
- url: '/organization/v1/positions/{id}/freeze',
3055
- ...options
3118
+ url: '/sandbox/v1/sandboxes/{sandboxID}/act',
3119
+ ...options,
3120
+ headers: {
3121
+ 'Content-Type': 'application/json',
3122
+ ...options.headers
3123
+ }
3056
3124
  });
3057
3125
  /**
3058
- * Unfreeze a position
3126
+ * Remove a file or directory in the sandbox
3059
3127
  *
3060
- * Returns a frozen position to active. Unfreezing an active position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED.
3128
+ * Remove an unneeded file or recursively remove a directory and its contents. This permanently deletes the selected path; read any needed content first. Returns 204 after removal.
3061
3129
  */
3062
- export const unfreezeOrganizationPosition = (options) => (options.client ?? client).post({
3130
+ export const removeSandboxFile = (options) => (options.client ?? client).delete({
3063
3131
  security: [{
3064
3132
  key: 'BearerAuth',
3065
3133
  scheme: 'bearer',
@@ -3069,15 +3137,15 @@ export const unfreezeOrganizationPosition = (options) => (options.client ?? clie
3069
3137
  name: 'X-API-Key',
3070
3138
  type: 'apiKey'
3071
3139
  }],
3072
- url: '/organization/v1/positions/{id}/unfreeze',
3140
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
3073
3141
  ...options
3074
3142
  });
3075
3143
  /**
3076
- * Reassign a position's manager
3144
+ * Read a file in the sandbox
3077
3145
  *
3078
- * Sets the position this position reports to, or sends null to return to the default line: the head position of its department, and for a head position the head of the parent department. Requires an organization owner or admin, or the head of the position's department or of a department above it. The target may be in any department. Errors: 400 REPORTING_CYCLE when the new line would loop back to this position; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND for the position or the target; 409 POSITION_CLOSED when either is closed.
3146
+ * Read UTF-8 file content when a command needs input or produced a text artifact. Returns a JSON string. Unlike E2B, this endpoint supports text only and rejects output above 1 MiB; binary and streaming reads are unavailable.
3079
3147
  */
3080
- export const reassignOrganizationPositionManager = (options) => (options.client ?? client).put({
3148
+ export const readSandboxFile = (options) => (options.client ?? client).get({
3081
3149
  security: [{
3082
3150
  key: 'BearerAuth',
3083
3151
  scheme: 'bearer',
@@ -3087,19 +3155,15 @@ export const reassignOrganizationPositionManager = (options) => (options.client
3087
3155
  name: 'X-API-Key',
3088
3156
  type: 'apiKey'
3089
3157
  }],
3090
- url: '/organization/v1/positions/{id}/manager',
3091
- ...options,
3092
- headers: {
3093
- 'Content-Type': 'application/json',
3094
- ...options.headers
3095
- }
3158
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
3159
+ ...options
3096
3160
  });
3097
3161
  /**
3098
- * Regrade a position
3162
+ * Write a file in the sandbox
3099
3163
  *
3100
- * Sets the job level of a position. If the position was opened from a job that lists allowed levels, the level must be one of them. Requires an organization owner or admin; a department head cannot regrade. Errors: 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND; 409 POSITION_CLOSED.
3164
+ * Write a file in the sandbox before running a command. Replaces the target content and creates missing parent directories. Unlike E2B, this endpoint accepts one UTF-8 text file per request, at most 1 MiB; binary and batch writes are unavailable. Example body: {"path":"/tmp/hello.txt","data":"hello"}.
3101
3165
  */
3102
- export const regradeOrganizationPosition = (options) => (options.client ?? client).put({
3166
+ export const writeSandboxFile = (options) => (options.client ?? client).put({
3103
3167
  security: [{
3104
3168
  key: 'BearerAuth',
3105
3169
  scheme: 'bearer',
@@ -3109,7 +3173,7 @@ export const regradeOrganizationPosition = (options) => (options.client ?? clien
3109
3173
  name: 'X-API-Key',
3110
3174
  type: 'apiKey'
3111
3175
  }],
3112
- url: '/organization/v1/positions/{id}/level',
3176
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
3113
3177
  ...options,
3114
3178
  headers: {
3115
3179
  'Content-Type': 'application/json',
@@ -3117,11 +3181,11 @@ export const regradeOrganizationPosition = (options) => (options.client ?? clien
3117
3181
  }
3118
3182
  });
3119
3183
  /**
3120
- * Designate a department head position
3184
+ * List files in a sandbox directory
3121
3185
  *
3122
- * Makes this position the head of its department; the previous head position stays an ordinary position. The head is a position, not a person, and positions in the department with no explicit manager report to it. Takes no body. Requires an organization owner or admin. Errors: 400 REPORTING_CYCLE when the change would make a position report into its own line; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED or POSITION_FROZEN, because only an active position can be head.
3186
+ * Inspect a directory to find paths to read or remove. Returns immediate children with name, path, type and size. Unlike E2B, recursive depth is unavailable and responses are limited to 1 MiB.
3123
3187
  */
3124
- export const designateOrganizationPositionHead = (options) => (options.client ?? client).post({
3188
+ export const listSandboxFiles = (options) => (options.client ?? client).get({
3125
3189
  security: [{
3126
3190
  key: 'BearerAuth',
3127
3191
  scheme: 'bearer',
@@ -3131,15 +3195,15 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
3131
3195
  name: 'X-API-Key',
3132
3196
  type: 'apiKey'
3133
3197
  }],
3134
- url: '/organization/v1/positions/{id}/designate_head',
3198
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
3135
3199
  ...options
3136
3200
  });
3137
3201
  /**
3138
- * Hire into a position
3202
+ * Create a directory in the sandbox
3139
3203
  *
3140
- * Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. An agent created moments ago may not be in the organization roster yet (agents enter it asynchronously): that answers 503 ACTOR_SYNCING with a Retry-After header and retryable true, and the same call succeeds after that wait. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
3204
+ * Create a directory and missing parent directories before writing files. Returns true when created or false when the path already exists. Supply the path as a query parameter.
3141
3205
  */
3142
- export const hireOrganizationPosition = (options) => (options.client ?? client).post({
3206
+ export const makeSandboxDirectory = (options) => (options.client ?? client).post({
3143
3207
  security: [{
3144
3208
  key: 'BearerAuth',
3145
3209
  scheme: 'bearer',
@@ -3149,19 +3213,15 @@ export const hireOrganizationPosition = (options) => (options.client ?? client).
3149
3213
  name: 'X-API-Key',
3150
3214
  type: 'apiKey'
3151
3215
  }],
3152
- url: '/organization/v1/positions/{id}/hire',
3153
- ...options,
3154
- headers: {
3155
- 'Content-Type': 'application/json',
3156
- ...options.headers
3157
- }
3216
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
3217
+ ...options
3158
3218
  });
3159
3219
  /**
3160
- * Replace a position's holder
3220
+ * Run a command in the sandbox
3161
3221
  *
3162
- * Ends the current holder's assignment with reason replaced and seats the successor in the same step, so the position is never vacant in between; the ended assignment records the successor's assignment id as successor_assignment_id. Nothing the predecessor learned or remembered passes to the successor, because experience belongs to the actor, not the position. The successor must exist in your organization and not be archived; it becomes primary if it holds nothing else, otherwise a concurrent assignment. If the predecessor was primary and holds other positions, the earliest of those becomes its primary. request_id makes the call idempotent: repeating it returns the first result and replaces nobody again. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing successor or request_id, a successor that already holds this position or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND for the successor; 409 POSITION_VACANT when nobody holds the position, so use hire instead. Example body: {"successor":"agent:agent_123","request_id":"replace-support-1"}.
3222
+ * Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–3600000 milliseconds, default 600000, that is 10 minutes; E2B defaults to 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout (timeoutMs 0); output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. On an android sandbox the command runs in the phone's root shell, its stderr is merged into stdout (read stdout and expect stderr to come back empty), and background mode is unavailable. Example body: {"cmd":"echo hi"}.
3163
3223
  */
3164
- export const replaceOrganizationPositionHolder = (options) => (options.client ?? client).post({
3224
+ export const runSandboxCommand = (options) => (options.client ?? client).post({
3165
3225
  security: [{
3166
3226
  key: 'BearerAuth',
3167
3227
  scheme: 'bearer',
@@ -3171,7 +3231,7 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
3171
3231
  name: 'X-API-Key',
3172
3232
  type: 'apiKey'
3173
3233
  }],
3174
- url: '/organization/v1/positions/{id}/replace_holder',
3234
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
3175
3235
  ...options,
3176
3236
  headers: {
3177
3237
  'Content-Type': 'application/json',
@@ -3179,11 +3239,11 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
3179
3239
  }
3180
3240
  });
3181
3241
  /**
3182
- * List assignments
3242
+ * Start adding a phone of your own
3183
3243
  *
3184
- * Lists assignments, newest start first, each tying one actor (person or agent) to one position; use it to see who holds what, or the history of a position or an actor. Ended assignments are included unless you filter active=true. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean active or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/assignments?position_id=pos_123&active=true.
3244
+ * Begin bringing your own device (BYOD): the platform answers an 8-character code, its ten-minute deadline and the QR payload your phone's app scans, and nothing is registered until the owner taps Allow on the phone. Show the QR payload (or the code) in your app; the phone opens GET /sandbox/v1/byod/pairings/{code} — with no credential — to show the organization and the deadline, then posts the claim once. The pairing stores the organization's display name, which the phone shows on its Allow screen, so create the pairing from a session or key that carries one. A code is spent by the first successful claim and cannot be reused; create a new pairing for another device. BYOD devices are separate from sandboxes: they never appear in listSandboxes and have no template, size or expiry. Example: POST /sandbox/v1/byod/pairings with no body returns {code:'K7M4PQRS',expires_at:'2026-11-22T13:10:00.000Z',qr:'praxis://byod/pair?code=K7M4PQRS&api=https%3A%2F%2Fapi.deepraxis.com'}.
3185
3245
  */
3186
- export const listOrganizationAssignments = (options) => (options?.client ?? client).get({
3246
+ export const createByodPairing = (options) => (options?.client ?? client).post({
3187
3247
  security: [{
3188
3248
  key: 'BearerAuth',
3189
3249
  scheme: 'bearer',
@@ -3193,15 +3253,15 @@ export const listOrganizationAssignments = (options) => (options?.client ?? clie
3193
3253
  name: 'X-API-Key',
3194
3254
  type: 'apiKey'
3195
3255
  }],
3196
- url: '/organization/v1/assignments',
3256
+ url: '/sandbox/v1/byod/pairings',
3197
3257
  ...options
3198
3258
  });
3199
3259
  /**
3200
- * Get an assignment
3260
+ * List your organization's own devices
3201
3261
  *
3202
- * Reads one assignment, current or ended, with who appointed and ended it and, for a replaced holder, the successor's assignment id. Read-only. Errors: 404 ASSIGNMENT_NOT_FOUND when the id is not an assignment of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3262
+ * List the devices your organization has paired, oldest first, with each one's platform, name, model, OS version, live online fact and when it was last seen. Use it to find a device id before you act on it, rename it or disconnect it, or to show the BYOD page. A revoked device is not listed, so a device that disappears from this answer was disconnected; there is no paging because an organization's own devices are few. Each row carries capabilities and, for a desktop, the agent_dirs it registered. Example: GET /sandbox/v1/byod/devices returns {data:[{object:'byod_device',id:'byd_0123456789abcdefghijklmno',platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16',online:true,last_seen_at:'2026-11-22T12:58:00.000Z',created_at:'2026-11-22T12:40:00.000Z',capabilities:['display'],agent_dirs:[]}]}.
3203
3263
  */
3204
- export const getOrganizationAssignment = (options) => (options.client ?? client).get({
3264
+ export const listByodDevices = (options) => (options?.client ?? client).get({
3205
3265
  security: [{
3206
3266
  key: 'BearerAuth',
3207
3267
  scheme: 'bearer',
@@ -3211,15 +3271,15 @@ export const getOrganizationAssignment = (options) => (options.client ?? client)
3211
3271
  name: 'X-API-Key',
3212
3272
  type: 'apiKey'
3213
3273
  }],
3214
- url: '/organization/v1/assignments/{id}',
3274
+ url: '/sandbox/v1/byod/devices',
3215
3275
  ...options
3216
3276
  });
3217
3277
  /**
3218
- * Transfer an assignment to another position
3278
+ * Read one of your organization's devices
3219
3279
  *
3220
- * Moves the actor from its current position to another vacant one: the current assignment ends with reason transferred and a new one starts in the target position, keeping the primary flag, so a primary assignment stays primary. Use it for a move or promotion; use terminate when the actor leaves the position without another. Only a current assignment can be transferred. The target must be active and vacant. Needs write rights over both departments: an organization owner or admin, or a head whose department is, or is above, both the department being left and the target's department. Errors: 400 INVALID_PARAMS for a missing to_position_id or a target equal to the current position; 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or already ended assignment; 404 POSITION_NOT_FOUND for the target; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED for the target. Example body: {"to_position_id":"pos_456"}.
3280
+ * Read one BYOD device: the same fields listByodDevices returns, for a single device. Use it to poll whether a device is online before acting on it, or to refresh one row of the BYOD page after a rename. An unknown id and another organization's device both answer 404, so the answer never reveals that a foreign device exists. Example: GET /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno.
3221
3281
  */
3222
- export const transferOrganizationAssignment = (options) => (options.client ?? client).post({
3282
+ export const getByodDevice = (options) => (options.client ?? client).get({
3223
3283
  security: [{
3224
3284
  key: 'BearerAuth',
3225
3285
  scheme: 'bearer',
@@ -3229,19 +3289,15 @@ export const transferOrganizationAssignment = (options) => (options.client ?? cl
3229
3289
  name: 'X-API-Key',
3230
3290
  type: 'apiKey'
3231
3291
  }],
3232
- url: '/organization/v1/assignments/{id}/transfer',
3233
- ...options,
3234
- headers: {
3235
- 'Content-Type': 'application/json',
3236
- ...options.headers
3237
- }
3292
+ url: '/sandbox/v1/byod/devices/{deviceID}',
3293
+ ...options
3238
3294
  });
3239
3295
  /**
3240
- * End an assignment
3296
+ * Rename one of your organization's devices
3241
3297
  *
3242
- * Ends a current assignment with the reason you give; the position becomes vacant and the assignment stays as history that never revives. If it was the actor's primary and the actor still holds other positions, the earliest of those becomes primary. Use transfer instead to move the actor to another position. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing reason or one outside the list; 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or already ended assignment. Example body: {"reason":"resigned"}.
3298
+ * Change a device's display name, and nothing else: pairing, credential, platform and connection are untouched. Use it to give a shared phone a name your team recognises. The body takes exactly one field, name, 1 to 64 characters after trimming; a missing, extra or wrongly typed field answers INVALID_PARAMS. An unknown id and another organization's device both answer 404. Example: PATCH /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno with {name:'Shelf phone'} returns the updated device.
3243
3299
  */
3244
- export const terminateOrganizationAssignment = (options) => (options.client ?? client).post({
3300
+ export const updateByodDevice = (options) => (options.client ?? client).patch({
3245
3301
  security: [{
3246
3302
  key: 'BearerAuth',
3247
3303
  scheme: 'bearer',
@@ -3251,7 +3307,7 @@ export const terminateOrganizationAssignment = (options) => (options.client ?? c
3251
3307
  name: 'X-API-Key',
3252
3308
  type: 'apiKey'
3253
3309
  }],
3254
- url: '/organization/v1/assignments/{id}/terminate',
3310
+ url: '/sandbox/v1/byod/devices/{deviceID}',
3255
3311
  ...options,
3256
3312
  headers: {
3257
3313
  'Content-Type': 'application/json',
@@ -3259,11 +3315,11 @@ export const terminateOrganizationAssignment = (options) => (options.client ?? c
3259
3315
  }
3260
3316
  });
3261
3317
  /**
3262
- * Make an assignment primary
3318
+ * Disconnect a device and revoke its credential
3263
3319
  *
3264
- * Makes this assignment the actor's primary one; the actor's previous primary becomes a concurrent assignment in the same step. Use it when an actor holds several positions and its main one changes. An assignment that is already primary is returned unchanged. Takes no body. Requires an organization owner or admin; a department head cannot call this. Errors: 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or ended assignment.
3320
+ * Disconnect a paired device: the device's credential is revoked, its control connection is closed, and it stops appearing in listByodDevices. Use it when the phone is lost, lent or no longer wanted; the same disconnect is offered as one tap on the device itself. The operation is idempotent — disconnecting an already-disconnected device answers the same 200 — so a retry after a lost response is safe. The device is untouched: nothing is erased on the phone, and it can be paired again with a new pairing. Because a revoked device is not listed, a later listByodDevices no longer shows it. An unknown id and another organization's device both answer 404. Example: POST /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno/disconnect returns {id:'byd_0123456789abcdefghijklmno',object:'byod_device',disconnected:true}.
3265
3321
  */
3266
- export const makePrimaryOrganizationAssignment = (options) => (options.client ?? client).post({
3322
+ export const disconnectByodDevice = (options) => (options.client ?? client).post({
3267
3323
  security: [{
3268
3324
  key: 'BearerAuth',
3269
3325
  scheme: 'bearer',
@@ -3273,15 +3329,15 @@ export const makePrimaryOrganizationAssignment = (options) => (options.client ??
3273
3329
  name: 'X-API-Key',
3274
3330
  type: 'apiKey'
3275
3331
  }],
3276
- url: '/organization/v1/assignments/{id}/make_primary',
3332
+ url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
3277
3333
  ...options
3278
3334
  });
3279
3335
  /**
3280
- * List actors holding positions
3336
+ * Read a pairing for the phone's Allow screen
3281
3337
  *
3282
- * Lists every actor, person or agent, that currently holds at least one position, ordered by actor address, each with its primary position and all positions it holds; use it to see who works where. Actors holding nothing are not listed. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/actors?department_id=dept_123.
3338
+ * The phone's own read, called by the app that scanned the QR code or the code was typed into: it answers the organization's display name and the code's deadline, which the owner sees before tapping Allow. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and do not call it from server code. An unknown, spent or expired code answers 404, with nothing said about which of the three it is; that also covers a code another organization created. The read is a preview only: it registers nothing, and the claim is what spends the code. Example: GET /sandbox/v1/byod/pairings/K7M4PQRS returns {organization_name:'烟火测试团队',expires_at:'2026-11-22T13:10:00.000Z'}.
3283
3339
  */
3284
- export const listOrganizationActors = (options) => (options?.client ?? client).get({
3340
+ export const getByodPairing = (options) => (options.client ?? client).get({
3285
3341
  security: [{
3286
3342
  key: 'BearerAuth',
3287
3343
  scheme: 'bearer',
@@ -3291,15 +3347,15 @@ export const listOrganizationActors = (options) => (options?.client ?? client).g
3291
3347
  name: 'X-API-Key',
3292
3348
  type: 'apiKey'
3293
3349
  }],
3294
- url: '/organization/v1/actors',
3350
+ url: '/sandbox/v1/byod/pairings/{code}',
3295
3351
  ...options
3296
3352
  });
3297
3353
  /**
3298
- * Get the position chain of an actor
3354
+ * Claim a pairing and register the phone
3299
3355
  *
3300
- * Reads where an actor, person or agent, sits in the organization: its primary position and its concurrent positions, each with the department path from the root down with every level's charter, the job, title and level name, the manager (the first filled position up the reporting line), the position's own duties and methods, and objectives. Use it to answer who this actor is and what it is responsible for. An actor that holds no position is not an error: primary is null and concurrent is empty. Read-only. Errors: 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3356
+ * The phone's own final step after the owner taps Allow: it registers the device and answers the device id, a one-time credential and the control socket url the app dials. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and never call it from server code. The claim is single use: the first successful call spends the code and a second call answers 404, as does an unknown or expired code, so the app must store the credential the moment it arrives because it is never shown again. Connect to socket_url with Authorization: Bearer <credential>; the socket speaks the phone channel (hello, ping/pong, act, result/error) and the device's one connection is replaced if the app reconnects. Example: POST /sandbox/v1/byod/pairings/K7M4PQRS/claim with {platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16'} returns {device_id:'byd_0123456789abcdefghijklmno',credential:'…',socket_url:'wss://49982-byd0123456789abcdefghijklmno.sandbox.praxisusercontent.com/'}.
3301
3357
  */
3302
- export const getOrganizationActor = (options) => (options.client ?? client).get({
3358
+ export const claimByodPairing = (options) => (options.client ?? client).post({
3303
3359
  security: [{
3304
3360
  key: 'BearerAuth',
3305
3361
  scheme: 'bearer',
@@ -3309,15 +3365,19 @@ export const getOrganizationActor = (options) => (options.client ?? client).get(
3309
3365
  name: 'X-API-Key',
3310
3366
  type: 'apiKey'
3311
3367
  }],
3312
- url: '/organization/v1/actors/{actor}',
3313
- ...options
3368
+ url: '/sandbox/v1/byod/pairings/{code}/claim',
3369
+ ...options,
3370
+ headers: {
3371
+ 'Content-Type': 'application/json',
3372
+ ...options.headers
3373
+ }
3314
3374
  });
3315
3375
  /**
3316
- * List periods
3376
+ * List departments
3317
3377
  *
3318
- * Lists the periods of your organization's OKR calendar, newest start first; use it to find the period_id to set objectives in, or to see which periods are still open for grading. Closed periods are included. Filter cadence to read one level of the calendar. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/periods?cadence=quarter.
3378
+ * Lists the departments of your organization's tree, including the root department; use it to find a department id or to walk the tree one level at a time with parent_id. Dissolved departments are included unless you filter status=active. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/departments?status=active.
3319
3379
  */
3320
- export const listOrganizationPeriods = (options) => (options?.client ?? client).get({
3380
+ export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
3321
3381
  security: [{
3322
3382
  key: 'BearerAuth',
3323
3383
  scheme: 'bearer',
@@ -3327,15 +3387,15 @@ export const listOrganizationPeriods = (options) => (options?.client ?? client).
3327
3387
  name: 'X-API-Key',
3328
3388
  type: 'apiKey'
3329
3389
  }],
3330
- url: '/organization/v1/periods',
3390
+ url: '/workforce/v1/departments',
3331
3391
  ...options
3332
3392
  });
3333
3393
  /**
3334
- * Open a period
3394
+ * Establish a department
3335
3395
  *
3336
- * Opens a period in your organization's single OKR calendar of years, halves and quarters; objectives are set inside a period. Its status is derived, never sent: planning before start_on, active from start_on through end_on inclusive, grading after end_on, and closed only when you close it. Periods of the same cadence never overlap. Give parent_id to place a half or quarter inside a coarser period (year > half > quarter) that contains its whole range. Dates are calendar dates, and today is read as the UTC date. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, a name over 100 characters, a cadence outside the list, a date that is not YYYY-MM-DD, start_on after end_on or an unknown body field; 400 PERIOD_OVERLAP when a period of the same cadence already covers part of the range, or the parent is not coarser or does not contain the range; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND when parent_id does not exist. Example body: {"name":"2026 Q4","cadence":"quarter","start_on":"2026-10-01","end_on":"2026-12-31"}.
3396
+ * Creates a department under an existing active parent department; use it to grow the tree, and use reorganize to rename or move one that already exists. order defaults to one after the last active sibling. The new department has no head position and no charter: open a position in it, then designate that position as head. Requires an organization owner or admin, or the head of the parent department or of a department above it. Errors: 400 INVALID_PARAMS for a missing or empty name, a name over 100 characters, an unknown body field or an active sibling with the same name; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND when the parent does not exist; 409 DEPARTMENT_DISSOLVED when the parent is dissolved. Example body: {"parent_id":"dept_123","name":"Support"}.
3337
3397
  */
3338
- export const openOrganizationPeriod = (options) => (options.client ?? client).post({
3398
+ export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
3339
3399
  security: [{
3340
3400
  key: 'BearerAuth',
3341
3401
  scheme: 'bearer',
@@ -3345,7 +3405,7 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
3345
3405
  name: 'X-API-Key',
3346
3406
  type: 'apiKey'
3347
3407
  }],
3348
- url: '/organization/v1/periods',
3408
+ url: '/workforce/v1/departments',
3349
3409
  ...options,
3350
3410
  headers: {
3351
3411
  'Content-Type': 'application/json',
@@ -3353,11 +3413,11 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
3353
3413
  }
3354
3414
  });
3355
3415
  /**
3356
- * Get a period
3416
+ * Get a department
3357
3417
  *
3358
- * Reads one period with its derived status, so you can tell whether it is still planning, active, in grading or closed. Read-only. Errors: 404 PERIOD_NOT_FOUND when the id is not a period of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3418
+ * Reads one department with its head position id and its charter, including the charter revision you need before amending the charter. Read-only. Errors: 404 DEPARTMENT_NOT_FOUND when the id is not a department of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3359
3419
  */
3360
- export const getOrganizationPeriod = (options) => (options.client ?? client).get({
3420
+ export const getOrganizationDepartment = (options) => (options.client ?? client).get({
3361
3421
  security: [{
3362
3422
  key: 'BearerAuth',
3363
3423
  scheme: 'bearer',
@@ -3367,15 +3427,15 @@ export const getOrganizationPeriod = (options) => (options.client ?? client).get
3367
3427
  name: 'X-API-Key',
3368
3428
  type: 'apiKey'
3369
3429
  }],
3370
- url: '/organization/v1/periods/{id}',
3430
+ url: '/workforce/v1/departments/{id}',
3371
3431
  ...options
3372
3432
  });
3373
3433
  /**
3374
- * Close a period
3434
+ * Reorganize a department
3375
3435
  *
3376
- * Closes a period once its objectives are graded: closed is the only status you set yourself, and it never reverts. After it, objectives and key results of the period can no longer be set or revised. Closing does not grade or change any objective. Closing a period that is already closed returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND.
3436
+ * Renames a department, moves it under another parent, or changes its sort order; send at least one of parent_id, name and order. Sub-departments and positions move with it. Requires an organization owner or admin. The root department is the organization itself: its name is the organization's name and cannot be changed here (rename the organization in its settings), and it can never be moved, but its order can change. Errors: 400 INVALID_PARAMS when no field is given, a name is empty or over 100 characters, or a department already has that name under the same parent; 400 DEPARTMENT_CYCLE when the new parent is the department itself or one of its descendants; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND for the department or the new parent; 409 DEPARTMENT_DISSOLVED when either is dissolved; 409 DEPARTMENT_ROOT_IMMUTABLE when parent_id or name is sent for the root.
3377
3437
  */
3378
- export const closeOrganizationPeriod = (options) => (options.client ?? client).post({
3438
+ export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
3379
3439
  security: [{
3380
3440
  key: 'BearerAuth',
3381
3441
  scheme: 'bearer',
@@ -3385,15 +3445,19 @@ export const closeOrganizationPeriod = (options) => (options.client ?? client).p
3385
3445
  name: 'X-API-Key',
3386
3446
  type: 'apiKey'
3387
3447
  }],
3388
- url: '/organization/v1/periods/{id}/close',
3389
- ...options
3448
+ url: '/workforce/v1/departments/{id}',
3449
+ ...options,
3450
+ headers: {
3451
+ 'Content-Type': 'application/json',
3452
+ ...options.headers
3453
+ }
3390
3454
  });
3391
3455
  /**
3392
- * List objectives
3456
+ * Dissolve a department
3393
3457
  *
3394
- * Lists objectives, oldest first, each with its scope, the parents it aligns to and, once graded, its result and score; use it to find an objective id or to read one period or one department's objectives. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/objectives?period_id=prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38&status=active.
3458
+ * Dissolves an empty department: it leaves the active tree, keeps its record for history, and takes no new sub-departments or positions. This API has no operation to reopen it. Requires an organization owner or admin. The department must have no active sub-department and no position that is not closed; dissolve or close those first. Takes no body. Errors: 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_NOT_EMPTY while an active sub-department or an unclosed position remains; 409 DEPARTMENT_ROOT_IMMUTABLE for the root; 409 DEPARTMENT_DISSOLVED when it is already dissolved.
3395
3459
  */
3396
- export const listOrganizationObjectives = (options) => (options?.client ?? client).get({
3460
+ export const dissolveOrganizationDepartment = (options) => (options.client ?? client).post({
3397
3461
  security: [{
3398
3462
  key: 'BearerAuth',
3399
3463
  scheme: 'bearer',
@@ -3403,15 +3467,15 @@ export const listOrganizationObjectives = (options) => (options?.client ?? clien
3403
3467
  name: 'X-API-Key',
3404
3468
  type: 'apiKey'
3405
3469
  }],
3406
- url: '/organization/v1/objectives',
3470
+ url: '/workforce/v1/departments/{id}/dissolve',
3407
3471
  ...options
3408
3472
  });
3409
3473
  /**
3410
- * Set an objective
3474
+ * Amend a department charter
3411
3475
  *
3412
- * Sets an objective: what a department or a position is trying to reach in one open period. It hangs on a department or a position of your organization's tree, and company objectives hang on the root department. It starts active with no parents; align it to higher objectives with the align operation, and add key results with the key results operations. Requires an organization owner or admin, or the head of the objective's home department (the department itself, or the department of the position). Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a description over 2000 characters, a scope kind outside the list or an unknown body field; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND, DEPARTMENT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED, DEPARTMENT_DISSOLVED or POSITION_CLOSED. Example body: {"period_id":"prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38","scope":{"kind":"department","id":"dept_4c2e9a17d0b34f58a6e1b3c7d9f20e84"},"title":"Cut first-response time"}.
3476
+ * Replaces the charter of a department: free-text rules that apply to the department and are inherited by every department below it. Send the charter.revision you last read as expected_revision (0 when the department has no charter yet); each successful amendment raises the revision by one. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for text over 2000 characters or a non-integer expected_revision; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_DISSOLVED; 409 REVISION_CONFLICT when the charter moved on, so get the department again, merge your change and retry with its revision.
3413
3477
  */
3414
- export const setOrganizationObjective = (options) => (options.client ?? client).post({
3478
+ export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
3415
3479
  security: [{
3416
3480
  key: 'BearerAuth',
3417
3481
  scheme: 'bearer',
@@ -3421,7 +3485,7 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
3421
3485
  name: 'X-API-Key',
3422
3486
  type: 'apiKey'
3423
3487
  }],
3424
- url: '/organization/v1/objectives',
3488
+ url: '/workforce/v1/departments/{id}/charter',
3425
3489
  ...options,
3426
3490
  headers: {
3427
3491
  'Content-Type': 'application/json',
@@ -3429,11 +3493,11 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
3429
3493
  }
3430
3494
  });
3431
3495
  /**
3432
- * Get an objective
3496
+ * List jobs
3433
3497
  *
3434
- * Reads one objective with its scope, the parents it aligns to with their weights, its status and, once graded, its result, score and grade note. Its key results are read with the key results list filtered by objective_id. Read-only. Errors: 404 OBJECTIVE_NOT_FOUND when the id is not an objective of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3498
+ * Lists the jobs of your organization ordered by code; use it to find the job_id to open positions from. Retired jobs are included unless you filter status=active. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3435
3499
  */
3436
- export const getOrganizationObjective = (options) => (options.client ?? client).get({
3500
+ export const listOrganizationJobs = (options) => (options?.client ?? client).get({
3437
3501
  security: [{
3438
3502
  key: 'BearerAuth',
3439
3503
  scheme: 'bearer',
@@ -3443,15 +3507,15 @@ export const getOrganizationObjective = (options) => (options.client ?? client).
3443
3507
  name: 'X-API-Key',
3444
3508
  type: 'apiKey'
3445
3509
  }],
3446
- url: '/organization/v1/objectives/{id}',
3510
+ url: '/workforce/v1/jobs',
3447
3511
  ...options
3448
3512
  });
3449
3513
  /**
3450
- * Revise an objective
3514
+ * Define a job
3451
3515
  *
3452
- * Rewords an active objective: change its title, its description or both; send at least one. Its period, scope and alignment do not change here; use align for parents, and grade to close it. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS when no field is given, a title is empty or over 200 characters, or a description is over 2000 characters; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 409 PERIOD_CLOSED when the objective was already graded or its period is closed. Example body: {"title":"Cut first-response time to under 2 hours"}.
3516
+ * Creates a job: a reusable template of duties and methods that is copied onto each position opened from it. The new job starts at revision 1 and status active. code is your own unique key for the job inside the organization. level_ids restricts the levels positions of this job may carry (empty or omitted allows any level). Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty or duplicate code, a name over 100 characters, text over 4000 characters or an unknown body field; 403 PERMISSION_DENIED; 404 JOB_LEVEL_NOT_FOUND when a level id does not exist. Example body: {"code":"support-agent","name":"Support agent","duties":"Answer customer tickets."}.
3453
3517
  */
3454
- export const reviseOrganizationObjective = (options) => (options.client ?? client).patch({
3518
+ export const defineOrganizationJob = (options) => (options.client ?? client).post({
3455
3519
  security: [{
3456
3520
  key: 'BearerAuth',
3457
3521
  scheme: 'bearer',
@@ -3461,7 +3525,7 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
3461
3525
  name: 'X-API-Key',
3462
3526
  type: 'apiKey'
3463
3527
  }],
3464
- url: '/organization/v1/objectives/{id}',
3528
+ url: '/workforce/v1/jobs',
3465
3529
  ...options,
3466
3530
  headers: {
3467
3531
  'Content-Type': 'application/json',
@@ -3469,11 +3533,11 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
3469
3533
  }
3470
3534
  });
3471
3535
  /**
3472
- * Align an objective to parent objectives
3536
+ * Get a job
3473
3537
  *
3474
- * Replaces the whole set of parent objectives this objective contributes to; send an empty parents array to remove its alignment. An objective aligns only upward: each parent must hang on the objective's own department or on a department above it, the objective cannot be its own parent, and the alignment graph must stay free of cycles. Each weight is greater than 0 and at most 1, and a parent may appear once. A closed parent is refused. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for a weight outside the range, a repeated parent or an unknown body field; 400 ALIGNMENT_CYCLE when a parent is the objective itself or the alignment would loop; 400 SCOPE_MISMATCH when a parent hangs outside the objective's department and its ancestors; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND for the objective or a parent; 409 PERIOD_CLOSED when a parent is closed. Example body: {"parents":[{"objective_id":"obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96","weight":1}]}.
3538
+ * Reads one job with its current revision, which you need before revising it. Read-only. Errors: 404 JOB_NOT_FOUND when the id is not a job of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3475
3539
  */
3476
- export const alignOrganizationObjective = (options) => (options.client ?? client).put({
3540
+ export const getOrganizationJob = (options) => (options.client ?? client).get({
3477
3541
  security: [{
3478
3542
  key: 'BearerAuth',
3479
3543
  scheme: 'bearer',
@@ -3483,19 +3547,15 @@ export const alignOrganizationObjective = (options) => (options.client ?? client
3483
3547
  name: 'X-API-Key',
3484
3548
  type: 'apiKey'
3485
3549
  }],
3486
- url: '/organization/v1/objectives/{id}/parents',
3487
- ...options,
3488
- headers: {
3489
- 'Content-Type': 'application/json',
3490
- ...options.headers
3491
- }
3550
+ url: '/workforce/v1/jobs/{id}',
3551
+ ...options
3492
3552
  });
3493
3553
  /**
3494
- * Grade an objective
3554
+ * Revise a job
3495
3555
  *
3496
- * Grades an objective and closes it in place: records its result, its score from 0 to 1, an optional note, and the scores of the key results you list. A key result you leave out keeps no score. Grading happens once; a closed objective cannot be graded again. When the objective has any committed key result and the result is not achieved, a note is required. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for a result outside the list, a non-numeric score or a note over 2000 characters; 400 SCORE_OUT_OF_RANGE when any score is outside 0 to 1; 400 GRADE_NOTE_REQUIRED when a committed objective is graded other than achieved without a note; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 404 KEY_RESULT_NOT_FOUND when a listed key result does not belong to this objective; 409 PERIOD_CLOSED when the objective is already closed. Example body: {"result":"partial","score":0.6,"note":"Hiring slipped a month."}.
3556
+ * Changes the name, duties, methods or allowed levels of a job; send expected_revision and at least one of those fields. Positions already opened keep their own copy and level, and only positions opened afterwards use the revised text. level_ids replaces the whole list. Each success raises the job revision by one. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when no field is given or a value breaks its limits; 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND when a level id does not exist; 409 REVISION_CONFLICT when the job moved on, so get the job again and retry with its revision.
3497
3557
  */
3498
- export const gradeOrganizationObjective = (options) => (options.client ?? client).post({
3558
+ export const reviseOrganizationJob = (options) => (options.client ?? client).patch({
3499
3559
  security: [{
3500
3560
  key: 'BearerAuth',
3501
3561
  scheme: 'bearer',
@@ -3505,7 +3565,7 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
3505
3565
  name: 'X-API-Key',
3506
3566
  type: 'apiKey'
3507
3567
  }],
3508
- url: '/organization/v1/objectives/{id}/grade',
3568
+ url: '/workforce/v1/jobs/{id}',
3509
3569
  ...options,
3510
3570
  headers: {
3511
3571
  'Content-Type': 'application/json',
@@ -3513,11 +3573,11 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
3513
3573
  }
3514
3574
  });
3515
3575
  /**
3516
- * List key results
3576
+ * Retire a job
3517
3577
  *
3518
- * Lists key results, oldest first, each with its metric, health, done flag and, once its objective is graded, its score; use it to read the key results of one objective or the ones a position owns. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/key_results?objective_id=obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96.
3578
+ * Retires a job so no new position can be opened from it; positions already opened are unchanged. Retiring a job that is already retired returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND.
3519
3579
  */
3520
- export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
3580
+ export const retireOrganizationJob = (options) => (options.client ?? client).post({
3521
3581
  security: [{
3522
3582
  key: 'BearerAuth',
3523
3583
  scheme: 'bearer',
@@ -3527,15 +3587,33 @@ export const listOrganizationKeyResults = (options) => (options?.client ?? clien
3527
3587
  name: 'X-API-Key',
3528
3588
  type: 'apiKey'
3529
3589
  }],
3530
- url: '/organization/v1/key_results',
3590
+ url: '/workforce/v1/jobs/{id}/retire',
3531
3591
  ...options
3532
3592
  });
3533
3593
  /**
3534
- * Set a key result
3594
+ * List job ladders
3535
3595
  *
3536
- * Sets a key result under an active objective: a measurable outcome owned by one position, whose current holder moves its progress. Give a metric to measure it by numbers; omit metric for a binary key result, whose progress is its done flag. It starts with health on_track, done false and no score. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a commitment outside the list, a metric whose target equals its initial value or whose unit is outside the list, or an unknown body field; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED when the objective is graded or its period is closed; 409 POSITION_CLOSED when the owner position is closed. Example body: {"objective_id":"obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96","title":"Median first response under 2 hours","owner_position_id":"pos_7a1c5e92d3b84f60a9e2c4d8b1f30a57","commitment":"committed","metric":{"initial":6,"target":2,"unit":"none"}}.
3596
+ * Lists the job ladders of your organization, oldest first, each with its levels in ascending order; use it to find the level ids for jobs and positions. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3537
3597
  */
3538
- export const setOrganizationKeyResult = (options) => (options.client ?? client).post({
3598
+ export const listOrganizationLadders = (options) => (options?.client ?? client).get({
3599
+ security: [{
3600
+ key: 'BearerAuth',
3601
+ scheme: 'bearer',
3602
+ type: 'http'
3603
+ }, {
3604
+ key: 'ApiKeyAuth',
3605
+ name: 'X-API-Key',
3606
+ type: 'apiKey'
3607
+ }],
3608
+ url: '/workforce/v1/ladders',
3609
+ ...options
3610
+ });
3611
+ /**
3612
+ * Define a job ladder
3613
+ *
3614
+ * Creates a job ladder: a named, ordered set of job levels such as junior to senior. Each level gets its own id (lvl_...), which jobs and positions refer to. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, an empty levels array, two levels with the same order or an unknown body field; 403 PERMISSION_DENIED. Example body: {"name":"Support","levels":[{"name":"Junior","order":1},{"name":"Senior","order":2}]}.
3615
+ */
3616
+ export const defineOrganizationLadder = (options) => (options.client ?? client).post({
3539
3617
  security: [{
3540
3618
  key: 'BearerAuth',
3541
3619
  scheme: 'bearer',
@@ -3545,7 +3623,7 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
3545
3623
  name: 'X-API-Key',
3546
3624
  type: 'apiKey'
3547
3625
  }],
3548
- url: '/organization/v1/key_results',
3626
+ url: '/workforce/v1/ladders',
3549
3627
  ...options,
3550
3628
  headers: {
3551
3629
  'Content-Type': 'application/json',
@@ -3553,11 +3631,11 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
3553
3631
  }
3554
3632
  });
3555
3633
  /**
3556
- * Get a key result
3634
+ * Get a job ladder
3557
3635
  *
3558
- * Reads one key result with its metric, its health, its done flag, its owner position and its score. Progress of a metric key result is (current - initial) / (target - initial), clamped between 0 and 1; a key result without a metric counts as 1 when done is true and 0 otherwise. Read-only. Errors: 404 KEY_RESULT_NOT_FOUND when the id is not a key result of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3636
+ * Reads one job ladder with its levels in ascending order. Read-only. Errors: 404 LADDER_NOT_FOUND when the id is not a ladder of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3559
3637
  */
3560
- export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
3638
+ export const getOrganizationLadder = (options) => (options.client ?? client).get({
3561
3639
  security: [{
3562
3640
  key: 'BearerAuth',
3563
3641
  scheme: 'bearer',
@@ -3567,15 +3645,15 @@ export const getOrganizationKeyResult = (options) => (options.client ?? client).
3567
3645
  name: 'X-API-Key',
3568
3646
  type: 'apiKey'
3569
3647
  }],
3570
- url: '/organization/v1/key_results/{id}',
3648
+ url: '/workforce/v1/ladders/{id}',
3571
3649
  ...options
3572
3650
  });
3573
3651
  /**
3574
- * Revise a key result
3652
+ * Revise a job ladder
3575
3653
  *
3576
- * Edits a key result; send at least one field. Progress is updated by this edit, not by check-in records: write metric.current for a metric key result, or done for a binary one, and set health as it changes. The holder of the owner position, when a person, may change only metric.current, health and done; an organization owner or admin, or the head of the objective's home department or of a department above it, may change any field. An agent holding the position cannot write it. metric replaces the whole metric; done applies only to a key result without a metric. Errors: 400 INVALID_PARAMS when no field is given, done is sent for a key result that has a metric, or a field is malformed; 403 NOT_POSITION_HOLDER when the caller is neither a manager nor the position's person holder; 403 PERMISSION_DENIED when a holder changes more than progress; 404 KEY_RESULT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED when the objective is graded or its period is closed; 409 POSITION_CLOSED for a closed new owner. Example body: {"metric":{"initial":6,"current":3.5,"target":2,"unit":"none"},"health":"at_risk"}.
3654
+ * Replaces all levels of a ladder with the array you send. A level with an id keeps that id and takes the new name and order, a level without an id is created, and an existing level you leave out is deleted. A level cannot be deleted while an open position or a job's level_ids still refers to it; first regrade those positions or revise those jobs. Send name to rename the ladder; leave it out to keep the name. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty levels array, duplicate order values, a level id sent twice or a level that is still referenced; 403 PERMISSION_DENIED; 404 LADDER_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND when a level id does not belong to this ladder.
3577
3655
  */
3578
- export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
3656
+ export const reviseOrganizationLadder = (options) => (options.client ?? client).put({
3579
3657
  security: [{
3580
3658
  key: 'BearerAuth',
3581
3659
  scheme: 'bearer',
@@ -3585,7 +3663,7 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
3585
3663
  name: 'X-API-Key',
3586
3664
  type: 'apiKey'
3587
3665
  }],
3588
- url: '/organization/v1/key_results/{id}',
3666
+ url: '/workforce/v1/ladders/{id}',
3589
3667
  ...options,
3590
3668
  headers: {
3591
3669
  'Content-Type': 'application/json',
@@ -3593,11 +3671,11 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
3593
3671
  }
3594
3672
  });
3595
3673
  /**
3596
- * List specs
3674
+ * List positions
3597
3675
  *
3598
- * Lists the specs (规定) of the organization, most recently updated first; use it to find which subject already has a spec before reading or revising one. Narrow it with kind. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, an unknown kind, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/specs?kind=job.
3676
+ * Lists positions across the organization ordered by department and then number, vacant ones included; narrow it with department_id, job_id, status or is_head. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean is_head or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/positions?department_id=dept_123&status=active.
3599
3677
  */
3600
- export const listOrganizationSpecs = (options) => (options?.client ?? client).get({
3678
+ export const listOrganizationPositions = (options) => (options?.client ?? client).get({
3601
3679
  security: [{
3602
3680
  key: 'BearerAuth',
3603
3681
  scheme: 'bearer',
@@ -3607,15 +3685,15 @@ export const listOrganizationSpecs = (options) => (options?.client ?? client).ge
3607
3685
  name: 'X-API-Key',
3608
3686
  type: 'apiKey'
3609
3687
  }],
3610
- url: '/organization/v1/specs',
3688
+ url: '/workforce/v1/positions',
3611
3689
  ...options
3612
3690
  });
3613
3691
  /**
3614
- * Get a spec
3692
+ * Open positions
3615
3693
  *
3616
- * Reads one subject's live spec, or one historical revision with revision; a subject never written answers revision 0 with an empty spec, so a first revise sends expected_revision 0. Read-only. Errors: 400 INVALID_PARAMS for a non-integer revision; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject, or the named SPEC_REVISION_NOT_FOUND, does not exist. Example: GET /organization/v1/specs/job/jpr_123?revision=2.
3694
+ * Opens one or more vacant positions in a department, optionally from a job: the job's name becomes the title and its duties and methods are copied onto each position. Without job_id a title is required. Positions get consecutive numbers in the department that are never reused. Open a position and then hire into it; the root department's head position already exists and is held by the organization's owner, seated automatically when the organization is first used. request_id makes the call idempotent: repeating it returns the first result and opens nothing more. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for a count outside 1 to 100, a missing request_id or an unknown body field; 400 POSITION_NAME_REQUIRED without job_id and title; 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND, JOB_NOT_FOUND, JOB_LEVEL_NOT_FOUND or POSITION_NOT_FOUND; 409 DEPARTMENT_DISSOLVED, JOB_RETIRED or POSITION_CLOSED (the reports_to target). Example body: {"department_id":"dept_123","job_id":"jpr_123","count":2,"request_id":"open-support-2026-11"}.
3617
3695
  */
3618
- export const getOrganizationSpec = (options) => (options.client ?? client).get({
3696
+ export const openOrganizationPositions = (options) => (options.client ?? client).post({
3619
3697
  security: [{
3620
3698
  key: 'BearerAuth',
3621
3699
  scheme: 'bearer',
@@ -3625,15 +3703,19 @@ export const getOrganizationSpec = (options) => (options.client ?? client).get({
3625
3703
  name: 'X-API-Key',
3626
3704
  type: 'apiKey'
3627
3705
  }],
3628
- url: '/organization/v1/specs/{kind}/{id}',
3629
- ...options
3706
+ url: '/workforce/v1/positions',
3707
+ ...options,
3708
+ headers: {
3709
+ 'Content-Type': 'application/json',
3710
+ ...options.headers
3711
+ }
3630
3712
  });
3631
3713
  /**
3632
- * Revise a spec
3714
+ * Get a position
3633
3715
  *
3634
- * Replaces the whole spec of a subject: expected_revision is the revision you last read (0 when none was written) and each success raises it by one, so a mismatch returns REVISION_CONFLICT and you must read again, merge and retry. The spec body is stored and returned verbatim; its blocks are document, agent, computer, phone, roles, grants, repositories, schedules, browser and remove, and it is validated against the block registry. Requires an organization owner or admin, or the head of the subject's department. Errors: 400 INVALID_PARAMS for a missing spec or expected_revision, a block outside the registry or an unknown body field; 403 PERMISSION_DENIED; 404 when the subject does not exist; 409 REVISION_CONFLICT. Example body: {"expected_revision":0,"spec":{"document":"Deliver reliably."}}.
3716
+ * Reads one position with its derived effective_reports_to line. Read-only. Errors: 404 POSITION_NOT_FOUND when the id is not a position of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3635
3717
  */
3636
- export const reviseOrganizationSpec = (options) => (options.client ?? client).put({
3718
+ export const getOrganizationPosition = (options) => (options.client ?? client).get({
3637
3719
  security: [{
3638
3720
  key: 'BearerAuth',
3639
3721
  scheme: 'bearer',
@@ -3643,19 +3725,15 @@ export const reviseOrganizationSpec = (options) => (options.client ?? client).pu
3643
3725
  name: 'X-API-Key',
3644
3726
  type: 'apiKey'
3645
3727
  }],
3646
- url: '/organization/v1/specs/{kind}/{id}',
3647
- ...options,
3648
- headers: {
3649
- 'Content-Type': 'application/json',
3650
- ...options.headers
3651
- }
3728
+ url: '/workforce/v1/positions/{id}',
3729
+ ...options
3652
3730
  });
3653
3731
  /**
3654
- * List spec revisions
3732
+ * Revise a position
3655
3733
  *
3656
- * Lists every stored revision of one subject's spec, newest first, each with its body, author and creation instant; use it to see what changed over time or to pick a revision to read or diff. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist.
3734
+ * Changes the title, duties or methods of one position; the job it was opened from is not touched, and the position's own copy is what changes. Sending no field returns the position unchanged. Requires an organization owner or admin, or the head of the position's department or of a department above it. A frozen position can still be revised. Errors: 400 INVALID_PARAMS for an empty title, a title over 100 characters or text over 4000 characters; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED.
3657
3735
  */
3658
- export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
3736
+ export const reviseOrganizationPosition = (options) => (options.client ?? client).patch({
3659
3737
  security: [{
3660
3738
  key: 'BearerAuth',
3661
3739
  scheme: 'bearer',
@@ -3665,15 +3743,19 @@ export const listOrganizationSpecRevisions = (options) => (options.client ?? cli
3665
3743
  name: 'X-API-Key',
3666
3744
  type: 'apiKey'
3667
3745
  }],
3668
- url: '/organization/v1/specs/{kind}/{id}/revisions',
3669
- ...options
3746
+ url: '/workforce/v1/positions/{id}',
3747
+ ...options,
3748
+ headers: {
3749
+ 'Content-Type': 'application/json',
3750
+ ...options.headers
3751
+ }
3670
3752
  });
3671
3753
  /**
3672
- * Diff two spec revisions
3754
+ * Close a position
3673
3755
  *
3674
- * Compares two revisions of one subject's spec and lists the changes between them, each with its path and, for a change, the value before and after; revision 0 is the empty spec, so diffing 0 against 1 shows the first write. Read-only. Errors: 400 INVALID_PARAMS when from or to is missing or not an integer; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist, or SPEC_REVISION_NOT_FOUND when from or to was never written. Example: GET /organization/v1/specs/job/jpr_123/diff?from=1&to=2.
3756
+ * Closes a vacant position for good; its number stays used and the record stays for history. A closed head position stops being the head, so the department has no head until you designate another. Closing a closed position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_OCCUPIED while someone still holds the position.
3675
3757
  */
3676
- export const diffOrganizationSpec = (options) => (options.client ?? client).get({
3758
+ export const closeOrganizationPosition = (options) => (options.client ?? client).post({
3677
3759
  security: [{
3678
3760
  key: 'BearerAuth',
3679
3761
  scheme: 'bearer',
@@ -3683,15 +3765,15 @@ export const diffOrganizationSpec = (options) => (options.client ?? client).get(
3683
3765
  name: 'X-API-Key',
3684
3766
  type: 'apiKey'
3685
3767
  }],
3686
- url: '/organization/v1/specs/{kind}/{id}/diff',
3768
+ url: '/workforce/v1/positions/{id}/close',
3687
3769
  ...options
3688
3770
  });
3689
3771
  /**
3690
- * Read the effective spec
3772
+ * Freeze a position
3691
3773
  *
3692
- * Merges the spec chain of a seat or an actor and returns the one effective configuration: the merged capability blocks, the document of every layer, where each merged value came from, and anything only the merged result shows to be wrong. Give exactly one of actor (every seat the actor holds) or position_id (one seat, held or vacant, a preview before hiring); holder_kind defaults from the seat's holder. Read-only; nothing is changed. Errors: 400 INVALID_PARAMS when neither or both of actor and position_id are given, the actor address is malformed, holder_kind is neither agent nor human, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 POSITION_NOT_FOUND. Example: GET /organization/v1/effective_spec?actor=agent:agent_123.
3774
+ * Freezes a vacant position to keep it without using it, for example while hiring is paused; unfreeze brings it back. Freezing a frozen position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED; 409 POSITION_OCCUPIED while someone still holds the position.
3693
3775
  */
3694
- export const getOrganizationEffectiveSpec = (options) => (options?.client ?? client).get({
3776
+ export const freezeOrganizationPosition = (options) => (options.client ?? client).post({
3695
3777
  security: [{
3696
3778
  key: 'BearerAuth',
3697
3779
  scheme: 'bearer',
@@ -3701,15 +3783,15 @@ export const getOrganizationEffectiveSpec = (options) => (options?.client ?? cli
3701
3783
  name: 'X-API-Key',
3702
3784
  type: 'apiKey'
3703
3785
  }],
3704
- url: '/organization/v1/effective_spec',
3786
+ url: '/workforce/v1/positions/{id}/freeze',
3705
3787
  ...options
3706
3788
  });
3707
3789
  /**
3708
- * Plan reconciliation
3790
+ * Unfreeze a position
3709
3791
  *
3710
- * Dry-runs the reconciler for one holder and returns what it would change: an action per block (hold, update, none, pending, blocked) with the value it would write, and the violations only the merged result shows. It changes nothing - no state, no agent and no memory. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/reconcile/plan?actor=agent:agent_123.
3792
+ * Returns a frozen position to active. Unfreezing an active position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED.
3711
3793
  */
3712
- export const planOrganizationReconcile = (options) => (options.client ?? client).get({
3794
+ export const unfreezeOrganizationPosition = (options) => (options.client ?? client).post({
3713
3795
  security: [{
3714
3796
  key: 'BearerAuth',
3715
3797
  scheme: 'bearer',
@@ -3719,15 +3801,15 @@ export const planOrganizationReconcile = (options) => (options.client ?? client)
3719
3801
  name: 'X-API-Key',
3720
3802
  type: 'apiKey'
3721
3803
  }],
3722
- url: '/organization/v1/reconcile/plan',
3804
+ url: '/workforce/v1/positions/{id}/unfreeze',
3723
3805
  ...options
3724
3806
  });
3725
3807
  /**
3726
- * Read reconcile status
3808
+ * Reassign a position's manager
3727
3809
  *
3728
- * Reads the reconciler's last result for one holder: whether the sweep is paused, the seats and layer revisions of the last applied run, each block's state (ready, pending, failed, waiting_human or paused), the drift between what is applied and what the specs want, and when it last applied. Read-only; it changes nothing. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/reconcile/status?actor=agent:agent_123.
3810
+ * Sets the position this position reports to, or sends null to return to the default line: the head position of its department, and for a head position the head of the parent department. Requires an organization owner or admin, or the head of the position's department or of a department above it. The target may be in any department. Errors: 400 REPORTING_CYCLE when the new line would loop back to this position; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND for the position or the target; 409 POSITION_CLOSED when either is closed.
3729
3811
  */
3730
- export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
3812
+ export const reassignOrganizationPositionManager = (options) => (options.client ?? client).put({
3731
3813
  security: [{
3732
3814
  key: 'BearerAuth',
3733
3815
  scheme: 'bearer',
@@ -3737,15 +3819,19 @@ export const getOrganizationReconcileStatus = (options) => (options.client ?? cl
3737
3819
  name: 'X-API-Key',
3738
3820
  type: 'apiKey'
3739
3821
  }],
3740
- url: '/organization/v1/reconcile/status',
3741
- ...options
3822
+ url: '/workforce/v1/positions/{id}/manager',
3823
+ ...options,
3824
+ headers: {
3825
+ 'Content-Type': 'application/json',
3826
+ ...options.headers
3827
+ }
3742
3828
  });
3743
3829
  /**
3744
- * Run reconciliation now
3830
+ * Regrade a position
3745
3831
  *
3746
- * Reconciles one holder now instead of waiting for the sweep: it plans, applies every update and returns the new status. Run plan first to see the changes without applying them. Requires an organization owner or admin. A block that cannot be applied now stays pending, waiting_human or failed, and the returned status says so. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
3832
+ * Sets the job level of a position. If the position was opened from a job that lists allowed levels, the level must be one of them. Requires an organization owner or admin; a department head cannot regrade. Errors: 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND; 409 POSITION_CLOSED.
3747
3833
  */
3748
- export const runOrganizationReconcile = (options) => (options.client ?? client).post({
3834
+ export const regradeOrganizationPosition = (options) => (options.client ?? client).put({
3749
3835
  security: [{
3750
3836
  key: 'BearerAuth',
3751
3837
  scheme: 'bearer',
@@ -3755,7 +3841,7 @@ export const runOrganizationReconcile = (options) => (options.client ?? client).
3755
3841
  name: 'X-API-Key',
3756
3842
  type: 'apiKey'
3757
3843
  }],
3758
- url: '/organization/v1/reconcile/run',
3844
+ url: '/workforce/v1/positions/{id}/level',
3759
3845
  ...options,
3760
3846
  headers: {
3761
3847
  'Content-Type': 'application/json',
@@ -3763,11 +3849,11 @@ export const runOrganizationReconcile = (options) => (options.client ?? client).
3763
3849
  }
3764
3850
  });
3765
3851
  /**
3766
- * Pause reconciliation
3852
+ * Designate a department head position
3767
3853
  *
3768
- * Stops the sweep from reconciling one holder until it is resumed: the holder's blocks keep their state and no further update is applied. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
3854
+ * Makes this position the head of its department; the previous head position stays an ordinary position. The head is a position, not a person, and positions in the department with no explicit manager report to it. Takes no body. Requires an organization owner or admin. Errors: 400 REPORTING_CYCLE when the change would make a position report into its own line; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED or POSITION_FROZEN, because only an active position can be head.
3769
3855
  */
3770
- export const pauseOrganizationReconcile = (options) => (options.client ?? client).post({
3856
+ export const designateOrganizationPositionHead = (options) => (options.client ?? client).post({
3771
3857
  security: [{
3772
3858
  key: 'BearerAuth',
3773
3859
  scheme: 'bearer',
@@ -3777,19 +3863,15 @@ export const pauseOrganizationReconcile = (options) => (options.client ?? client
3777
3863
  name: 'X-API-Key',
3778
3864
  type: 'apiKey'
3779
3865
  }],
3780
- url: '/organization/v1/reconcile/pause',
3781
- ...options,
3782
- headers: {
3783
- 'Content-Type': 'application/json',
3784
- ...options.headers
3785
- }
3866
+ url: '/workforce/v1/positions/{id}/designate_head',
3867
+ ...options
3786
3868
  });
3787
3869
  /**
3788
- * Resume reconciliation
3870
+ * Hire into a position
3789
3871
  *
3790
- * Restarts the sweep for a paused holder and reconciles it now, returning the new status. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
3872
+ * Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. An agent created moments ago may not be in the organization roster yet (agents enter it asynchronously): that answers 503 ACTOR_SYNCING with a Retry-After header and retryable true, and the same call succeeds after that wait. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
3791
3873
  */
3792
- export const resumeOrganizationReconcile = (options) => (options.client ?? client).post({
3874
+ export const hireOrganizationPosition = (options) => (options.client ?? client).post({
3793
3875
  security: [{
3794
3876
  key: 'BearerAuth',
3795
3877
  scheme: 'bearer',
@@ -3799,7 +3881,7 @@ export const resumeOrganizationReconcile = (options) => (options.client ?? clien
3799
3881
  name: 'X-API-Key',
3800
3882
  type: 'apiKey'
3801
3883
  }],
3802
- url: '/organization/v1/reconcile/resume',
3884
+ url: '/workforce/v1/positions/{id}/hire',
3803
3885
  ...options,
3804
3886
  headers: {
3805
3887
  'Content-Type': 'application/json',
@@ -3807,11 +3889,11 @@ export const resumeOrganizationReconcile = (options) => (options.client ?? clien
3807
3889
  }
3808
3890
  });
3809
3891
  /**
3810
- * Upgrade to a full sandbox
3892
+ * Replace a position's holder
3811
3893
  *
3812
- * Move a light sandbox to a full environment when its capabilities are insufficient. Stops active processes and terminals, migrates files, and preserves the sandbox ID and name. Reconnect with the new envdAccessToken. A failed migration preserves source files but does not restart terminated processes.
3894
+ * Ends the current holder's assignment with reason replaced and seats the successor in the same step, so the position is never vacant in between; the ended assignment records the successor's assignment id as successor_assignment_id. Nothing the predecessor learned or remembered passes to the successor, because experience belongs to the actor, not the position. The successor must exist in your organization and not be archived; it becomes primary if it holds nothing else, otherwise a concurrent assignment. If the predecessor was primary and holds other positions, the earliest of those becomes its primary. request_id makes the call idempotent: repeating it returns the first result and replaces nobody again. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing successor or request_id, a successor that already holds this position or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND for the successor; 409 POSITION_VACANT when nobody holds the position, so use hire instead. Example body: {"successor":"agent:agent_123","request_id":"replace-support-1"}.
3813
3895
  */
3814
- export const upgradeSandbox = (options) => (options.client ?? client).post({
3896
+ export const replaceOrganizationPositionHolder = (options) => (options.client ?? client).post({
3815
3897
  security: [{
3816
3898
  key: 'BearerAuth',
3817
3899
  scheme: 'bearer',
@@ -3821,7 +3903,7 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
3821
3903
  name: 'X-API-Key',
3822
3904
  type: 'apiKey'
3823
3905
  }],
3824
- url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
3906
+ url: '/workforce/v1/positions/{id}/replace_holder',
3825
3907
  ...options,
3826
3908
  headers: {
3827
3909
  'Content-Type': 'application/json',
@@ -3829,11 +3911,11 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
3829
3911
  }
3830
3912
  });
3831
3913
  /**
3832
- * Extend a running sandbox without shortening its deadline
3914
+ * List assignments
3833
3915
  *
3834
- * Extend a running sandbox only when it needs a later expiry; this never resumes a paused sandbox. Timeout is seconds from now, not added to the prior deadline, and must be 900, 1800 or 3600. Returns 409 for paused, expired, or non-extending requests.
3916
+ * Lists assignments, newest start first, each tying one actor (person or agent) to one position; use it to see who holds what, or the history of a position or an actor. Ended assignments are included unless you filter active=true. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean active or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/assignments?position_id=pos_123&active=true.
3835
3917
  */
3836
- export const extendSandbox = (options) => (options.client ?? client).post({
3918
+ export const listOrganizationAssignments = (options) => (options?.client ?? client).get({
3837
3919
  security: [{
3838
3920
  key: 'BearerAuth',
3839
3921
  scheme: 'bearer',
@@ -3843,19 +3925,15 @@ export const extendSandbox = (options) => (options.client ?? client).post({
3843
3925
  name: 'X-API-Key',
3844
3926
  type: 'apiKey'
3845
3927
  }],
3846
- url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
3847
- ...options,
3848
- headers: {
3849
- 'Content-Type': 'application/json',
3850
- ...options.headers
3851
- }
3928
+ url: '/workforce/v1/assignments',
3929
+ ...options
3852
3930
  });
3853
3931
  /**
3854
- * List live processes and retained observations
3932
+ * Get an assignment
3855
3933
  *
3856
- * Inspect live processes and retained observations; this does not start a command. Praxis observation, not complete provider history. Only a witnessed exit event establishes exitCode; disconnects and restarts leave gaps and unknown state. Output retains at most 1 MiB/1024 chunks per process and 4 MiB/4096 chunks per instance across 256 observations. Truncation is explicit. Output data is base64; timestamps are Unix milliseconds. Reading never resumes a paused sandbox.
3934
+ * Reads one assignment, current or ended, with who appointed and ended it and, for a replaced holder, the successor's assignment id. Read-only. Errors: 404 ASSIGNMENT_NOT_FOUND when the id is not an assignment of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3857
3935
  */
3858
- export const listObservedProcesses = (options) => (options.client ?? client).get({
3936
+ export const getOrganizationAssignment = (options) => (options.client ?? client).get({
3859
3937
  security: [{
3860
3938
  key: 'BearerAuth',
3861
3939
  scheme: 'bearer',
@@ -3865,15 +3943,15 @@ export const listObservedProcesses = (options) => (options.client ?? client).get
3865
3943
  name: 'X-API-Key',
3866
3944
  type: 'apiKey'
3867
3945
  }],
3868
- url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
3946
+ url: '/workforce/v1/assignments/{id}',
3869
3947
  ...options
3870
3948
  });
3871
3949
  /**
3872
- * Read bounded observed process output
3950
+ * Transfer an assignment to another position
3873
3951
  *
3874
- * Read retained stdout and stderr chunks for a processID returned by processes.list. Praxis observation, not complete provider history. Only a witnessed exit event establishes exitCode; disconnects and restarts leave gaps and unknown state. Output retains at most 1 MiB/1024 chunks per process and 4 MiB/4096 chunks per instance across 256 observations. Truncation is explicit. Output data is base64; timestamps are Unix milliseconds. Reading never resumes a paused sandbox.
3952
+ * Moves the actor from its current position to another vacant one: the current assignment ends with reason transferred and a new one starts in the target position, keeping the primary flag, so a primary assignment stays primary. Use it for a move or promotion; use terminate when the actor leaves the position without another. Only a current assignment can be transferred. The target must be active and vacant. Needs write rights over both departments: an organization owner or admin, or a head whose department is, or is above, both the department being left and the target's department. Errors: 400 INVALID_PARAMS for a missing to_position_id or a target equal to the current position; 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or already ended assignment; 404 POSITION_NOT_FOUND for the target; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED for the target. Example body: {"to_position_id":"pos_456"}.
3875
3953
  */
3876
- export const getObservedProcessOutput = (options) => (options.client ?? client).get({
3954
+ export const transferOrganizationAssignment = (options) => (options.client ?? client).post({
3877
3955
  security: [{
3878
3956
  key: 'BearerAuth',
3879
3957
  scheme: 'bearer',
@@ -3883,15 +3961,19 @@ export const getObservedProcessOutput = (options) => (options.client ?? client).
3883
3961
  name: 'X-API-Key',
3884
3962
  type: 'apiKey'
3885
3963
  }],
3886
- url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
3887
- ...options
3964
+ url: '/workforce/v1/assignments/{id}/transfer',
3965
+ ...options,
3966
+ headers: {
3967
+ 'Content-Type': 'application/json',
3968
+ ...options.headers
3969
+ }
3888
3970
  });
3889
3971
  /**
3890
- * Start a task whose output is pushed off the machine while it runs
3972
+ * End an assignment
3891
3973
  *
3892
- * Run a long command whose output you will read back afterwards, including after the sandbox is deleted, instead of holding one connection open. Use this for builds, test runs and batch jobs; use commands.run for a short command whose output you want inline. The machine's resident daemon pushes the task's stdout/stderr to Praxis storage as it is produced, so the log survives the sandbox (seven days) and can be read in ranges with sandboxes.tasks.log; no vendor exec channel is involved. The command and the shipping credential travel to the daemon in its process environment, never in argv, so neither appears in the machine's process list. Only a full sandbox whose daemon advertises log-ship can run a task; any other machine returns PROVIDER_UNSUPPORTED with the reason. Returns 201 with the task id; starting is not waiting — poll the log to follow the task, and the final marker's exitCode for how it ended.
3974
+ * Ends a current assignment with the reason you give; the position becomes vacant and the assignment stays as history that never revives. If it was the actor's primary and the actor still holds other positions, the earliest of those becomes primary. Use transfer instead to move the actor to another position. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing reason or one outside the list; 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or already ended assignment. Example body: {"reason":"resigned"}.
3893
3975
  */
3894
- export const startSandboxTask = (options) => (options.client ?? client).post({
3976
+ export const terminateOrganizationAssignment = (options) => (options.client ?? client).post({
3895
3977
  security: [{
3896
3978
  key: 'BearerAuth',
3897
3979
  scheme: 'bearer',
@@ -3901,7 +3983,7 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
3901
3983
  name: 'X-API-Key',
3902
3984
  type: 'apiKey'
3903
3985
  }],
3904
- url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
3986
+ url: '/workforce/v1/assignments/{id}/terminate',
3905
3987
  ...options,
3906
3988
  headers: {
3907
3989
  'Content-Type': 'application/json',
@@ -3909,11 +3991,11 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
3909
3991
  }
3910
3992
  });
3911
3993
  /**
3912
- * Read a range of a task's pushed output
3994
+ * Make an assignment primary
3913
3995
  *
3914
- * Follow a task started with sandboxes.tasks.start, or read it long after its sandbox is gone. This reads Praxis storage and never the machine, so the answer is the same whether the sandbox is running, paused or deleted; the log is kept for seven days. Read in ranges: pass the previous answer's nextOffset as offset to continue, and stop when done is true. done means the final marker exists and the whole stream has been read, and only then do exitCode and size carry the task's outcome. text is UTF-8 decoded by bytes and backs up to a whole character when a cut would split one, so a page never ends mid-character; size, offset and nextOffset all count bytes. Ownership comes from the sandbox's index row while it exists and from the record written when the task started once it does not, so a sandbox id you own keeps answering after the sandbox is deleted. A task that was never started, or one belonging to another organization, returns NOT_FOUND.
3996
+ * Makes this assignment the actor's primary one; the actor's previous primary becomes a concurrent assignment in the same step. Use it when an actor holds several positions and its main one changes. An assignment that is already primary is returned unchanged. Takes no body. Requires an organization owner or admin; a department head cannot call this. Errors: 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or ended assignment.
3915
3997
  */
3916
- export const getSandboxTaskLog = (options) => (options.client ?? client).get({
3998
+ export const makePrimaryOrganizationAssignment = (options) => (options.client ?? client).post({
3917
3999
  security: [{
3918
4000
  key: 'BearerAuth',
3919
4001
  scheme: 'bearer',
@@ -3923,89 +4005,51 @@ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
3923
4005
  name: 'X-API-Key',
3924
4006
  type: 'apiKey'
3925
4007
  }],
3926
- url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
4008
+ url: '/workforce/v1/assignments/{id}/make_primary',
3927
4009
  ...options
3928
4010
  });
3929
4011
  /**
3930
- * Kill sandbox
4012
+ * List actors holding positions
3931
4013
  *
3932
- * Kill a sandbox: stop it and release its resources for good. Use it when you are done with the sandbox; to keep its state for later use pause it instead with pauseSandbox. Success answers 204 with no body, and a killed sandbox answers 404 afterwards.
4014
+ * Lists every actor, person or agent, that currently holds at least one position, ordered by actor address, each with its primary position and all positions it holds; use it to see who works where. Actors holding nothing are not listed. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/actors?department_id=dept_123.
3933
4015
  */
3934
- export const deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
3935
- security: [
3936
- {
3937
- key: 'sandbox-ApiKeyAuth',
3938
- name: 'X-API-Key',
3939
- type: 'apiKey'
3940
- },
3941
- {
3942
- key: 'sandbox-AuthProviderBearerAuth',
4016
+ export const listOrganizationActors = (options) => (options?.client ?? client).get({
4017
+ security: [{
4018
+ key: 'BearerAuth',
3943
4019
  scheme: 'bearer',
3944
4020
  type: 'http'
3945
- },
3946
- {
3947
- key: 'sandbox-AuthProviderTeamAuth',
3948
- name: 'X-Team-ID',
3949
- type: 'apiKey'
3950
- },
3951
- { name: 'X-Admin-Token', type: 'apiKey' },
3952
- {
3953
- key: 'sandbox-AdminTeamAuth',
3954
- name: 'X-Team-ID',
4021
+ }, {
4022
+ key: 'ApiKeyAuth',
4023
+ name: 'X-API-Key',
3955
4024
  type: 'apiKey'
3956
- },
3957
- {
3958
- key: 'sandbox-AdminJWTAuth',
3959
- scheme: 'bearer',
3960
- type: 'http'
3961
- }
3962
- ],
3963
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4025
+ }],
4026
+ url: '/workforce/v1/actors',
3964
4027
  ...options
3965
4028
  });
3966
4029
  /**
3967
- * Sandbox
4030
+ * Get the position chain of an actor
3968
4031
  *
3969
- * Read one sandbox: its state (running or paused), template, resources, start time and expiry (endAt), plus the access token for its data plane when it is running. Use it to poll the state or the remaining lifetime of a sandbox; to find sandboxes use listSandboxes. An unknown id or another team's sandbox answers 404.
4032
+ * Reads where an actor, person or agent, sits in the organization: its primary position and its concurrent positions, each with the department path from the root down with every level's charter, the job, title and level name, the manager (the first filled position up the reporting line), the position's own duties and methods, and objectives. Use it to answer who this actor is and what it is responsible for. An actor that holds no position is not an error: primary is null and concurrent is empty. Read-only. Errors: 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3970
4033
  */
3971
- export const getSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).get({
3972
- security: [
3973
- {
3974
- key: 'sandbox-ApiKeyAuth',
3975
- name: 'X-API-Key',
3976
- type: 'apiKey'
3977
- },
3978
- {
3979
- key: 'sandbox-AuthProviderBearerAuth',
4034
+ export const getOrganizationActor = (options) => (options.client ?? client).get({
4035
+ security: [{
4036
+ key: 'BearerAuth',
3980
4037
  scheme: 'bearer',
3981
4038
  type: 'http'
3982
- },
3983
- {
3984
- key: 'sandbox-AuthProviderTeamAuth',
3985
- name: 'X-Team-ID',
3986
- type: 'apiKey'
3987
- },
3988
- { name: 'X-Admin-Token', type: 'apiKey' },
3989
- {
3990
- key: 'sandbox-AdminTeamAuth',
3991
- name: 'X-Team-ID',
4039
+ }, {
4040
+ key: 'ApiKeyAuth',
4041
+ name: 'X-API-Key',
3992
4042
  type: 'apiKey'
3993
- },
3994
- {
3995
- key: 'sandbox-AdminJWTAuth',
3996
- scheme: 'bearer',
3997
- type: 'http'
3998
- }
3999
- ],
4000
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4043
+ }],
4044
+ url: '/workforce/v1/actors/{actor}',
4001
4045
  ...options
4002
4046
  });
4003
4047
  /**
4004
- * Rename a sandbox
4048
+ * List periods
4005
4049
  *
4006
- * Rename your sandbox. Names are trimmed, must contain 1–64 characters after trimming, and must be unique within your team. Only name may be changed. Returns the updated sandbox detail, as GET does. Killed or unavailable sandboxes return 404.
4050
+ * Lists the periods of your organization's OKR calendar, newest start first; use it to find the period_id to set objectives in, or to see which periods are still open for grading. Closed periods are included. Filter cadence to read one level of the calendar. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/periods?cadence=quarter.
4007
4051
  */
4008
- export const renameSandbox = (options) => (options.client ?? client).patch({
4052
+ export const listOrganizationPeriods = (options) => (options?.client ?? client).get({
4009
4053
  security: [{
4010
4054
  key: 'BearerAuth',
4011
4055
  scheme: 'bearer',
@@ -4015,21 +4059,15 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
4015
4059
  name: 'X-API-Key',
4016
4060
  type: 'apiKey'
4017
4061
  }],
4018
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4019
- ...options,
4020
- headers: {
4021
- 'Content-Type': 'application/json',
4022
- ...options.headers
4023
- }
4062
+ url: '/workforce/v1/periods',
4063
+ ...options
4024
4064
  });
4025
4065
  /**
4026
- * Act on a phone sandbox's screen
4027
- *
4028
- * See and operate an android sandbox's phone screen: take a screenshot, read the UI hierarchy to get a ref for each node, then tap a node or a screen point, long-press, swipe, scroll, type text, press a key, open or close an app, open a URL, or wait. Use it to drive and automate a mobile app on a phone sandbox created with templateID "android"; those machines have no terminal or file API, so drive the screen with this operation and run shell commands with commands.run. Start with a snapshot to learn what is on screen and to mint the refs the tap-like actions use; a ref names a node in the latest snapshot only, so after a newer snapshot, or after an action that changed the screen, take a fresh snapshot — a stale ref is refused with INVALID_PARAMS. The phone runs one action at a time, so actions on one sandbox are serial: send the next only after the previous call returns. A phone that has just been created may not have connected yet and answers 503 SERVICE_UNAVAILABLE with Retry-After: 2; retry after that delay (measured on develop: the sandbox is created in about 45 s and the phone program connects about 15 s later). Text is entered through the phone's own input, which supports ASCII only, so typing non-ASCII text into a Chinese app is not supported and answers INVALID_PARAMS. A linux sandbox has no screen and answers CAPABILITY_UNSUPPORTED.
4066
+ * Open a period
4029
4067
  *
4030
- * The same path is the caller's action socket: send GET with the standard WebSocket upgrade headers instead of POST and drive many actions over one connection. The server answers {"type":"ready","instanceId":"<id>"} first, then every frame {"id":"<your correlation id>","action":{…}} (an action of the same shape as this operation's body, at most 64 characters of id) is answered by its own id, in submission order, as {"id":"…","result":{…}} or {"id":"…","error":{"code":"…","message":"…","retryable":true}}. At most 8 actions may be in flight on one connection (the next answers RATE_LIMITED), and 10 malformed frames in a row close the connection 1008. Authentication is the caller's own (an organization API key), never the phone's token. Closing the connection ends only that client's view: actions already accepted are answered, and the phone stays connected. Before the handshake, a phone that is still being built or has not connected yet answers 503 DEVICE_NOT_READY with the state it is in and Retry-After: 2.
4068
+ * Opens a period in your organization's single OKR calendar of years, halves and quarters; objectives are set inside a period. Its status is derived, never sent: planning before start_on, active from start_on through end_on inclusive, grading after end_on, and closed only when you close it. Periods of the same cadence never overlap. Give parent_id to place a half or quarter inside a coarser period (year > half > quarter) that contains its whole range. Dates are calendar dates, and today is read as the UTC date. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, a name over 100 characters, a cadence outside the list, a date that is not YYYY-MM-DD, start_on after end_on or an unknown body field; 400 PERIOD_OVERLAP when a period of the same cadence already covers part of the range, or the parent is not coarser or does not contain the range; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND when parent_id does not exist. Example body: {"name":"2026 Q4","cadence":"quarter","start_on":"2026-10-01","end_on":"2026-12-31"}.
4031
4069
  */
4032
- export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
4070
+ export const openOrganizationPeriod = (options) => (options.client ?? client).post({
4033
4071
  security: [{
4034
4072
  key: 'BearerAuth',
4035
4073
  scheme: 'bearer',
@@ -4039,7 +4077,7 @@ export const actOnSandboxDisplay = (options) => (options.client ?? client).post(
4039
4077
  name: 'X-API-Key',
4040
4078
  type: 'apiKey'
4041
4079
  }],
4042
- url: '/sandbox/v1/sandboxes/{sandboxID}/act',
4080
+ url: '/workforce/v1/periods',
4043
4081
  ...options,
4044
4082
  headers: {
4045
4083
  'Content-Type': 'application/json',
@@ -4047,11 +4085,11 @@ export const actOnSandboxDisplay = (options) => (options.client ?? client).post(
4047
4085
  }
4048
4086
  });
4049
4087
  /**
4050
- * Remove a file or directory in the sandbox
4088
+ * Get a period
4051
4089
  *
4052
- * Remove an unneeded file or recursively remove a directory and its contents. This permanently deletes the selected path; read any needed content first. Returns 204 after removal.
4090
+ * Reads one period with its derived status, so you can tell whether it is still planning, active, in grading or closed. Read-only. Errors: 404 PERIOD_NOT_FOUND when the id is not a period of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
4053
4091
  */
4054
- export const removeSandboxFile = (options) => (options.client ?? client).delete({
4092
+ export const getOrganizationPeriod = (options) => (options.client ?? client).get({
4055
4093
  security: [{
4056
4094
  key: 'BearerAuth',
4057
4095
  scheme: 'bearer',
@@ -4061,15 +4099,15 @@ export const removeSandboxFile = (options) => (options.client ?? client).delete(
4061
4099
  name: 'X-API-Key',
4062
4100
  type: 'apiKey'
4063
4101
  }],
4064
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4102
+ url: '/workforce/v1/periods/{id}',
4065
4103
  ...options
4066
4104
  });
4067
4105
  /**
4068
- * Read a file in the sandbox
4106
+ * Close a period
4069
4107
  *
4070
- * Read UTF-8 file content when a command needs input or produced a text artifact. Returns a JSON string. Unlike E2B, this endpoint supports text only and rejects output above 1 MiB; binary and streaming reads are unavailable.
4108
+ * Closes a period once its objectives are graded: closed is the only status you set yourself, and it never reverts. After it, objectives and key results of the period can no longer be set or revised. Closing does not grade or change any objective. Closing a period that is already closed returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND.
4071
4109
  */
4072
- export const readSandboxFile = (options) => (options.client ?? client).get({
4110
+ export const closeOrganizationPeriod = (options) => (options.client ?? client).post({
4073
4111
  security: [{
4074
4112
  key: 'BearerAuth',
4075
4113
  scheme: 'bearer',
@@ -4079,15 +4117,15 @@ export const readSandboxFile = (options) => (options.client ?? client).get({
4079
4117
  name: 'X-API-Key',
4080
4118
  type: 'apiKey'
4081
4119
  }],
4082
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4120
+ url: '/workforce/v1/periods/{id}/close',
4083
4121
  ...options
4084
4122
  });
4085
4123
  /**
4086
- * Write a file in the sandbox
4124
+ * List objectives
4087
4125
  *
4088
- * Write a file in the sandbox before running a command. Replaces the target content and creates missing parent directories. Unlike E2B, this endpoint accepts one UTF-8 text file per request, at most 1 MiB; binary and batch writes are unavailable. Example body: {"path":"/tmp/hello.txt","data":"hello"}.
4126
+ * Lists objectives, oldest first, each with its scope, the parents it aligns to and, once graded, its result and score; use it to find an objective id or to read one period or one department's objectives. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/objectives?period_id=prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38&status=active.
4089
4127
  */
4090
- export const writeSandboxFile = (options) => (options.client ?? client).put({
4128
+ export const listOrganizationObjectives = (options) => (options?.client ?? client).get({
4091
4129
  security: [{
4092
4130
  key: 'BearerAuth',
4093
4131
  scheme: 'bearer',
@@ -4097,19 +4135,15 @@ export const writeSandboxFile = (options) => (options.client ?? client).put({
4097
4135
  name: 'X-API-Key',
4098
4136
  type: 'apiKey'
4099
4137
  }],
4100
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4101
- ...options,
4102
- headers: {
4103
- 'Content-Type': 'application/json',
4104
- ...options.headers
4105
- }
4138
+ url: '/workforce/v1/objectives',
4139
+ ...options
4106
4140
  });
4107
4141
  /**
4108
- * List files in a sandbox directory
4142
+ * Set an objective
4109
4143
  *
4110
- * Inspect a directory to find paths to read or remove. Returns immediate children with name, path, type and size. Unlike E2B, recursive depth is unavailable and responses are limited to 1 MiB.
4144
+ * Sets an objective: what a department or a position is trying to reach in one open period. It hangs on a department or a position of your organization's tree, and company objectives hang on the root department. It starts active with no parents; align it to higher objectives with the align operation, and add key results with the key results operations. Requires an organization owner or admin, or the head of the objective's home department (the department itself, or the department of the position). Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a description over 2000 characters, a scope kind outside the list or an unknown body field; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND, DEPARTMENT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED, DEPARTMENT_DISSOLVED or POSITION_CLOSED. Example body: {"period_id":"prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38","scope":{"kind":"department","id":"dept_4c2e9a17d0b34f58a6e1b3c7d9f20e84"},"title":"Cut first-response time"}.
4111
4145
  */
4112
- export const listSandboxFiles = (options) => (options.client ?? client).get({
4146
+ export const setOrganizationObjective = (options) => (options.client ?? client).post({
4113
4147
  security: [{
4114
4148
  key: 'BearerAuth',
4115
4149
  scheme: 'bearer',
@@ -4119,15 +4153,19 @@ export const listSandboxFiles = (options) => (options.client ?? client).get({
4119
4153
  name: 'X-API-Key',
4120
4154
  type: 'apiKey'
4121
4155
  }],
4122
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
4123
- ...options
4124
- });
4125
- /**
4126
- * Create a directory in the sandbox
4156
+ url: '/workforce/v1/objectives',
4157
+ ...options,
4158
+ headers: {
4159
+ 'Content-Type': 'application/json',
4160
+ ...options.headers
4161
+ }
4162
+ });
4163
+ /**
4164
+ * Get an objective
4127
4165
  *
4128
- * Create a directory and missing parent directories before writing files. Returns true when created or false when the path already exists. Supply the path as a query parameter.
4166
+ * Reads one objective with its scope, the parents it aligns to with their weights, its status and, once graded, its result, score and grade note. Its key results are read with the key results list filtered by objective_id. Read-only. Errors: 404 OBJECTIVE_NOT_FOUND when the id is not an objective of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
4129
4167
  */
4130
- export const makeSandboxDirectory = (options) => (options.client ?? client).post({
4168
+ export const getOrganizationObjective = (options) => (options.client ?? client).get({
4131
4169
  security: [{
4132
4170
  key: 'BearerAuth',
4133
4171
  scheme: 'bearer',
@@ -4137,15 +4175,15 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
4137
4175
  name: 'X-API-Key',
4138
4176
  type: 'apiKey'
4139
4177
  }],
4140
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
4178
+ url: '/workforce/v1/objectives/{id}',
4141
4179
  ...options
4142
4180
  });
4143
4181
  /**
4144
- * Run a command in the sandbox
4182
+ * Revise an objective
4145
4183
  *
4146
- * Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–3600000 milliseconds, default 600000, that is 10 minutes; E2B defaults to 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout (timeoutMs 0); output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. On an android sandbox the command runs in the phone's root shell, its stderr is merged into stdout (read stdout and expect stderr to come back empty), and background mode is unavailable. Example body: {"cmd":"echo hi"}.
4184
+ * Rewords an active objective: change its title, its description or both; send at least one. Its period, scope and alignment do not change here; use align for parents, and grade to close it. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS when no field is given, a title is empty or over 200 characters, or a description is over 2000 characters; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 409 PERIOD_CLOSED when the objective was already graded or its period is closed. Example body: {"title":"Cut first-response time to under 2 hours"}.
4147
4185
  */
4148
- export const runSandboxCommand = (options) => (options.client ?? client).post({
4186
+ export const reviseOrganizationObjective = (options) => (options.client ?? client).patch({
4149
4187
  security: [{
4150
4188
  key: 'BearerAuth',
4151
4189
  scheme: 'bearer',
@@ -4155,7 +4193,7 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
4155
4193
  name: 'X-API-Key',
4156
4194
  type: 'apiKey'
4157
4195
  }],
4158
- url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
4196
+ url: '/workforce/v1/objectives/{id}',
4159
4197
  ...options,
4160
4198
  headers: {
4161
4199
  'Content-Type': 'application/json',
@@ -4163,11 +4201,11 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
4163
4201
  }
4164
4202
  });
4165
4203
  /**
4166
- * Start adding a phone of your own
4204
+ * Align an objective to parent objectives
4167
4205
  *
4168
- * Begin bringing your own device (BYOD): the platform answers an 8-character code, its ten-minute deadline and the QR payload your phone's app scans, and nothing is registered until the owner taps Allow on the phone. Show the QR payload (or the code) in your app; the phone opens GET /sandbox/v1/byod/pairings/{code} — with no credential — to show the organization and the deadline, then posts the claim once. The pairing stores the organization's display name, which the phone shows on its Allow screen, so create the pairing from a session or key that carries one. A code is spent by the first successful claim and cannot be reused; create a new pairing for another device. BYOD devices are separate from sandboxes: they never appear in listSandboxes and have no template, size or expiry. Example: POST /sandbox/v1/byod/pairings with no body returns {code:'K7M4PQRS',expires_at:'2026-11-22T13:10:00.000Z',qr:'praxis://byod/pair?code=K7M4PQRS&api=https%3A%2F%2Fapi.deepraxis.com'}.
4206
+ * Replaces the whole set of parent objectives this objective contributes to; send an empty parents array to remove its alignment. An objective aligns only upward: each parent must hang on the objective's own department or on a department above it, the objective cannot be its own parent, and the alignment graph must stay free of cycles. Each weight is greater than 0 and at most 1, and a parent may appear once. A closed parent is refused. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for a weight outside the range, a repeated parent or an unknown body field; 400 ALIGNMENT_CYCLE when a parent is the objective itself or the alignment would loop; 400 SCOPE_MISMATCH when a parent hangs outside the objective's department and its ancestors; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND for the objective or a parent; 409 PERIOD_CLOSED when a parent is closed. Example body: {"parents":[{"objective_id":"obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96","weight":1}]}.
4169
4207
  */
4170
- export const createByodPairing = (options) => (options?.client ?? client).post({
4208
+ export const alignOrganizationObjective = (options) => (options.client ?? client).put({
4171
4209
  security: [{
4172
4210
  key: 'BearerAuth',
4173
4211
  scheme: 'bearer',
@@ -4177,15 +4215,19 @@ export const createByodPairing = (options) => (options?.client ?? client).post({
4177
4215
  name: 'X-API-Key',
4178
4216
  type: 'apiKey'
4179
4217
  }],
4180
- url: '/sandbox/v1/byod/pairings',
4181
- ...options
4218
+ url: '/workforce/v1/objectives/{id}/parents',
4219
+ ...options,
4220
+ headers: {
4221
+ 'Content-Type': 'application/json',
4222
+ ...options.headers
4223
+ }
4182
4224
  });
4183
4225
  /**
4184
- * List your organization's own devices
4226
+ * Grade an objective
4185
4227
  *
4186
- * List the devices your organization has paired, oldest first, with each one's platform, name, model, OS version, live online fact and when it was last seen. Use it to find a device id before you act on it, rename it or disconnect it, or to show the BYOD page. A revoked device is not listed, so a device that disappears from this answer was disconnected; there is no paging because an organization's own devices are few. Each row carries capabilities and, for a desktop, the agent_dirs it registered. Example: GET /sandbox/v1/byod/devices returns {data:[{object:'byod_device',id:'byd_0123456789abcdefghijklmno',platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16',online:true,last_seen_at:'2026-11-22T12:58:00.000Z',created_at:'2026-11-22T12:40:00.000Z',capabilities:['display'],agent_dirs:[]}]}.
4228
+ * Grades an objective and closes it in place: records its result, its score from 0 to 1, an optional note, and the scores of the key results you list. A key result you leave out keeps no score. Grading happens once; a closed objective cannot be graded again. When the objective has any committed key result and the result is not achieved, a note is required. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for a result outside the list, a non-numeric score or a note over 2000 characters; 400 SCORE_OUT_OF_RANGE when any score is outside 0 to 1; 400 GRADE_NOTE_REQUIRED when a committed objective is graded other than achieved without a note; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 404 KEY_RESULT_NOT_FOUND when a listed key result does not belong to this objective; 409 PERIOD_CLOSED when the objective is already closed. Example body: {"result":"partial","score":0.6,"note":"Hiring slipped a month."}.
4187
4229
  */
4188
- export const listByodDevices = (options) => (options?.client ?? client).get({
4230
+ export const gradeOrganizationObjective = (options) => (options.client ?? client).post({
4189
4231
  security: [{
4190
4232
  key: 'BearerAuth',
4191
4233
  scheme: 'bearer',
@@ -4195,15 +4237,19 @@ export const listByodDevices = (options) => (options?.client ?? client).get({
4195
4237
  name: 'X-API-Key',
4196
4238
  type: 'apiKey'
4197
4239
  }],
4198
- url: '/sandbox/v1/byod/devices',
4199
- ...options
4240
+ url: '/workforce/v1/objectives/{id}/grade',
4241
+ ...options,
4242
+ headers: {
4243
+ 'Content-Type': 'application/json',
4244
+ ...options.headers
4245
+ }
4200
4246
  });
4201
4247
  /**
4202
- * Read one of your organization's devices
4248
+ * List key results
4203
4249
  *
4204
- * Read one BYOD device: the same fields listByodDevices returns, for a single device. Use it to poll whether a device is online before acting on it, or to refresh one row of the BYOD page after a rename. An unknown id and another organization's device both answer 404, so the answer never reveals that a foreign device exists. Example: GET /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno.
4250
+ * Lists key results, oldest first, each with its metric, health, done flag and, once its objective is graded, its score; use it to read the key results of one objective or the ones a position owns. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/key_results?objective_id=obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96.
4205
4251
  */
4206
- export const getByodDevice = (options) => (options.client ?? client).get({
4252
+ export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
4207
4253
  security: [{
4208
4254
  key: 'BearerAuth',
4209
4255
  scheme: 'bearer',
@@ -4213,15 +4259,15 @@ export const getByodDevice = (options) => (options.client ?? client).get({
4213
4259
  name: 'X-API-Key',
4214
4260
  type: 'apiKey'
4215
4261
  }],
4216
- url: '/sandbox/v1/byod/devices/{deviceID}',
4262
+ url: '/workforce/v1/key_results',
4217
4263
  ...options
4218
4264
  });
4219
4265
  /**
4220
- * Rename one of your organization's devices
4266
+ * Set a key result
4221
4267
  *
4222
- * Change a device's display name, and nothing else: pairing, credential, platform and connection are untouched. Use it to give a shared phone a name your team recognises. The body takes exactly one field, name, 1 to 64 characters after trimming; a missing, extra or wrongly typed field answers INVALID_PARAMS. An unknown id and another organization's device both answer 404. Example: PATCH /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno with {name:'Shelf phone'} returns the updated device.
4268
+ * Sets a key result under an active objective: a measurable outcome owned by one position, whose current holder moves its progress. Give a metric to measure it by numbers; omit metric for a binary key result, whose progress is its done flag. It starts with health on_track, done false and no score. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a commitment outside the list, a metric whose target equals its initial value or whose unit is outside the list, or an unknown body field; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED when the objective is graded or its period is closed; 409 POSITION_CLOSED when the owner position is closed. Example body: {"objective_id":"obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96","title":"Median first response under 2 hours","owner_position_id":"pos_7a1c5e92d3b84f60a9e2c4d8b1f30a57","commitment":"committed","metric":{"initial":6,"target":2,"unit":"none"}}.
4223
4269
  */
4224
- export const updateByodDevice = (options) => (options.client ?? client).patch({
4270
+ export const setOrganizationKeyResult = (options) => (options.client ?? client).post({
4225
4271
  security: [{
4226
4272
  key: 'BearerAuth',
4227
4273
  scheme: 'bearer',
@@ -4231,7 +4277,7 @@ export const updateByodDevice = (options) => (options.client ?? client).patch({
4231
4277
  name: 'X-API-Key',
4232
4278
  type: 'apiKey'
4233
4279
  }],
4234
- url: '/sandbox/v1/byod/devices/{deviceID}',
4280
+ url: '/workforce/v1/key_results',
4235
4281
  ...options,
4236
4282
  headers: {
4237
4283
  'Content-Type': 'application/json',
@@ -4239,11 +4285,11 @@ export const updateByodDevice = (options) => (options.client ?? client).patch({
4239
4285
  }
4240
4286
  });
4241
4287
  /**
4242
- * Disconnect a device and revoke its credential
4288
+ * Get a key result
4243
4289
  *
4244
- * Disconnect a paired device: the device's credential is revoked, its control connection is closed, and it stops appearing in listByodDevices. Use it when the phone is lost, lent or no longer wanted; the same disconnect is offered as one tap on the device itself. The operation is idempotent — disconnecting an already-disconnected device answers the same 200 — so a retry after a lost response is safe. The device is untouched: nothing is erased on the phone, and it can be paired again with a new pairing. Because a revoked device is not listed, a later listByodDevices no longer shows it. An unknown id and another organization's device both answer 404. Example: POST /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno/disconnect returns {id:'byd_0123456789abcdefghijklmno',object:'byod_device',disconnected:true}.
4290
+ * Reads one key result with its metric, its health, its done flag, its owner position and its score. Progress of a metric key result is (current - initial) / (target - initial), clamped between 0 and 1; a key result without a metric counts as 1 when done is true and 0 otherwise. Read-only. Errors: 404 KEY_RESULT_NOT_FOUND when the id is not a key result of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
4245
4291
  */
4246
- export const disconnectByodDevice = (options) => (options.client ?? client).post({
4292
+ export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
4247
4293
  security: [{
4248
4294
  key: 'BearerAuth',
4249
4295
  scheme: 'bearer',
@@ -4253,15 +4299,15 @@ export const disconnectByodDevice = (options) => (options.client ?? client).post
4253
4299
  name: 'X-API-Key',
4254
4300
  type: 'apiKey'
4255
4301
  }],
4256
- url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
4302
+ url: '/workforce/v1/key_results/{id}',
4257
4303
  ...options
4258
4304
  });
4259
4305
  /**
4260
- * Read a pairing for the phone's Allow screen
4306
+ * Revise a key result
4261
4307
  *
4262
- * The phone's own read, called by the app that scanned the QR code or the code was typed into: it answers the organization's display name and the code's deadline, which the owner sees before tapping Allow. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and do not call it from server code. An unknown, spent or expired code answers 404, with nothing said about which of the three it is; that also covers a code another organization created. The read is a preview only: it registers nothing, and the claim is what spends the code. Example: GET /sandbox/v1/byod/pairings/K7M4PQRS returns {organization_name:'烟火测试团队',expires_at:'2026-11-22T13:10:00.000Z'}.
4308
+ * Edits a key result; send at least one field. Progress is updated by this edit, not by check-in records: write metric.current for a metric key result, or done for a binary one, and set health as it changes. The holder of the owner position, when a person, may change only metric.current, health and done; an organization owner or admin, or the head of the objective's home department or of a department above it, may change any field. An agent holding the position cannot write it. metric replaces the whole metric; done applies only to a key result without a metric. Errors: 400 INVALID_PARAMS when no field is given, done is sent for a key result that has a metric, or a field is malformed; 403 NOT_POSITION_HOLDER when the caller is neither a manager nor the position's person holder; 403 PERMISSION_DENIED when a holder changes more than progress; 404 KEY_RESULT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED when the objective is graded or its period is closed; 409 POSITION_CLOSED for a closed new owner. Example body: {"metric":{"initial":6,"current":3.5,"target":2,"unit":"none"},"health":"at_risk"}.
4263
4309
  */
4264
- export const getByodPairing = (options) => (options.client ?? client).get({
4310
+ export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
4265
4311
  security: [{
4266
4312
  key: 'BearerAuth',
4267
4313
  scheme: 'bearer',
@@ -4271,15 +4317,19 @@ export const getByodPairing = (options) => (options.client ?? client).get({
4271
4317
  name: 'X-API-Key',
4272
4318
  type: 'apiKey'
4273
4319
  }],
4274
- url: '/sandbox/v1/byod/pairings/{code}',
4275
- ...options
4320
+ url: '/workforce/v1/key_results/{id}',
4321
+ ...options,
4322
+ headers: {
4323
+ 'Content-Type': 'application/json',
4324
+ ...options.headers
4325
+ }
4276
4326
  });
4277
4327
  /**
4278
- * Claim a pairing and register the phone
4328
+ * List specs
4279
4329
  *
4280
- * The phone's own final step after the owner taps Allow: it registers the device and answers the device id, a one-time credential and the control socket url the app dials. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and never call it from server code. The claim is single use: the first successful call spends the code and a second call answers 404, as does an unknown or expired code, so the app must store the credential the moment it arrives because it is never shown again. Connect to socket_url with Authorization: Bearer <credential>; the socket speaks the phone channel (hello, ping/pong, act, result/error) and the device's one connection is replaced if the app reconnects. Example: POST /sandbox/v1/byod/pairings/K7M4PQRS/claim with {platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16'} returns {device_id:'byd_0123456789abcdefghijklmno',credential:'…',socket_url:'wss://49982-byd0123456789abcdefghijklmno--sbx-develop.praxisusercontent.com/'}.
4330
+ * Lists the specs (规定) of the organization in the workforce/v1 envelope (api_version, kind, metadata, spec; status is null in a list); use it to find which subject already has a spec before reading or revising one. Narrow it with kind. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, an unknown kind, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/specs?kind=job.
4281
4331
  */
4282
- export const claimByodPairing = (options) => (options.client ?? client).post({
4332
+ export const listOrganizationSpecs = (options) => (options?.client ?? client).get({
4283
4333
  security: [{
4284
4334
  key: 'BearerAuth',
4285
4335
  scheme: 'bearer',
@@ -4289,19 +4339,15 @@ export const claimByodPairing = (options) => (options.client ?? client).post({
4289
4339
  name: 'X-API-Key',
4290
4340
  type: 'apiKey'
4291
4341
  }],
4292
- url: '/sandbox/v1/byod/pairings/{code}/claim',
4293
- ...options,
4294
- headers: {
4295
- 'Content-Type': 'application/json',
4296
- ...options.headers
4297
- }
4342
+ url: '/workforce/v1/specs',
4343
+ ...options
4298
4344
  });
4299
4345
  /**
4300
- * Delete session
4346
+ * Get a spec
4301
4347
  *
4302
- * Delete an idle or terminated session and its event history after saving a deletion snapshot. Supply the session id from creation or listing. Running sessions return 409 INVALID_STATE: interrupt first or wait until idle or terminated. Afterwards retrieval and event listing return 404 and lists omit the session. Example: DELETE /agent/v1/sessions/sesn_example.
4348
+ * Reads one subject's spec in the workforce/v1 envelope: metadata (id, name, revision, labels, annotations, change_note, update_time, updated_by), spec ({ document, provision }) and status (how many holders last reconciled on it, how many are ready and how many have a failed block). revision reads one historical revision instead, with status null. A subject never written answers revision 0 with an empty spec, so a first revise sends metadata.revision 0. Read-only. Errors: 400 INVALID_PARAMS for a non-integer revision; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject, or the named SPEC_REVISION_NOT_FOUND, does not exist. Example: GET /workforce/v1/specs/job/jpr_123?revision=2.
4303
4349
  */
4304
- export const sessionsDelete = (options) => (options.client ?? client).delete({
4350
+ export const getOrganizationSpec = (options) => (options.client ?? client).get({
4305
4351
  security: [{
4306
4352
  key: 'BearerAuth',
4307
4353
  scheme: 'bearer',
@@ -4311,15 +4357,15 @@ export const sessionsDelete = (options) => (options.client ?? client).delete({
4311
4357
  name: 'X-API-Key',
4312
4358
  type: 'apiKey'
4313
4359
  }],
4314
- url: '/agent/v1/sessions/{session_id}',
4360
+ url: '/workforce/v1/specs/{kind}/{id}',
4315
4361
  ...options
4316
4362
  });
4317
4363
  /**
4318
- * Get session
4364
+ * Revise a spec
4319
4365
  *
4320
- * Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on the agent version's default environment, node22.
4366
+ * Replaces the whole spec of a subject: metadata.revision is the revision you last read (0 when none was written) and each success raises it by one, so a mismatch returns REVISION_CONFLICT and you must read again, merge and retry. The spec is { document, provision }: document is Markdown text injected into the holder's memory and never merged, provision holds the capability blocks and remove; GET /workforce/v1/spec_schema returns the JSON Schema of every block, and a block outside it is refused with its path. labels and annotations carry over from the previous revision when omitted; change_note belongs to this revision only. Other metadata fields you read back (id, name, update_time, updated_by) are accepted and ignored. dry_run=true checks everything and writes nothing: it answers the spec that would be written, the changes against the live one and the reconcile plan of every affected holder in office (at most 50, plans_truncated says more exist). Requires an organization owner or admin, or the head of the subject's department. Errors: 400 INVALID_PARAMS for a missing spec or metadata.revision, an api_version other than workforce/v1, labels or annotations over their limits, a block outside the registry or an unknown body field; 403 PERMISSION_DENIED; 404 when the subject does not exist; 409 REVISION_CONFLICT. Example body: {"metadata":{"revision":0,"change_note":"first charter"},"spec":{"document":"Deliver reliably.","provision":{"computer":{"template":"base"}}}}.
4321
4367
  */
4322
- export const sessionsRetrieve = (options) => (options.client ?? client).get({
4368
+ export const reviseOrganizationSpec = (options) => (options.client ?? client).put({
4323
4369
  security: [{
4324
4370
  key: 'BearerAuth',
4325
4371
  scheme: 'bearer',
@@ -4329,15 +4375,19 @@ export const sessionsRetrieve = (options) => (options.client ?? client).get({
4329
4375
  name: 'X-API-Key',
4330
4376
  type: 'apiKey'
4331
4377
  }],
4332
- url: '/agent/v1/sessions/{session_id}',
4333
- ...options
4378
+ url: '/workforce/v1/specs/{kind}/{id}',
4379
+ ...options,
4380
+ headers: {
4381
+ 'Content-Type': 'application/json',
4382
+ ...options.headers
4383
+ }
4334
4384
  });
4335
4385
  /**
4336
- * Update session
4386
+ * List spec revisions
4337
4387
  *
4338
- * 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; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
4388
+ * Lists every stored revision of one subject's spec, newest first, each with its body, author and creation instant; use it to see what changed over time or to pick a revision to read or diff. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist.
4339
4389
  */
4340
- export const sessionsUpdate = (options) => (options.client ?? client).post({
4390
+ export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
4341
4391
  security: [{
4342
4392
  key: 'BearerAuth',
4343
4393
  scheme: 'bearer',
@@ -4347,19 +4397,15 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
4347
4397
  name: 'X-API-Key',
4348
4398
  type: 'apiKey'
4349
4399
  }],
4350
- url: '/agent/v1/sessions/{session_id}',
4351
- ...options,
4352
- headers: {
4353
- 'Content-Type': 'application/json',
4354
- ...options.headers
4355
- }
4400
+ url: '/workforce/v1/specs/{kind}/{id}/revisions',
4401
+ ...options
4356
4402
  });
4357
4403
  /**
4358
- * List agents
4404
+ * Diff two spec revisions
4359
4405
  *
4360
- * List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.
4406
+ * Compares two revisions of one subject's spec and lists the changes between them, each with its path and, for a change, the value before and after; revision 0 is the empty spec, so diffing 0 against 1 shows the first write. Read-only. Errors: 400 INVALID_PARAMS when from or to is missing or not an integer; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist, or SPEC_REVISION_NOT_FOUND when from or to was never written. Example: GET /workforce/v1/specs/job/jpr_123/diff?from=1&to=2.
4361
4407
  */
4362
- export const agentsList = (options) => (options?.client ?? client).get({
4408
+ export const diffOrganizationSpec = (options) => (options.client ?? client).get({
4363
4409
  security: [{
4364
4410
  key: 'BearerAuth',
4365
4411
  scheme: 'bearer',
@@ -4369,15 +4415,15 @@ export const agentsList = (options) => (options?.client ?? client).get({
4369
4415
  name: 'X-API-Key',
4370
4416
  type: 'apiKey'
4371
4417
  }],
4372
- url: '/agent/v1/agents',
4418
+ url: '/workforce/v1/specs/{kind}/{id}/diff',
4373
4419
  ...options
4374
4420
  });
4375
4421
  /**
4376
- * Create agent
4422
+ * Read the effective spec
4377
4423
  *
4378
- * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. Omit kind to create a service agent (Managed Agents behaviour: a fresh environment per session). Pass kind: "general" for an employee-style agent with its own computer, created with it; size and template come from the agent's computers configuration. 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 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"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. A general or assume agent created without computer_id gets a new computer registered in the same request, named after the agent; a service agent with computer_id returns 400. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. phone gives the agent one phone, in one of two mutually exclusive forms: {sku, name?, archive: {exclude}} is a cloud Android device the platform builds on demand from that Sandbox SKU, and {byod, name?} is your organization's own device, named by a byd_… id it already owns (Brought Your Own Device), which the platform drives but never builds. A body naming both sku and byod returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. Only a general or assume agent may have a phone: a service agent with phone returns 400. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
4424
+ * Merges the spec chain of a seat or an actor and returns the one effective configuration: the merged capability blocks, the document of every layer, where each merged value came from, and anything only the merged result shows to be wrong. Give exactly one of actor (every seat the actor holds) or position_id (one seat, held or vacant, a preview before hiring); holder_kind defaults from the seat's holder. Read-only; nothing is changed. Errors: 400 INVALID_PARAMS when neither or both of actor and position_id are given, the actor address is malformed, holder_kind is neither agent nor human, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 POSITION_NOT_FOUND. Example: GET /workforce/v1/effective_spec?actor=agent:agent_123.
4379
4425
  */
4380
- export const agentsCreate = (options) => (options.client ?? client).post({
4426
+ export const getOrganizationEffectiveSpec = (options) => (options?.client ?? client).get({
4381
4427
  security: [{
4382
4428
  key: 'BearerAuth',
4383
4429
  scheme: 'bearer',
@@ -4387,19 +4433,15 @@ export const agentsCreate = (options) => (options.client ?? client).post({
4387
4433
  name: 'X-API-Key',
4388
4434
  type: 'apiKey'
4389
4435
  }],
4390
- url: '/agent/v1/agents',
4391
- ...options,
4392
- headers: {
4393
- 'Content-Type': 'application/json',
4394
- ...options.headers
4395
- }
4436
+ url: '/workforce/v1/effective_spec',
4437
+ ...options
4396
4438
  });
4397
4439
  /**
4398
- * Get agent
4440
+ * Read the spec schema
4399
4441
  *
4400
- * Read the agent configuration currently effective for new sessions. By default, version equals active_version and latest_version identifies the newest saved version, including an unapplied save. Use latest_version for optimistic concurrency when updating. Pass version as a positive integer to read that saved version; version=active is equivalent to omission. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so tools can be sent back unchanged to agents.update. Use agents.versions.list to enumerate saved versions.
4442
+ * Returns the JSON Schema (draft 2020-12) of a spec body, generated from the block registry: document, provision, every block and field under provision, and remove. Each field carries x-praxis-merge (single, set, keyed or layered), x-praxis-merge-key for a set, x-praxis-holders on a block (agent, human), and x-praxis-applied (whether reconcile applies it today), plus a Chinese title and an English description. Read it before writing a spec so a block or field is never guessed. The body is the schema itself, returned without any key renamed. Read-only. Errors: 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/spec_schema.
4401
4443
  */
4402
- export const agentsRetrieve = (options) => (options.client ?? client).get({
4444
+ export const getOrganizationSpecSchema = (options) => (options?.client ?? client).get({
4403
4445
  security: [{
4404
4446
  key: 'BearerAuth',
4405
4447
  scheme: 'bearer',
@@ -4409,15 +4451,15 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
4409
4451
  name: 'X-API-Key',
4410
4452
  type: 'apiKey'
4411
4453
  }],
4412
- url: '/agent/v1/agents/{agent_id}',
4454
+ url: '/workforce/v1/spec_schema',
4413
4455
  ...options
4414
4456
  });
4415
4457
  /**
4416
- * Update agent
4458
+ * Plan reconciliation
4417
4459
  *
4418
- * Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved 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. phone takes the same two mutually exclusive forms as agents.create: {sku, name?, archive} for a cloud device, or {byod, name?} for your organization's own device (a byd_… id); naming both returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. phone: null turns the phone off and releases a cloud device; a BYOD phone is the organization's and is never killed. Assume agents reject model, models, subagent_model, subagents and multiagent on every update; other fields follow the general agent rules, with vault_ids also accepted.
4460
+ * Dry-runs the reconciler for one holder and returns what it would change: an action per block (hold, update, none, pending, blocked) with the value it would write, and the violations only the merged result shows. It changes nothing - no state, no agent and no memory. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/reconcile/plan?actor=agent:agent_123.
4419
4461
  */
4420
- export const agentsUpdate = (options) => (options.client ?? client).post({
4462
+ export const planOrganizationReconcile = (options) => (options.client ?? client).get({
4421
4463
  security: [{
4422
4464
  key: 'BearerAuth',
4423
4465
  scheme: 'bearer',
@@ -4427,19 +4469,15 @@ export const agentsUpdate = (options) => (options.client ?? client).post({
4427
4469
  name: 'X-API-Key',
4428
4470
  type: 'apiKey'
4429
4471
  }],
4430
- url: '/agent/v1/agents/{agent_id}',
4431
- ...options,
4432
- headers: {
4433
- 'Content-Type': 'application/json',
4434
- ...options.headers
4435
- }
4472
+ url: '/workforce/v1/reconcile/plan',
4473
+ ...options
4436
4474
  });
4437
4475
  /**
4438
- * Archive agent
4476
+ * Read reconcile status
4439
4477
  *
4440
- * Archive an agent so it can no longer be updated and no new session can be created from it (AGENT_ARCHIVED). The agent and all of its versions stay readable. Use it to retire an agent you no longer want to run; it does not delete anything.
4478
+ * Reads the reconciler's last result for one holder: whether the sweep is paused, the seats and layer revisions of the last applied run, each block's state (ready, pending, failed, waiting_human, paused or not_applicable), the drift between what is applied and what the specs want, and when it last applied. Read-only; it changes nothing. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/reconcile/status?actor=agent:agent_123.
4441
4479
  */
4442
- export const agentsArchive = (options) => (options.client ?? client).post({
4480
+ export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
4443
4481
  security: [{
4444
4482
  key: 'BearerAuth',
4445
4483
  scheme: 'bearer',
@@ -4449,15 +4487,15 @@ export const agentsArchive = (options) => (options.client ?? client).post({
4449
4487
  name: 'X-API-Key',
4450
4488
  type: 'apiKey'
4451
4489
  }],
4452
- url: '/agent/v1/agents/{agent_id}/archive',
4490
+ url: '/workforce/v1/reconcile/status',
4453
4491
  ...options
4454
4492
  });
4455
4493
  /**
4456
- * List agent versions
4494
+ * Run reconciliation now
4457
4495
  *
4458
- * List the saved versions of one agent in ascending version number, oldest first, in pages of at most 100 (default 20). Each item is the full agent definition at that saved version, so you can compare configurations. active is true only for the item new sessions use. active_version on every item is the same agent-level currently effective version; it is not that item's version. Use agents.retrieve with version to read a single saved version; agent_id comes from agents.list or agents.create. Pass next_page as page to continue.
4496
+ * Reconciles one holder now instead of waiting for the sweep: it plans, applies every update and returns the new status. Run plan first to see the changes without applying them. Requires an organization owner or admin. A block that cannot be applied now stays pending, waiting_human or failed, and the returned status says so. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
4459
4497
  */
4460
- export const agentsVersionsList = (options) => (options.client ?? client).get({
4498
+ export const runOrganizationReconcile = (options) => (options.client ?? client).post({
4461
4499
  security: [{
4462
4500
  key: 'BearerAuth',
4463
4501
  scheme: 'bearer',
@@ -4467,15 +4505,19 @@ export const agentsVersionsList = (options) => (options.client ?? client).get({
4467
4505
  name: 'X-API-Key',
4468
4506
  type: 'apiKey'
4469
4507
  }],
4470
- url: '/agent/v1/agents/{agent_id}/versions',
4471
- ...options
4508
+ url: '/workforce/v1/reconcile/run',
4509
+ ...options,
4510
+ headers: {
4511
+ 'Content-Type': 'application/json',
4512
+ ...options.headers
4513
+ }
4472
4514
  });
4473
4515
  /**
4474
- * List sessions
4516
+ * Pause reconciliation
4475
4517
  *
4476
- * 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.
4518
+ * Stops the sweep from reconciling one holder until it is resumed: the holder's blocks keep their state and no further update is applied. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
4477
4519
  */
4478
- export const sessionsList = (options) => (options?.client ?? client).get({
4520
+ export const pauseOrganizationReconcile = (options) => (options.client ?? client).post({
4479
4521
  security: [{
4480
4522
  key: 'BearerAuth',
4481
4523
  scheme: 'bearer',
@@ -4485,15 +4527,19 @@ export const sessionsList = (options) => (options?.client ?? client).get({
4485
4527
  name: 'X-API-Key',
4486
4528
  type: 'apiKey'
4487
4529
  }],
4488
- url: '/agent/v1/sessions',
4489
- ...options
4530
+ url: '/workforce/v1/reconcile/pause',
4531
+ ...options,
4532
+ headers: {
4533
+ 'Content-Type': 'application/json',
4534
+ ...options.headers
4535
+ }
4490
4536
  });
4491
4537
  /**
4492
- * Create session
4538
+ * Resume reconciliation
4493
4539
  *
4494
- * 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. 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 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.
4540
+ * Restarts the sweep for a paused holder and reconciles it now, returning the new status. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
4495
4541
  */
4496
- export const sessionsCreate = (options) => (options.client ?? client).post({
4542
+ export const resumeOrganizationReconcile = (options) => (options.client ?? client).post({
4497
4543
  security: [{
4498
4544
  key: 'BearerAuth',
4499
4545
  scheme: 'bearer',
@@ -4503,7 +4549,7 @@ export const sessionsCreate = (options) => (options.client ?? client).post({
4503
4549
  name: 'X-API-Key',
4504
4550
  type: 'apiKey'
4505
4551
  }],
4506
- url: '/agent/v1/sessions',
4552
+ url: '/workforce/v1/reconcile/resume',
4507
4553
  ...options,
4508
4554
  headers: {
4509
4555
  'Content-Type': 'application/json',
@@ -4511,11 +4557,11 @@ export const sessionsCreate = (options) => (options.client ?? client).post({
4511
4557
  }
4512
4558
  });
4513
4559
  /**
4514
- * Archive session
4560
+ * Delete session
4515
4561
  *
4516
- * Archive a session. An archived session refuses new messages with 400 invalid_request_error, while its details and event history stay readable. Archiving again is idempotent and archived_at keeps the first archive time. Use it when a conversation is finished; it does not delete anything.
4562
+ * Delete an idle or terminated session and its event history after saving a deletion snapshot. Supply the session id from creation or listing. Running sessions return 409 INVALID_STATE: interrupt first or wait until idle or terminated. Afterwards retrieval and event listing return 404 and lists omit the session. Example: DELETE /agent/v1/sessions/sesn_example.
4517
4563
  */
4518
- export const sessionsArchive = (options) => (options.client ?? client).post({
4564
+ export const sessionsDelete = (options) => (options.client ?? client).delete({
4519
4565
  security: [{
4520
4566
  key: 'BearerAuth',
4521
4567
  scheme: 'bearer',
@@ -4525,15 +4571,15 @@ export const sessionsArchive = (options) => (options.client ?? client).post({
4525
4571
  name: 'X-API-Key',
4526
4572
  type: 'apiKey'
4527
4573
  }],
4528
- url: '/agent/v1/sessions/{session_id}/archive',
4574
+ url: '/agent/v1/sessions/{session_id}',
4529
4575
  ...options
4530
4576
  });
4531
4577
  /**
4532
- * List session events
4578
+ * Get session
4533
4579
  *
4534
- * Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids; a request nobody answered within 24 hours is settled as unanswered and the session goes idle with stop_reason request_expired, which the /anthropic/v1 face shows as end_turn), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, system.notification_suppressed (pending background notifications that hit the wake quota and started no run), system.notification_recorded, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.list instead. In the path, session_id may also be `main` (your own main session with that agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4580
+ * Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on the agent version's default environment, node22.
4535
4581
  */
4536
- export const sessionsEventsList = (options) => (options.client ?? client).get({
4582
+ export const sessionsRetrieve = (options) => (options.client ?? client).get({
4537
4583
  security: [{
4538
4584
  key: 'BearerAuth',
4539
4585
  scheme: 'bearer',
@@ -4543,15 +4589,15 @@ export const sessionsEventsList = (options) => (options.client ?? client).get({
4543
4589
  name: 'X-API-Key',
4544
4590
  type: 'apiKey'
4545
4591
  }],
4546
- url: '/agent/v1/sessions/{session_id}/events',
4592
+ url: '/agent/v1/sessions/{session_id}',
4547
4593
  ...options
4548
4594
  });
4549
4595
  /**
4550
- * Send session events
4596
+ * Update session
4551
4597
  *
4552
- * Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.send instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4598
+ * 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; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
4553
4599
  */
4554
- export const sessionsEventsSend = (options) => (options.client ?? client).post({
4600
+ export const sessionsUpdate = (options) => (options.client ?? client).post({
4555
4601
  security: [{
4556
4602
  key: 'BearerAuth',
4557
4603
  scheme: 'bearer',
@@ -4561,7 +4607,7 @@ export const sessionsEventsSend = (options) => (options.client ?? client).post({
4561
4607
  name: 'X-API-Key',
4562
4608
  type: 'apiKey'
4563
4609
  }],
4564
- url: '/agent/v1/sessions/{session_id}/events',
4610
+ url: '/agent/v1/sessions/{session_id}',
4565
4611
  ...options,
4566
4612
  headers: {
4567
4613
  'Content-Type': 'application/json',
@@ -4569,11 +4615,11 @@ export const sessionsEventsSend = (options) => (options.client ?? client).post({
4569
4615
  }
4570
4616
  });
4571
4617
  /**
4572
- * Stream session events
4618
+ * List agents
4573
4619
  *
4574
- * Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event. This operation addresses one session — normally a worker session an agent dispatched; to follow a general agent itself, use agents.events.stream instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4620
+ * List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.
4575
4621
  */
4576
- export const sessionsEventsStream = (options) => (options.client ?? client).sse.get({
4622
+ export const agentsList = (options) => (options?.client ?? client).get({
4577
4623
  security: [{
4578
4624
  key: 'BearerAuth',
4579
4625
  scheme: 'bearer',
@@ -4583,15 +4629,15 @@ export const sessionsEventsStream = (options) => (options.client ?? client).sse.
4583
4629
  name: 'X-API-Key',
4584
4630
  type: 'apiKey'
4585
4631
  }],
4586
- url: '/agent/v1/sessions/{session_id}/events/stream',
4632
+ url: '/agent/v1/agents',
4587
4633
  ...options
4588
4634
  });
4589
4635
  /**
4590
- * List session threads
4636
+ * Create agent
4591
4637
  *
4592
- * List the execution threads of a session: the primary thread plus every child thread started by subagents or advisors, in created_at order. Child threads reference the primary through parent_thread_id. Pages hold at most 100 threads (default 20). Use a thread id with sessions.threads.retrieve, sessions.threads.events.list or sessions.threads.events.stream.
4638
+ * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. Omit kind to create a service agent (Managed Agents behaviour: a fresh environment per session). Pass kind: "general" for an employee-style agent with its own computer, created with it; size and template come from the agent's computers configuration. 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 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"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. A general or assume agent created without computer_id gets a new computer registered in the same request, named after the agent; a service agent with computer_id returns 400. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. phone gives the agent one phone, in one of two mutually exclusive forms: {sku, name?, archive: {exclude}} is a cloud Android device the platform builds on demand from that Sandbox SKU, and {byod, name?} is your organization's own device, named by a byd_… id it already owns (Brought Your Own Device), which the platform drives but never builds. A body naming both sku and byod returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. Only a general or assume agent may have a phone: a service agent with phone returns 400. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
4593
4639
  */
4594
- export const sessionsThreadsList = (options) => (options.client ?? client).get({
4640
+ export const agentsCreate = (options) => (options.client ?? client).post({
4595
4641
  security: [{
4596
4642
  key: 'BearerAuth',
4597
4643
  scheme: 'bearer',
@@ -4601,15 +4647,19 @@ export const sessionsThreadsList = (options) => (options.client ?? client).get({
4601
4647
  name: 'X-API-Key',
4602
4648
  type: 'apiKey'
4603
4649
  }],
4604
- url: '/agent/v1/sessions/{session_id}/threads',
4605
- ...options
4650
+ url: '/agent/v1/agents',
4651
+ ...options,
4652
+ headers: {
4653
+ 'Content-Type': 'application/json',
4654
+ ...options.headers
4655
+ }
4606
4656
  });
4607
4657
  /**
4608
- * Get session thread
4658
+ * Get agent
4609
4659
  *
4610
- * Read one execution thread of a session, field for field the same as its list item. Thread ids that are unknown, malformed or belong to another session all return 404, so existence is not revealed. thread_id comes from sessions.threads.list or from the session_thread_id of a session.thread_created event.
4660
+ * Read the agent configuration currently effective for new sessions. By default, version equals active_version and latest_version identifies the newest saved version, including an unapplied save. Use latest_version for optimistic concurrency when updating. Pass version as a positive integer to read that saved version; version=active is equivalent to omission. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so tools can be sent back unchanged to agents.update. Use agents.versions.list to enumerate saved versions.
4611
4661
  */
4612
- export const sessionsThreadsRetrieve = (options) => (options.client ?? client).get({
4662
+ export const agentsRetrieve = (options) => (options.client ?? client).get({
4613
4663
  security: [{
4614
4664
  key: 'BearerAuth',
4615
4665
  scheme: 'bearer',
@@ -4619,15 +4669,15 @@ export const sessionsThreadsRetrieve = (options) => (options.client ?? client).g
4619
4669
  name: 'X-API-Key',
4620
4670
  type: 'apiKey'
4621
4671
  }],
4622
- url: '/agent/v1/sessions/{session_id}/threads/{thread_id}',
4672
+ url: '/agent/v1/agents/{agent_id}',
4623
4673
  ...options
4624
4674
  });
4625
4675
  /**
4626
- * Archive session thread
4676
+ * Update agent
4627
4677
  *
4628
- * Archive one execution thread. Archiving the primary thread archives the session; archiving a child archives only that child, leaving the parent and its siblings untouched. An archived child has status terminated and archived_at set, receives no new events and keeps its history readable.
4678
+ * Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved 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. phone takes the same two mutually exclusive forms as agents.create: {sku, name?, archive} for a cloud device, or {byod, name?} for your organization's own device (a byd_… id); naming both returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. phone: null turns the phone off and releases a cloud device; a BYOD phone is the organization's and is never killed. Assume agents reject model, models, subagent_model, subagents and multiagent on every update; other fields follow the general agent rules, with vault_ids also accepted.
4629
4679
  */
4630
- export const sessionsThreadsArchive = (options) => (options.client ?? client).post({
4680
+ export const agentsUpdate = (options) => (options.client ?? client).post({
4631
4681
  security: [{
4632
4682
  key: 'BearerAuth',
4633
4683
  scheme: 'bearer',
@@ -4637,7 +4687,217 @@ export const sessionsThreadsArchive = (options) => (options.client ?? client).po
4637
4687
  name: 'X-API-Key',
4638
4688
  type: 'apiKey'
4639
4689
  }],
4640
- url: '/agent/v1/sessions/{session_id}/threads/{thread_id}/archive',
4690
+ url: '/agent/v1/agents/{agent_id}',
4691
+ ...options,
4692
+ headers: {
4693
+ 'Content-Type': 'application/json',
4694
+ ...options.headers
4695
+ }
4696
+ });
4697
+ /**
4698
+ * Archive agent
4699
+ *
4700
+ * Archive an agent so it can no longer be updated and no new session can be created from it (AGENT_ARCHIVED). The agent and all of its versions stay readable. Use it to retire an agent you no longer want to run; it does not delete anything.
4701
+ */
4702
+ export const agentsArchive = (options) => (options.client ?? client).post({
4703
+ security: [{
4704
+ key: 'BearerAuth',
4705
+ scheme: 'bearer',
4706
+ type: 'http'
4707
+ }, {
4708
+ key: 'ApiKeyAuth',
4709
+ name: 'X-API-Key',
4710
+ type: 'apiKey'
4711
+ }],
4712
+ url: '/agent/v1/agents/{agent_id}/archive',
4713
+ ...options
4714
+ });
4715
+ /**
4716
+ * List agent versions
4717
+ *
4718
+ * List the saved versions of one agent in ascending version number, oldest first, in pages of at most 100 (default 20). Each item is the full agent definition at that saved version, so you can compare configurations. active is true only for the item new sessions use. active_version on every item is the same agent-level currently effective version; it is not that item's version. Use agents.retrieve with version to read a single saved version; agent_id comes from agents.list or agents.create. Pass next_page as page to continue.
4719
+ */
4720
+ export const agentsVersionsList = (options) => (options.client ?? client).get({
4721
+ security: [{
4722
+ key: 'BearerAuth',
4723
+ scheme: 'bearer',
4724
+ type: 'http'
4725
+ }, {
4726
+ key: 'ApiKeyAuth',
4727
+ name: 'X-API-Key',
4728
+ type: 'apiKey'
4729
+ }],
4730
+ url: '/agent/v1/agents/{agent_id}/versions',
4731
+ ...options
4732
+ });
4733
+ /**
4734
+ * List sessions
4735
+ *
4736
+ * 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.
4737
+ */
4738
+ export const sessionsList = (options) => (options?.client ?? client).get({
4739
+ security: [{
4740
+ key: 'BearerAuth',
4741
+ scheme: 'bearer',
4742
+ type: 'http'
4743
+ }, {
4744
+ key: 'ApiKeyAuth',
4745
+ name: 'X-API-Key',
4746
+ type: 'apiKey'
4747
+ }],
4748
+ url: '/agent/v1/sessions',
4749
+ ...options
4750
+ });
4751
+ /**
4752
+ * Create session
4753
+ *
4754
+ * 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. 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 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.
4755
+ */
4756
+ export const sessionsCreate = (options) => (options.client ?? client).post({
4757
+ security: [{
4758
+ key: 'BearerAuth',
4759
+ scheme: 'bearer',
4760
+ type: 'http'
4761
+ }, {
4762
+ key: 'ApiKeyAuth',
4763
+ name: 'X-API-Key',
4764
+ type: 'apiKey'
4765
+ }],
4766
+ url: '/agent/v1/sessions',
4767
+ ...options,
4768
+ headers: {
4769
+ 'Content-Type': 'application/json',
4770
+ ...options.headers
4771
+ }
4772
+ });
4773
+ /**
4774
+ * Archive session
4775
+ *
4776
+ * Archive a session. An archived session refuses new messages with 400 invalid_request_error, while its details and event history stay readable. Archiving again is idempotent and archived_at keeps the first archive time. Use it when a conversation is finished; it does not delete anything.
4777
+ */
4778
+ export const sessionsArchive = (options) => (options.client ?? client).post({
4779
+ security: [{
4780
+ key: 'BearerAuth',
4781
+ scheme: 'bearer',
4782
+ type: 'http'
4783
+ }, {
4784
+ key: 'ApiKeyAuth',
4785
+ name: 'X-API-Key',
4786
+ type: 'apiKey'
4787
+ }],
4788
+ url: '/agent/v1/sessions/{session_id}/archive',
4789
+ ...options
4790
+ });
4791
+ /**
4792
+ * List session events
4793
+ *
4794
+ * Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids; a request nobody answered within 24 hours is settled as unanswered and the session goes idle with stop_reason request_expired, which the /anthropic/v1 face shows as end_turn), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, system.notification_suppressed (pending background notifications that hit the wake quota and started no run), system.notification_recorded, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.list instead. In the path, session_id may also be `main` (your own main session with that agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4795
+ */
4796
+ export const sessionsEventsList = (options) => (options.client ?? client).get({
4797
+ security: [{
4798
+ key: 'BearerAuth',
4799
+ scheme: 'bearer',
4800
+ type: 'http'
4801
+ }, {
4802
+ key: 'ApiKeyAuth',
4803
+ name: 'X-API-Key',
4804
+ type: 'apiKey'
4805
+ }],
4806
+ url: '/agent/v1/sessions/{session_id}/events',
4807
+ ...options
4808
+ });
4809
+ /**
4810
+ * Send session events
4811
+ *
4812
+ * Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.send instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4813
+ */
4814
+ export const sessionsEventsSend = (options) => (options.client ?? client).post({
4815
+ security: [{
4816
+ key: 'BearerAuth',
4817
+ scheme: 'bearer',
4818
+ type: 'http'
4819
+ }, {
4820
+ key: 'ApiKeyAuth',
4821
+ name: 'X-API-Key',
4822
+ type: 'apiKey'
4823
+ }],
4824
+ url: '/agent/v1/sessions/{session_id}/events',
4825
+ ...options,
4826
+ headers: {
4827
+ 'Content-Type': 'application/json',
4828
+ ...options.headers
4829
+ }
4830
+ });
4831
+ /**
4832
+ * Stream session events
4833
+ *
4834
+ * Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event. This operation addresses one session — normally a worker session an agent dispatched; to follow a general agent itself, use agents.events.stream instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4835
+ */
4836
+ export const sessionsEventsStream = (options) => (options.client ?? client).sse.get({
4837
+ security: [{
4838
+ key: 'BearerAuth',
4839
+ scheme: 'bearer',
4840
+ type: 'http'
4841
+ }, {
4842
+ key: 'ApiKeyAuth',
4843
+ name: 'X-API-Key',
4844
+ type: 'apiKey'
4845
+ }],
4846
+ url: '/agent/v1/sessions/{session_id}/events/stream',
4847
+ ...options
4848
+ });
4849
+ /**
4850
+ * List session threads
4851
+ *
4852
+ * List the execution threads of a session: the primary thread plus every child thread started by subagents or advisors, in created_at order. Child threads reference the primary through parent_thread_id. Pages hold at most 100 threads (default 20). Use a thread id with sessions.threads.retrieve, sessions.threads.events.list or sessions.threads.events.stream.
4853
+ */
4854
+ export const sessionsThreadsList = (options) => (options.client ?? client).get({
4855
+ security: [{
4856
+ key: 'BearerAuth',
4857
+ scheme: 'bearer',
4858
+ type: 'http'
4859
+ }, {
4860
+ key: 'ApiKeyAuth',
4861
+ name: 'X-API-Key',
4862
+ type: 'apiKey'
4863
+ }],
4864
+ url: '/agent/v1/sessions/{session_id}/threads',
4865
+ ...options
4866
+ });
4867
+ /**
4868
+ * Get session thread
4869
+ *
4870
+ * Read one execution thread of a session, field for field the same as its list item. Thread ids that are unknown, malformed or belong to another session all return 404, so existence is not revealed. thread_id comes from sessions.threads.list or from the session_thread_id of a session.thread_created event.
4871
+ */
4872
+ export const sessionsThreadsRetrieve = (options) => (options.client ?? client).get({
4873
+ security: [{
4874
+ key: 'BearerAuth',
4875
+ scheme: 'bearer',
4876
+ type: 'http'
4877
+ }, {
4878
+ key: 'ApiKeyAuth',
4879
+ name: 'X-API-Key',
4880
+ type: 'apiKey'
4881
+ }],
4882
+ url: '/agent/v1/sessions/{session_id}/threads/{thread_id}',
4883
+ ...options
4884
+ });
4885
+ /**
4886
+ * Archive session thread
4887
+ *
4888
+ * Archive one execution thread. Archiving the primary thread archives the session; archiving a child archives only that child, leaving the parent and its siblings untouched. An archived child has status terminated and archived_at set, receives no new events and keeps its history readable.
4889
+ */
4890
+ export const sessionsThreadsArchive = (options) => (options.client ?? client).post({
4891
+ security: [{
4892
+ key: 'BearerAuth',
4893
+ scheme: 'bearer',
4894
+ type: 'http'
4895
+ }, {
4896
+ key: 'ApiKeyAuth',
4897
+ name: 'X-API-Key',
4898
+ type: 'apiKey'
4899
+ }],
4900
+ url: '/agent/v1/sessions/{session_id}/threads/{thread_id}/archive',
4641
4901
  ...options
4642
4902
  });
4643
4903
  /**
@@ -4871,7 +5131,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
4871
5131
  /**
4872
5132
  * Create deployment
4873
5133
  *
4874
- * 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. 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"}}.
4875
5135
  */
4876
5136
  export const deploymentsCreate = (options) => (options.client ?? client).post({
4877
5137
  security: [{
@@ -4911,7 +5171,7 @@ export const deploymentsRetrieve = (options) => (options.client ?? client).get({
4911
5171
  /**
4912
5172
  * Update deployment
4913
5173
  *
4914
- * 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.
4915
5175
  */
4916
5176
  export const deploymentsUpdate = (options) => (options.client ?? client).post({
4917
5177
  security: [{
@@ -5517,7 +5777,7 @@ export const applicationListGrants = (options) => (options.client ?? client).get
5517
5777
  /**
5518
5778
  * Create grant
5519
5779
  *
5520
- * Record access to an organization-owned database or knowledge base, all organization files (files, id *), or models (models, id *, read only). Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
5780
+ * Record access to an organization-owned database, knowledge base, file, media library, workflow, script, agent or another Worker, to models (id *, read only), or to a whole service (search, browser, ticket, crm, canvas, cut, studio, ontology, workspace: id *, read_write; feedback: read), or to full authority (organization: id *, read_write), which excludes every other grant. The types are the ones a service agent can bind. The retired files type is refused; grant one file by its file-… id. A Worker's platform calls reach only what its grants name, and nothing with no grant; an agent grant at read_write is what lets it issue that agent's customer grant codes. Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
5521
5781
  */
5522
5782
  export const applicationCreateGrant = (options) => (options.client ?? client).post({
5523
5783
  security: [{
@@ -6105,7 +6365,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
6105
6365
  /**
6106
6366
  * Create a workflow
6107
6367
  *
6108
- * Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 5 min (run-sandbox 6 h), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. To pause for a person, call praxis/approval (it opens a human task; the step output is the decision); agents answer with praxis.automation.humanTasks.respond on behalf of their user. Guide: /docs/developers/automation/guides/approvals Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
6368
+ * Workflow syntax reference: https://docs.deepraxis.com/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 5 min (run-sandbox 6 h), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. To pause for a person, call praxis/approval (it opens a human task; the step output is the decision); agents answer with praxis.automation.humanTasks.respond on behalf of their user. Guide: /developers/automation/guides/approvals Guide: /developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
6109
6369
  */
6110
6370
  export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
6111
6371
  security: [{
@@ -6145,7 +6405,7 @@ export const automationWorkflowsGet = (options) => (options.client ?? client).ge
6145
6405
  /**
6146
6406
  * Update a workflow draft
6147
6407
  *
6148
- * Update description, labels or draft with the current draft revision in If-Match, taken from draft.revision in the get-workflow response. Even metadata-only updates create a new draft revision. A mismatch returns 412 PRECONDITION_FAILED; read the draft again, merge and retry. The draft is not validated here, so check it with validate (kind=workflow) before publishing. Error details are in errors[]. See the workflow syntax reference at https://deepraxis.com/docs/developers/automation/reference/workflow-syntax.
6408
+ * Update description, labels or draft with the current draft revision in If-Match, taken from draft.revision in the get-workflow response. Even metadata-only updates create a new draft revision. A mismatch returns 412 PRECONDITION_FAILED; read the draft again, merge and retry. The draft is not validated here, so check it with validate (kind=workflow) before publishing. Error details are in errors[]. See the workflow syntax reference at https://docs.deepraxis.com/developers/automation/reference/workflow-syntax.
6149
6409
  */
6150
6410
  export const automationWorkflowsPatch = (options) => (options.client ?? client).patch({
6151
6411
  security: [{
@@ -6349,7 +6609,7 @@ export const automationWorkflowsSetDistTag = (options) => (options.client ?? cli
6349
6609
  /**
6350
6610
  * Validate a definition
6351
6611
  *
6352
- * Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation. For kind=workflow the YAML needs document (dsl, namespace, name, version) and do; each problem is one entry in errors[] (pointer, detail, hint), so read the first one. A listen outside the supported subset (to.all, inside a fork) and emit are not reported here and fail with DEFINITION_INVALID only when a run is created. Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax.
6612
+ * Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation. For kind=workflow the YAML needs document (dsl, namespace, name, version) and do; each problem is one entry in errors[] (pointer, detail, hint), so read the first one. A listen outside the supported subset (to.all, inside a fork) and emit are not reported here and fail with DEFINITION_INVALID only when a run is created. Workflow syntax reference: https://docs.deepraxis.com/developers/automation/reference/workflow-syntax.
6353
6613
  */
6354
6614
  export const automationValidateValidate = (options) => (options.client ?? client).post({
6355
6615
  security: [{
@@ -8592,7 +8852,7 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
8592
8852
  * codemode.describe("praxis.cut.script") // names, one page at a time
8593
8853
  * ```
8594
8854
  *
8595
- * Published at https://docs.deepraxis.com/docs/developers/cut/script-reference with one anchor per entry. Names below omit the `praxis.cut.<kind>.` prefix.
8855
+ * Published at https://docs.deepraxis.com/developers/cut/script-reference with one anchor per entry. Names below omit the `praxis.cut.<kind>.` prefix.
8596
8856
  *
8597
8857
  * #### Script functions (script)
8598
8858
  *
@@ -9057,19 +9317,563 @@ export const cutListVersions = (options) => (options.client ?? client).get({
9057
9317
  /**
9058
9318
  * Save project version
9059
9319
  *
9060
- * Save the current project timeline as a named recovery point before a substantial edit. Supply an optional label or send an empty object; keep the returned version id for versions.restore. Saving a version does not publish a rendered asset; use projects.exports.create for video output.
9320
+ * Save the current project timeline as a named recovery point before a substantial edit. Supply an optional label or send an empty object; keep the returned version id for versions.restore. Saving a version does not publish a rendered asset; use projects.exports.create for video output.
9321
+ */
9322
+ export const cutCreateVersion = (options) => (options.client ?? client).post({
9323
+ security: [{
9324
+ key: 'BearerAuth',
9325
+ scheme: 'bearer',
9326
+ type: 'http'
9327
+ }, {
9328
+ key: 'ApiKeyAuth',
9329
+ name: 'X-API-Key',
9330
+ type: 'apiKey'
9331
+ }],
9332
+ url: '/cut/v1/projects/{project_id}/versions',
9333
+ ...options,
9334
+ headers: {
9335
+ 'Content-Type': 'application/json',
9336
+ ...options.headers
9337
+ }
9338
+ });
9339
+ /**
9340
+ * Restore saved version
9341
+ *
9342
+ * Replace current editing content with a saved project snapshot selected from projects.versions.list. The restore commits a new transaction and revision while preserving the saved version for future use. Inspect the returned summary and timeline before further editing; a response revision conflict can follow a committed restore, so retrieve current state before retrying.
9343
+ */
9344
+ export const cutRestoreVersion = (options) => (options.client ?? client).post({
9345
+ security: [{
9346
+ key: 'BearerAuth',
9347
+ scheme: 'bearer',
9348
+ type: 'http'
9349
+ }, {
9350
+ key: 'ApiKeyAuth',
9351
+ name: 'X-API-Key',
9352
+ type: 'apiKey'
9353
+ }],
9354
+ url: '/cut/v1/versions/{version_id}:restore',
9355
+ ...options
9356
+ });
9357
+ /**
9358
+ * List table databases
9359
+ *
9360
+ * Find the table databases owned by your tenant (databases of the other type are not listed) and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
9361
+ */
9362
+ export const databaseListTableDatabases = (options) => (options?.client ?? client).get({
9363
+ security: [{
9364
+ key: 'database-bearerAuth',
9365
+ scheme: 'bearer',
9366
+ type: 'http'
9367
+ }],
9368
+ url: '/database/v1/table',
9369
+ ...options
9370
+ });
9371
+ /**
9372
+ * Create table database
9373
+ *
9374
+ * Creates an empty table database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.table.tables.create, then read and write rows with praxis.database.table.rest. The path is the type: the body takes no kind, and a body that carries kind returns 400 INVALID_PARAMS: kind is set by the path. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListTableDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies. For Redis-style keys use praxis.database.kv.create instead.
9375
+ */
9376
+ export const databaseCreateTableDatabase = (options) => (options.client ?? client).post({
9377
+ security: [{
9378
+ key: 'database-bearerAuth',
9379
+ scheme: 'bearer',
9380
+ type: 'http'
9381
+ }],
9382
+ url: '/database/v1/table',
9383
+ ...options,
9384
+ headers: {
9385
+ 'Content-Type': 'application/json',
9386
+ ...options.headers
9387
+ }
9388
+ });
9389
+ /**
9390
+ * List key-value databases
9391
+ *
9392
+ * Find the key-value databases owned by your tenant (databases of the other type are not listed) and obtain their ids for key and command operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
9393
+ */
9394
+ export const databaseListKvDatabases = (options) => (options?.client ?? client).get({
9395
+ security: [{
9396
+ key: 'database-bearerAuth',
9397
+ scheme: 'bearer',
9398
+ type: 'http'
9399
+ }],
9400
+ url: '/database/v1/kv',
9401
+ ...options
9402
+ });
9403
+ /**
9404
+ * Create key-value database
9405
+ *
9406
+ * Creates an empty key-value database (键值库) for the caller and returns it with status active (HTTP 201); read and write it next with praxis.database.kv.keys and praxis.database.kv.commands, or point an existing Redis or @upstash/redis client at /redis/<database_id>. The path is the type: the body takes no kind, and a body that carries kind returns 400 INVALID_PARAMS: kind is set by the path. Creating a key-value database in an organization that has not been opened for it returns 400 INVALID_PARAMS: kind kv is not available. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListKvDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Use a Praxis credential; access is scoped to its tenant. For structured tables and rows use praxis.database.table.create instead.
9407
+ */
9408
+ export const databaseCreateKvDatabase = (options) => (options.client ?? client).post({
9409
+ security: [{
9410
+ key: 'database-bearerAuth',
9411
+ scheme: 'bearer',
9412
+ type: 'http'
9413
+ }],
9414
+ url: '/database/v1/kv',
9415
+ ...options,
9416
+ headers: {
9417
+ 'Content-Type': 'application/json',
9418
+ ...options.headers
9419
+ }
9420
+ });
9421
+ /**
9422
+ * Delete database
9423
+ *
9424
+ * Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
9425
+ */
9426
+ export const databaseDeleteTableDatabase = (options) => (options.client ?? client).delete({
9427
+ security: [{
9428
+ key: 'database-bearerAuth',
9429
+ scheme: 'bearer',
9430
+ type: 'http'
9431
+ }],
9432
+ url: '/database/v1/table/{database_id}',
9433
+ ...options
9434
+ });
9435
+ /**
9436
+ * Get table database
9437
+ *
9438
+ * Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id, or the id of a key-value database, returns 404 DATABASE_NOT_FOUND.
9439
+ */
9440
+ export const databaseGetTableDatabase = (options) => (options.client ?? client).get({
9441
+ security: [{
9442
+ key: 'database-bearerAuth',
9443
+ scheme: 'bearer',
9444
+ type: 'http'
9445
+ }],
9446
+ url: '/database/v1/table/{database_id}',
9447
+ ...options
9448
+ });
9449
+ /**
9450
+ * Update database
9451
+ *
9452
+ * Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreTableDatabase.
9453
+ */
9454
+ export const databaseUpdateTableDatabase = (options) => (options.client ?? client).patch({
9455
+ security: [{
9456
+ key: 'database-bearerAuth',
9457
+ scheme: 'bearer',
9458
+ type: 'http'
9459
+ }],
9460
+ url: '/database/v1/table/{database_id}',
9461
+ ...options,
9462
+ headers: {
9463
+ 'Content-Type': 'application/json',
9464
+ ...options.headers
9465
+ }
9466
+ });
9467
+ /**
9468
+ * Delete database
9469
+ *
9470
+ * Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
9471
+ */
9472
+ export const databaseDeleteKvDatabase = (options) => (options.client ?? client).delete({
9473
+ security: [{
9474
+ key: 'database-bearerAuth',
9475
+ scheme: 'bearer',
9476
+ type: 'http'
9477
+ }],
9478
+ url: '/database/v1/kv/{database_id}',
9479
+ ...options
9480
+ });
9481
+ /**
9482
+ * Get key-value database
9483
+ *
9484
+ * Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before key or command operations to confirm status is active: key and command calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id, or the id of a table database, returns 404 DATABASE_NOT_FOUND.
9485
+ */
9486
+ export const databaseGetKvDatabase = (options) => (options.client ?? client).get({
9487
+ security: [{
9488
+ key: 'database-bearerAuth',
9489
+ scheme: 'bearer',
9490
+ type: 'http'
9491
+ }],
9492
+ url: '/database/v1/kv/{database_id}',
9493
+ ...options
9494
+ });
9495
+ /**
9496
+ * Update database
9497
+ *
9498
+ * Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreKvDatabase.
9499
+ */
9500
+ export const databaseUpdateKvDatabase = (options) => (options.client ?? client).patch({
9501
+ security: [{
9502
+ key: 'database-bearerAuth',
9503
+ scheme: 'bearer',
9504
+ type: 'http'
9505
+ }],
9506
+ url: '/database/v1/kv/{database_id}',
9507
+ ...options,
9508
+ headers: {
9509
+ 'Content-Type': 'application/json',
9510
+ ...options.headers
9511
+ }
9512
+ });
9513
+ /**
9514
+ * Restore database
9515
+ *
9516
+ * Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
9517
+ */
9518
+ export const databaseRestoreTableDatabase = (options) => (options.client ?? client).post({
9519
+ security: [{
9520
+ key: 'database-bearerAuth',
9521
+ scheme: 'bearer',
9522
+ type: 'http'
9523
+ }],
9524
+ url: '/database/v1/table/{database_id}/restore',
9525
+ ...options
9526
+ });
9527
+ /**
9528
+ * Restore database
9529
+ *
9530
+ * Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
9531
+ */
9532
+ export const databaseRestoreKvDatabase = (options) => (options.client ?? client).post({
9533
+ security: [{
9534
+ key: 'database-bearerAuth',
9535
+ scheme: 'bearer',
9536
+ type: 'http'
9537
+ }],
9538
+ url: '/database/v1/kv/{database_id}/restore',
9539
+ ...options
9540
+ });
9541
+ /**
9542
+ * Permanently purge database
9543
+ *
9544
+ * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
9545
+ */
9546
+ export const databasePurgeTableDatabase = (options) => (options.client ?? client).post({
9547
+ security: [{
9548
+ key: 'database-bearerAuth',
9549
+ scheme: 'bearer',
9550
+ type: 'http'
9551
+ }],
9552
+ url: '/database/v1/table/{database_id}/purge',
9553
+ ...options
9554
+ });
9555
+ /**
9556
+ * Permanently purge database
9557
+ *
9558
+ * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
9559
+ */
9560
+ export const databasePurgeKvDatabase = (options) => (options.client ?? client).post({
9561
+ security: [{
9562
+ key: 'database-bearerAuth',
9563
+ scheme: 'bearer',
9564
+ type: 'http'
9565
+ }],
9566
+ url: '/database/v1/kv/{database_id}/purge',
9567
+ ...options
9568
+ });
9569
+ /**
9570
+ * List tables
9571
+ *
9572
+ * Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseTableGetTable instead when you also need row_count for one table.
9573
+ */
9574
+ export const databaseTableListTables = (options) => (options.client ?? client).get({
9575
+ security: [{
9576
+ key: 'database-bearerAuth',
9577
+ scheme: 'bearer',
9578
+ type: 'http'
9579
+ }],
9580
+ url: '/database/v1/table/{database_id}/tables',
9581
+ ...options
9582
+ });
9583
+ /**
9584
+ * Create table
9585
+ *
9586
+ * Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseTableAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseTableInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
9587
+ */
9588
+ export const databaseTableCreateTable = (options) => (options.client ?? client).post({
9589
+ security: [{
9590
+ key: 'database-bearerAuth',
9591
+ scheme: 'bearer',
9592
+ type: 'http'
9593
+ }],
9594
+ url: '/database/v1/table/{database_id}/tables',
9595
+ ...options,
9596
+ headers: {
9597
+ 'Content-Type': 'application/json',
9598
+ ...options.headers
9599
+ }
9600
+ });
9601
+ /**
9602
+ * Delete table
9603
+ *
9604
+ * Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
9605
+ */
9606
+ export const databaseTableDeleteTable = (options) => (options.client ?? client).delete({
9607
+ security: [{
9608
+ key: 'database-bearerAuth',
9609
+ scheme: 'bearer',
9610
+ type: 'http'
9611
+ }],
9612
+ url: '/database/v1/table/{database_id}/tables/{table}',
9613
+ ...options
9614
+ });
9615
+ /**
9616
+ * Get table
9617
+ *
9618
+ * Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
9619
+ */
9620
+ export const databaseTableGetTable = (options) => (options.client ?? client).get({
9621
+ security: [{
9622
+ key: 'database-bearerAuth',
9623
+ scheme: 'bearer',
9624
+ type: 'http'
9625
+ }],
9626
+ url: '/database/v1/table/{database_id}/tables/{table}',
9627
+ ...options
9628
+ });
9629
+ /**
9630
+ * Update table
9631
+ *
9632
+ * Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseTableAddField, databaseTableUpdateField and databaseTableDeleteField.
9633
+ */
9634
+ export const databaseTableUpdateTable = (options) => (options.client ?? client).patch({
9635
+ security: [{
9636
+ key: 'database-bearerAuth',
9637
+ scheme: 'bearer',
9638
+ type: 'http'
9639
+ }],
9640
+ url: '/database/v1/table/{database_id}/tables/{table}',
9641
+ ...options,
9642
+ headers: {
9643
+ 'Content-Type': 'application/json',
9644
+ ...options.headers
9645
+ }
9646
+ });
9647
+ /**
9648
+ * Add field
9649
+ *
9650
+ * Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
9651
+ */
9652
+ export const databaseTableAddField = (options) => (options.client ?? client).post({
9653
+ security: [{
9654
+ key: 'database-bearerAuth',
9655
+ scheme: 'bearer',
9656
+ type: 'http'
9657
+ }],
9658
+ url: '/database/v1/table/{database_id}/tables/{table}/fields',
9659
+ ...options,
9660
+ headers: {
9661
+ 'Content-Type': 'application/json',
9662
+ ...options.headers
9663
+ }
9664
+ });
9665
+ /**
9666
+ * Delete field
9667
+ *
9668
+ * Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
9669
+ */
9670
+ export const databaseTableDeleteField = (options) => (options.client ?? client).delete({
9671
+ security: [{
9672
+ key: 'database-bearerAuth',
9673
+ scheme: 'bearer',
9674
+ type: 'http'
9675
+ }],
9676
+ url: '/database/v1/table/{database_id}/tables/{table}/fields/{field}',
9677
+ ...options
9678
+ });
9679
+ /**
9680
+ * Update field
9681
+ *
9682
+ * Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
9683
+ */
9684
+ export const databaseTableUpdateField = (options) => (options.client ?? client).patch({
9685
+ security: [{
9686
+ key: 'database-bearerAuth',
9687
+ scheme: 'bearer',
9688
+ type: 'http'
9689
+ }],
9690
+ url: '/database/v1/table/{database_id}/tables/{table}/fields/{field}',
9691
+ ...options,
9692
+ headers: {
9693
+ 'Content-Type': 'application/json',
9694
+ ...options.headers
9695
+ }
9696
+ });
9697
+ /**
9698
+ * List events
9699
+ *
9700
+ * Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
9701
+ */
9702
+ export const databaseTableListEvents = (options) => (options.client ?? client).get({
9703
+ security: [{
9704
+ key: 'database-bearerAuth',
9705
+ scheme: 'bearer',
9706
+ type: 'http'
9707
+ }],
9708
+ url: '/database/v1/table/{database_id}/events',
9709
+ ...options
9710
+ });
9711
+ /**
9712
+ * List key-value database events
9713
+ *
9714
+ * Read the lifecycle events of a key-value database (created, status changes), including while the database is deleting; use it to see when the database was provisioned or deleted. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. This is paged lifecycle history, not a feed of key changes: writing, updating or deleting keys does not add events. The id of a table database returns 404 DATABASE_NOT_FOUND here; read its events with praxis.database.table.events.list.
9715
+ */
9716
+ export const databaseKvListEvents = (options) => (options.client ?? client).get({
9717
+ security: [{
9718
+ key: 'database-bearerAuth',
9719
+ scheme: 'bearer',
9720
+ type: 'http'
9721
+ }],
9722
+ url: '/database/v1/kv/{database_id}/events',
9723
+ ...options
9724
+ });
9725
+ /**
9726
+ * Delete rows
9727
+ *
9728
+ * Deletes the rows matched by the filter query parameters (the same filters as databaseTableSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
9729
+ */
9730
+ export const databaseTableDelete = (options) => (options.client ?? client).delete({
9731
+ security: [{
9732
+ key: 'database-bearerAuth',
9733
+ scheme: 'bearer',
9734
+ type: 'http'
9735
+ }],
9736
+ url: '/database/v1/table/{database_id}/rest/{table}',
9737
+ ...options
9738
+ });
9739
+ /**
9740
+ * Select rows
9741
+ *
9742
+ * Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
9743
+ */
9744
+ export const databaseTableSelect = (options) => (options.client ?? client).get({
9745
+ security: [{
9746
+ key: 'database-bearerAuth',
9747
+ scheme: 'bearer',
9748
+ type: 'http'
9749
+ }],
9750
+ url: '/database/v1/table/{database_id}/rest/{table}',
9751
+ ...options
9752
+ });
9753
+ /**
9754
+ * Count rows
9755
+ *
9756
+ * Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
9757
+ */
9758
+ export const databaseTableHead = (options) => (options.client ?? client).head({
9759
+ security: [{
9760
+ key: 'database-bearerAuth',
9761
+ scheme: 'bearer',
9762
+ type: 'http'
9763
+ }],
9764
+ url: '/database/v1/table/{database_id}/rest/{table}',
9765
+ ...options
9766
+ });
9767
+ /**
9768
+ * Update rows
9769
+ *
9770
+ * Updates the rows matched by the filter query parameters (the same filters as databaseTableSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
9771
+ */
9772
+ export const databaseTableUpdate = (options) => (options.client ?? client).patch({
9773
+ security: [{
9774
+ key: 'database-bearerAuth',
9775
+ scheme: 'bearer',
9776
+ type: 'http'
9777
+ }],
9778
+ url: '/database/v1/table/{database_id}/rest/{table}',
9779
+ ...options,
9780
+ headers: {
9781
+ 'Content-Type': 'application/json',
9782
+ ...options.headers
9783
+ }
9784
+ });
9785
+ /**
9786
+ * Insert rows
9787
+ *
9788
+ * Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
9789
+ * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
9790
+ * The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
9791
+ */
9792
+ export const databaseTableInsert = (options) => (options.client ?? client).post({
9793
+ security: [{
9794
+ key: 'database-bearerAuth',
9795
+ scheme: 'bearer',
9796
+ type: 'http'
9797
+ }],
9798
+ url: '/database/v1/table/{database_id}/rest/{table}',
9799
+ ...options,
9800
+ headers: {
9801
+ 'Content-Type': 'application/json',
9802
+ ...options.headers
9803
+ }
9804
+ });
9805
+ /**
9806
+ * List keys
9807
+ *
9808
+ * Browse the keys of a key-value database (kind kv): use it to see what is stored before reading one key with databaseKvGetKey; to run an arbitrary Redis command (counters, ranges, scans) use databaseKvExecuteCommand instead. Keys come back in lexicographic key order, one page at a time, as summaries (key, type, remaining TTL, size) without values; expired keys are never returned. pattern filters with a Redis glob (* ? [abc] [^abc]) matched against the whole key, and type keeps one value type. limit is 1–500, default 50; while next_cursor is a string, pass it back unchanged as cursor for the next page; null means this is the last page. Needs a read credential. Errors: 400 INVALID_PARAMS for a limit outside 1–500 or a malformed query; 404 DATABASE_NOT_FOUND for an unknown id.
9809
+ */
9810
+ export const databaseKvListKeys = (options) => (options.client ?? client).get({
9811
+ security: [{
9812
+ key: 'database-bearerAuth',
9813
+ scheme: 'bearer',
9814
+ type: 'http'
9815
+ }],
9816
+ url: '/database/v1/kv/{database_id}/keys',
9817
+ ...options
9818
+ });
9819
+ /**
9820
+ * Delete key
9821
+ *
9822
+ * Delete one key of a key-value database together with its value; the data cannot be recovered. A key that is absent or has already expired is not an error: the call succeeds with deleted false, so it is safe to retry. To delete many keys at once or by pattern, list them with databaseKvListKeys or run DEL / UNLINK through databaseKvExecuteCommand. Needs a read-write credential. Errors: 404 DATABASE_NOT_FOUND for an unknown id; 403 BINDING_READ_ONLY for a read-only credential.
9823
+ */
9824
+ export const databaseKvDeleteKey = (options) => (options.client ?? client).delete({
9825
+ security: [{
9826
+ key: 'database-bearerAuth',
9827
+ scheme: 'bearer',
9828
+ type: 'http'
9829
+ }],
9830
+ url: '/database/v1/kv/{database_id}/keys/{key}',
9831
+ ...options
9832
+ });
9833
+ /**
9834
+ * Get key
9835
+ *
9836
+ * Read one key of a key-value database with its type, TTL, size and value; use databaseKvListKeys first to find key names. A string value is returned whole. A hash, list, set or zset is returned a page of entries at a time: limit is 1–1000, default 100, and while next_cursor is a string, pass it back unchanged as cursor to read the next page; string values and the last page return next_cursor null. value takes the shape of type: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}]. Needs a read credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS for a limit outside 1–1000; 404 DATABASE_NOT_FOUND.
9837
+ */
9838
+ export const databaseKvGetKey = (options) => (options.client ?? client).get({
9839
+ security: [{
9840
+ key: 'database-bearerAuth',
9841
+ scheme: 'bearer',
9842
+ type: 'http'
9843
+ }],
9844
+ url: '/database/v1/kv/{database_id}/keys/{key}',
9845
+ ...options
9846
+ });
9847
+ /**
9848
+ * Update key
9849
+ *
9850
+ * Change only the TTL of an existing key of a key-value database, leaving its value alone. update_mask must be ttl_ms (the only writable field) and ttl_ms is required: a positive integer is the new TTL in milliseconds (Redis PEXPIRE), null removes the TTL so the key never expires (PERSIST). To replace the value use databaseKvSetKey. Returns the key after the change. Needs a read-write credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS when update_mask is not ttl_ms or ttl_ms is neither a positive integer nor null; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY.
9851
+ */
9852
+ export const databaseKvUpdateKey = (options) => (options.client ?? client).patch({
9853
+ security: [{
9854
+ key: 'database-bearerAuth',
9855
+ scheme: 'bearer',
9856
+ type: 'http'
9857
+ }],
9858
+ url: '/database/v1/kv/{database_id}/keys/{key}',
9859
+ ...options,
9860
+ headers: {
9861
+ 'Content-Type': 'application/json',
9862
+ ...options.headers
9863
+ }
9864
+ });
9865
+ /**
9866
+ * Set key
9867
+ *
9868
+ * Overwrite one key of a key-value database with a whole new value in a single transaction, creating it if absent; the previous value is dropped first and never merged, even when the type changes. To change only the TTL use databaseKvUpdateKey; to add to a counter or push onto a list use databaseKvExecuteCommand. type decides the shape of value: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}] with finite scores. Containers must not be empty, and hash fields and set members must be unique. ttl_ms omitted keeps the key's existing TTL, a positive integer sets a new one in milliseconds, null makes the key permanent. A value is at most 1 MiB and a key at most 1 KiB. Returns the stored key (first page for a container). Needs a read-write credential. Errors: 400 INVALID_PARAMS for an empty container, duplicate field or member, non-finite score or bad ttl_ms; 400 LIMIT_EXCEEDED for an oversized key or value; 503 CAPACITY when the database is full; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY for a read-only credential.
9061
9869
  */
9062
- export const cutCreateVersion = (options) => (options.client ?? client).post({
9870
+ export const databaseKvSetKey = (options) => (options.client ?? client).put({
9063
9871
  security: [{
9064
- key: 'BearerAuth',
9872
+ key: 'database-bearerAuth',
9065
9873
  scheme: 'bearer',
9066
9874
  type: 'http'
9067
- }, {
9068
- key: 'ApiKeyAuth',
9069
- name: 'X-API-Key',
9070
- type: 'apiKey'
9071
9875
  }],
9072
- url: '/cut/v1/projects/{project_id}/versions',
9876
+ url: '/database/v1/kv/{database_id}/keys/{key}',
9073
9877
  ...options,
9074
9878
  headers: {
9075
9879
  'Content-Type': 'application/json',
@@ -9077,27 +9881,29 @@ export const cutCreateVersion = (options) => (options.client ?? client).post({
9077
9881
  }
9078
9882
  });
9079
9883
  /**
9080
- * Restore saved version
9884
+ * Execute command
9081
9885
  *
9082
- * Replace current editing content with a saved project snapshot selected from projects.versions.list. The restore commits a new transaction and revision while preserving the saved version for future use. Inspect the returned summary and timeline before further editing; a response revision conflict can follow a committed restore, so retrieve current state before retrying.
9886
+ * Run one Redis command with Redis 7 semantics against a key-value database and get its reply; use it for what the key operations cannot do: counters (INCR), list and set operations, ranges (LRANGE, ZRANGE), scans (SCAN, HSCAN) and expiry commands. For one whole-value read or write use databaseKvGetKey / databaseKvSetKey; for existing Redis clients use the Upstash-compatible face under /redis. command is the command name followed by its arguments, every element a string, for example ["SET","k","v"] or ["LRANGE","queue","0","9"]. result is Redis's reply as plain JSON (integers, strings, arrays, null), never base64. Not supported: Lua scripting (EVAL), blocking commands, Pub/Sub and Streams. A value is at most 1 MiB, a key at most 1 KiB, a reply at most 8 MiB (read big collections in ranges with SCAN, HSCAN, LRANGE or ZRANGE) and the database at most 1 GiB. A read command needs a read credential; a write command, or a command that cannot be parsed, needs a read-write credential. Errors: 400 KV_COMMAND_ERROR when Redis rejects the command, with Redis's own text in message (for example WRONGTYPE Operation against a key holding the wrong kind of value or ERR unknown command); 400 INVALID_PARAMS for a missing or empty command; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY for a write on a read-only credential.
9083
9887
  */
9084
- export const cutRestoreVersion = (options) => (options.client ?? client).post({
9888
+ export const databaseKvExecuteCommand = (options) => (options.client ?? client).post({
9085
9889
  security: [{
9086
- key: 'BearerAuth',
9890
+ key: 'database-bearerAuth',
9087
9891
  scheme: 'bearer',
9088
9892
  type: 'http'
9089
- }, {
9090
- key: 'ApiKeyAuth',
9091
- name: 'X-API-Key',
9092
- type: 'apiKey'
9093
9893
  }],
9094
- url: '/cut/v1/versions/{version_id}:restore',
9095
- ...options
9894
+ url: '/database/v1/kv/{database_id}/commands',
9895
+ ...options,
9896
+ headers: {
9897
+ 'Content-Type': 'application/json',
9898
+ ...options.headers
9899
+ }
9096
9900
  });
9097
9901
  /**
9098
9902
  * List databases
9099
9903
  *
9100
- * Find databases owned by your tenant and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
9904
+ * Deprecated: use praxis.database.table.list for a table database or praxis.database.kv.list for a key-value database instead; this path stops working on 2027-03-01. Find databases owned by your tenant and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
9905
+ *
9906
+ * @deprecated
9101
9907
  */
9102
9908
  export const databaseListDatabases = (options) => (options?.client ?? client).get({
9103
9909
  security: [{
@@ -9111,7 +9917,9 @@ export const databaseListDatabases = (options) => (options?.client ?? client).ge
9111
9917
  /**
9112
9918
  * Create database
9113
9919
  *
9114
- * Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
9920
+ * Deprecated: use praxis.database.table.create for a table database or praxis.database.kv.create for a key-value database instead; this path stops working on 2027-03-01. Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. kind is optional: table (the default) for tables and rows, kv for Redis-style keys and values; it cannot change later, and creating kv where it is not available returns 400 INVALID_PARAMS: kind kv is not available. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
9921
+ *
9922
+ * @deprecated
9115
9923
  */
9116
9924
  export const databaseCreateDatabase = (options) => (options.client ?? client).post({
9117
9925
  security: [{
@@ -9129,7 +9937,9 @@ export const databaseCreateDatabase = (options) => (options.client ?? client).po
9129
9937
  /**
9130
9938
  * Delete database
9131
9939
  *
9132
- * Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
9940
+ * Deprecated: use praxis.database.table.delete for a table database or praxis.database.kv.delete for a key-value database instead; this path stops working on 2027-03-01. Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
9941
+ *
9942
+ * @deprecated
9133
9943
  */
9134
9944
  export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
9135
9945
  security: [{
@@ -9143,7 +9953,9 @@ export const databaseDeleteDatabase = (options) => (options.client ?? client).de
9143
9953
  /**
9144
9954
  * Get database
9145
9955
  *
9146
- * Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id returns 404 DATABASE_NOT_FOUND.
9956
+ * Deprecated: use praxis.database.table.retrieve for a table database or praxis.database.kv.retrieve for a key-value database instead; this path stops working on 2027-03-01. Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id returns 404 DATABASE_NOT_FOUND.
9957
+ *
9958
+ * @deprecated
9147
9959
  */
9148
9960
  export const databaseGetDatabase = (options) => (options.client ?? client).get({
9149
9961
  security: [{
@@ -9157,7 +9969,9 @@ export const databaseGetDatabase = (options) => (options.client ?? client).get({
9157
9969
  /**
9158
9970
  * Update database
9159
9971
  *
9160
- * Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreDatabase.
9972
+ * Deprecated: use praxis.database.table.update for a table database or praxis.database.kv.update for a key-value database instead; this path stops working on 2027-03-01. Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreDatabase.
9973
+ *
9974
+ * @deprecated
9161
9975
  */
9162
9976
  export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
9163
9977
  security: [{
@@ -9175,7 +9989,9 @@ export const databaseUpdateDatabase = (options) => (options.client ?? client).pa
9175
9989
  /**
9176
9990
  * Restore database
9177
9991
  *
9178
- * Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
9992
+ * Deprecated: use praxis.database.table.restore for a table database or praxis.database.kv.restore for a key-value database instead; this path stops working on 2027-03-01. Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
9993
+ *
9994
+ * @deprecated
9179
9995
  */
9180
9996
  export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
9181
9997
  security: [{
@@ -9189,7 +10005,9 @@ export const databaseRestoreDatabase = (options) => (options.client ?? client).p
9189
10005
  /**
9190
10006
  * Permanently purge database
9191
10007
  *
9192
- * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
10008
+ * Deprecated: use praxis.database.table.purge.create for a table database or praxis.database.kv.purge.create for a key-value database instead; this path stops working on 2027-03-01. Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
10009
+ *
10010
+ * @deprecated
9193
10011
  */
9194
10012
  export const databasePurgeDatabase = (options) => (options.client ?? client).post({
9195
10013
  security: [{
@@ -9203,7 +10021,9 @@ export const databasePurgeDatabase = (options) => (options.client ?? client).pos
9203
10021
  /**
9204
10022
  * List tables
9205
10023
  *
9206
- * Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseGetTable instead when you also need row_count for one table.
10024
+ * Deprecated: use praxis.database.table.tables.list instead; this path stops working on 2027-03-01. Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseGetTable instead when you also need row_count for one table.
10025
+ *
10026
+ * @deprecated
9207
10027
  */
9208
10028
  export const databaseListTables = (options) => (options.client ?? client).get({
9209
10029
  security: [{
@@ -9217,7 +10037,9 @@ export const databaseListTables = (options) => (options.client ?? client).get({
9217
10037
  /**
9218
10038
  * Create table
9219
10039
  *
9220
- * Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
10040
+ * Deprecated: use praxis.database.table.tables.create instead; this path stops working on 2027-03-01. Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
10041
+ *
10042
+ * @deprecated
9221
10043
  */
9222
10044
  export const databaseCreateTable = (options) => (options.client ?? client).post({
9223
10045
  security: [{
@@ -9235,7 +10057,9 @@ export const databaseCreateTable = (options) => (options.client ?? client).post(
9235
10057
  /**
9236
10058
  * Delete table
9237
10059
  *
9238
- * Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
10060
+ * Deprecated: use praxis.database.table.tables.delete instead; this path stops working on 2027-03-01. Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
10061
+ *
10062
+ * @deprecated
9239
10063
  */
9240
10064
  export const databaseDeleteTable = (options) => (options.client ?? client).delete({
9241
10065
  security: [{
@@ -9249,7 +10073,9 @@ export const databaseDeleteTable = (options) => (options.client ?? client).delet
9249
10073
  /**
9250
10074
  * Get table
9251
10075
  *
9252
- * Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
10076
+ * Deprecated: use praxis.database.table.tables.retrieve instead; this path stops working on 2027-03-01. Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
10077
+ *
10078
+ * @deprecated
9253
10079
  */
9254
10080
  export const databaseGetTable = (options) => (options.client ?? client).get({
9255
10081
  security: [{
@@ -9263,7 +10089,9 @@ export const databaseGetTable = (options) => (options.client ?? client).get({
9263
10089
  /**
9264
10090
  * Update table
9265
10091
  *
9266
- * Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseAddField, databaseUpdateField and databaseDeleteField.
10092
+ * Deprecated: use praxis.database.table.tables.update instead; this path stops working on 2027-03-01. Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseAddField, databaseUpdateField and databaseDeleteField.
10093
+ *
10094
+ * @deprecated
9267
10095
  */
9268
10096
  export const databaseUpdateTable = (options) => (options.client ?? client).patch({
9269
10097
  security: [{
@@ -9281,7 +10109,9 @@ export const databaseUpdateTable = (options) => (options.client ?? client).patch
9281
10109
  /**
9282
10110
  * Add field
9283
10111
  *
9284
- * Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
10112
+ * Deprecated: use praxis.database.table.tables.fields.create instead; this path stops working on 2027-03-01. Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
10113
+ *
10114
+ * @deprecated
9285
10115
  */
9286
10116
  export const databaseAddField = (options) => (options.client ?? client).post({
9287
10117
  security: [{
@@ -9299,7 +10129,9 @@ export const databaseAddField = (options) => (options.client ?? client).post({
9299
10129
  /**
9300
10130
  * Delete field
9301
10131
  *
9302
- * Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
10132
+ * Deprecated: use praxis.database.table.tables.fields.delete instead; this path stops working on 2027-03-01. Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
10133
+ *
10134
+ * @deprecated
9303
10135
  */
9304
10136
  export const databaseDeleteField = (options) => (options.client ?? client).delete({
9305
10137
  security: [{
@@ -9313,7 +10145,9 @@ export const databaseDeleteField = (options) => (options.client ?? client).delet
9313
10145
  /**
9314
10146
  * Update field
9315
10147
  *
9316
- * Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
10148
+ * Deprecated: use praxis.database.table.tables.fields.update instead; this path stops working on 2027-03-01. Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
10149
+ *
10150
+ * @deprecated
9317
10151
  */
9318
10152
  export const databaseUpdateField = (options) => (options.client ?? client).patch({
9319
10153
  security: [{
@@ -9331,7 +10165,9 @@ export const databaseUpdateField = (options) => (options.client ?? client).patch
9331
10165
  /**
9332
10166
  * List events
9333
10167
  *
9334
- * Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
10168
+ * Deprecated: use praxis.database.table.events.list for a table database or praxis.database.kv.events.list for a key-value database instead; this path stops working on 2027-03-01. Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
10169
+ *
10170
+ * @deprecated
9335
10171
  */
9336
10172
  export const databaseListEvents = (options) => (options.client ?? client).get({
9337
10173
  security: [{
@@ -9345,7 +10181,9 @@ export const databaseListEvents = (options) => (options.client ?? client).get({
9345
10181
  /**
9346
10182
  * Delete rows
9347
10183
  *
9348
- * Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
10184
+ * Deprecated: use praxis.database.table.rest.delete instead; this path stops working on 2027-03-01. Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
10185
+ *
10186
+ * @deprecated
9349
10187
  */
9350
10188
  export const databaseDelete = (options) => (options.client ?? client).delete({
9351
10189
  security: [{
@@ -9359,7 +10197,9 @@ export const databaseDelete = (options) => (options.client ?? client).delete({
9359
10197
  /**
9360
10198
  * Select rows
9361
10199
  *
9362
- * Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
10200
+ * Deprecated: use praxis.database.table.rest.retrieve instead; this path stops working on 2027-03-01. Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
10201
+ *
10202
+ * @deprecated
9363
10203
  */
9364
10204
  export const databaseSelect = (options) => (options.client ?? client).get({
9365
10205
  security: [{
@@ -9373,7 +10213,9 @@ export const databaseSelect = (options) => (options.client ?? client).get({
9373
10213
  /**
9374
10214
  * Count rows
9375
10215
  *
9376
- * Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
10216
+ * Deprecated: use praxis.database.table.rest.head instead; this path stops working on 2027-03-01. Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
10217
+ *
10218
+ * @deprecated
9377
10219
  */
9378
10220
  export const databaseHead = (options) => (options.client ?? client).head({
9379
10221
  security: [{
@@ -9387,7 +10229,9 @@ export const databaseHead = (options) => (options.client ?? client).head({
9387
10229
  /**
9388
10230
  * Update rows
9389
10231
  *
9390
- * Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
10232
+ * Deprecated: use praxis.database.table.rest.update instead; this path stops working on 2027-03-01. Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
10233
+ *
10234
+ * @deprecated
9391
10235
  */
9392
10236
  export const databaseUpdate = (options) => (options.client ?? client).patch({
9393
10237
  security: [{
@@ -9405,9 +10249,11 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
9405
10249
  /**
9406
10250
  * Insert rows
9407
10251
  *
9408
- * Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
10252
+ * Deprecated: use praxis.database.table.rest.create instead; this path stops working on 2027-03-01. Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
9409
10253
  * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
9410
10254
  * The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
10255
+ *
10256
+ * @deprecated
9411
10257
  */
9412
10258
  export const databaseInsert = (options) => (options.client ?? client).post({
9413
10259
  security: [{
@@ -9422,6 +10268,114 @@ export const databaseInsert = (options) => (options.client ?? client).post({
9422
10268
  ...options.headers
9423
10269
  }
9424
10270
  });
10271
+ /**
10272
+ * List keys
10273
+ *
10274
+ * Deprecated: use praxis.database.kv.keys.list instead; this path stops working on 2027-03-01. Browse the keys of a key-value database (kind kv): use it to see what is stored before reading one key with databaseGetKey; to run an arbitrary Redis command (counters, ranges, scans) use databaseExecuteCommand instead. Keys come back in lexicographic key order, one page at a time, as summaries (key, type, remaining TTL, size) without values; expired keys are never returned. pattern filters with a Redis glob (* ? [abc] [^abc]) matched against the whole key, and type keeps one value type. limit is 1–500, default 50; while next_cursor is a string, pass it back unchanged as cursor for the next page; null means this is the last page. Needs a read credential. Errors: 400 INVALID_PARAMS for a limit outside 1–500 or a malformed query; 404 DATABASE_NOT_FOUND for an unknown id; 409 DATABASE_KIND_MISMATCH when the database is a table database.
10275
+ *
10276
+ * @deprecated
10277
+ */
10278
+ export const databaseListKeys = (options) => (options.client ?? client).get({
10279
+ security: [{
10280
+ key: 'database-bearerAuth',
10281
+ scheme: 'bearer',
10282
+ type: 'http'
10283
+ }],
10284
+ url: '/database/v1/databases/{database_id}/keys',
10285
+ ...options
10286
+ });
10287
+ /**
10288
+ * Delete key
10289
+ *
10290
+ * Deprecated: use praxis.database.kv.keys.delete instead; this path stops working on 2027-03-01. Delete one key of a key-value database together with its value; the data cannot be recovered. A key that is absent or has already expired is not an error: the call succeeds with deleted false, so it is safe to retry. To delete many keys at once or by pattern, list them with databaseListKeys or run DEL / UNLINK through databaseExecuteCommand. Needs a read-write credential. Errors: 404 DATABASE_NOT_FOUND for an unknown id; 409 DATABASE_KIND_MISMATCH for a table database; 403 BINDING_READ_ONLY for a read-only credential.
10291
+ *
10292
+ * @deprecated
10293
+ */
10294
+ export const databaseDeleteKey = (options) => (options.client ?? client).delete({
10295
+ security: [{
10296
+ key: 'database-bearerAuth',
10297
+ scheme: 'bearer',
10298
+ type: 'http'
10299
+ }],
10300
+ url: '/database/v1/databases/{database_id}/keys/{key}',
10301
+ ...options
10302
+ });
10303
+ /**
10304
+ * Get key
10305
+ *
10306
+ * Deprecated: use praxis.database.kv.keys.retrieve instead; this path stops working on 2027-03-01. Read one key of a key-value database with its type, TTL, size and value; use databaseListKeys first to find key names. A string value is returned whole. A hash, list, set or zset is returned a page of entries at a time: limit is 1–1000, default 100, and while next_cursor is a string, pass it back unchanged as cursor to read the next page; string values and the last page return next_cursor null. value takes the shape of type: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}]. Needs a read credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS for a limit outside 1–1000; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH for a table database.
10307
+ *
10308
+ * @deprecated
10309
+ */
10310
+ export const databaseGetKey = (options) => (options.client ?? client).get({
10311
+ security: [{
10312
+ key: 'database-bearerAuth',
10313
+ scheme: 'bearer',
10314
+ type: 'http'
10315
+ }],
10316
+ url: '/database/v1/databases/{database_id}/keys/{key}',
10317
+ ...options
10318
+ });
10319
+ /**
10320
+ * Update key
10321
+ *
10322
+ * Deprecated: use praxis.database.kv.keys.update instead; this path stops working on 2027-03-01. Change only the TTL of an existing key of a key-value database, leaving its value alone. update_mask must be ttl_ms (the only writable field) and ttl_ms is required: a positive integer is the new TTL in milliseconds (Redis PEXPIRE), null removes the TTL so the key never expires (PERSIST). To replace the value use databaseSetKey. Returns the key after the change. Needs a read-write credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS when update_mask is not ttl_ms or ttl_ms is neither a positive integer nor null; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY.
10323
+ *
10324
+ * @deprecated
10325
+ */
10326
+ export const databaseUpdateKey = (options) => (options.client ?? client).patch({
10327
+ security: [{
10328
+ key: 'database-bearerAuth',
10329
+ scheme: 'bearer',
10330
+ type: 'http'
10331
+ }],
10332
+ url: '/database/v1/databases/{database_id}/keys/{key}',
10333
+ ...options,
10334
+ headers: {
10335
+ 'Content-Type': 'application/json',
10336
+ ...options.headers
10337
+ }
10338
+ });
10339
+ /**
10340
+ * Set key
10341
+ *
10342
+ * Deprecated: use praxis.database.kv.keys.set instead; this path stops working on 2027-03-01. Overwrite one key of a key-value database with a whole new value in a single transaction, creating it if absent; the previous value is dropped first and never merged, even when the type changes. To change only the TTL use databaseUpdateKey; to add to a counter or push onto a list use databaseExecuteCommand. type decides the shape of value: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}] with finite scores. Containers must not be empty, and hash fields and set members must be unique. ttl_ms omitted keeps the key's existing TTL, a positive integer sets a new one in milliseconds, null makes the key permanent. A value is at most 1 MiB and a key at most 1 KiB. Returns the stored key (first page for a container). Needs a read-write credential. Errors: 400 INVALID_PARAMS for an empty container, duplicate field or member, non-finite score or bad ttl_ms; 400 LIMIT_EXCEEDED for an oversized key or value; 503 CAPACITY when the database is full; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY for a read-only credential.
10343
+ *
10344
+ * @deprecated
10345
+ */
10346
+ export const databaseSetKey = (options) => (options.client ?? client).put({
10347
+ security: [{
10348
+ key: 'database-bearerAuth',
10349
+ scheme: 'bearer',
10350
+ type: 'http'
10351
+ }],
10352
+ url: '/database/v1/databases/{database_id}/keys/{key}',
10353
+ ...options,
10354
+ headers: {
10355
+ 'Content-Type': 'application/json',
10356
+ ...options.headers
10357
+ }
10358
+ });
10359
+ /**
10360
+ * Execute command
10361
+ *
10362
+ * Deprecated: use praxis.database.kv.commands.execute instead; this path stops working on 2027-03-01. Run one Redis command with Redis 7 semantics against a key-value database and get its reply; use it for what the key operations cannot do: counters (INCR), list and set operations, ranges (LRANGE, ZRANGE), scans (SCAN, HSCAN) and expiry commands. For one whole-value read or write use databaseGetKey / databaseSetKey; for existing Redis clients use the Upstash-compatible face under /redis. command is the command name followed by its arguments, every element a string, for example ["SET","k","v"] or ["LRANGE","queue","0","9"]. result is Redis's reply as plain JSON (integers, strings, arrays, null), never base64. Not supported: Lua scripting (EVAL), blocking commands, Pub/Sub and Streams. A value is at most 1 MiB, a key at most 1 KiB, a reply at most 8 MiB (read big collections in ranges with SCAN, HSCAN, LRANGE or ZRANGE) and the database at most 1 GiB. A read command needs a read credential; a write command, or a command that cannot be parsed, needs a read-write credential. Errors: 400 KV_COMMAND_ERROR when Redis rejects the command, with Redis's own text in message (for example WRONGTYPE Operation against a key holding the wrong kind of value or ERR unknown command); 400 INVALID_PARAMS for a missing or empty command; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY for a write on a read-only credential.
10363
+ *
10364
+ * @deprecated
10365
+ */
10366
+ export const databaseExecuteCommand = (options) => (options.client ?? client).post({
10367
+ security: [{
10368
+ key: 'database-bearerAuth',
10369
+ scheme: 'bearer',
10370
+ type: 'http'
10371
+ }],
10372
+ url: '/database/v1/databases/{database_id}/commands',
10373
+ ...options,
10374
+ headers: {
10375
+ 'Content-Type': 'application/json',
10376
+ ...options.headers
10377
+ }
10378
+ });
9425
10379
  /**
9426
10380
  * Read a commit's test catalog
9427
10381
  *
@@ -9715,7 +10669,7 @@ export const devopsTestReportsUpload = (options) => (options.client ?? client).p
9715
10669
  /**
9716
10670
  * Retrieve the merge gate's test plan at a commit
9717
10671
  *
9718
- * Ask what the merge gate would require at one commit before running anything: the packages the base...commit diff affects, each package's input hash at that commit's own tree, and whether evidence already answers it. Read a package as passed when a recorded run covered every case the package has at the gate's sizes and they passed, failed when the newest evidence at its input hash failed, and missing when no run has a row for that (package, input hash). Use it before running tests — run `praxis devops test <package>` for each missing or failed package on a clean, pushed commit and the run files the evidence itself — or to explain a gate verdict, because it is the same required set and the same (package, input hash) lookup the gate itself decides on. The call is read-only: it starts no run, runs no case and writes nothing. The commit must already be pushed, since the hashes are recomputed from the tree GitHub holds; a commit whose tree cannot be read answers COMMIT_NOT_FOUND instead of an empty plan. A selection of nothing means every changed path belongs to no test package, which is a pass and not a failure.
10672
+ * Ask what the merge gate would require at one commit before running anything: the packages the base...commit diff affects, each package's input hash at that commit's own tree, and whether evidence already answers it. The answer also carries cases: every feature scenario of the affected packages at the gate's sizes, each with required (whether this diff can affect it, chosen by the files the scenario was recorded running), the reason, the deps hash it is judged at and its own evidence. A merge needs evidence only for the required cases; run `praxis devops test <package> --record-impact` to record coverage and results. Read a package as passed when a recorded run covered every case the package has at the gate's sizes and they passed, failed when the newest evidence at its input hash failed, and missing when no run has a row for that (package, input hash). Use it before running tests — run `praxis devops test <package>` for each missing or failed package on a clean, pushed commit and the run files the evidence itself — or to explain a gate verdict, because it is the same required set and the same (package, input hash) lookup the gate itself decides on. The call is read-only: it starts no run, runs no case and writes nothing. The commit must already be pushed, since the hashes are recomputed from the tree GitHub holds; a commit whose tree cannot be read answers COMMIT_NOT_FOUND instead of an empty plan. A selection of nothing means every changed path belongs to no test package, which is a pass and not a failure.
9719
10673
  */
9720
10674
  export const devopsTestPlanGet = (options) => (options.client ?? client).get({
9721
10675
  security: [{
@@ -9740,6 +10694,42 @@ export const devopsProjectsList = (options) => (options?.client ?? client).get({
9740
10694
  url: '/devops/v1/projects',
9741
10695
  ...options
9742
10696
  });
10697
+ /**
10698
+ * Create a project
10699
+ *
10700
+ * Create a delivery project and its two default environments (develop, production). The code lives in one of two places. Our own Git: pass provider platform and package, the id (pkg_...) of a git package in your organization's registry (the registry domain lists packages and creates git libraries); there is no install flow and no connection, the project records the provider, the package and the package's default branch, and from then on pull requests, the merge gate, changes and cloud workspaces use that package and DevOps merges a pull request itself. A package backs at most one project (REPOSITORY_ALREADY_BOUND) and a package that is not a git package of your organization is INVALID_ARGUMENT. If the package has no default branch yet, which is usual for a library imported from elsewhere, pass initialRef, an existing branch such as import: the default branch is created at its head while the project is created, and no change can be opened before it exists. If the default branch already exists the call is refused with DEFAULT_BRANCH_EXISTS, and a missing initialRef branch with REF_NOT_FOUND; neither leaves a project behind. For a package whose project already exists, use devops.projects.initializeDefaultBranch instead. GitHub (the default): pass the connection of a completed GitHub App install and the repository (owner/name) it can see; leave both out to create a project with no repository yet. A name must be kebab-case and unused in the organization (PROJECT_NAME_TAKEN).
10701
+ */
10702
+ export const devopsProjectsCreate = (options) => (options.client ?? client).post({
10703
+ security: [{
10704
+ key: 'devops-bearerAuth',
10705
+ scheme: 'bearer',
10706
+ type: 'http'
10707
+ }],
10708
+ url: '/devops/v1/projects',
10709
+ ...options,
10710
+ headers: {
10711
+ 'Content-Type': 'application/json',
10712
+ ...options.headers
10713
+ }
10714
+ });
10715
+ /**
10716
+ * Create a project's default branch
10717
+ *
10718
+ * Create the default branch of a project on our own Git, once. A git package imported from elsewhere can hold branches and no default branch, and every change is cut from the default branch, so until it exists no change can be opened. The default branch is protected and only DevOps holds the credential that may write it, so this call is the one way to create it: it points the default branch at the head of the existing branch named in from (for example import). It only creates: a default branch that already exists is refused with DEFAULT_BRANCH_EXISTS and is never moved, a from that is not a branch of the repository is REF_NOT_FOUND, and a GitHub project is INVALID_ARGUMENT because GitHub's branches are GitHub's. The push reaches the project like any other push to its default branch. Read the project first (devops.projects.retrieve) for the package's default branch name.
10719
+ */
10720
+ export const devopsProjectsInitializeDefaultBranch = (options) => (options.client ?? client).post({
10721
+ security: [{
10722
+ key: 'devops-bearerAuth',
10723
+ scheme: 'bearer',
10724
+ type: 'http'
10725
+ }],
10726
+ url: '/devops/v1/projects/{id}/default-branch:initialize',
10727
+ ...options,
10728
+ headers: {
10729
+ 'Content-Type': 'application/json',
10730
+ ...options.headers
10731
+ }
10732
+ });
9743
10733
  /**
9744
10734
  * Retrieve a project
9745
10735
  *
@@ -9839,7 +10829,7 @@ export const devopsReleasesAbandon = (options) => (options.client ?? client).pos
9839
10829
  /**
9840
10830
  * Create a promotion
9841
10831
  *
9842
- * Promote a release into one environment: this is the operation that actually schedules a deployment. Name the release and the environment; path is regular for an ordinary promotion, targeted to deploy only the targets you list, patch to carry a patch release, and rollback to return the environment to an earlier release. A regular promotion promotes EVERY target the release changed in that environment and refuses a targets list (to promote a subset use path targeted, so a narrowing is never silently ignored). A targeted promotion requires targets: each item is a target id from the target list or the workspace path the console shows (services/devops), and the call resolves the path to the id. A target the release does not carry is refused with the targets the release does deploy; so is a target this environment never runs. Naming a target also deploys the targets it depends on, which come first and are reported in plan.addedDependencies. The targets that changed but were not named are listed in plan.skipped with reason not_requested, so a reader sees what the promotion left behind. Callees upgrade first by default: naming a target brings the targets it depends on, because a caller cannot run on a callee it did not deploy. To leave one of those callees behind, pass withoutCallees, a list of { target, reason } on a targeted promotion. Each entry names a callee the named targets depend on — by target id or workspace path, as in targets — and carries a required, non-empty reason, because an exception nobody can justify afterwards is indistinguishable from a mistake. An excluded callee is subtracted rather than deferred: it is not deployed, and a target that entered the plan only through it leaves the plan too, so nothing is deployed that would have needed it. The exclusion is visible in the plan (plan.skipped with reason callee_excluded, carrying the reason in message) and on the promotion (withoutCallees), and a retry repeats it. Excluding a target you named is refused (take it out of targets instead), as is excluding a target the named ones do not depend on; a regular promotion refuses withoutCallees the same way it refuses targets. A targeted promotion's success verifies only the targets it deployed, not the whole release, so the upstream gate still requires the untouched targets before a later environment may take them. The service reads the environment's promotion order and refuses when an upstream environment has not verified this release yet, unless a bypass carries the authorization for that gate. An environment takes one promotion at a time, so a create while another is running is queued behind it rather than refused; only a regular promotion supersedes waiting regular ones, and a targeted promotion neither overtakes another ride nor is overtaken. Set validateOnly to read the plan and its refusals — layers, skipped targets, pending migrations, missing configuration keys — without scheduling anything, which is the safe way to find out what a promotion will do; the same plan is on the promotion this call answers and on `praxis api devops promotion get`, which reads it again with the promotion's progress as the rollout advances. patch and rollback are not creatable here yet and are refused with NOT_IMPLEMENTED. The answer is the promotion: the plan it will execute is in its plan field (layers, skipped, refusals, pending migrations) and its progress is in state; `praxis api devops promotion get <id>` shows both again at any time. With an environment that requires approval the promotion waits in awaiting_approval until `praxis api devops promotion approve`.
10832
+ * Promote a release into one environment: this is the operation that actually schedules a deployment. Name the release and the environment; path is regular for an ordinary promotion, targeted to deploy only the targets you list, patch to carry a patch release, and rollback to return the environment to an earlier release. A regular promotion promotes EVERY target the release changed in that environment and refuses a targets list (to promote a subset use path targeted, so a narrowing is never silently ignored). A targeted promotion requires targets: each item is a target id from the target list or the workspace path the console shows (services/devops), and the call resolves the path to the id. A target the release does not carry is refused with the targets the release does deploy; so is a target this environment never runs. Naming a target also deploys the targets it depends on, which come first and are reported in plan.addedDependencies. The targets that changed but were not named are listed in plan.skipped with reason not_requested, so a reader sees what the promotion left behind. Callees upgrade first by default: naming a target brings the targets it depends on, because a caller cannot run on a callee it did not deploy. To skip that on purpose, pass dependencies skip, a forced express that deploys only the named targets and records that it did so (see dependencies). Every promotion runs one version of the deploy engine, resolved from the project's settings.deploy.engine when the promotion is created and recorded as engineVersion; a request that engine version cannot serve is refused with ENGINE_TOO_OLD, which names the option and the first version that has it. To leave one of those callees behind, pass withoutCallees, a list of { target, reason } on a targeted promotion. Each entry names a callee the named targets depend on — by target id or workspace path, as in targets — and carries a required, non-empty reason, because an exception nobody can justify afterwards is indistinguishable from a mistake. An excluded callee is subtracted rather than deferred: it is not deployed, and a target that entered the plan only through it leaves the plan too, so nothing is deployed that would have needed it. The exclusion is visible in the plan (plan.skipped with reason callee_excluded, carrying the reason in message) and on the promotion (withoutCallees), and a retry repeats it. Excluding a target you named is refused (take it out of targets instead), as is excluding a target the named ones do not depend on; a regular promotion refuses withoutCallees the same way it refuses targets. A targeted promotion's success verifies only the targets it deployed, not the whole release, so the upstream gate still requires the untouched targets before a later environment may take them. The service reads the environment's promotion order and refuses when an upstream environment has not verified this release yet, unless a bypass carries the authorization for that gate. An environment takes one promotion at a time, so a create while another is running is queued behind it rather than refused; only a regular promotion supersedes waiting regular ones, and a targeted promotion neither overtakes another ride nor is overtaken. Set validateOnly to read the plan and its refusals — layers, skipped targets, pending migrations, missing configuration keys — without scheduling anything, which is the safe way to find out what a promotion will do; the answer then carries validateOnly true and the placeholder id prm_validate_only, because nothing was stored and there is no promotion to read again; the same plan is on the promotion a real call answers and on `praxis api devops promotion get`, which reads it again with the promotion's progress as the rollout advances. patch and rollback are not creatable here yet and are refused with NOT_IMPLEMENTED: a rollback is created with environments.rollback, not with path rollback on this call. An environment whose blocksLater is true stays held during its observation window: a promotion created for it waits queued (its stateDescription names the promotion it waits for) until promotions.conclude ends the window, and the environment list shows the queue as busy with that promotion as active. A promotion in which every rollout was skipped as artifact_identical (the change did not alter the built artifact, such as a comment) succeeds and moves the checkpoints but deploys nothing; promotions.retrieve counts it in summary.identical. The answer is the promotion: the plan it will execute is in its plan field (layers, skipped, refusals, pending migrations) and its progress is in state; `praxis api devops promotion get <id>` shows both again at any time. With an environment that requires approval the promotion waits in awaiting_approval until `praxis api devops promotion approve`.
9843
10833
  */
9844
10834
  export const devopsPromotionsCreate = (options) => (options.client ?? client).post({
9845
10835
  security: [{
@@ -9857,7 +10847,7 @@ export const devopsPromotionsCreate = (options) => (options.client ?? client).po
9857
10847
  /**
9858
10848
  * List promotions
9859
10849
  *
9860
- * List the project's promotions, newest first, across every environment. Use it to see what is queued, what is observing, and what finished recently, without reading each environment separately. A promotion in a terminal state stays in this list, which is how a caller tells "never promoted" apart from "promoted and then rolled back". Neither filter nor orderBy is accepted yet, so page through with pageToken instead of narrowing the query.
10850
+ * List the project's promotions, newest first, across every environment. Use it to see what is queued, what is observing, and what finished recently, without reading each environment separately. A promotion in a terminal state stays in this list, which is how a caller tells "never promoted" apart from "promoted and then rolled back". The one filter is the forced query parameter (true or false, sent as text in the query string); a filter expression and orderBy are not accepted yet, so page through with pageToken instead of narrowing further.
9861
10851
  */
9862
10852
  export const devopsPromotionsList = (options) => (options.client ?? client).get({
9863
10853
  security: [{
@@ -9871,7 +10861,7 @@ export const devopsPromotionsList = (options) => (options.client ?? client).get(
9871
10861
  /**
9872
10862
  * Retrieve a promotion
9873
10863
  *
9874
- * Read one promotion: its state, its approval, its plan, and the failure that stopped it when there is one. Poll this after creating a promotion to follow it to a terminal state, or read it to find out why a deployment stopped — failure.cause tells plan refusal apart from a failed deploy, and executor names the runs involved. Pass expand=rollouts to receive the per-target rollouts in the same answer instead of listing them separately. state observing means the environment is deployed and the observation window is running, so the promotion is not finished and conclude is still to come. The plan is in the plan field of the answer (null until one is made) and the promotion's state is in state, so this is where to read both before approve (needs awaiting_approval) or conclude (needs observing).
10864
+ * Read one promotion: its state, its approval, its plan, and the failure that stopped it when there is one. Poll this after creating a promotion to follow it to a terminal state, or read it to find out why a deployment stopped — failure.cause tells plan refusal apart from a failed deploy, and executor names the runs involved. Pass expand=rollouts to receive the per-target rollouts in the same answer instead of listing them separately. state observing means the environment is deployed and the observation window is running, so the promotion is not finished and conclude is still to come; the window holds the environment, so a promotion queued behind it waits until conclude. Once a rollout has ended, summary says how many targets were really deployed (deployed), how many were skipped as artifact_identical (identical: the change did not alter the built artifact, such as a comment, so nothing was deployed although the promotion succeeds and its checkpoints advance) and how many ended any other way (other). The plan is in the plan field of the answer (null until one is made) and the promotion's state is in state, so this is where to read both before approve (needs awaiting_approval) or conclude (needs observing).
9875
10865
  */
9876
10866
  export const devopsPromotionsGet = (options) => (options.client ?? client).get({
9877
10867
  security: [{
@@ -9885,7 +10875,7 @@ export const devopsPromotionsGet = (options) => (options.client ?? client).get({
9885
10875
  /**
9886
10876
  * Approve or reject a promotion
9887
10877
  *
9888
- * Answer the approval an environment asked for: send approved true to let the promotion proceed, false to reject it and end it in approval_rejected. This is the environment-level gate an environment with requireApproval raises, not the per-rollout approval. Comment records the reasoning next to the decision, which is what a later reader sees instead of the bare verdict. The call is refused with PROMOTION_NOT_AWAITING_APPROVAL when the promotion is not waiting for one, so a stale approval cannot restart something that already finished. Approving is attributed to the credential that sends it. It needs state awaiting_approval, which `praxis api devops promotion get <id>` shows in state; read the plan field there first, because the decision is about that plan. Approving a plan that names another commit than the one now planned is refused with PLAN_STALE; create the promotion again.
10878
+ * Not supported yet (Sean 2026-11-27: approvals return as a step of the workflow engine): every call answers 409 ENGINE_UNSUPPORTED, and an environment that requires approval is refused when a promotion into it is created, so no promotion waits for an answer.
9889
10879
  */
9890
10880
  export const devopsPromotionsApprove = (options) => (options.client ?? client).post({
9891
10881
  security: [{
@@ -9935,7 +10925,7 @@ export const devopsPromotionsRetry = (options) => (options.client ?? client).pos
9935
10925
  /**
9936
10926
  * Conclude an observation
9937
10927
  *
9938
- * Record the verdict on a promotion that is observing: send keep to accept the deployment as the environment's new state, or rollback to record it as unhealthy. This is the decision the observation window exists for, so a promotion in observing state stays open until it is concluded; reason is stored as the attribution. Concluding with rollback only records the verdict: the observation closes unhealthy and the promotion fails with observation_failed, but the deployment is not moved. To move the deployment back, call `praxis api devops environment rollback <environment_id>` (that one deploys the earlier release again). A promotion that is not observing is refused with PROMOTION_NOT_OBSERVING, which is how a caller tells "already concluded" apart from a call that had no effect. It needs state observing, which `praxis api devops promotion get <id>` shows in state.
10928
+ * Retired with the observation window (ticket-4240): a promotion ends when its deploy ends, so no promotion is ever observing and every call answers 409 PROMOTION_NOT_OBSERVING. Watching production after a release is its author's own work; to undo a release use environments.rollback, which also takes the culprit Change this call used to record.
9939
10929
  */
9940
10930
  export const devopsPromotionsConclude = (options) => (options.client ?? client).post({
9941
10931
  security: [{
@@ -9950,6 +10940,20 @@ export const devopsPromotionsConclude = (options) => (options.client ?? client).
9950
10940
  ...options.headers
9951
10941
  }
9952
10942
  });
10943
+ /**
10944
+ * Get the checkout credential of a running promotion
10945
+ *
10946
+ * Issue the credential the deploy machine fetches a platform-Git project's code with. The caller is the deploy machine itself, during a run: its `devops/prepare` step sends the API key it already holds and receives the clone URL of the project's repository plus a pull-only credential for exactly that one repository. The credential lives 15 minutes and is issued again on every request, so it never sits in the run's stored input or log, and a leaked copy is useless almost at once. A run that needs the code later, such as an engine checkout after a long install, asks again. It answers only while the promotion is deploying (a rollback is a promotion and deploys too) or halted; a promotion that is queued, waiting for approval, observing or finished is refused with PROMOTION_NOT_RUNNING, because no machine should be fetching code for it. A project whose code is on GitHub is refused with SOURCE_NOT_PLATFORM: its checkout uses the GitHub App token, not this. The key must belong to the promotion's organization, the same check as reading the promotion with `praxis api devops promotion get <id>`. People do not need this call: to read a platform project's code use the code browser calls instead.
10947
+ */
10948
+ export const devopsPromotionsCheckoutCredential = (options) => (options.client ?? client).post({
10949
+ security: [{
10950
+ key: 'devops-bearerAuth',
10951
+ scheme: 'bearer',
10952
+ type: 'http'
10953
+ }],
10954
+ url: '/devops/v1/promotions/{id}:checkoutCredential',
10955
+ ...options
10956
+ });
9953
10957
  /**
9954
10958
  * List a promotion's rollouts
9955
10959
  *
@@ -10027,7 +11031,7 @@ export const devopsEnvironmentsCheckpointsList = (options) => (options.client ??
10027
11031
  /**
10028
11032
  * Roll an environment back
10029
11033
  *
10030
- * Put targets of an environment back on the versions they ran before, the way Cloud Deploy rolls a target back: the earlier release is deployed again, and the live version and the deployment state move back together, so the next promotion does not quietly undo it. With no targets it undoes the environment's latest successful promotion, every target that promotion deployed; targets narrows that to some of them, by target id or workspace path such as services/agent. Each target returns to the version it ran just before that promotion; toRelease names an older release instead, which must be one every target has already run in this environment. Callers go back before their callees, and a caller that the undone promotion deployed together with a callee you roll back is brought along (listed in plan.addedDependencies). The request is the approval: reason is recorded as the approval comment, so the rollback does not wait in awaiting_approval, and a promotion still in its observation window is concluded as rolled back. Database migrations are not reversed. Send validateOnly true to see the plan without creating anything. Refusals: ROLLBACK_NOTHING_TO_ROLL_BACK when no promotion has succeeded here, ROLLBACK_NO_PREVIOUS when a target has no earlier version, ROLLBACK_AMBIGUOUS when the targets ran different earlier releases (roll them back separately or name toRelease), ROLLBACK_NOT_RUN_HERE when toRelease carries a version a target never ran here.
11034
+ * Put targets of an environment back on the versions they ran before, the way Cloud Deploy rolls a target back: the earlier release is deployed again, and the live version and the deployment state move back together, so the next promotion does not quietly undo it. With no targets it undoes the environment's latest successful promotion, every target that promotion deployed; targets narrows that to some of them, by target id or workspace path such as services/agent. Each target returns to the version it ran just before that promotion; toRelease names an older release instead, which must be one every target has already run in this environment. Callers go back before their callees, and a caller that the undone promotion deployed together with a callee you roll back is brought along (listed in plan.addedDependencies). The request is the approval: reason is recorded as the approval comment, so the rollback does not wait in awaiting_approval, and a promotion still in its observation window is concluded as rolled back. Database migrations are not reversed. Send validateOnly true to see the plan without creating anything; the answer then carries validateOnly true and the placeholder id prm_validate_only, because no promotion was stored. This is the way to create a rollback; promotions.create does not take path rollback. Refusals: ROLLBACK_NOTHING_TO_ROLL_BACK when no promotion has succeeded here, ROLLBACK_NO_PREVIOUS when a target has no earlier version, ROLLBACK_AMBIGUOUS when the targets ran different earlier releases (roll them back separately or name toRelease), ROLLBACK_NOT_RUN_HERE when toRelease carries a version a target never ran here.
10031
11035
  */
10032
11036
  export const devopsEnvironmentsRollback = (options) => (options.client ?? client).post({
10033
11037
  security: [{
@@ -10501,7 +11505,7 @@ export const devopsPullRequestsList = (options) => (options.client ?? client).ge
10501
11505
  /**
10502
11506
  * Retrieve a pull request
10503
11507
  *
10504
- * Read one pull request in full: its state, its head and base, its changed paths, the exposure its description declares, and — the part this call exists for — its gate. The gate is a list of named checks (the declaration, the flag duties, the affected tests, and the one judgement only a person makes), each with a result and, when it failed or is pending, the sentence saying what is missing; the gate's own state is passed only when no check failed and none is still pending. Read the gate here before merging or before recording a verdict, and read it again after a rerun: the checks are facts about the current head, and a new head starts a new gate. Add expand=runs to also get the affected test runs reported at the head commit, newest first, which is how you see why the tests check came out the way it did.
11508
+ * Read one pull request in full: its state, its head and base, its changed paths, the exposure its description declares, and — the part this call exists for — its gate. The gate is a list of named checks (the declaration, the flag duties, the affected tests, and the one judgement only a person makes), each with a result and, when it failed or is pending, the sentence saying what is missing; the tests check is never pending, because DevOps runs no tests for a pull request: it is passed, or failed naming the missing or failed cases and the command `praxis devops test <package> --record-impact` the author runs on the pushed head; the gate's own state is passed only when no check failed and none is still pending. Read the gate here before merging or before recording a verdict, and read it again after a rerun: the checks are facts about the current head, and a new head starts a new gate. Add expand=runs to also get the test runs reported at the head commit (uploaded by the author, never started by DevOps), newest first.
10505
11509
  */
10506
11510
  export const devopsPullRequestsGet = (options) => (options.client ?? client).get({
10507
11511
  security: [{
@@ -10515,7 +11519,7 @@ export const devopsPullRequestsGet = (options) => (options.client ?? client).get
10515
11519
  /**
10516
11520
  * Decide a pull request's merge gate again
10517
11521
  *
10518
- * Decide the merge gate again at the pull request's current head and report the result on GitHub as the "Praxis DevOps / gate" check run. Use it when a fact the gate reads has changed without a new push — a test run finished, a flag was registered, or a check that had no evidence now has some — so nobody has to push an empty commit to make the check move. The answer is the pull request with the gate it now reaches. A head whose earlier gate already had a verdict and comes back pending opens a NEW check run, because GitHub will not reopen a completed one; while the same head is still deciding, the run it already owns is updated in place. Nothing else on the pull request changes, and repeating the call is safe: the same facts decide the same gate.
11522
+ * Decide the merge gate again at the pull request's current head and report the result on GitHub as the "Praxis DevOps / gate" check run. Use it when a fact the gate reads has changed without a new push — a flag was registered, or a check that had no evidence now has some (test evidence uploaded for the head already decides the gate again by itself) — so nobody has to push an empty commit to make the check move. The answer is the pull request with the gate it now reaches. A head whose earlier gate already had a verdict and comes back pending opens a NEW check run, because GitHub will not reopen a completed one; while the same head is still deciding, the run it already owns is updated in place. Nothing else on the pull request changes, and repeating the call is safe: the same facts decide the same gate.
10519
11523
  */
10520
11524
  export const devopsPullRequestsRerunGate = (options) => (options.client ?? client).post({
10521
11525
  security: [{
@@ -10529,7 +11533,7 @@ export const devopsPullRequestsRerunGate = (options) => (options.client ?? clien
10529
11533
  /**
10530
11534
  * Merge a pull request through its gate
10531
11535
  *
10532
- * Land a pull request by having DevOps call GitHub, so the merge goes through the platform's own merge gate instead of around it. The gate is the permission: while the gate is pending or failed the merge is refused with GATE_NOT_PASSED, and a pull request that is already merged or closed is refused with PULL_REQUEST_NOT_OPEN. Only the commit the gate decided on may land — that commit is sent to GitHub as the merge sha, so a head that moved underneath is refused with HEAD_MOVED rather than merged untested — and GitHub's own refusal, such as a conflict, comes back as MERGE_REFUSED carrying its words. method picks the merge shape and defaults to merge. queue true does not merge now: it puts the pull request into its (project, base) merge queue, where the commit that eventually lands is one GitHub built from the current base and a test run proved. Send requestId to make a retry safe — a retry that reaches a pull request DevOps itself already merged answers that merge without calling GitHub again; it does not make the merge wait. Merging something already merged by somebody else stays a refusal rather than a replay.
11536
+ * Land a pull request by having DevOps call GitHub, so the merge goes through the platform's own merge gate instead of around it. The gate is the permission: while the gate is pending or failed the merge is refused with GATE_NOT_PASSED, and a pull request that is already merged or closed is refused with PULL_REQUEST_NOT_OPEN. Only the commit the gate decided on may land — that commit is sent to GitHub as the merge sha, so a head that moved underneath is refused with HEAD_MOVED rather than merged untested — and GitHub's own refusal, such as a conflict, comes back as MERGE_REFUSED carrying its words. method picks the merge shape; on GitHub it defaults to rebase. A project on our own Git (provider platform) merges by squash only: no method means squash, and rebase or merge is refused with INVALID_ARGUMENT naming squash. queue true does not merge now: it puts the pull request into its (project, base) merge queue, where the commit that eventually lands is one GitHub built from the current base and a test run proved. Send requestId to make a retry safe — a retry that reaches a pull request DevOps itself already merged answers that merge without calling GitHub again; it does not make the merge wait. Merging something already merged by somebody else stays a refusal rather than a replay.
10533
11537
  */
10534
11538
  export const devopsPullRequestsMerge = (options) => (options.client ?? client).post({
10535
11539
  security: [{
@@ -10545,9 +11549,9 @@ export const devopsPullRequestsMerge = (options) => (options.client ?? client).p
10545
11549
  }
10546
11550
  });
10547
11551
  /**
10548
- * Record a gatekeeper's verdict on a direct change
11552
+ * Record a review verdict on a pull request
10549
11553
  *
10550
- * A gatekeeper's judgement of a change declared direct — the one gate check a person answers, because a direct change has no flag to hold it back. Send result passed to let it through, or failed to hold it, with reason saying in a sentence a reviewer can act on why; the reason becomes the message of the gate's exposure-judged check. The verdict is about ONE commit: headSha must be the pull request's current head, and a verdict for any other commit is refused with INVALID_ARGUMENT rather than applied, because a judgement of a version nobody reviewed must never pass the version that is there now — so a recorded verdict stops applying the moment the head moves, and the new head must be judged on its own. Recording it decides the gate again, so a passed verdict makes the gate passed once every other check has too, and the answer is the pull request with the gate it now reaches. A passed verdict for a change whose tests have not run leaves the gate pending: a person's judgement never outvotes a missing test.
11554
+ * Record a reviewer's verdict on a pull request, after the fact (Sean 2026-11-24). The merge gate no longer waits for it: exposure-judged is decided by machine from the declaration for every kind of exposure, so a pull request merges without any verdict. This call is the review record — send result passed or failed with reason saying in a sentence a reviewer can act on why. It is stored on the pull request as review and announced with the event devops.pullRequest.reviewed. A failed verdict on an already merged pull request is a finding for follow-up (the event says finding true): the merge stands, nothing is un-merged, and a rollback or a fix is asked for on the ticket. headSha must be the pull request's head, and a verdict for another commit is refused with INVALID_ARGUMENT. List the merged pull requests nobody reviewed with pullRequests.list reviewed=false.
10551
11555
  */
10552
11556
  export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? client).post({
10553
11557
  security: [{
@@ -10580,6 +11584,24 @@ export const devopsPullRequestsClose = (options) => (options.client ?? client).p
10580
11584
  ...options.headers
10581
11585
  }
10582
11586
  });
11587
+ /**
11588
+ * Review a pull request on our own Git
11589
+ *
11590
+ * Give your verdict on a pull request whose project keeps its code on the platform's own Git, where there is no GitHub to hold reviews. The reviewer is you — the user or agent the credential names, never a name in the body — and the platform stores your verdict on the pull request's reviewers under your id, so an ownership rule that lists principal ids reads it. Send approved to approve, changes_requested to hold it with changes you want, or commented to say something without a verdict. A second review from you replaces your first, and the gate is decided again so a rule that reads reviews sees it at once. Only an open pull request is reviewed: a merged or closed one is refused with PULL_REQUEST_NOT_OPEN. A project connected to GitHub is refused with INVALID_ARGUMENT, because its reviews belong to GitHub and the platform projects them from there, so a verdict is never recorded in two places that can disagree.
11591
+ */
11592
+ export const devopsPullRequestsReviewsCreate = (options) => (options.client ?? client).post({
11593
+ security: [{
11594
+ key: 'devops-bearerAuth',
11595
+ scheme: 'bearer',
11596
+ type: 'http'
11597
+ }],
11598
+ url: '/devops/v1/pull-requests/{id}/reviews',
11599
+ ...options,
11600
+ headers: {
11601
+ 'Content-Type': 'application/json',
11602
+ ...options.headers
11603
+ }
11604
+ });
10583
11605
  /**
10584
11606
  * List connections
10585
11607
  *
@@ -10725,7 +11747,7 @@ export const devopsTestRunsRetryFailed = (options) => (options.client ?? client)
10725
11747
  /**
10726
11748
  * List a project's stage workspaces
10727
11749
  *
10728
- * List the project's three stage workspaces — development, integration and runtime — in that order. Each row says how a machine of that stage is built and how long it lives; it is configuration, not a machine, so listing never opens one. A project whose rows do not exist yet gets all three materialized on this call with the defaults (size medium, prebuild on, idle timeout 30 minutes, retention 7 days), and a later call reads those same rows back rather than replacing them. Read one stage with the workspace retrieve; the machines actually running are units.
11750
+ * List the project's three stage workspaces — development, integration and release — in that order. Each row says how a machine of that stage is built and how long it lives; it is configuration, not a machine, so listing never opens one. A project whose rows do not exist yet gets all three materialized on this call with the defaults (size medium, prebuild on, idle timeout 30 minutes, retention 7 days), and a later call reads those same rows back rather than replacing them. Read one stage with the workspace retrieve; the machines actually running are units.
10729
11751
  */
10730
11752
  export const devopsWorkspacesList = (options) => (options.client ?? client).get({
10731
11753
  security: [{
@@ -10800,6 +11822,20 @@ export const devopsUnitsCreate = (options) => (options.client ?? client).post({
10800
11822
  ...options.headers
10801
11823
  }
10802
11824
  });
11825
+ /**
11826
+ * List a project's cleanup ledger
11827
+ *
11828
+ * List what the daily cleanup job removed or archived for the project, newest decision first: merged branches deleted when their pull request merged, stopped units deleted after the project's window, test evidence past its age, and prebuilds beyond the kept versions. Each row names the kind of thing, which one, whether it was archived (the record stays, the heavy content goes) or deleted, the reason and when it was decided and done; error is set while the last attempt failed and the job will try again. The ledger is read-only: the job is its only writer, and a project changes what is kept through settings.retention on devops.projects.update. A project with no row has had nothing cleaned.
11829
+ */
11830
+ export const devopsCleanupsList = (options) => (options.client ?? client).get({
11831
+ security: [{
11832
+ key: 'devops-bearerAuth',
11833
+ scheme: 'bearer',
11834
+ type: 'http'
11835
+ }],
11836
+ url: '/devops/v1/projects/{project}/cleanups',
11837
+ ...options
11838
+ });
10803
11839
  /**
10804
11840
  * Delete a unit
10805
11841
  *
@@ -12297,7 +13333,7 @@ export const registryRepositoriesList = (options) => (options?.client ?? client)
12297
13333
  /**
12298
13334
  * Create repository
12299
13335
  *
12300
- * 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。
13336
+ * 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。format 默认 oci,库里放技能和插件;要放 git 仓库就传 format=git,建库后 format 不能改。git 库需要这个组织已开放 git 功能,否则返回 409。
12301
13337
  */
12302
13338
  export const registryRepositoriesCreate = (options) => (options.client ?? client).post({
12303
13339
  security: [{
@@ -12373,12 +13409,11 @@ export const registryRepositoriesPackagesList = (options) => (options.client ??
12373
13409
  ...options
12374
13410
  });
12375
13411
  /**
12376
- * Publish a package
13412
+ * Create a package
12377
13413
  *
12378
- * 把一个新包发布进这个库,一次调用建立包并上传它的第一个版本。发布内容是 multipart:version 必填,archive 给一个 zip,或者 files 给一组文件(每个文件的 filename 是相对上传根的路径,例如 pdf/SKILL.md)。单个顶层目录会被剥掉。种类按根上有什么判:有 SKILL.md 就是 skill,有 .claude-plugin/plugin.json 就是 plugin;两者都没有、或都有,会被拒。名字从 SKILL.md 或 plugin.json 里读,不从路径或 query 猜。限额:上传 ≤25 MiB,解压后 ≤50 MiB,≤1000 个文件。版本必须是 semver 且严格递增;第一个版本可以是任意合法 semver,之后每个新版本都要比已发布的最高版本高。把已有智能体的技能搬过来时,先用 GET /agent/v1/skills/{id}/versions/{v}/content 导出 zip,再在这里作为 archive 发布。
13414
+ * 在一个库里建新包,按库的 format 走两条路。git 库(format=git):Content-Type 用 application/json,请求体 {name, format:"git", default_branch?, description?, import?},建一个空的 git 仓库,或者用 import.url(公开 https 仓库)从现有仓库导入;成功返回的包带 clone_url、default_branch 和 protected_refs(默认只保护默认分支),接着调用 packages.git-credential 取推拉凭据;组织未开放 git 功能返回 409,往 oci 库里用 JSON 建包也是 409。oci 库(技能和插件):把一个新包发布进这个库,一次调用建立包并上传它的第一个版本,Content-Type 用 multipart/form-data。发布内容是 multipart:version 必填,archive 给一个 zip,或者 files 给一组文件(每个文件的 filename 是相对上传根的路径,例如 pdf/SKILL.md)。单个顶层目录会被剥掉。种类按根上有什么判:有 SKILL.md 就是 skill,有 .claude-plugin/plugin.json 就是 plugin;两者都没有、或都有,会被拒。名字从 SKILL.md 或 plugin.json 里读,不从路径或 query 猜。限额:上传 ≤25 MiB,解压后 ≤50 MiB,≤1000 个文件。版本必须是 semver 且严格递增;第一个版本可以是任意合法 semver,之后每个新版本都要比已发布的最高版本高。把已有智能体的技能搬过来时,先用 GET /agent/v1/skills/{id}/versions/{v}/content 导出 zip,再在这里作为 archive 发布。
12379
13415
  */
12380
13416
  export const registryRepositoriesPackagesCreate = (options) => (options.client ?? client).post({
12381
- ...formDataBodySerializer,
12382
13417
  security: [{
12383
13418
  key: 'registry-bearerAuth',
12384
13419
  scheme: 'bearer',
@@ -12387,7 +13422,7 @@ export const registryRepositoriesPackagesCreate = (options) => (options.client ?
12387
13422
  url: '/registry/v1/repositories/{repository_id}/packages',
12388
13423
  ...options,
12389
13424
  headers: {
12390
- 'Content-Type': null,
13425
+ 'Content-Type': 'application/json',
12391
13426
  ...options.headers
12392
13427
  }
12393
13428
  });
@@ -12438,6 +13473,24 @@ export const registryPackagesVersionsCreate = (options) => (options.client ?? cl
12438
13473
  ...options.headers
12439
13474
  }
12440
13475
  });
13476
+ /**
13477
+ * Create a git credential
13478
+ *
13479
+ * 给一个 git 包换一个短期的 git 凭据,用来 git clone / git push。access 选 pull(只读,用来克隆和拉取)或 push(推分支,同时可以克隆和拉取)。push-protected(更新受保护分支)暂不发放,请推到别的分支再合并,请求它返回 400。ttl_seconds 是有效秒数,1-3600,默认 3600;到期后重新调用本接口,不要缓存过期的凭据。返回的 password 是敏感信息,只出现这一次,不要写进日志或提交。用法:git clone https://x-access-token:$PASSWORD@host/git/组织/库/包.git,或把 url 里的地址配上 http.extraHeader。组织未开放 git 功能返回 409;另一个组织的包、已被删除的包和 oci 包都返回 404。同一个 package_id 可以多次取,每次是一个新凭据,互不影响。
13480
+ */
13481
+ export const registryPackagesGitCredentialCreate = (options) => (options.client ?? client).post({
13482
+ security: [{
13483
+ key: 'registry-bearerAuth',
13484
+ scheme: 'bearer',
13485
+ type: 'http'
13486
+ }],
13487
+ url: '/registry/v1/packages/{package_id}/git-credential',
13488
+ ...options,
13489
+ headers: {
13490
+ 'Content-Type': 'application/json',
13491
+ ...options.headers
13492
+ }
13493
+ });
12441
13494
  /**
12442
13495
  * List commits
12443
13496
  *
@@ -12455,7 +13508,7 @@ export const registryGitLog = (options) => (options.client ?? client).get({
12455
13508
  /**
12456
13509
  * Read a commit
12457
13510
  *
12458
- * 按对象 id 读一个提交(完整 sha,不解析缩写)。返回提交信息、作者、提交时间与父提交。仓库里没有这个对象返回 404。
13511
+ * 按对象 id 读一个提交(完整 sha,不解析缩写)。返回提交信息、作者、提交时间与父提交;changed_files=true 时再返回它相对第一个父提交改了哪些文件(根提交的全部文件算新增),文件列表被上限截断时 changed_files_truncated 为 true。仓库里没有这个对象返回 404。
12459
13512
  */
12460
13513
  export const registryGitCommitsRetrieve = (options) => (options.client ?? client).get({
12461
13514
  security: [{
@@ -12480,6 +13533,62 @@ export const registryGitTreesRetrieve = (options) => (options.client ?? client).
12480
13533
  url: '/registry/v1/packages/{package_id}/git/trees/{sha}',
12481
13534
  ...options
12482
13535
  });
13536
+ /**
13537
+ * List branches and tags
13538
+ *
13539
+ * 列出一个 git 包的分支和标签,按名字排序;prefix 只取 refs/heads/(分支)或 refs/tags/(标签),不给就两者都列。page 从 1 起,size 1 到 500,默认 100;has_more 为 true 表示还有下一页。带注解的标签返回它指向的提交 id,不是标签对象的 id。想把一个名字换成提交 id 用 git/resolve,不要自己在这个列表里找。只读;OCI 包返回 404。
13540
+ */
13541
+ export const registryGitRefs = (options) => (options.client ?? client).get({
13542
+ security: [{
13543
+ key: 'registry-bearerAuth',
13544
+ scheme: 'bearer',
13545
+ type: 'http'
13546
+ }],
13547
+ url: '/registry/v1/packages/{package_id}/git/refs',
13548
+ ...options
13549
+ });
13550
+ /**
13551
+ * Resolve a ref
13552
+ *
13553
+ * 把一个引用换成它指向的提交 id:ref 可以是分支名、标签名、refs/… 全名、HEAD 或完整对象 id(40 或 64 位十六进制,缩写不解析)。名字既是标签又是分支时取标签。完整对象 id 只在仓库里真有这个提交时才返回。仓库没有这个引用或提交返回 404(GIT_OBJECT_NOT_FOUND),不会返回空值。要比较两个引用用 git/compare。
13554
+ */
13555
+ export const registryGitResolve = (options) => (options.client ?? client).get({
13556
+ security: [{
13557
+ key: 'registry-bearerAuth',
13558
+ scheme: 'bearer',
13559
+ type: 'http'
13560
+ }],
13561
+ url: '/registry/v1/packages/{package_id}/git/resolve',
13562
+ ...options
13563
+ });
13564
+ /**
13565
+ * Compare two refs
13566
+ *
13567
+ * 比较 base 与 head(引用名或完整对象 id):status 是 identical、ahead(head 在 base 之上有新提交)、behind(head 已包含在 base 里)或 diverged(两边各有提交);merge_base 是找到的最近共同祖先;files 是 head 相对 merge_base 改了哪些文件(added、modified、removed、renamed,renamed 带 previous_path),commits 是 head 比 base 多出的提交,最新的在前。Artifacts 无法低成本回答祖先关系,所以这里只沿两边的第一父链各走最多 300 个提交,并在有界读取下比对树:找不到共同祖先时返回 diverged、merge_base 为 null;files 被上限(3000 个文件、1000 次树读取)截断时 truncated 为 true;commits 被截断、或合并提交藏起了被合并分支上的提交时 commits_truncated 为 true。truncated 或 commits_truncated 为 true 时不要把列表当作完整结果。引用不存在返回 404。只读。
13568
+ */
13569
+ export const registryGitCompare = (options) => (options.client ?? client).get({
13570
+ security: [{
13571
+ key: 'registry-bearerAuth',
13572
+ scheme: 'bearer',
13573
+ type: 'http'
13574
+ }],
13575
+ url: '/registry/v1/packages/{package_id}/git/compare',
13576
+ ...options
13577
+ });
13578
+ /**
13579
+ * List a tree recursively
13580
+ *
13581
+ * 读一个提交(或树对象)下的全部条目,递归,每个条目用相对根的完整路径命名,目录和子模块也是条目(子模块不展开)。适合要拿到整个仓库文件清单的场景(例如 DevOps 的构建判断);只想看一个目录用 git/trees/{sha}。相同的子树只读一次。条目上限 20000、树读取上限 1000 次,撞到上限时 truncated 为 true、entries 只是前一部分,不要当作全部。sha 通常来自 git/resolve。仓库里没有这个对象返回 404。只读。
13582
+ */
13583
+ export const registryGitTreesRecursive = (options) => (options.client ?? client).get({
13584
+ security: [{
13585
+ key: 'registry-bearerAuth',
13586
+ scheme: 'bearer',
13587
+ type: 'http'
13588
+ }],
13589
+ url: '/registry/v1/packages/{package_id}/git/trees/{sha}/recursive',
13590
+ ...options
13591
+ });
12483
13592
  /**
12484
13593
  * Download a file from a ref
12485
13594
  *
@@ -15543,7 +16652,7 @@ export const vaultListTemplates = (options) => (options?.client ?? client).get({
15543
16652
  /**
15544
16653
  * Create authorization
15545
16654
  *
15546
- * Connect an OAuth service to an active vault using either an OAuth template or a resource URL. Unlike Anthropic mcp_oauth credential creation, this flow obtains tokens through user consent rather than accepting an auth token bundle; compatible mcp_oauth creation and updates return 501. Open connect_url, then poll praxis.vault.authorizations.retrieve until completed, failed or expired; only completed supplies the resulting secret_id. This stores a credential but does not enable vault-backed MCP authentication in Agent sessions.
16655
+ * Connect an OAuth service to an active vault using either an OAuth template or a resource URL. Unlike Anthropic mcp_oauth credential creation, this flow obtains tokens through user consent rather than accepting an auth token bundle; compatible mcp_oauth creation and updates return 501. Open connect_url, then poll praxis.vault.authorizations.retrieve until completed, failed or expired; only completed supplies the resulting secret_id. The resulting oauth secret serves vault-backed MCP authentication — an Agent session or deployment whose vault_ids include this vault sends it to the MCP server whose URL equals this authorization's resource URL (normalized), and the platform refreshes the token once when that server answers 401.
15547
16656
  */
15548
16657
  export const vaultCreateAuthorization = (options) => (options.client ?? client).post({
15549
16658
  security: [{