@deepraxis/sdk 0.1.1-dev.29ead51 → 0.1.1-dev.2a7c4d7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -929,6 +929,30 @@ export const listSessionRequests = (options) => (options.client ?? client).get({
929
929
  url: '/agent/v1/sessions/{session_id}/requests',
930
930
  ...options
931
931
  });
932
+ /**
933
+ * Create Session Dictation Stream (Extension)
934
+ *
935
+ * Open a dictation stream for a session and get the address to push microphone audio to.
936
+ *
937
+ * Own-face extension. The body is optional: hotwords (at most 50 words the recogniser should favour). Returns 201 { id, push_url, expires_at }: id is the stream id (mst_...), push_url a wss address, expires_at when the address stops accepting a new connection. The speech-to-text model is the agent's dictation_model, or the platform default when it names none. Once connected to push_url, send one text frame {"type":"start","format":"pcm_s16le","sample_rate":16000,"channels":1}, then binary PCM frames of at most 64 KiB, then {"type":"stop"}; the text frames you receive are partial, final, done (with audio_seconds and cost_usd) and error. Each final carries end_ms, where that sentence ends in the audio you sent: if the connection drops, send what comes after the last end_ms to a new dictation. You may connect ahead of time: the stream waits up to 5 minutes for start; after start it closes after 30 s without a frame, and it carries at most 10 minutes of audio. push_url carries a short-lived capability: treat it as a secret and do not store or log it. A session that is missing or not yours returns 404; a model that cannot transcribe a live stream returns 409 DICTATION_UNCONFIGURED; dictation not available in this environment returns 503 DICTATION_UNAVAILABLE; more than 50 hotwords or an unsupported field returns 400.
938
+ */
939
+ export const createSessionDictation = (options) => (options.client ?? client).post({
940
+ security: [{
941
+ key: 'BearerAuth',
942
+ scheme: 'bearer',
943
+ type: 'http'
944
+ }, {
945
+ key: 'ApiKeyAuth',
946
+ name: 'X-API-Key',
947
+ type: 'apiKey'
948
+ }],
949
+ url: '/agent/v1/sessions/{session_id}/dictations',
950
+ ...options,
951
+ headers: {
952
+ 'Content-Type': 'application/json',
953
+ ...options.headers
954
+ }
955
+ });
932
956
  /**
933
957
  * List Session Background Tasks (Extension)
934
958
  *
@@ -1138,7 +1162,7 @@ export const browserListSessions = (options) => (options?.client ?? client).get(
1138
1162
  /**
1139
1163
  * 创建浏览器会话
1140
1164
  *
1141
- * 创建云端 Chrome,返回自带凭证的 connectUrl。API 会话默认断开后结束;最长 6 小时。
1165
+ * 创建云端 Chrome,返回自带凭证的 connectUrl。API 会话默认断开后结束;最长 6 小时。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
1142
1166
  */
1143
1167
  export const browserCreateSession = (options) => (options.client ?? client).post({
1144
1168
  security: [{
@@ -1188,7 +1212,7 @@ export const browserCloseSession = (options) => (options.client ?? client).post(
1188
1212
  /**
1189
1213
  * 读取调试地址
1190
1214
  *
1191
- * 读取当前会话及各标签页的实时观看地址和 CDP 连接地址。直接使用返回的完整链接,保留查询凭证;会话不在运行状态时 pages 为空,返回地址不代表会话仍可连接。
1215
+ * 读取当前会话及各标签页的实时观看地址和 CDP 连接地址。直接使用返回的完整链接,保留查询凭证;会话不在运行状态时 pages 为空,返回地址不代表会话仍可连接——会话结束后(进入释放或已释放),用返回的 wsUrl 建立 CDP 连接会得到 409 SESSION_ENDED。
1192
1216
  */
1193
1217
  export const browserGetDebug = (options) => (options.client ?? client).get({
1194
1218
  security: [{
@@ -2667,11 +2691,11 @@ export const exportOrganizationCharges = (options) => (options.client ?? client)
2667
2691
  ...options
2668
2692
  });
2669
2693
  /**
2670
- * List departments
2694
+ * Your inbox counts for the notification bell
2671
2695
  *
2672
- * 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.
2673
2697
  */
2674
- export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
2698
+ export const getOrganizationNotificationsInbox = (options) => (options?.client ?? client).get({
2675
2699
  security: [{
2676
2700
  key: 'BearerAuth',
2677
2701
  scheme: 'bearer',
@@ -2681,15 +2705,15 @@ export const listOrganizationDepartments = (options) => (options?.client ?? clie
2681
2705
  name: 'X-API-Key',
2682
2706
  type: 'apiKey'
2683
2707
  }],
2684
- url: '/organization/v1/departments',
2708
+ url: '/organization/v1/notifications/inbox',
2685
2709
  ...options
2686
2710
  });
2687
2711
  /**
2688
- * Establish a department
2712
+ * List the letters addressed to you
2689
2713
  *
2690
- * 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.
2691
2715
  */
2692
- export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
2716
+ export const listOrganizationNotificationLetters = (options) => (options?.client ?? client).get({
2693
2717
  security: [{
2694
2718
  key: 'BearerAuth',
2695
2719
  scheme: 'bearer',
@@ -2699,19 +2723,15 @@ export const establishOrganizationDepartment = (options) => (options.client ?? c
2699
2723
  name: 'X-API-Key',
2700
2724
  type: 'apiKey'
2701
2725
  }],
2702
- url: '/organization/v1/departments',
2703
- ...options,
2704
- headers: {
2705
- 'Content-Type': 'application/json',
2706
- ...options.headers
2707
- }
2726
+ url: '/organization/v1/notifications/letters',
2727
+ ...options
2708
2728
  });
2709
2729
  /**
2710
- * Get a department
2730
+ * Mark one of your letters read
2711
2731
  *
2712
- * 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.
2713
2733
  */
2714
- export const getOrganizationDepartment = (options) => (options.client ?? client).get({
2734
+ export const readOrganizationNotificationLetter = (options) => (options.client ?? client).post({
2715
2735
  security: [{
2716
2736
  key: 'BearerAuth',
2717
2737
  scheme: 'bearer',
@@ -2721,15 +2741,15 @@ export const getOrganizationDepartment = (options) => (options.client ?? client)
2721
2741
  name: 'X-API-Key',
2722
2742
  type: 'apiKey'
2723
2743
  }],
2724
- url: '/organization/v1/departments/{id}',
2744
+ url: '/organization/v1/notifications/letters/{id}:read',
2725
2745
  ...options
2726
2746
  });
2727
2747
  /**
2728
- * Reorganize a department
2748
+ * Mark all your letters read
2729
2749
  *
2730
- * 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.
2731
2751
  */
2732
- export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
2752
+ export const readAllOrganizationNotificationLetters = (options) => (options?.client ?? client).post({
2733
2753
  security: [{
2734
2754
  key: 'BearerAuth',
2735
2755
  scheme: 'bearer',
@@ -2739,19 +2759,19 @@ export const reorganizeOrganizationDepartment = (options) => (options.client ??
2739
2759
  name: 'X-API-Key',
2740
2760
  type: 'apiKey'
2741
2761
  }],
2742
- url: '/organization/v1/departments/{id}',
2762
+ url: '/organization/v1/notifications/letters:readAll',
2743
2763
  ...options,
2744
2764
  headers: {
2745
2765
  'Content-Type': 'application/json',
2746
- ...options.headers
2766
+ ...options?.headers
2747
2767
  }
2748
2768
  });
2749
2769
  /**
2750
- * Dissolve a department
2770
+ * Archive one of your letters
2751
2771
  *
2752
- * 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.
2753
2773
  */
2754
- export const dissolveOrganizationDepartment = (options) => (options.client ?? client).post({
2774
+ export const archiveOrganizationNotificationLetter = (options) => (options.client ?? client).post({
2755
2775
  security: [{
2756
2776
  key: 'BearerAuth',
2757
2777
  scheme: 'bearer',
@@ -2761,37 +2781,15 @@ export const dissolveOrganizationDepartment = (options) => (options.client ?? cl
2761
2781
  name: 'X-API-Key',
2762
2782
  type: 'apiKey'
2763
2783
  }],
2764
- url: '/organization/v1/departments/{id}/dissolve',
2784
+ url: '/organization/v1/notifications/letters/{id}:archive',
2765
2785
  ...options
2766
2786
  });
2767
2787
  /**
2768
- * Amend a department charter
2769
- *
2770
- * 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.
2771
- */
2772
- export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
2773
- security: [{
2774
- key: 'BearerAuth',
2775
- scheme: 'bearer',
2776
- type: 'http'
2777
- }, {
2778
- key: 'ApiKeyAuth',
2779
- name: 'X-API-Key',
2780
- type: 'apiKey'
2781
- }],
2782
- url: '/organization/v1/departments/{id}/charter',
2783
- ...options,
2784
- headers: {
2785
- 'Content-Type': 'application/json',
2786
- ...options.headers
2787
- }
2788
- });
2789
- /**
2790
- * List jobs
2788
+ * Your notification switches, and what they resolve to
2791
2789
  *
2792
- * 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.
2793
2791
  */
2794
- export const listOrganizationJobs = (options) => (options?.client ?? client).get({
2792
+ export const getOrganizationNotificationPreferences = (options) => (options?.client ?? client).get({
2795
2793
  security: [{
2796
2794
  key: 'BearerAuth',
2797
2795
  scheme: 'bearer',
@@ -2801,15 +2799,15 @@ export const listOrganizationJobs = (options) => (options?.client ?? client).get
2801
2799
  name: 'X-API-Key',
2802
2800
  type: 'apiKey'
2803
2801
  }],
2804
- url: '/organization/v1/jobs',
2802
+ url: '/organization/v1/notifications/preferences',
2805
2803
  ...options
2806
2804
  });
2807
2805
  /**
2808
- * Define a job
2806
+ * Change your notification switches
2809
2807
  *
2810
- * 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.
2811
2809
  */
2812
- export const defineOrganizationJob = (options) => (options.client ?? client).post({
2810
+ export const updateOrganizationNotificationPreferences = (options) => (options.client ?? client).post({
2813
2811
  security: [{
2814
2812
  key: 'BearerAuth',
2815
2813
  scheme: 'bearer',
@@ -2819,7 +2817,7 @@ export const defineOrganizationJob = (options) => (options.client ?? client).pos
2819
2817
  name: 'X-API-Key',
2820
2818
  type: 'apiKey'
2821
2819
  }],
2822
- url: '/organization/v1/jobs',
2820
+ url: '/organization/v1/notifications/preferences',
2823
2821
  ...options,
2824
2822
  headers: {
2825
2823
  'Content-Type': 'application/json',
@@ -2827,11 +2825,11 @@ export const defineOrganizationJob = (options) => (options.client ?? client).pos
2827
2825
  }
2828
2826
  });
2829
2827
  /**
2830
- * Get a job
2828
+ * The organization's notification layer
2831
2829
  *
2832
- * 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.
2833
2831
  */
2834
- export const getOrganizationJob = (options) => (options.client ?? client).get({
2832
+ export const getOrganizationNotificationDefaults = (options) => (options?.client ?? client).get({
2835
2833
  security: [{
2836
2834
  key: 'BearerAuth',
2837
2835
  scheme: 'bearer',
@@ -2841,15 +2839,15 @@ export const getOrganizationJob = (options) => (options.client ?? client).get({
2841
2839
  name: 'X-API-Key',
2842
2840
  type: 'apiKey'
2843
2841
  }],
2844
- url: '/organization/v1/jobs/{id}',
2842
+ url: '/organization/v1/notifications/organization_default',
2845
2843
  ...options
2846
2844
  });
2847
2845
  /**
2848
- * Revise a job
2846
+ * Set the organization's notification layer
2849
2847
  *
2850
- * 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.
2851
2849
  */
2852
- export const reviseOrganizationJob = (options) => (options.client ?? client).patch({
2850
+ export const updateOrganizationNotificationDefaults = (options) => (options.client ?? client).post({
2853
2851
  security: [{
2854
2852
  key: 'BearerAuth',
2855
2853
  scheme: 'bearer',
@@ -2859,7 +2857,7 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
2859
2857
  name: 'X-API-Key',
2860
2858
  type: 'apiKey'
2861
2859
  }],
2862
- url: '/organization/v1/jobs/{id}',
2860
+ url: '/organization/v1/notifications/organization_default',
2863
2861
  ...options,
2864
2862
  headers: {
2865
2863
  'Content-Type': 'application/json',
@@ -2867,11 +2865,11 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
2867
2865
  }
2868
2866
  });
2869
2867
  /**
2870
- * Retire a job
2868
+ * Your own notification delivery records
2871
2869
  *
2872
- * 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.
2873
2871
  */
2874
- export const retireOrganizationJob = (options) => (options.client ?? client).post({
2872
+ export const listOrganizationNotificationDeliveries = (options) => (options?.client ?? client).get({
2875
2873
  security: [{
2876
2874
  key: 'BearerAuth',
2877
2875
  scheme: 'bearer',
@@ -2881,15 +2879,15 @@ export const retireOrganizationJob = (options) => (options.client ?? client).pos
2881
2879
  name: 'X-API-Key',
2882
2880
  type: 'apiKey'
2883
2881
  }],
2884
- url: '/organization/v1/jobs/{id}/retire',
2882
+ url: '/organization/v1/notifications/deliveries',
2885
2883
  ...options
2886
2884
  });
2887
2885
  /**
2888
- * List job ladders
2886
+ * Upgrade to a full sandbox
2889
2887
  *
2890
- * 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.
2891
2889
  */
2892
- export const listOrganizationLadders = (options) => (options?.client ?? client).get({
2890
+ export const upgradeSandbox = (options) => (options.client ?? client).post({
2893
2891
  security: [{
2894
2892
  key: 'BearerAuth',
2895
2893
  scheme: 'bearer',
@@ -2899,15 +2897,19 @@ export const listOrganizationLadders = (options) => (options?.client ?? client).
2899
2897
  name: 'X-API-Key',
2900
2898
  type: 'apiKey'
2901
2899
  }],
2902
- url: '/organization/v1/ladders',
2903
- ...options
2900
+ url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
2901
+ ...options,
2902
+ headers: {
2903
+ 'Content-Type': 'application/json',
2904
+ ...options.headers
2905
+ }
2904
2906
  });
2905
2907
  /**
2906
- * Define a job ladder
2908
+ * Extend a running sandbox without shortening its deadline
2907
2909
  *
2908
- * 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.
2909
2911
  */
2910
- export const defineOrganizationLadder = (options) => (options.client ?? client).post({
2912
+ export const extendSandbox = (options) => (options.client ?? client).post({
2911
2913
  security: [{
2912
2914
  key: 'BearerAuth',
2913
2915
  scheme: 'bearer',
@@ -2917,7 +2919,7 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
2917
2919
  name: 'X-API-Key',
2918
2920
  type: 'apiKey'
2919
2921
  }],
2920
- url: '/organization/v1/ladders',
2922
+ url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
2921
2923
  ...options,
2922
2924
  headers: {
2923
2925
  'Content-Type': 'application/json',
@@ -2925,11 +2927,11 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
2925
2927
  }
2926
2928
  });
2927
2929
  /**
2928
- * Get a job ladder
2930
+ * List live processes and retained observations
2929
2931
  *
2930
- * 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.
2931
2933
  */
2932
- export const getOrganizationLadder = (options) => (options.client ?? client).get({
2934
+ export const listObservedProcesses = (options) => (options.client ?? client).get({
2933
2935
  security: [{
2934
2936
  key: 'BearerAuth',
2935
2937
  scheme: 'bearer',
@@ -2939,15 +2941,33 @@ export const getOrganizationLadder = (options) => (options.client ?? client).get
2939
2941
  name: 'X-API-Key',
2940
2942
  type: 'apiKey'
2941
2943
  }],
2942
- url: '/organization/v1/ladders/{id}',
2944
+ url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
2943
2945
  ...options
2944
2946
  });
2945
2947
  /**
2946
- * Revise a job ladder
2948
+ * Read bounded observed process output
2947
2949
  *
2948
- * 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.
2949
2951
  */
2950
- export const reviseOrganizationLadder = (options) => (options.client ?? client).put({
2952
+ export const getObservedProcessOutput = (options) => (options.client ?? client).get({
2953
+ security: [{
2954
+ key: 'BearerAuth',
2955
+ scheme: 'bearer',
2956
+ type: 'http'
2957
+ }, {
2958
+ key: 'ApiKeyAuth',
2959
+ name: 'X-API-Key',
2960
+ type: 'apiKey'
2961
+ }],
2962
+ url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
2963
+ ...options
2964
+ });
2965
+ /**
2966
+ * Start a task whose output is pushed off the machine while it runs
2967
+ *
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.
2969
+ */
2970
+ export const startSandboxTask = (options) => (options.client ?? client).post({
2951
2971
  security: [{
2952
2972
  key: 'BearerAuth',
2953
2973
  scheme: 'bearer',
@@ -2957,7 +2977,7 @@ export const reviseOrganizationLadder = (options) => (options.client ?? client).
2957
2977
  name: 'X-API-Key',
2958
2978
  type: 'apiKey'
2959
2979
  }],
2960
- url: '/organization/v1/ladders/{id}',
2980
+ url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
2961
2981
  ...options,
2962
2982
  headers: {
2963
2983
  'Content-Type': 'application/json',
@@ -2965,11 +2985,11 @@ export const reviseOrganizationLadder = (options) => (options.client ?? client).
2965
2985
  }
2966
2986
  });
2967
2987
  /**
2968
- * List positions
2988
+ * Read a range of a task's pushed output
2969
2989
  *
2970
- * 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.
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.
2971
2991
  */
2972
- export const listOrganizationPositions = (options) => (options?.client ?? client).get({
2992
+ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
2973
2993
  security: [{
2974
2994
  key: 'BearerAuth',
2975
2995
  scheme: 'bearer',
@@ -2979,37 +2999,89 @@ export const listOrganizationPositions = (options) => (options?.client ?? client
2979
2999
  name: 'X-API-Key',
2980
3000
  type: 'apiKey'
2981
3001
  }],
2982
- url: '/organization/v1/positions',
3002
+ url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
2983
3003
  ...options
2984
3004
  });
2985
3005
  /**
2986
- * Open positions
3006
+ * Kill sandbox
2987
3007
  *
2988
- * 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"}.
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.
2989
3009
  */
2990
- export const openOrganizationPositions = (options) => (options.client ?? client).post({
2991
- security: [{
2992
- 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',
2993
3019
  scheme: 'bearer',
2994
3020
  type: 'http'
2995
- }, {
2996
- 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',
2997
3051
  name: 'X-API-Key',
2998
3052
  type: 'apiKey'
2999
- }],
3000
- url: '/organization/v1/positions',
3001
- ...options,
3002
- headers: {
3003
- 'Content-Type': 'application/json',
3004
- ...options.headers
3005
- }
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}',
3077
+ ...options
3006
3078
  });
3007
3079
  /**
3008
- * Get a position
3080
+ * Rename a sandbox
3009
3081
  *
3010
- * 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.
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.
3011
3083
  */
3012
- export const getOrganizationPosition = (options) => (options.client ?? client).get({
3084
+ export const renameSandbox = (options) => (options.client ?? client).patch({
3013
3085
  security: [{
3014
3086
  key: 'BearerAuth',
3015
3087
  scheme: 'bearer',
@@ -3019,15 +3091,21 @@ export const getOrganizationPosition = (options) => (options.client ?? client).g
3019
3091
  name: 'X-API-Key',
3020
3092
  type: 'apiKey'
3021
3093
  }],
3022
- url: '/organization/v1/positions/{id}',
3023
- ...options
3094
+ url: '/sandbox/v1/sandboxes/{sandboxID}',
3095
+ ...options,
3096
+ headers: {
3097
+ 'Content-Type': 'application/json',
3098
+ ...options.headers
3099
+ }
3024
3100
  });
3025
3101
  /**
3026
- * Revise a position
3102
+ * Act on a phone sandbox's screen
3027
3103
  *
3028
- * 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.
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.
3029
3107
  */
3030
- export const reviseOrganizationPosition = (options) => (options.client ?? client).patch({
3108
+ export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
3031
3109
  security: [{
3032
3110
  key: 'BearerAuth',
3033
3111
  scheme: 'bearer',
@@ -3037,7 +3115,7 @@ export const reviseOrganizationPosition = (options) => (options.client ?? client
3037
3115
  name: 'X-API-Key',
3038
3116
  type: 'apiKey'
3039
3117
  }],
3040
- url: '/organization/v1/positions/{id}',
3118
+ url: '/sandbox/v1/sandboxes/{sandboxID}/act',
3041
3119
  ...options,
3042
3120
  headers: {
3043
3121
  'Content-Type': 'application/json',
@@ -3045,11 +3123,11 @@ export const reviseOrganizationPosition = (options) => (options.client ?? client
3045
3123
  }
3046
3124
  });
3047
3125
  /**
3048
- * Close a position
3126
+ * Remove a file or directory in the sandbox
3049
3127
  *
3050
- * 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.
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.
3051
3129
  */
3052
- export const closeOrganizationPosition = (options) => (options.client ?? client).post({
3130
+ export const removeSandboxFile = (options) => (options.client ?? client).delete({
3053
3131
  security: [{
3054
3132
  key: 'BearerAuth',
3055
3133
  scheme: 'bearer',
@@ -3059,15 +3137,15 @@ export const closeOrganizationPosition = (options) => (options.client ?? client)
3059
3137
  name: 'X-API-Key',
3060
3138
  type: 'apiKey'
3061
3139
  }],
3062
- url: '/organization/v1/positions/{id}/close',
3140
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
3063
3141
  ...options
3064
3142
  });
3065
3143
  /**
3066
- * Freeze a position
3144
+ * Read a file in the sandbox
3067
3145
  *
3068
- * 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.
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.
3069
3147
  */
3070
- export const freezeOrganizationPosition = (options) => (options.client ?? client).post({
3148
+ export const readSandboxFile = (options) => (options.client ?? client).get({
3071
3149
  security: [{
3072
3150
  key: 'BearerAuth',
3073
3151
  scheme: 'bearer',
@@ -3077,15 +3155,15 @@ export const freezeOrganizationPosition = (options) => (options.client ?? client
3077
3155
  name: 'X-API-Key',
3078
3156
  type: 'apiKey'
3079
3157
  }],
3080
- url: '/organization/v1/positions/{id}/freeze',
3158
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
3081
3159
  ...options
3082
3160
  });
3083
3161
  /**
3084
- * Unfreeze a position
3162
+ * Write a file in the sandbox
3085
3163
  *
3086
- * 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.
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"}.
3087
3165
  */
3088
- export const unfreezeOrganizationPosition = (options) => (options.client ?? client).post({
3166
+ export const writeSandboxFile = (options) => (options.client ?? client).put({
3089
3167
  security: [{
3090
3168
  key: 'BearerAuth',
3091
3169
  scheme: 'bearer',
@@ -3095,47 +3173,7 @@ export const unfreezeOrganizationPosition = (options) => (options.client ?? clie
3095
3173
  name: 'X-API-Key',
3096
3174
  type: 'apiKey'
3097
3175
  }],
3098
- url: '/organization/v1/positions/{id}/unfreeze',
3099
- ...options
3100
- });
3101
- /**
3102
- * Reassign a position's manager
3103
- *
3104
- * 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.
3105
- */
3106
- export const reassignOrganizationPositionManager = (options) => (options.client ?? client).put({
3107
- security: [{
3108
- key: 'BearerAuth',
3109
- scheme: 'bearer',
3110
- type: 'http'
3111
- }, {
3112
- key: 'ApiKeyAuth',
3113
- name: 'X-API-Key',
3114
- type: 'apiKey'
3115
- }],
3116
- url: '/organization/v1/positions/{id}/manager',
3117
- ...options,
3118
- headers: {
3119
- 'Content-Type': 'application/json',
3120
- ...options.headers
3121
- }
3122
- });
3123
- /**
3124
- * Regrade a position
3125
- *
3126
- * 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.
3127
- */
3128
- export const regradeOrganizationPosition = (options) => (options.client ?? client).put({
3129
- security: [{
3130
- key: 'BearerAuth',
3131
- scheme: 'bearer',
3132
- type: 'http'
3133
- }, {
3134
- key: 'ApiKeyAuth',
3135
- name: 'X-API-Key',
3136
- type: 'apiKey'
3137
- }],
3138
- url: '/organization/v1/positions/{id}/level',
3176
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
3139
3177
  ...options,
3140
3178
  headers: {
3141
3179
  'Content-Type': 'application/json',
@@ -3143,11 +3181,11 @@ export const regradeOrganizationPosition = (options) => (options.client ?? clien
3143
3181
  }
3144
3182
  });
3145
3183
  /**
3146
- * Designate a department head position
3184
+ * List files in a sandbox directory
3147
3185
  *
3148
- * 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.
3149
3187
  */
3150
- export const designateOrganizationPositionHead = (options) => (options.client ?? client).post({
3188
+ export const listSandboxFiles = (options) => (options.client ?? client).get({
3151
3189
  security: [{
3152
3190
  key: 'BearerAuth',
3153
3191
  scheme: 'bearer',
@@ -3157,15 +3195,15 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
3157
3195
  name: 'X-API-Key',
3158
3196
  type: 'apiKey'
3159
3197
  }],
3160
- url: '/organization/v1/positions/{id}/designate_head',
3198
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
3161
3199
  ...options
3162
3200
  });
3163
3201
  /**
3164
- * Hire into a position
3202
+ * Create a directory in the sandbox
3165
3203
  *
3166
- * 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.
3167
3205
  */
3168
- export const hireOrganizationPosition = (options) => (options.client ?? client).post({
3206
+ export const makeSandboxDirectory = (options) => (options.client ?? client).post({
3169
3207
  security: [{
3170
3208
  key: 'BearerAuth',
3171
3209
  scheme: 'bearer',
@@ -3175,19 +3213,15 @@ export const hireOrganizationPosition = (options) => (options.client ?? client).
3175
3213
  name: 'X-API-Key',
3176
3214
  type: 'apiKey'
3177
3215
  }],
3178
- url: '/organization/v1/positions/{id}/hire',
3179
- ...options,
3180
- headers: {
3181
- 'Content-Type': 'application/json',
3182
- ...options.headers
3183
- }
3216
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
3217
+ ...options
3184
3218
  });
3185
3219
  /**
3186
- * Replace a position's holder
3220
+ * Run a command in the sandbox
3187
3221
  *
3188
- * 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"}.
3189
3223
  */
3190
- export const replaceOrganizationPositionHolder = (options) => (options.client ?? client).post({
3224
+ export const runSandboxCommand = (options) => (options.client ?? client).post({
3191
3225
  security: [{
3192
3226
  key: 'BearerAuth',
3193
3227
  scheme: 'bearer',
@@ -3197,7 +3231,7 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
3197
3231
  name: 'X-API-Key',
3198
3232
  type: 'apiKey'
3199
3233
  }],
3200
- url: '/organization/v1/positions/{id}/replace_holder',
3234
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
3201
3235
  ...options,
3202
3236
  headers: {
3203
3237
  'Content-Type': 'application/json',
@@ -3205,11 +3239,11 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
3205
3239
  }
3206
3240
  });
3207
3241
  /**
3208
- * List assignments
3242
+ * Start adding a phone of your own
3209
3243
  *
3210
- * 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'}.
3211
3245
  */
3212
- export const listOrganizationAssignments = (options) => (options?.client ?? client).get({
3246
+ export const createByodPairing = (options) => (options?.client ?? client).post({
3213
3247
  security: [{
3214
3248
  key: 'BearerAuth',
3215
3249
  scheme: 'bearer',
@@ -3219,15 +3253,15 @@ export const listOrganizationAssignments = (options) => (options?.client ?? clie
3219
3253
  name: 'X-API-Key',
3220
3254
  type: 'apiKey'
3221
3255
  }],
3222
- url: '/organization/v1/assignments',
3256
+ url: '/sandbox/v1/byod/pairings',
3223
3257
  ...options
3224
3258
  });
3225
3259
  /**
3226
- * Get an assignment
3260
+ * List your organization's own devices
3227
3261
  *
3228
- * 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:[]}]}.
3229
3263
  */
3230
- export const getOrganizationAssignment = (options) => (options.client ?? client).get({
3264
+ export const listByodDevices = (options) => (options?.client ?? client).get({
3231
3265
  security: [{
3232
3266
  key: 'BearerAuth',
3233
3267
  scheme: 'bearer',
@@ -3237,15 +3271,15 @@ export const getOrganizationAssignment = (options) => (options.client ?? client)
3237
3271
  name: 'X-API-Key',
3238
3272
  type: 'apiKey'
3239
3273
  }],
3240
- url: '/organization/v1/assignments/{id}',
3274
+ url: '/sandbox/v1/byod/devices',
3241
3275
  ...options
3242
3276
  });
3243
3277
  /**
3244
- * Transfer an assignment to another position
3278
+ * Read one of your organization's devices
3245
3279
  *
3246
- * 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.
3247
3281
  */
3248
- export const transferOrganizationAssignment = (options) => (options.client ?? client).post({
3282
+ export const getByodDevice = (options) => (options.client ?? client).get({
3249
3283
  security: [{
3250
3284
  key: 'BearerAuth',
3251
3285
  scheme: 'bearer',
@@ -3255,19 +3289,15 @@ export const transferOrganizationAssignment = (options) => (options.client ?? cl
3255
3289
  name: 'X-API-Key',
3256
3290
  type: 'apiKey'
3257
3291
  }],
3258
- url: '/organization/v1/assignments/{id}/transfer',
3259
- ...options,
3260
- headers: {
3261
- 'Content-Type': 'application/json',
3262
- ...options.headers
3263
- }
3292
+ url: '/sandbox/v1/byod/devices/{deviceID}',
3293
+ ...options
3264
3294
  });
3265
3295
  /**
3266
- * End an assignment
3296
+ * Rename one of your organization's devices
3267
3297
  *
3268
- * 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.
3269
3299
  */
3270
- export const terminateOrganizationAssignment = (options) => (options.client ?? client).post({
3300
+ export const updateByodDevice = (options) => (options.client ?? client).patch({
3271
3301
  security: [{
3272
3302
  key: 'BearerAuth',
3273
3303
  scheme: 'bearer',
@@ -3277,7 +3307,7 @@ export const terminateOrganizationAssignment = (options) => (options.client ?? c
3277
3307
  name: 'X-API-Key',
3278
3308
  type: 'apiKey'
3279
3309
  }],
3280
- url: '/organization/v1/assignments/{id}/terminate',
3310
+ url: '/sandbox/v1/byod/devices/{deviceID}',
3281
3311
  ...options,
3282
3312
  headers: {
3283
3313
  'Content-Type': 'application/json',
@@ -3285,11 +3315,11 @@ export const terminateOrganizationAssignment = (options) => (options.client ?? c
3285
3315
  }
3286
3316
  });
3287
3317
  /**
3288
- * Make an assignment primary
3318
+ * Disconnect a device and revoke its credential
3289
3319
  *
3290
- * 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}.
3291
3321
  */
3292
- export const makePrimaryOrganizationAssignment = (options) => (options.client ?? client).post({
3322
+ export const disconnectByodDevice = (options) => (options.client ?? client).post({
3293
3323
  security: [{
3294
3324
  key: 'BearerAuth',
3295
3325
  scheme: 'bearer',
@@ -3299,15 +3329,15 @@ export const makePrimaryOrganizationAssignment = (options) => (options.client ??
3299
3329
  name: 'X-API-Key',
3300
3330
  type: 'apiKey'
3301
3331
  }],
3302
- url: '/organization/v1/assignments/{id}/make_primary',
3332
+ url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
3303
3333
  ...options
3304
3334
  });
3305
3335
  /**
3306
- * List actors holding positions
3336
+ * Read a pairing for the phone's Allow screen
3307
3337
  *
3308
- * 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'}.
3309
3339
  */
3310
- export const listOrganizationActors = (options) => (options?.client ?? client).get({
3340
+ export const getByodPairing = (options) => (options.client ?? client).get({
3311
3341
  security: [{
3312
3342
  key: 'BearerAuth',
3313
3343
  scheme: 'bearer',
@@ -3317,15 +3347,15 @@ export const listOrganizationActors = (options) => (options?.client ?? client).g
3317
3347
  name: 'X-API-Key',
3318
3348
  type: 'apiKey'
3319
3349
  }],
3320
- url: '/organization/v1/actors',
3350
+ url: '/sandbox/v1/byod/pairings/{code}',
3321
3351
  ...options
3322
3352
  });
3323
3353
  /**
3324
- * Get the position chain of an actor
3354
+ * Claim a pairing and register the phone
3325
3355
  *
3326
- * 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/'}.
3327
3357
  */
3328
- export const getOrganizationActor = (options) => (options.client ?? client).get({
3358
+ export const claimByodPairing = (options) => (options.client ?? client).post({
3329
3359
  security: [{
3330
3360
  key: 'BearerAuth',
3331
3361
  scheme: 'bearer',
@@ -3335,15 +3365,19 @@ export const getOrganizationActor = (options) => (options.client ?? client).get(
3335
3365
  name: 'X-API-Key',
3336
3366
  type: 'apiKey'
3337
3367
  }],
3338
- url: '/organization/v1/actors/{actor}',
3339
- ...options
3368
+ url: '/sandbox/v1/byod/pairings/{code}/claim',
3369
+ ...options,
3370
+ headers: {
3371
+ 'Content-Type': 'application/json',
3372
+ ...options.headers
3373
+ }
3340
3374
  });
3341
3375
  /**
3342
- * List periods
3376
+ * List departments
3343
3377
  *
3344
- * 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.
3345
3379
  */
3346
- export const listOrganizationPeriods = (options) => (options?.client ?? client).get({
3380
+ export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
3347
3381
  security: [{
3348
3382
  key: 'BearerAuth',
3349
3383
  scheme: 'bearer',
@@ -3353,15 +3387,15 @@ export const listOrganizationPeriods = (options) => (options?.client ?? client).
3353
3387
  name: 'X-API-Key',
3354
3388
  type: 'apiKey'
3355
3389
  }],
3356
- url: '/organization/v1/periods',
3390
+ url: '/workforce/v1/departments',
3357
3391
  ...options
3358
3392
  });
3359
3393
  /**
3360
- * Open a period
3394
+ * Establish a department
3361
3395
  *
3362
- * 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"}.
3363
3397
  */
3364
- export const openOrganizationPeriod = (options) => (options.client ?? client).post({
3398
+ export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
3365
3399
  security: [{
3366
3400
  key: 'BearerAuth',
3367
3401
  scheme: 'bearer',
@@ -3371,7 +3405,7 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
3371
3405
  name: 'X-API-Key',
3372
3406
  type: 'apiKey'
3373
3407
  }],
3374
- url: '/organization/v1/periods',
3408
+ url: '/workforce/v1/departments',
3375
3409
  ...options,
3376
3410
  headers: {
3377
3411
  'Content-Type': 'application/json',
@@ -3379,11 +3413,11 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
3379
3413
  }
3380
3414
  });
3381
3415
  /**
3382
- * Get a period
3416
+ * Get a department
3383
3417
  *
3384
- * 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.
3385
3419
  */
3386
- export const getOrganizationPeriod = (options) => (options.client ?? client).get({
3420
+ export const getOrganizationDepartment = (options) => (options.client ?? client).get({
3387
3421
  security: [{
3388
3422
  key: 'BearerAuth',
3389
3423
  scheme: 'bearer',
@@ -3393,15 +3427,15 @@ export const getOrganizationPeriod = (options) => (options.client ?? client).get
3393
3427
  name: 'X-API-Key',
3394
3428
  type: 'apiKey'
3395
3429
  }],
3396
- url: '/organization/v1/periods/{id}',
3430
+ url: '/workforce/v1/departments/{id}',
3397
3431
  ...options
3398
3432
  });
3399
3433
  /**
3400
- * Close a period
3434
+ * Reorganize a department
3401
3435
  *
3402
- * 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.
3403
3437
  */
3404
- export const closeOrganizationPeriod = (options) => (options.client ?? client).post({
3438
+ export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
3405
3439
  security: [{
3406
3440
  key: 'BearerAuth',
3407
3441
  scheme: 'bearer',
@@ -3411,15 +3445,19 @@ export const closeOrganizationPeriod = (options) => (options.client ?? client).p
3411
3445
  name: 'X-API-Key',
3412
3446
  type: 'apiKey'
3413
3447
  }],
3414
- url: '/organization/v1/periods/{id}/close',
3415
- ...options
3448
+ url: '/workforce/v1/departments/{id}',
3449
+ ...options,
3450
+ headers: {
3451
+ 'Content-Type': 'application/json',
3452
+ ...options.headers
3453
+ }
3416
3454
  });
3417
3455
  /**
3418
- * List objectives
3456
+ * Dissolve a department
3419
3457
  *
3420
- * 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.
3421
3459
  */
3422
- export const listOrganizationObjectives = (options) => (options?.client ?? client).get({
3460
+ export const dissolveOrganizationDepartment = (options) => (options.client ?? client).post({
3423
3461
  security: [{
3424
3462
  key: 'BearerAuth',
3425
3463
  scheme: 'bearer',
@@ -3429,15 +3467,15 @@ export const listOrganizationObjectives = (options) => (options?.client ?? clien
3429
3467
  name: 'X-API-Key',
3430
3468
  type: 'apiKey'
3431
3469
  }],
3432
- url: '/organization/v1/objectives',
3470
+ url: '/workforce/v1/departments/{id}/dissolve',
3433
3471
  ...options
3434
3472
  });
3435
3473
  /**
3436
- * Set an objective
3474
+ * Amend a department charter
3437
3475
  *
3438
- * 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.
3439
3477
  */
3440
- export const setOrganizationObjective = (options) => (options.client ?? client).post({
3478
+ export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
3441
3479
  security: [{
3442
3480
  key: 'BearerAuth',
3443
3481
  scheme: 'bearer',
@@ -3447,7 +3485,7 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
3447
3485
  name: 'X-API-Key',
3448
3486
  type: 'apiKey'
3449
3487
  }],
3450
- url: '/organization/v1/objectives',
3488
+ url: '/workforce/v1/departments/{id}/charter',
3451
3489
  ...options,
3452
3490
  headers: {
3453
3491
  'Content-Type': 'application/json',
@@ -3455,11 +3493,11 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
3455
3493
  }
3456
3494
  });
3457
3495
  /**
3458
- * Get an objective
3496
+ * List jobs
3459
3497
  *
3460
- * 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.
3461
3499
  */
3462
- export const getOrganizationObjective = (options) => (options.client ?? client).get({
3500
+ export const listOrganizationJobs = (options) => (options?.client ?? client).get({
3463
3501
  security: [{
3464
3502
  key: 'BearerAuth',
3465
3503
  scheme: 'bearer',
@@ -3469,15 +3507,15 @@ export const getOrganizationObjective = (options) => (options.client ?? client).
3469
3507
  name: 'X-API-Key',
3470
3508
  type: 'apiKey'
3471
3509
  }],
3472
- url: '/organization/v1/objectives/{id}',
3510
+ url: '/workforce/v1/jobs',
3473
3511
  ...options
3474
3512
  });
3475
3513
  /**
3476
- * Revise an objective
3514
+ * Define a job
3477
3515
  *
3478
- * 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."}.
3479
3517
  */
3480
- export const reviseOrganizationObjective = (options) => (options.client ?? client).patch({
3518
+ export const defineOrganizationJob = (options) => (options.client ?? client).post({
3481
3519
  security: [{
3482
3520
  key: 'BearerAuth',
3483
3521
  scheme: 'bearer',
@@ -3487,7 +3525,7 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
3487
3525
  name: 'X-API-Key',
3488
3526
  type: 'apiKey'
3489
3527
  }],
3490
- url: '/organization/v1/objectives/{id}',
3528
+ url: '/workforce/v1/jobs',
3491
3529
  ...options,
3492
3530
  headers: {
3493
3531
  'Content-Type': 'application/json',
@@ -3495,11 +3533,11 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
3495
3533
  }
3496
3534
  });
3497
3535
  /**
3498
- * Align an objective to parent objectives
3536
+ * Get a job
3499
3537
  *
3500
- * 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.
3501
3539
  */
3502
- export const alignOrganizationObjective = (options) => (options.client ?? client).put({
3540
+ export const getOrganizationJob = (options) => (options.client ?? client).get({
3503
3541
  security: [{
3504
3542
  key: 'BearerAuth',
3505
3543
  scheme: 'bearer',
@@ -3509,19 +3547,15 @@ export const alignOrganizationObjective = (options) => (options.client ?? client
3509
3547
  name: 'X-API-Key',
3510
3548
  type: 'apiKey'
3511
3549
  }],
3512
- url: '/organization/v1/objectives/{id}/parents',
3513
- ...options,
3514
- headers: {
3515
- 'Content-Type': 'application/json',
3516
- ...options.headers
3517
- }
3550
+ url: '/workforce/v1/jobs/{id}',
3551
+ ...options
3518
3552
  });
3519
3553
  /**
3520
- * Grade an objective
3554
+ * Revise a job
3521
3555
  *
3522
- * 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.
3523
3557
  */
3524
- export const gradeOrganizationObjective = (options) => (options.client ?? client).post({
3558
+ export const reviseOrganizationJob = (options) => (options.client ?? client).patch({
3525
3559
  security: [{
3526
3560
  key: 'BearerAuth',
3527
3561
  scheme: 'bearer',
@@ -3531,7 +3565,7 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
3531
3565
  name: 'X-API-Key',
3532
3566
  type: 'apiKey'
3533
3567
  }],
3534
- url: '/organization/v1/objectives/{id}/grade',
3568
+ url: '/workforce/v1/jobs/{id}',
3535
3569
  ...options,
3536
3570
  headers: {
3537
3571
  'Content-Type': 'application/json',
@@ -3539,11 +3573,11 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
3539
3573
  }
3540
3574
  });
3541
3575
  /**
3542
- * List key results
3576
+ * Retire a job
3543
3577
  *
3544
- * 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.
3545
3579
  */
3546
- export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
3580
+ export const retireOrganizationJob = (options) => (options.client ?? client).post({
3547
3581
  security: [{
3548
3582
  key: 'BearerAuth',
3549
3583
  scheme: 'bearer',
@@ -3553,15 +3587,33 @@ export const listOrganizationKeyResults = (options) => (options?.client ?? clien
3553
3587
  name: 'X-API-Key',
3554
3588
  type: 'apiKey'
3555
3589
  }],
3556
- url: '/organization/v1/key_results',
3590
+ url: '/workforce/v1/jobs/{id}/retire',
3557
3591
  ...options
3558
3592
  });
3559
3593
  /**
3560
- * Set a key result
3594
+ * List job ladders
3561
3595
  *
3562
- * 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.
3563
3597
  */
3564
- 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({
3565
3617
  security: [{
3566
3618
  key: 'BearerAuth',
3567
3619
  scheme: 'bearer',
@@ -3571,7 +3623,7 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
3571
3623
  name: 'X-API-Key',
3572
3624
  type: 'apiKey'
3573
3625
  }],
3574
- url: '/organization/v1/key_results',
3626
+ url: '/workforce/v1/ladders',
3575
3627
  ...options,
3576
3628
  headers: {
3577
3629
  'Content-Type': 'application/json',
@@ -3579,11 +3631,11 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
3579
3631
  }
3580
3632
  });
3581
3633
  /**
3582
- * Get a key result
3634
+ * Get a job ladder
3583
3635
  *
3584
- * 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.
3585
3637
  */
3586
- export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
3638
+ export const getOrganizationLadder = (options) => (options.client ?? client).get({
3587
3639
  security: [{
3588
3640
  key: 'BearerAuth',
3589
3641
  scheme: 'bearer',
@@ -3593,15 +3645,15 @@ export const getOrganizationKeyResult = (options) => (options.client ?? client).
3593
3645
  name: 'X-API-Key',
3594
3646
  type: 'apiKey'
3595
3647
  }],
3596
- url: '/organization/v1/key_results/{id}',
3648
+ url: '/workforce/v1/ladders/{id}',
3597
3649
  ...options
3598
3650
  });
3599
3651
  /**
3600
- * Revise a key result
3652
+ * Revise a job ladder
3601
3653
  *
3602
- * 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.
3603
3655
  */
3604
- export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
3656
+ export const reviseOrganizationLadder = (options) => (options.client ?? client).put({
3605
3657
  security: [{
3606
3658
  key: 'BearerAuth',
3607
3659
  scheme: 'bearer',
@@ -3611,7 +3663,7 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
3611
3663
  name: 'X-API-Key',
3612
3664
  type: 'apiKey'
3613
3665
  }],
3614
- url: '/organization/v1/key_results/{id}',
3666
+ url: '/workforce/v1/ladders/{id}',
3615
3667
  ...options,
3616
3668
  headers: {
3617
3669
  'Content-Type': 'application/json',
@@ -3619,11 +3671,11 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
3619
3671
  }
3620
3672
  });
3621
3673
  /**
3622
- * List specs
3674
+ * List positions
3623
3675
  *
3624
- * 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.
3625
3677
  */
3626
- export const listOrganizationSpecs = (options) => (options?.client ?? client).get({
3678
+ export const listOrganizationPositions = (options) => (options?.client ?? client).get({
3627
3679
  security: [{
3628
3680
  key: 'BearerAuth',
3629
3681
  scheme: 'bearer',
@@ -3633,15 +3685,15 @@ export const listOrganizationSpecs = (options) => (options?.client ?? client).ge
3633
3685
  name: 'X-API-Key',
3634
3686
  type: 'apiKey'
3635
3687
  }],
3636
- url: '/organization/v1/specs',
3688
+ url: '/workforce/v1/positions',
3637
3689
  ...options
3638
3690
  });
3639
3691
  /**
3640
- * Get a spec
3692
+ * Open positions
3641
3693
  *
3642
- * 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"}.
3643
3695
  */
3644
- export const getOrganizationSpec = (options) => (options.client ?? client).get({
3696
+ export const openOrganizationPositions = (options) => (options.client ?? client).post({
3645
3697
  security: [{
3646
3698
  key: 'BearerAuth',
3647
3699
  scheme: 'bearer',
@@ -3651,15 +3703,19 @@ export const getOrganizationSpec = (options) => (options.client ?? client).get({
3651
3703
  name: 'X-API-Key',
3652
3704
  type: 'apiKey'
3653
3705
  }],
3654
- url: '/organization/v1/specs/{kind}/{id}',
3655
- ...options
3706
+ url: '/workforce/v1/positions',
3707
+ ...options,
3708
+ headers: {
3709
+ 'Content-Type': 'application/json',
3710
+ ...options.headers
3711
+ }
3656
3712
  });
3657
3713
  /**
3658
- * Revise a spec
3714
+ * Get a position
3659
3715
  *
3660
- * 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.
3661
3717
  */
3662
- export const reviseOrganizationSpec = (options) => (options.client ?? client).put({
3718
+ export const getOrganizationPosition = (options) => (options.client ?? client).get({
3663
3719
  security: [{
3664
3720
  key: 'BearerAuth',
3665
3721
  scheme: 'bearer',
@@ -3669,19 +3725,15 @@ export const reviseOrganizationSpec = (options) => (options.client ?? client).pu
3669
3725
  name: 'X-API-Key',
3670
3726
  type: 'apiKey'
3671
3727
  }],
3672
- url: '/organization/v1/specs/{kind}/{id}',
3673
- ...options,
3674
- headers: {
3675
- 'Content-Type': 'application/json',
3676
- ...options.headers
3677
- }
3728
+ url: '/workforce/v1/positions/{id}',
3729
+ ...options
3678
3730
  });
3679
3731
  /**
3680
- * List spec revisions
3732
+ * Revise a position
3681
3733
  *
3682
- * 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.
3683
3735
  */
3684
- export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
3736
+ export const reviseOrganizationPosition = (options) => (options.client ?? client).patch({
3685
3737
  security: [{
3686
3738
  key: 'BearerAuth',
3687
3739
  scheme: 'bearer',
@@ -3691,15 +3743,19 @@ export const listOrganizationSpecRevisions = (options) => (options.client ?? cli
3691
3743
  name: 'X-API-Key',
3692
3744
  type: 'apiKey'
3693
3745
  }],
3694
- url: '/organization/v1/specs/{kind}/{id}/revisions',
3695
- ...options
3746
+ url: '/workforce/v1/positions/{id}',
3747
+ ...options,
3748
+ headers: {
3749
+ 'Content-Type': 'application/json',
3750
+ ...options.headers
3751
+ }
3696
3752
  });
3697
3753
  /**
3698
- * Diff two spec revisions
3754
+ * Close a position
3699
3755
  *
3700
- * 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.
3701
3757
  */
3702
- export const diffOrganizationSpec = (options) => (options.client ?? client).get({
3758
+ export const closeOrganizationPosition = (options) => (options.client ?? client).post({
3703
3759
  security: [{
3704
3760
  key: 'BearerAuth',
3705
3761
  scheme: 'bearer',
@@ -3709,15 +3765,15 @@ export const diffOrganizationSpec = (options) => (options.client ?? client).get(
3709
3765
  name: 'X-API-Key',
3710
3766
  type: 'apiKey'
3711
3767
  }],
3712
- url: '/organization/v1/specs/{kind}/{id}/diff',
3768
+ url: '/workforce/v1/positions/{id}/close',
3713
3769
  ...options
3714
3770
  });
3715
3771
  /**
3716
- * Read the effective spec
3772
+ * Freeze a position
3717
3773
  *
3718
- * 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.
3719
3775
  */
3720
- export const getOrganizationEffectiveSpec = (options) => (options?.client ?? client).get({
3776
+ export const freezeOrganizationPosition = (options) => (options.client ?? client).post({
3721
3777
  security: [{
3722
3778
  key: 'BearerAuth',
3723
3779
  scheme: 'bearer',
@@ -3727,15 +3783,15 @@ export const getOrganizationEffectiveSpec = (options) => (options?.client ?? cli
3727
3783
  name: 'X-API-Key',
3728
3784
  type: 'apiKey'
3729
3785
  }],
3730
- url: '/organization/v1/effective_spec',
3786
+ url: '/workforce/v1/positions/{id}/freeze',
3731
3787
  ...options
3732
3788
  });
3733
3789
  /**
3734
- * Plan reconciliation
3790
+ * Unfreeze a position
3735
3791
  *
3736
- * 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.
3737
3793
  */
3738
- export const planOrganizationReconcile = (options) => (options.client ?? client).get({
3794
+ export const unfreezeOrganizationPosition = (options) => (options.client ?? client).post({
3739
3795
  security: [{
3740
3796
  key: 'BearerAuth',
3741
3797
  scheme: 'bearer',
@@ -3745,15 +3801,15 @@ export const planOrganizationReconcile = (options) => (options.client ?? client)
3745
3801
  name: 'X-API-Key',
3746
3802
  type: 'apiKey'
3747
3803
  }],
3748
- url: '/organization/v1/reconcile/plan',
3804
+ url: '/workforce/v1/positions/{id}/unfreeze',
3749
3805
  ...options
3750
3806
  });
3751
3807
  /**
3752
- * Read reconcile status
3808
+ * Reassign a position's manager
3753
3809
  *
3754
- * 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.
3755
3811
  */
3756
- export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
3812
+ export const reassignOrganizationPositionManager = (options) => (options.client ?? client).put({
3757
3813
  security: [{
3758
3814
  key: 'BearerAuth',
3759
3815
  scheme: 'bearer',
@@ -3763,15 +3819,19 @@ export const getOrganizationReconcileStatus = (options) => (options.client ?? cl
3763
3819
  name: 'X-API-Key',
3764
3820
  type: 'apiKey'
3765
3821
  }],
3766
- url: '/organization/v1/reconcile/status',
3767
- ...options
3822
+ url: '/workforce/v1/positions/{id}/manager',
3823
+ ...options,
3824
+ headers: {
3825
+ 'Content-Type': 'application/json',
3826
+ ...options.headers
3827
+ }
3768
3828
  });
3769
3829
  /**
3770
- * Run reconciliation now
3830
+ * Regrade a position
3771
3831
  *
3772
- * 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.
3773
3833
  */
3774
- export const runOrganizationReconcile = (options) => (options.client ?? client).post({
3834
+ export const regradeOrganizationPosition = (options) => (options.client ?? client).put({
3775
3835
  security: [{
3776
3836
  key: 'BearerAuth',
3777
3837
  scheme: 'bearer',
@@ -3781,7 +3841,7 @@ export const runOrganizationReconcile = (options) => (options.client ?? client).
3781
3841
  name: 'X-API-Key',
3782
3842
  type: 'apiKey'
3783
3843
  }],
3784
- url: '/organization/v1/reconcile/run',
3844
+ url: '/workforce/v1/positions/{id}/level',
3785
3845
  ...options,
3786
3846
  headers: {
3787
3847
  'Content-Type': 'application/json',
@@ -3789,11 +3849,11 @@ export const runOrganizationReconcile = (options) => (options.client ?? client).
3789
3849
  }
3790
3850
  });
3791
3851
  /**
3792
- * Pause reconciliation
3852
+ * Designate a department head position
3793
3853
  *
3794
- * 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.
3795
3855
  */
3796
- export const pauseOrganizationReconcile = (options) => (options.client ?? client).post({
3856
+ export const designateOrganizationPositionHead = (options) => (options.client ?? client).post({
3797
3857
  security: [{
3798
3858
  key: 'BearerAuth',
3799
3859
  scheme: 'bearer',
@@ -3803,19 +3863,15 @@ export const pauseOrganizationReconcile = (options) => (options.client ?? client
3803
3863
  name: 'X-API-Key',
3804
3864
  type: 'apiKey'
3805
3865
  }],
3806
- url: '/organization/v1/reconcile/pause',
3807
- ...options,
3808
- headers: {
3809
- 'Content-Type': 'application/json',
3810
- ...options.headers
3811
- }
3866
+ url: '/workforce/v1/positions/{id}/designate_head',
3867
+ ...options
3812
3868
  });
3813
3869
  /**
3814
- * Resume reconciliation
3870
+ * Hire into a position
3815
3871
  *
3816
- * 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"}.
3817
3873
  */
3818
- export const resumeOrganizationReconcile = (options) => (options.client ?? client).post({
3874
+ export const hireOrganizationPosition = (options) => (options.client ?? client).post({
3819
3875
  security: [{
3820
3876
  key: 'BearerAuth',
3821
3877
  scheme: 'bearer',
@@ -3825,7 +3881,7 @@ export const resumeOrganizationReconcile = (options) => (options.client ?? clien
3825
3881
  name: 'X-API-Key',
3826
3882
  type: 'apiKey'
3827
3883
  }],
3828
- url: '/organization/v1/reconcile/resume',
3884
+ url: '/workforce/v1/positions/{id}/hire',
3829
3885
  ...options,
3830
3886
  headers: {
3831
3887
  'Content-Type': 'application/json',
@@ -3833,11 +3889,11 @@ export const resumeOrganizationReconcile = (options) => (options.client ?? clien
3833
3889
  }
3834
3890
  });
3835
3891
  /**
3836
- * Upgrade to a full sandbox
3892
+ * Replace a position's holder
3837
3893
  *
3838
- * 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"}.
3839
3895
  */
3840
- export const upgradeSandbox = (options) => (options.client ?? client).post({
3896
+ export const replaceOrganizationPositionHolder = (options) => (options.client ?? client).post({
3841
3897
  security: [{
3842
3898
  key: 'BearerAuth',
3843
3899
  scheme: 'bearer',
@@ -3847,7 +3903,7 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
3847
3903
  name: 'X-API-Key',
3848
3904
  type: 'apiKey'
3849
3905
  }],
3850
- url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
3906
+ url: '/workforce/v1/positions/{id}/replace_holder',
3851
3907
  ...options,
3852
3908
  headers: {
3853
3909
  'Content-Type': 'application/json',
@@ -3855,11 +3911,11 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
3855
3911
  }
3856
3912
  });
3857
3913
  /**
3858
- * Extend a running sandbox without shortening its deadline
3914
+ * List assignments
3859
3915
  *
3860
- * 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.
3861
3917
  */
3862
- export const extendSandbox = (options) => (options.client ?? client).post({
3918
+ export const listOrganizationAssignments = (options) => (options?.client ?? client).get({
3863
3919
  security: [{
3864
3920
  key: 'BearerAuth',
3865
3921
  scheme: 'bearer',
@@ -3869,19 +3925,15 @@ export const extendSandbox = (options) => (options.client ?? client).post({
3869
3925
  name: 'X-API-Key',
3870
3926
  type: 'apiKey'
3871
3927
  }],
3872
- url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
3873
- ...options,
3874
- headers: {
3875
- 'Content-Type': 'application/json',
3876
- ...options.headers
3877
- }
3928
+ url: '/workforce/v1/assignments',
3929
+ ...options
3878
3930
  });
3879
3931
  /**
3880
- * List live processes and retained observations
3932
+ * Get an assignment
3881
3933
  *
3882
- * 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.
3883
3935
  */
3884
- export const listObservedProcesses = (options) => (options.client ?? client).get({
3936
+ export const getOrganizationAssignment = (options) => (options.client ?? client).get({
3885
3937
  security: [{
3886
3938
  key: 'BearerAuth',
3887
3939
  scheme: 'bearer',
@@ -3891,15 +3943,15 @@ export const listObservedProcesses = (options) => (options.client ?? client).get
3891
3943
  name: 'X-API-Key',
3892
3944
  type: 'apiKey'
3893
3945
  }],
3894
- url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
3946
+ url: '/workforce/v1/assignments/{id}',
3895
3947
  ...options
3896
3948
  });
3897
3949
  /**
3898
- * Read bounded observed process output
3950
+ * Transfer an assignment to another position
3899
3951
  *
3900
- * 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"}.
3901
3953
  */
3902
- export const getObservedProcessOutput = (options) => (options.client ?? client).get({
3954
+ export const transferOrganizationAssignment = (options) => (options.client ?? client).post({
3903
3955
  security: [{
3904
3956
  key: 'BearerAuth',
3905
3957
  scheme: 'bearer',
@@ -3909,15 +3961,19 @@ export const getObservedProcessOutput = (options) => (options.client ?? client).
3909
3961
  name: 'X-API-Key',
3910
3962
  type: 'apiKey'
3911
3963
  }],
3912
- url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
3913
- ...options
3964
+ url: '/workforce/v1/assignments/{id}/transfer',
3965
+ ...options,
3966
+ headers: {
3967
+ 'Content-Type': 'application/json',
3968
+ ...options.headers
3969
+ }
3914
3970
  });
3915
3971
  /**
3916
- * Start a task whose output is pushed off the machine while it runs
3972
+ * End an assignment
3917
3973
  *
3918
- * 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"}.
3919
3975
  */
3920
- export const startSandboxTask = (options) => (options.client ?? client).post({
3976
+ export const terminateOrganizationAssignment = (options) => (options.client ?? client).post({
3921
3977
  security: [{
3922
3978
  key: 'BearerAuth',
3923
3979
  scheme: 'bearer',
@@ -3927,7 +3983,7 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
3927
3983
  name: 'X-API-Key',
3928
3984
  type: 'apiKey'
3929
3985
  }],
3930
- url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
3986
+ url: '/workforce/v1/assignments/{id}/terminate',
3931
3987
  ...options,
3932
3988
  headers: {
3933
3989
  'Content-Type': 'application/json',
@@ -3935,11 +3991,11 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
3935
3991
  }
3936
3992
  });
3937
3993
  /**
3938
- * Read a range of a task's pushed output
3994
+ * Make an assignment primary
3939
3995
  *
3940
- * 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.
3941
3997
  */
3942
- export const getSandboxTaskLog = (options) => (options.client ?? client).get({
3998
+ export const makePrimaryOrganizationAssignment = (options) => (options.client ?? client).post({
3943
3999
  security: [{
3944
4000
  key: 'BearerAuth',
3945
4001
  scheme: 'bearer',
@@ -3949,89 +4005,69 @@ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
3949
4005
  name: 'X-API-Key',
3950
4006
  type: 'apiKey'
3951
4007
  }],
3952
- url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
4008
+ url: '/workforce/v1/assignments/{id}/make_primary',
3953
4009
  ...options
3954
4010
  });
3955
4011
  /**
3956
- * Kill sandbox
4012
+ * List actors holding positions
3957
4013
  *
3958
- * 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.
3959
4015
  */
3960
- export const deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
3961
- security: [
3962
- {
3963
- key: 'sandbox-ApiKeyAuth',
3964
- name: 'X-API-Key',
3965
- type: 'apiKey'
3966
- },
3967
- {
3968
- key: 'sandbox-AuthProviderBearerAuth',
4016
+ export const listOrganizationActors = (options) => (options?.client ?? client).get({
4017
+ security: [{
4018
+ key: 'BearerAuth',
3969
4019
  scheme: 'bearer',
3970
4020
  type: 'http'
3971
- },
3972
- {
3973
- key: 'sandbox-AuthProviderTeamAuth',
3974
- name: 'X-Team-ID',
3975
- type: 'apiKey'
3976
- },
3977
- { name: 'X-Admin-Token', type: 'apiKey' },
3978
- {
3979
- key: 'sandbox-AdminTeamAuth',
3980
- name: 'X-Team-ID',
4021
+ }, {
4022
+ key: 'ApiKeyAuth',
4023
+ name: 'X-API-Key',
3981
4024
  type: 'apiKey'
3982
- },
3983
- {
3984
- key: 'sandbox-AdminJWTAuth',
3985
- scheme: 'bearer',
3986
- type: 'http'
3987
- }
3988
- ],
3989
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4025
+ }],
4026
+ url: '/workforce/v1/actors',
3990
4027
  ...options
3991
4028
  });
3992
4029
  /**
3993
- * Sandbox
4030
+ * Get the position chain of an actor
3994
4031
  *
3995
- * 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.
3996
4033
  */
3997
- export const getSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).get({
3998
- security: [
3999
- {
4000
- key: 'sandbox-ApiKeyAuth',
4001
- name: 'X-API-Key',
4002
- type: 'apiKey'
4003
- },
4004
- {
4005
- key: 'sandbox-AuthProviderBearerAuth',
4034
+ export const getOrganizationActor = (options) => (options.client ?? client).get({
4035
+ security: [{
4036
+ key: 'BearerAuth',
4006
4037
  scheme: 'bearer',
4007
4038
  type: 'http'
4008
- },
4009
- {
4010
- key: 'sandbox-AuthProviderTeamAuth',
4011
- name: 'X-Team-ID',
4012
- type: 'apiKey'
4013
- },
4014
- { name: 'X-Admin-Token', type: 'apiKey' },
4015
- {
4016
- key: 'sandbox-AdminTeamAuth',
4017
- name: 'X-Team-ID',
4039
+ }, {
4040
+ key: 'ApiKeyAuth',
4041
+ name: 'X-API-Key',
4018
4042
  type: 'apiKey'
4019
- },
4020
- {
4021
- key: 'sandbox-AdminJWTAuth',
4043
+ }],
4044
+ url: '/workforce/v1/actors/{actor}',
4045
+ ...options
4046
+ });
4047
+ /**
4048
+ * List periods
4049
+ *
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.
4051
+ */
4052
+ export const listOrganizationPeriods = (options) => (options?.client ?? client).get({
4053
+ security: [{
4054
+ key: 'BearerAuth',
4022
4055
  scheme: 'bearer',
4023
4056
  type: 'http'
4024
- }
4025
- ],
4026
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4057
+ }, {
4058
+ key: 'ApiKeyAuth',
4059
+ name: 'X-API-Key',
4060
+ type: 'apiKey'
4061
+ }],
4062
+ url: '/workforce/v1/periods',
4027
4063
  ...options
4028
4064
  });
4029
4065
  /**
4030
- * Rename a sandbox
4066
+ * Open a period
4031
4067
  *
4032
- * 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.
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"}.
4033
4069
  */
4034
- export const renameSandbox = (options) => (options.client ?? client).patch({
4070
+ export const openOrganizationPeriod = (options) => (options.client ?? client).post({
4035
4071
  security: [{
4036
4072
  key: 'BearerAuth',
4037
4073
  scheme: 'bearer',
@@ -4041,7 +4077,7 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
4041
4077
  name: 'X-API-Key',
4042
4078
  type: 'apiKey'
4043
4079
  }],
4044
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4080
+ url: '/workforce/v1/periods',
4045
4081
  ...options,
4046
4082
  headers: {
4047
4083
  'Content-Type': 'application/json',
@@ -4049,13 +4085,11 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
4049
4085
  }
4050
4086
  });
4051
4087
  /**
4052
- * Act on a phone sandbox's screen
4053
- *
4054
- * 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.
4088
+ * Get a period
4055
4089
  *
4056
- * 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.
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.
4057
4091
  */
4058
- export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
4092
+ export const getOrganizationPeriod = (options) => (options.client ?? client).get({
4059
4093
  security: [{
4060
4094
  key: 'BearerAuth',
4061
4095
  scheme: 'bearer',
@@ -4065,19 +4099,15 @@ export const actOnSandboxDisplay = (options) => (options.client ?? client).post(
4065
4099
  name: 'X-API-Key',
4066
4100
  type: 'apiKey'
4067
4101
  }],
4068
- url: '/sandbox/v1/sandboxes/{sandboxID}/act',
4069
- ...options,
4070
- headers: {
4071
- 'Content-Type': 'application/json',
4072
- ...options.headers
4073
- }
4102
+ url: '/workforce/v1/periods/{id}',
4103
+ ...options
4074
4104
  });
4075
4105
  /**
4076
- * Remove a file or directory in the sandbox
4106
+ * Close a period
4077
4107
  *
4078
- * 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.
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.
4079
4109
  */
4080
- export const removeSandboxFile = (options) => (options.client ?? client).delete({
4110
+ export const closeOrganizationPeriod = (options) => (options.client ?? client).post({
4081
4111
  security: [{
4082
4112
  key: 'BearerAuth',
4083
4113
  scheme: 'bearer',
@@ -4087,15 +4117,15 @@ export const removeSandboxFile = (options) => (options.client ?? client).delete(
4087
4117
  name: 'X-API-Key',
4088
4118
  type: 'apiKey'
4089
4119
  }],
4090
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4120
+ url: '/workforce/v1/periods/{id}/close',
4091
4121
  ...options
4092
4122
  });
4093
4123
  /**
4094
- * Read a file in the sandbox
4124
+ * List objectives
4095
4125
  *
4096
- * 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.
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.
4097
4127
  */
4098
- export const readSandboxFile = (options) => (options.client ?? client).get({
4128
+ export const listOrganizationObjectives = (options) => (options?.client ?? client).get({
4099
4129
  security: [{
4100
4130
  key: 'BearerAuth',
4101
4131
  scheme: 'bearer',
@@ -4105,15 +4135,15 @@ export const readSandboxFile = (options) => (options.client ?? client).get({
4105
4135
  name: 'X-API-Key',
4106
4136
  type: 'apiKey'
4107
4137
  }],
4108
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4138
+ url: '/workforce/v1/objectives',
4109
4139
  ...options
4110
4140
  });
4111
4141
  /**
4112
- * Write a file in the sandbox
4142
+ * Set an objective
4113
4143
  *
4114
- * 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"}.
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"}.
4115
4145
  */
4116
- export const writeSandboxFile = (options) => (options.client ?? client).put({
4146
+ export const setOrganizationObjective = (options) => (options.client ?? client).post({
4117
4147
  security: [{
4118
4148
  key: 'BearerAuth',
4119
4149
  scheme: 'bearer',
@@ -4123,7 +4153,7 @@ export const writeSandboxFile = (options) => (options.client ?? client).put({
4123
4153
  name: 'X-API-Key',
4124
4154
  type: 'apiKey'
4125
4155
  }],
4126
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4156
+ url: '/workforce/v1/objectives',
4127
4157
  ...options,
4128
4158
  headers: {
4129
4159
  'Content-Type': 'application/json',
@@ -4131,11 +4161,11 @@ export const writeSandboxFile = (options) => (options.client ?? client).put({
4131
4161
  }
4132
4162
  });
4133
4163
  /**
4134
- * List files in a sandbox directory
4164
+ * Get an objective
4135
4165
  *
4136
- * 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.
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.
4137
4167
  */
4138
- export const listSandboxFiles = (options) => (options.client ?? client).get({
4168
+ export const getOrganizationObjective = (options) => (options.client ?? client).get({
4139
4169
  security: [{
4140
4170
  key: 'BearerAuth',
4141
4171
  scheme: 'bearer',
@@ -4145,15 +4175,15 @@ export const listSandboxFiles = (options) => (options.client ?? client).get({
4145
4175
  name: 'X-API-Key',
4146
4176
  type: 'apiKey'
4147
4177
  }],
4148
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
4178
+ url: '/workforce/v1/objectives/{id}',
4149
4179
  ...options
4150
4180
  });
4151
4181
  /**
4152
- * Create a directory in the sandbox
4182
+ * Revise an objective
4153
4183
  *
4154
- * 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.
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"}.
4155
4185
  */
4156
- export const makeSandboxDirectory = (options) => (options.client ?? client).post({
4186
+ export const reviseOrganizationObjective = (options) => (options.client ?? client).patch({
4157
4187
  security: [{
4158
4188
  key: 'BearerAuth',
4159
4189
  scheme: 'bearer',
@@ -4163,15 +4193,81 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
4163
4193
  name: 'X-API-Key',
4164
4194
  type: 'apiKey'
4165
4195
  }],
4166
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
4196
+ url: '/workforce/v1/objectives/{id}',
4197
+ ...options,
4198
+ headers: {
4199
+ 'Content-Type': 'application/json',
4200
+ ...options.headers
4201
+ }
4202
+ });
4203
+ /**
4204
+ * Align an objective to parent objectives
4205
+ *
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}]}.
4207
+ */
4208
+ export const alignOrganizationObjective = (options) => (options.client ?? client).put({
4209
+ security: [{
4210
+ key: 'BearerAuth',
4211
+ scheme: 'bearer',
4212
+ type: 'http'
4213
+ }, {
4214
+ key: 'ApiKeyAuth',
4215
+ name: 'X-API-Key',
4216
+ type: 'apiKey'
4217
+ }],
4218
+ url: '/workforce/v1/objectives/{id}/parents',
4219
+ ...options,
4220
+ headers: {
4221
+ 'Content-Type': 'application/json',
4222
+ ...options.headers
4223
+ }
4224
+ });
4225
+ /**
4226
+ * Grade an objective
4227
+ *
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."}.
4229
+ */
4230
+ export const gradeOrganizationObjective = (options) => (options.client ?? client).post({
4231
+ security: [{
4232
+ key: 'BearerAuth',
4233
+ scheme: 'bearer',
4234
+ type: 'http'
4235
+ }, {
4236
+ key: 'ApiKeyAuth',
4237
+ name: 'X-API-Key',
4238
+ type: 'apiKey'
4239
+ }],
4240
+ url: '/workforce/v1/objectives/{id}/grade',
4241
+ ...options,
4242
+ headers: {
4243
+ 'Content-Type': 'application/json',
4244
+ ...options.headers
4245
+ }
4246
+ });
4247
+ /**
4248
+ * List key results
4249
+ *
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.
4251
+ */
4252
+ export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
4253
+ security: [{
4254
+ key: 'BearerAuth',
4255
+ scheme: 'bearer',
4256
+ type: 'http'
4257
+ }, {
4258
+ key: 'ApiKeyAuth',
4259
+ name: 'X-API-Key',
4260
+ type: 'apiKey'
4261
+ }],
4262
+ url: '/workforce/v1/key_results',
4167
4263
  ...options
4168
4264
  });
4169
4265
  /**
4170
- * Run a command in the sandbox
4266
+ * Set a key result
4171
4267
  *
4172
- * 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"}.
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"}}.
4173
4269
  */
4174
- export const runSandboxCommand = (options) => (options.client ?? client).post({
4270
+ export const setOrganizationKeyResult = (options) => (options.client ?? client).post({
4175
4271
  security: [{
4176
4272
  key: 'BearerAuth',
4177
4273
  scheme: 'bearer',
@@ -4181,7 +4277,7 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
4181
4277
  name: 'X-API-Key',
4182
4278
  type: 'apiKey'
4183
4279
  }],
4184
- url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
4280
+ url: '/workforce/v1/key_results',
4185
4281
  ...options,
4186
4282
  headers: {
4187
4283
  'Content-Type': 'application/json',
@@ -4189,11 +4285,11 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
4189
4285
  }
4190
4286
  });
4191
4287
  /**
4192
- * Start adding a phone of your own
4288
+ * Get a key result
4193
4289
  *
4194
- * 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'}.
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.
4195
4291
  */
4196
- export const createByodPairing = (options) => (options?.client ?? client).post({
4292
+ export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
4197
4293
  security: [{
4198
4294
  key: 'BearerAuth',
4199
4295
  scheme: 'bearer',
@@ -4203,15 +4299,15 @@ export const createByodPairing = (options) => (options?.client ?? client).post({
4203
4299
  name: 'X-API-Key',
4204
4300
  type: 'apiKey'
4205
4301
  }],
4206
- url: '/sandbox/v1/byod/pairings',
4302
+ url: '/workforce/v1/key_results/{id}',
4207
4303
  ...options
4208
4304
  });
4209
4305
  /**
4210
- * List your organization's own devices
4306
+ * Revise a key result
4211
4307
  *
4212
- * 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:[]}]}.
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"}.
4213
4309
  */
4214
- export const listByodDevices = (options) => (options?.client ?? client).get({
4310
+ export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
4215
4311
  security: [{
4216
4312
  key: 'BearerAuth',
4217
4313
  scheme: 'bearer',
@@ -4221,15 +4317,37 @@ export const listByodDevices = (options) => (options?.client ?? client).get({
4221
4317
  name: 'X-API-Key',
4222
4318
  type: 'apiKey'
4223
4319
  }],
4224
- url: '/sandbox/v1/byod/devices',
4320
+ url: '/workforce/v1/key_results/{id}',
4321
+ ...options,
4322
+ headers: {
4323
+ 'Content-Type': 'application/json',
4324
+ ...options.headers
4325
+ }
4326
+ });
4327
+ /**
4328
+ * List specs
4329
+ *
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.
4331
+ */
4332
+ export const listOrganizationSpecs = (options) => (options?.client ?? client).get({
4333
+ security: [{
4334
+ key: 'BearerAuth',
4335
+ scheme: 'bearer',
4336
+ type: 'http'
4337
+ }, {
4338
+ key: 'ApiKeyAuth',
4339
+ name: 'X-API-Key',
4340
+ type: 'apiKey'
4341
+ }],
4342
+ url: '/workforce/v1/specs',
4225
4343
  ...options
4226
4344
  });
4227
4345
  /**
4228
- * Read one of your organization's devices
4346
+ * Get a spec
4229
4347
  *
4230
- * 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.
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.
4231
4349
  */
4232
- export const getByodDevice = (options) => (options.client ?? client).get({
4350
+ export const getOrganizationSpec = (options) => (options.client ?? client).get({
4233
4351
  security: [{
4234
4352
  key: 'BearerAuth',
4235
4353
  scheme: 'bearer',
@@ -4239,15 +4357,15 @@ export const getByodDevice = (options) => (options.client ?? client).get({
4239
4357
  name: 'X-API-Key',
4240
4358
  type: 'apiKey'
4241
4359
  }],
4242
- url: '/sandbox/v1/byod/devices/{deviceID}',
4360
+ url: '/workforce/v1/specs/{kind}/{id}',
4243
4361
  ...options
4244
4362
  });
4245
4363
  /**
4246
- * Rename one of your organization's devices
4364
+ * Revise a spec
4247
4365
  *
4248
- * 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.
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"}}}}.
4249
4367
  */
4250
- export const updateByodDevice = (options) => (options.client ?? client).patch({
4368
+ export const reviseOrganizationSpec = (options) => (options.client ?? client).put({
4251
4369
  security: [{
4252
4370
  key: 'BearerAuth',
4253
4371
  scheme: 'bearer',
@@ -4257,7 +4375,7 @@ export const updateByodDevice = (options) => (options.client ?? client).patch({
4257
4375
  name: 'X-API-Key',
4258
4376
  type: 'apiKey'
4259
4377
  }],
4260
- url: '/sandbox/v1/byod/devices/{deviceID}',
4378
+ url: '/workforce/v1/specs/{kind}/{id}',
4261
4379
  ...options,
4262
4380
  headers: {
4263
4381
  'Content-Type': 'application/json',
@@ -4265,11 +4383,11 @@ export const updateByodDevice = (options) => (options.client ?? client).patch({
4265
4383
  }
4266
4384
  });
4267
4385
  /**
4268
- * Disconnect a device and revoke its credential
4386
+ * List spec revisions
4269
4387
  *
4270
- * 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}.
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.
4271
4389
  */
4272
- export const disconnectByodDevice = (options) => (options.client ?? client).post({
4390
+ export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
4273
4391
  security: [{
4274
4392
  key: 'BearerAuth',
4275
4393
  scheme: 'bearer',
@@ -4279,15 +4397,15 @@ export const disconnectByodDevice = (options) => (options.client ?? client).post
4279
4397
  name: 'X-API-Key',
4280
4398
  type: 'apiKey'
4281
4399
  }],
4282
- url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
4400
+ url: '/workforce/v1/specs/{kind}/{id}/revisions',
4283
4401
  ...options
4284
4402
  });
4285
4403
  /**
4286
- * Read a pairing for the phone's Allow screen
4404
+ * Diff two spec revisions
4287
4405
  *
4288
- * 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'}.
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.
4289
4407
  */
4290
- export const getByodPairing = (options) => (options.client ?? client).get({
4408
+ export const diffOrganizationSpec = (options) => (options.client ?? client).get({
4291
4409
  security: [{
4292
4410
  key: 'BearerAuth',
4293
4411
  scheme: 'bearer',
@@ -4297,15 +4415,15 @@ export const getByodPairing = (options) => (options.client ?? client).get({
4297
4415
  name: 'X-API-Key',
4298
4416
  type: 'apiKey'
4299
4417
  }],
4300
- url: '/sandbox/v1/byod/pairings/{code}',
4418
+ url: '/workforce/v1/specs/{kind}/{id}/diff',
4301
4419
  ...options
4302
4420
  });
4303
4421
  /**
4304
- * Claim a pairing and register the phone
4422
+ * Read the effective spec
4305
4423
  *
4306
- * 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-develop.praxisusercontent.com/'}.
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.
4307
4425
  */
4308
- export const claimByodPairing = (options) => (options.client ?? client).post({
4426
+ export const getOrganizationEffectiveSpec = (options) => (options?.client ?? client).get({
4309
4427
  security: [{
4310
4428
  key: 'BearerAuth',
4311
4429
  scheme: 'bearer',
@@ -4315,7 +4433,123 @@ export const claimByodPairing = (options) => (options.client ?? client).post({
4315
4433
  name: 'X-API-Key',
4316
4434
  type: 'apiKey'
4317
4435
  }],
4318
- url: '/sandbox/v1/byod/pairings/{code}/claim',
4436
+ url: '/workforce/v1/effective_spec',
4437
+ ...options
4438
+ });
4439
+ /**
4440
+ * Read the spec schema
4441
+ *
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.
4443
+ */
4444
+ export const getOrganizationSpecSchema = (options) => (options?.client ?? client).get({
4445
+ security: [{
4446
+ key: 'BearerAuth',
4447
+ scheme: 'bearer',
4448
+ type: 'http'
4449
+ }, {
4450
+ key: 'ApiKeyAuth',
4451
+ name: 'X-API-Key',
4452
+ type: 'apiKey'
4453
+ }],
4454
+ url: '/workforce/v1/spec_schema',
4455
+ ...options
4456
+ });
4457
+ /**
4458
+ * Plan reconciliation
4459
+ *
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.
4461
+ */
4462
+ export const planOrganizationReconcile = (options) => (options.client ?? client).get({
4463
+ security: [{
4464
+ key: 'BearerAuth',
4465
+ scheme: 'bearer',
4466
+ type: 'http'
4467
+ }, {
4468
+ key: 'ApiKeyAuth',
4469
+ name: 'X-API-Key',
4470
+ type: 'apiKey'
4471
+ }],
4472
+ url: '/workforce/v1/reconcile/plan',
4473
+ ...options
4474
+ });
4475
+ /**
4476
+ * Read reconcile status
4477
+ *
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.
4479
+ */
4480
+ export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
4481
+ security: [{
4482
+ key: 'BearerAuth',
4483
+ scheme: 'bearer',
4484
+ type: 'http'
4485
+ }, {
4486
+ key: 'ApiKeyAuth',
4487
+ name: 'X-API-Key',
4488
+ type: 'apiKey'
4489
+ }],
4490
+ url: '/workforce/v1/reconcile/status',
4491
+ ...options
4492
+ });
4493
+ /**
4494
+ * Run reconciliation now
4495
+ *
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"}.
4497
+ */
4498
+ export const runOrganizationReconcile = (options) => (options.client ?? client).post({
4499
+ security: [{
4500
+ key: 'BearerAuth',
4501
+ scheme: 'bearer',
4502
+ type: 'http'
4503
+ }, {
4504
+ key: 'ApiKeyAuth',
4505
+ name: 'X-API-Key',
4506
+ type: 'apiKey'
4507
+ }],
4508
+ url: '/workforce/v1/reconcile/run',
4509
+ ...options,
4510
+ headers: {
4511
+ 'Content-Type': 'application/json',
4512
+ ...options.headers
4513
+ }
4514
+ });
4515
+ /**
4516
+ * Pause reconciliation
4517
+ *
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"}.
4519
+ */
4520
+ export const pauseOrganizationReconcile = (options) => (options.client ?? client).post({
4521
+ security: [{
4522
+ key: 'BearerAuth',
4523
+ scheme: 'bearer',
4524
+ type: 'http'
4525
+ }, {
4526
+ key: 'ApiKeyAuth',
4527
+ name: 'X-API-Key',
4528
+ type: 'apiKey'
4529
+ }],
4530
+ url: '/workforce/v1/reconcile/pause',
4531
+ ...options,
4532
+ headers: {
4533
+ 'Content-Type': 'application/json',
4534
+ ...options.headers
4535
+ }
4536
+ });
4537
+ /**
4538
+ * Resume reconciliation
4539
+ *
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"}.
4541
+ */
4542
+ export const resumeOrganizationReconcile = (options) => (options.client ?? client).post({
4543
+ security: [{
4544
+ key: 'BearerAuth',
4545
+ scheme: 'bearer',
4546
+ type: 'http'
4547
+ }, {
4548
+ key: 'ApiKeyAuth',
4549
+ name: 'X-API-Key',
4550
+ type: 'apiKey'
4551
+ }],
4552
+ url: '/workforce/v1/reconcile/resume',
4319
4553
  ...options,
4320
4554
  headers: {
4321
4555
  'Content-Type': 'application/json',
@@ -4897,7 +5131,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
4897
5131
  /**
4898
5132
  * Create deployment
4899
5133
  *
4900
- * 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"}}.
4901
5135
  */
4902
5136
  export const deploymentsCreate = (options) => (options.client ?? client).post({
4903
5137
  security: [{
@@ -4937,7 +5171,7 @@ export const deploymentsRetrieve = (options) => (options.client ?? client).get({
4937
5171
  /**
4938
5172
  * Update deployment
4939
5173
  *
4940
- * 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.
4941
5175
  */
4942
5176
  export const deploymentsUpdate = (options) => (options.client ?? client).post({
4943
5177
  security: [{
@@ -8899,87 +9133,649 @@ export const cutCreateBinding = (options) => (options.client ?? client).post({
8899
9133
  name: 'X-API-Key',
8900
9134
  type: 'apiKey'
8901
9135
  }],
8902
- url: '/cut/v1/projects/{project_id}/bindings',
8903
- ...options,
8904
- headers: {
8905
- 'Content-Type': 'application/json',
8906
- ...options.headers
8907
- }
9136
+ url: '/cut/v1/projects/{project_id}/bindings',
9137
+ ...options,
9138
+ headers: {
9139
+ 'Content-Type': 'application/json',
9140
+ ...options.headers
9141
+ }
9142
+ });
9143
+ /**
9144
+ * Remove library binding
9145
+ *
9146
+ * Detach a library alias obtained from bindings.list after removing all timeline clips that reference its library. BINDING_IN_USE returns 409 while references remain; inspect timeline and edit those clips first. Removal must preserve the one writable default upload binding.
9147
+ */
9148
+ export const cutDeleteBinding = (options) => (options.client ?? client).delete({
9149
+ security: [{
9150
+ key: 'BearerAuth',
9151
+ scheme: 'bearer',
9152
+ type: 'http'
9153
+ }, {
9154
+ key: 'ApiKeyAuth',
9155
+ name: 'X-API-Key',
9156
+ type: 'apiKey'
9157
+ }],
9158
+ url: '/cut/v1/projects/{project_id}/bindings/{name}',
9159
+ ...options
9160
+ });
9161
+ /**
9162
+ * Import project media
9163
+ *
9164
+ * Import a URL, data URI or existing file into a writable project media library. Select binding from bindings.list or omit it to use default_upload. Save library_id and asset_id from the result and use them as libraryId and assetId inside execute script media references; overwrites follow the source asset latest version.
9165
+ */
9166
+ export const cutImportMedia = (options) => (options.client ?? client).post({
9167
+ security: [{
9168
+ key: 'BearerAuth',
9169
+ scheme: 'bearer',
9170
+ type: 'http'
9171
+ }, {
9172
+ key: 'ApiKeyAuth',
9173
+ name: 'X-API-Key',
9174
+ type: 'apiKey'
9175
+ }],
9176
+ url: '/cut/v1/projects/{project_id}/media:import',
9177
+ ...options,
9178
+ headers: {
9179
+ 'Content-Type': 'application/json',
9180
+ ...options.headers
9181
+ }
9182
+ });
9183
+ /**
9184
+ * List project exports
9185
+ *
9186
+ * Find export jobs associated with this project before polling or canceling a render. Copy an export id into praxis.cut.exports.retrieve or cancel. Continue with next_page_token as page_token when present; queued or in-progress jobs have not produced a final media asset.
9187
+ */
9188
+ export const cutListExports = (options) => (options.client ?? client).get({
9189
+ security: [{
9190
+ key: 'BearerAuth',
9191
+ scheme: 'bearer',
9192
+ type: 'http'
9193
+ }, {
9194
+ key: 'ApiKeyAuth',
9195
+ name: 'X-API-Key',
9196
+ type: 'apiKey'
9197
+ }],
9198
+ url: '/cut/v1/projects/{project_id}/exports',
9199
+ ...options
9200
+ });
9201
+ /**
9202
+ * Create video export
9203
+ *
9204
+ * Start an asynchronous video export from the project into a writable bound media library. Choose binding from bindings.list or omit it for default_upload, and optionally select revision and output settings. HTTP 202 only accepts the job; poll praxis.cut.exports.retrieve using the returned id until status is done, failed or canceled. On done, asset identifies the video written back to praxis.media. Each call starts a job, so retrieve a known job before retrying a submission.
9205
+ */
9206
+ export const cutCreateExport = (options) => (options.client ?? client).post({
9207
+ security: [{
9208
+ key: 'BearerAuth',
9209
+ scheme: 'bearer',
9210
+ type: 'http'
9211
+ }, {
9212
+ key: 'ApiKeyAuth',
9213
+ name: 'X-API-Key',
9214
+ type: 'apiKey'
9215
+ }],
9216
+ url: '/cut/v1/projects/{project_id}/exports',
9217
+ ...options,
9218
+ headers: {
9219
+ 'Content-Type': 'application/json',
9220
+ ...options.headers
9221
+ }
9222
+ });
9223
+ /**
9224
+ * Create draft range render
9225
+ *
9226
+ * Render one interval of the timeline so you can hear or look at how that passage comes out, without publishing anything to a media library. Choose kind audio for the mixed soundtrack as an .m4a file, or kind video for a draft-quality .mp4 with picture and sound. from and to are seconds on the project clock and must satisfy 0 <= from < to, to <= the timeline duration (an end up to 0.05 s past it, a rounded duration, is read as the end), and to - from <= 120; a longer passage is requested in several 分段请求 ranges and joined by the caller. The result is a temporary file (purpose user_data) that expires 24 hours after it is stored and is never imported into a library, so it is not a deliverable and carries no cut-export tag. HTTP 202 only accepts the job; poll praxis.cut.renders.retrieve using the returned id until status is done or failed, then read url while it lasts. A draft also bills like a draft export, by rendered seconds. Each project runs at most 2 draft renders at a time, a budget separate from its exports; a third answers HTTP 429 CUT_BUSY and the same call succeeds once one finishes.
9227
+ */
9228
+ export const cutCreateRender = (options) => (options.client ?? client).post({
9229
+ security: [{
9230
+ key: 'BearerAuth',
9231
+ scheme: 'bearer',
9232
+ type: 'http'
9233
+ }, {
9234
+ key: 'ApiKeyAuth',
9235
+ name: 'X-API-Key',
9236
+ type: 'apiKey'
9237
+ }],
9238
+ url: '/cut/v1/projects/{project_id}/renders',
9239
+ ...options,
9240
+ headers: {
9241
+ 'Content-Type': 'application/json',
9242
+ ...options.headers
9243
+ }
9244
+ });
9245
+ /**
9246
+ * Retrieve draft range render
9247
+ *
9248
+ * Poll a draft render id returned by projects.renders.create to see whether the interval is ready, then read url while it lasts. queued and rendering are in progress; done provides file_id and a short-lived url for the rendered .m4a or .mp4; failed provides error. Only done yields a url, and the file behind it disappears 24 hours after it was stored, so retrieve again when the link has expired.
9249
+ */
9250
+ export const cutRetrieveRender = (options) => (options.client ?? client).get({
9251
+ security: [{
9252
+ key: 'BearerAuth',
9253
+ scheme: 'bearer',
9254
+ type: 'http'
9255
+ }, {
9256
+ key: 'ApiKeyAuth',
9257
+ name: 'X-API-Key',
9258
+ type: 'apiKey'
9259
+ }],
9260
+ url: '/cut/v1/renders/{render_id}',
9261
+ ...options
9262
+ });
9263
+ /**
9264
+ * Retrieve video export
9265
+ *
9266
+ * Poll an export id returned by projects.exports.create or list to observe render progress. queued, fetching, rendering, stitching and saving are in progress; done provides asset in the target library, failed provides error, and canceled means the job stopped. Only done confirms a usable output asset.
9267
+ */
9268
+ export const cutRetrieveExport = (options) => (options.client ?? client).get({
9269
+ security: [{
9270
+ key: 'BearerAuth',
9271
+ scheme: 'bearer',
9272
+ type: 'http'
9273
+ }, {
9274
+ key: 'ApiKeyAuth',
9275
+ name: 'X-API-Key',
9276
+ type: 'apiKey'
9277
+ }],
9278
+ url: '/cut/v1/exports/{export_id}',
9279
+ ...options
9280
+ });
9281
+ /**
9282
+ * Cancel video export
9283
+ *
9284
+ * Request cancellation of an export obtained from projects.exports.create or list when its output is no longer needed. Read the returned job status and retrieve it to confirm the terminal outcome; do not interpret a cancellation request as successful rendering.
9285
+ */
9286
+ export const cutCancelExport = (options) => (options.client ?? client).post({
9287
+ security: [{
9288
+ key: 'BearerAuth',
9289
+ scheme: 'bearer',
9290
+ type: 'http'
9291
+ }, {
9292
+ key: 'ApiKeyAuth',
9293
+ name: 'X-API-Key',
9294
+ type: 'apiKey'
9295
+ }],
9296
+ url: '/cut/v1/exports/{export_id}:cancel',
9297
+ ...options
9298
+ });
9299
+ /**
9300
+ * List saved versions
9301
+ *
9302
+ * Find saved timeline snapshots for this project and obtain version_id values for restore. A saved version records its original revision; restoring it creates a new current revision rather than rewinding the revision counter. Continue with next_page_token as page_token until absent.
9303
+ */
9304
+ export const cutListVersions = (options) => (options.client ?? client).get({
9305
+ security: [{
9306
+ key: 'BearerAuth',
9307
+ scheme: 'bearer',
9308
+ type: 'http'
9309
+ }, {
9310
+ key: 'ApiKeyAuth',
9311
+ name: 'X-API-Key',
9312
+ type: 'apiKey'
9313
+ }],
9314
+ url: '/cut/v1/projects/{project_id}/versions',
9315
+ ...options
9316
+ });
9317
+ /**
9318
+ * Save project version
9319
+ *
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
8908
9724
  });
8909
9725
  /**
8910
- * Remove library binding
9726
+ * Delete rows
8911
9727
  *
8912
- * Detach a library alias obtained from bindings.list after removing all timeline clips that reference its library. BINDING_IN_USE returns 409 while references remain; inspect timeline and edit those clips first. Removal must preserve the one writable default upload binding.
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.
8913
9729
  */
8914
- export const cutDeleteBinding = (options) => (options.client ?? client).delete({
9730
+ export const databaseTableDelete = (options) => (options.client ?? client).delete({
8915
9731
  security: [{
8916
- key: 'BearerAuth',
9732
+ key: 'database-bearerAuth',
8917
9733
  scheme: 'bearer',
8918
9734
  type: 'http'
8919
- }, {
8920
- key: 'ApiKeyAuth',
8921
- name: 'X-API-Key',
8922
- type: 'apiKey'
8923
9735
  }],
8924
- url: '/cut/v1/projects/{project_id}/bindings/{name}',
9736
+ url: '/database/v1/table/{database_id}/rest/{table}',
8925
9737
  ...options
8926
9738
  });
8927
9739
  /**
8928
- * Import project media
9740
+ * Select rows
8929
9741
  *
8930
- * Import a URL, data URI or existing file into a writable project media library. Select binding from bindings.list or omit it to use default_upload. Save library_id and asset_id from the result and use them as libraryId and assetId inside execute script media references; overwrites follow the source asset latest version.
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.
8931
9743
  */
8932
- export const cutImportMedia = (options) => (options.client ?? client).post({
9744
+ export const databaseTableSelect = (options) => (options.client ?? client).get({
8933
9745
  security: [{
8934
- key: 'BearerAuth',
9746
+ key: 'database-bearerAuth',
8935
9747
  scheme: 'bearer',
8936
9748
  type: 'http'
8937
- }, {
8938
- key: 'ApiKeyAuth',
8939
- name: 'X-API-Key',
8940
- type: 'apiKey'
8941
9749
  }],
8942
- url: '/cut/v1/projects/{project_id}/media:import',
8943
- ...options,
8944
- headers: {
8945
- 'Content-Type': 'application/json',
8946
- ...options.headers
8947
- }
9750
+ url: '/database/v1/table/{database_id}/rest/{table}',
9751
+ ...options
8948
9752
  });
8949
9753
  /**
8950
- * List project exports
9754
+ * Count rows
8951
9755
  *
8952
- * Find export jobs associated with this project before polling or canceling a render. Copy an export id into praxis.cut.exports.retrieve or cancel. Continue with next_page_token as page_token when present; queued or in-progress jobs have not produced a final media asset.
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.
8953
9757
  */
8954
- export const cutListExports = (options) => (options.client ?? client).get({
9758
+ export const databaseTableHead = (options) => (options.client ?? client).head({
8955
9759
  security: [{
8956
- key: 'BearerAuth',
9760
+ key: 'database-bearerAuth',
8957
9761
  scheme: 'bearer',
8958
9762
  type: 'http'
8959
- }, {
8960
- key: 'ApiKeyAuth',
8961
- name: 'X-API-Key',
8962
- type: 'apiKey'
8963
9763
  }],
8964
- url: '/cut/v1/projects/{project_id}/exports',
9764
+ url: '/database/v1/table/{database_id}/rest/{table}',
8965
9765
  ...options
8966
9766
  });
8967
9767
  /**
8968
- * Create video export
9768
+ * Update rows
8969
9769
  *
8970
- * Start an asynchronous video export from the project into a writable bound media library. Choose binding from bindings.list or omit it for default_upload, and optionally select revision and output settings. HTTP 202 only accepts the job; poll praxis.cut.exports.retrieve using the returned id until status is done, failed or canceled. On done, asset identifies the video written back to praxis.media. Each call starts a job, so retrieve a known job before retrying a submission.
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.
8971
9771
  */
8972
- export const cutCreateExport = (options) => (options.client ?? client).post({
9772
+ export const databaseTableUpdate = (options) => (options.client ?? client).patch({
8973
9773
  security: [{
8974
- key: 'BearerAuth',
9774
+ key: 'database-bearerAuth',
8975
9775
  scheme: 'bearer',
8976
9776
  type: 'http'
8977
- }, {
8978
- key: 'ApiKeyAuth',
8979
- name: 'X-API-Key',
8980
- type: 'apiKey'
8981
9777
  }],
8982
- url: '/cut/v1/projects/{project_id}/exports',
9778
+ url: '/database/v1/table/{database_id}/rest/{table}',
8983
9779
  ...options,
8984
9780
  headers: {
8985
9781
  'Content-Type': 'application/json',
@@ -8987,21 +9783,19 @@ export const cutCreateExport = (options) => (options.client ?? client).post({
8987
9783
  }
8988
9784
  });
8989
9785
  /**
8990
- * Create draft range render
9786
+ * Insert rows
8991
9787
  *
8992
- * Render one interval of the timeline so you can hear or look at how that passage comes out, without publishing anything to a media library. Choose kind audio for the mixed soundtrack as an .m4a file, or kind video for a draft-quality .mp4 with picture and sound. from and to are seconds on the project clock and must satisfy 0 <= from < to, to <= the timeline duration (an end up to 0.05 s past it, a rounded duration, is read as the end), and to - from <= 120; a longer passage is requested in several 分段请求 ranges and joined by the caller. The result is a temporary file (purpose user_data) that expires 24 hours after it is stored and is never imported into a library, so it is not a deliverable and carries no cut-export tag. HTTP 202 only accepts the job; poll praxis.cut.renders.retrieve using the returned id until status is done or failed, then read url while it lasts. A draft also bills like a draft export, by rendered seconds. Each project runs at most 2 draft renders at a time, a budget separate from its exports; a third answers HTTP 429 CUT_BUSY and the same call succeeds once one finishes.
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.
8993
9791
  */
8994
- export const cutCreateRender = (options) => (options.client ?? client).post({
9792
+ export const databaseTableInsert = (options) => (options.client ?? client).post({
8995
9793
  security: [{
8996
- key: 'BearerAuth',
9794
+ key: 'database-bearerAuth',
8997
9795
  scheme: 'bearer',
8998
9796
  type: 'http'
8999
- }, {
9000
- key: 'ApiKeyAuth',
9001
- name: 'X-API-Key',
9002
- type: 'apiKey'
9003
9797
  }],
9004
- url: '/cut/v1/projects/{project_id}/renders',
9798
+ url: '/database/v1/table/{database_id}/rest/{table}',
9005
9799
  ...options,
9006
9800
  headers: {
9007
9801
  'Content-Type': 'application/json',
@@ -9009,93 +9803,77 @@ export const cutCreateRender = (options) => (options.client ?? client).post({
9009
9803
  }
9010
9804
  });
9011
9805
  /**
9012
- * Retrieve draft range render
9806
+ * List keys
9013
9807
  *
9014
- * Poll a draft render id returned by projects.renders.create to see whether the interval is ready, then read url while it lasts. queued and rendering are in progress; done provides file_id and a short-lived url for the rendered .m4a or .mp4; failed provides error. Only done yields a url, and the file behind it disappears 24 hours after it was stored, so retrieve again when the link has expired.
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.
9015
9809
  */
9016
- export const cutRetrieveRender = (options) => (options.client ?? client).get({
9810
+ export const databaseKvListKeys = (options) => (options.client ?? client).get({
9017
9811
  security: [{
9018
- key: 'BearerAuth',
9812
+ key: 'database-bearerAuth',
9019
9813
  scheme: 'bearer',
9020
9814
  type: 'http'
9021
- }, {
9022
- key: 'ApiKeyAuth',
9023
- name: 'X-API-Key',
9024
- type: 'apiKey'
9025
9815
  }],
9026
- url: '/cut/v1/renders/{render_id}',
9816
+ url: '/database/v1/kv/{database_id}/keys',
9027
9817
  ...options
9028
9818
  });
9029
9819
  /**
9030
- * Retrieve video export
9820
+ * Delete key
9031
9821
  *
9032
- * Poll an export id returned by projects.exports.create or list to observe render progress. queued, fetching, rendering, stitching and saving are in progress; done provides asset in the target library, failed provides error, and canceled means the job stopped. Only done confirms a usable output asset.
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.
9033
9823
  */
9034
- export const cutRetrieveExport = (options) => (options.client ?? client).get({
9824
+ export const databaseKvDeleteKey = (options) => (options.client ?? client).delete({
9035
9825
  security: [{
9036
- key: 'BearerAuth',
9826
+ key: 'database-bearerAuth',
9037
9827
  scheme: 'bearer',
9038
9828
  type: 'http'
9039
- }, {
9040
- key: 'ApiKeyAuth',
9041
- name: 'X-API-Key',
9042
- type: 'apiKey'
9043
9829
  }],
9044
- url: '/cut/v1/exports/{export_id}',
9830
+ url: '/database/v1/kv/{database_id}/keys/{key}',
9045
9831
  ...options
9046
9832
  });
9047
9833
  /**
9048
- * Cancel video export
9834
+ * Get key
9049
9835
  *
9050
- * Request cancellation of an export obtained from projects.exports.create or list when its output is no longer needed. Read the returned job status and retrieve it to confirm the terminal outcome; do not interpret a cancellation request as successful rendering.
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.
9051
9837
  */
9052
- export const cutCancelExport = (options) => (options.client ?? client).post({
9838
+ export const databaseKvGetKey = (options) => (options.client ?? client).get({
9053
9839
  security: [{
9054
- key: 'BearerAuth',
9840
+ key: 'database-bearerAuth',
9055
9841
  scheme: 'bearer',
9056
9842
  type: 'http'
9057
- }, {
9058
- key: 'ApiKeyAuth',
9059
- name: 'X-API-Key',
9060
- type: 'apiKey'
9061
9843
  }],
9062
- url: '/cut/v1/exports/{export_id}:cancel',
9844
+ url: '/database/v1/kv/{database_id}/keys/{key}',
9063
9845
  ...options
9064
9846
  });
9065
9847
  /**
9066
- * List saved versions
9848
+ * Update key
9067
9849
  *
9068
- * Find saved timeline snapshots for this project and obtain version_id values for restore. A saved version records its original revision; restoring it creates a new current revision rather than rewinding the revision counter. Continue with next_page_token as page_token until absent.
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.
9069
9851
  */
9070
- export const cutListVersions = (options) => (options.client ?? client).get({
9852
+ export const databaseKvUpdateKey = (options) => (options.client ?? client).patch({
9071
9853
  security: [{
9072
- key: 'BearerAuth',
9854
+ key: 'database-bearerAuth',
9073
9855
  scheme: 'bearer',
9074
9856
  type: 'http'
9075
- }, {
9076
- key: 'ApiKeyAuth',
9077
- name: 'X-API-Key',
9078
- type: 'apiKey'
9079
9857
  }],
9080
- url: '/cut/v1/projects/{project_id}/versions',
9081
- ...options
9858
+ url: '/database/v1/kv/{database_id}/keys/{key}',
9859
+ ...options,
9860
+ headers: {
9861
+ 'Content-Type': 'application/json',
9862
+ ...options.headers
9863
+ }
9082
9864
  });
9083
9865
  /**
9084
- * Save project version
9866
+ * Set key
9085
9867
  *
9086
- * 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.
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.
9087
9869
  */
9088
- export const cutCreateVersion = (options) => (options.client ?? client).post({
9870
+ export const databaseKvSetKey = (options) => (options.client ?? client).put({
9089
9871
  security: [{
9090
- key: 'BearerAuth',
9872
+ key: 'database-bearerAuth',
9091
9873
  scheme: 'bearer',
9092
9874
  type: 'http'
9093
- }, {
9094
- key: 'ApiKeyAuth',
9095
- name: 'X-API-Key',
9096
- type: 'apiKey'
9097
9875
  }],
9098
- url: '/cut/v1/projects/{project_id}/versions',
9876
+ url: '/database/v1/kv/{database_id}/keys/{key}',
9099
9877
  ...options,
9100
9878
  headers: {
9101
9879
  'Content-Type': 'application/json',
@@ -9103,27 +9881,29 @@ export const cutCreateVersion = (options) => (options.client ?? client).post({
9103
9881
  }
9104
9882
  });
9105
9883
  /**
9106
- * Restore saved version
9884
+ * Execute command
9107
9885
  *
9108
- * 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.
9109
9887
  */
9110
- export const cutRestoreVersion = (options) => (options.client ?? client).post({
9888
+ export const databaseKvExecuteCommand = (options) => (options.client ?? client).post({
9111
9889
  security: [{
9112
- key: 'BearerAuth',
9890
+ key: 'database-bearerAuth',
9113
9891
  scheme: 'bearer',
9114
9892
  type: 'http'
9115
- }, {
9116
- key: 'ApiKeyAuth',
9117
- name: 'X-API-Key',
9118
- type: 'apiKey'
9119
9893
  }],
9120
- url: '/cut/v1/versions/{version_id}:restore',
9121
- ...options
9894
+ url: '/database/v1/kv/{database_id}/commands',
9895
+ ...options,
9896
+ headers: {
9897
+ 'Content-Type': 'application/json',
9898
+ ...options.headers
9899
+ }
9122
9900
  });
9123
9901
  /**
9124
9902
  * List databases
9125
9903
  *
9126
- * 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
9127
9907
  */
9128
9908
  export const databaseListDatabases = (options) => (options?.client ?? client).get({
9129
9909
  security: [{
@@ -9137,7 +9917,9 @@ export const databaseListDatabases = (options) => (options?.client ?? client).ge
9137
9917
  /**
9138
9918
  * Create database
9139
9919
  *
9140
- * 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
9141
9923
  */
9142
9924
  export const databaseCreateDatabase = (options) => (options.client ?? client).post({
9143
9925
  security: [{
@@ -9155,7 +9937,9 @@ export const databaseCreateDatabase = (options) => (options.client ?? client).po
9155
9937
  /**
9156
9938
  * Delete database
9157
9939
  *
9158
- * 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
9159
9943
  */
9160
9944
  export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
9161
9945
  security: [{
@@ -9169,7 +9953,9 @@ export const databaseDeleteDatabase = (options) => (options.client ?? client).de
9169
9953
  /**
9170
9954
  * Get database
9171
9955
  *
9172
- * 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
9173
9959
  */
9174
9960
  export const databaseGetDatabase = (options) => (options.client ?? client).get({
9175
9961
  security: [{
@@ -9183,7 +9969,9 @@ export const databaseGetDatabase = (options) => (options.client ?? client).get({
9183
9969
  /**
9184
9970
  * Update database
9185
9971
  *
9186
- * 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
9187
9975
  */
9188
9976
  export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
9189
9977
  security: [{
@@ -9201,7 +9989,9 @@ export const databaseUpdateDatabase = (options) => (options.client ?? client).pa
9201
9989
  /**
9202
9990
  * Restore database
9203
9991
  *
9204
- * 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
9205
9995
  */
9206
9996
  export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
9207
9997
  security: [{
@@ -9215,7 +10005,9 @@ export const databaseRestoreDatabase = (options) => (options.client ?? client).p
9215
10005
  /**
9216
10006
  * Permanently purge database
9217
10007
  *
9218
- * 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
9219
10011
  */
9220
10012
  export const databasePurgeDatabase = (options) => (options.client ?? client).post({
9221
10013
  security: [{
@@ -9229,7 +10021,9 @@ export const databasePurgeDatabase = (options) => (options.client ?? client).pos
9229
10021
  /**
9230
10022
  * List tables
9231
10023
  *
9232
- * 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
9233
10027
  */
9234
10028
  export const databaseListTables = (options) => (options.client ?? client).get({
9235
10029
  security: [{
@@ -9243,7 +10037,9 @@ export const databaseListTables = (options) => (options.client ?? client).get({
9243
10037
  /**
9244
10038
  * Create table
9245
10039
  *
9246
- * 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
9247
10043
  */
9248
10044
  export const databaseCreateTable = (options) => (options.client ?? client).post({
9249
10045
  security: [{
@@ -9261,7 +10057,9 @@ export const databaseCreateTable = (options) => (options.client ?? client).post(
9261
10057
  /**
9262
10058
  * Delete table
9263
10059
  *
9264
- * 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
9265
10063
  */
9266
10064
  export const databaseDeleteTable = (options) => (options.client ?? client).delete({
9267
10065
  security: [{
@@ -9275,7 +10073,9 @@ export const databaseDeleteTable = (options) => (options.client ?? client).delet
9275
10073
  /**
9276
10074
  * Get table
9277
10075
  *
9278
- * 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
9279
10079
  */
9280
10080
  export const databaseGetTable = (options) => (options.client ?? client).get({
9281
10081
  security: [{
@@ -9289,7 +10089,9 @@ export const databaseGetTable = (options) => (options.client ?? client).get({
9289
10089
  /**
9290
10090
  * Update table
9291
10091
  *
9292
- * 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
9293
10095
  */
9294
10096
  export const databaseUpdateTable = (options) => (options.client ?? client).patch({
9295
10097
  security: [{
@@ -9307,7 +10109,9 @@ export const databaseUpdateTable = (options) => (options.client ?? client).patch
9307
10109
  /**
9308
10110
  * Add field
9309
10111
  *
9310
- * 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
9311
10115
  */
9312
10116
  export const databaseAddField = (options) => (options.client ?? client).post({
9313
10117
  security: [{
@@ -9325,7 +10129,9 @@ export const databaseAddField = (options) => (options.client ?? client).post({
9325
10129
  /**
9326
10130
  * Delete field
9327
10131
  *
9328
- * 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
9329
10135
  */
9330
10136
  export const databaseDeleteField = (options) => (options.client ?? client).delete({
9331
10137
  security: [{
@@ -9339,7 +10145,9 @@ export const databaseDeleteField = (options) => (options.client ?? client).delet
9339
10145
  /**
9340
10146
  * Update field
9341
10147
  *
9342
- * 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
9343
10151
  */
9344
10152
  export const databaseUpdateField = (options) => (options.client ?? client).patch({
9345
10153
  security: [{
@@ -9357,7 +10165,9 @@ export const databaseUpdateField = (options) => (options.client ?? client).patch
9357
10165
  /**
9358
10166
  * List events
9359
10167
  *
9360
- * 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
9361
10171
  */
9362
10172
  export const databaseListEvents = (options) => (options.client ?? client).get({
9363
10173
  security: [{
@@ -9371,7 +10181,9 @@ export const databaseListEvents = (options) => (options.client ?? client).get({
9371
10181
  /**
9372
10182
  * Delete rows
9373
10183
  *
9374
- * 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
9375
10187
  */
9376
10188
  export const databaseDelete = (options) => (options.client ?? client).delete({
9377
10189
  security: [{
@@ -9385,7 +10197,9 @@ export const databaseDelete = (options) => (options.client ?? client).delete({
9385
10197
  /**
9386
10198
  * Select rows
9387
10199
  *
9388
- * 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
9389
10203
  */
9390
10204
  export const databaseSelect = (options) => (options.client ?? client).get({
9391
10205
  security: [{
@@ -9399,7 +10213,9 @@ export const databaseSelect = (options) => (options.client ?? client).get({
9399
10213
  /**
9400
10214
  * Count rows
9401
10215
  *
9402
- * 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
9403
10219
  */
9404
10220
  export const databaseHead = (options) => (options.client ?? client).head({
9405
10221
  security: [{
@@ -9413,7 +10229,9 @@ export const databaseHead = (options) => (options.client ?? client).head({
9413
10229
  /**
9414
10230
  * Update rows
9415
10231
  *
9416
- * 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
9417
10235
  */
9418
10236
  export const databaseUpdate = (options) => (options.client ?? client).patch({
9419
10237
  security: [{
@@ -9431,9 +10249,11 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
9431
10249
  /**
9432
10250
  * Insert rows
9433
10251
  *
9434
- * 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.
9435
10253
  * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
9436
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
9437
10257
  */
9438
10258
  export const databaseInsert = (options) => (options.client ?? client).post({
9439
10259
  security: [{
@@ -9448,6 +10268,114 @@ export const databaseInsert = (options) => (options.client ?? client).post({
9448
10268
  ...options.headers
9449
10269
  }
9450
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
+ });
9451
10379
  /**
9452
10380
  * Read a commit's test catalog
9453
10381
  *
@@ -9947,7 +10875,7 @@ export const devopsPromotionsGet = (options) => (options.client ?? client).get({
9947
10875
  /**
9948
10876
  * Approve or reject a promotion
9949
10877
  *
9950
- * 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.
9951
10879
  */
9952
10880
  export const devopsPromotionsApprove = (options) => (options.client ?? client).post({
9953
10881
  security: [{
@@ -9997,7 +10925,7 @@ export const devopsPromotionsRetry = (options) => (options.client ?? client).pos
9997
10925
  /**
9998
10926
  * Conclude an observation
9999
10927
  *
10000
- * 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.
10001
10929
  */
10002
10930
  export const devopsPromotionsConclude = (options) => (options.client ?? client).post({
10003
10931
  security: [{