@deepraxis/sdk 0.1.1-dev.fa8e340 → 0.1.1-dev.fb97f26

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.
@@ -360,7 +360,7 @@ export const getAgentAppearance = (options) => (options.client ?? client).get({
360
360
  /**
361
361
  * Retrieve agent phone
362
362
  *
363
- * Read the agent's cloud phone, or learn that it has none: use it before driving the phone or to show its state in a settings page. configured says whether a phone block is saved at all (false is not an error: the phone is off), and state is one of none, starting, booting, restoring, running, archiving or releasing — none means no instance exists (never built, already released, or gone), archiving means its app state is being packed, and releasing means a release was asked for and the cron has not finished. sku and name come from the configuration when one exists. When the phone is reachable, sandbox_id is the public sandbox id of its running instance: take the phone over with it through POST /sandbox/v1/sandboxes/{id}/act, or open the sandbox page's screen tab in the Console; lease_ends_at is when that instance's lease runs out and the sandbox kills it. archived_at and archive_error describe the last app-state archive, which a fresh instance restores on the next use. Reading never builds a phone. Only a general or assume agent may have one: a service agent, an agent of another organization and a missing agent all answer 404 AGENT_NOT_FOUND. This operation is for people and their tools — the model cannot call it; an agent drives its own phone only through its phone tool, which can act on the device but cannot read this state or release it.
363
+ * Read the agent's phone, or learn that it has none: use it before driving the phone or to show its state in a settings page. configured says whether a phone block is saved at all (false is not an error: the phone is off). A cloud phone's state is one of none, starting, booting, restoring, running, archiving or releasing — none means no instance exists (never built, already released, or gone), archiving means its app state is being packed, and releasing means a release was asked for and the cron has not finished. A BYOD phone (the organization's own device) has two states instead, online and offline, and reports byod_device as its byd_… id, sku null and no lease. sku and name come from the configuration when one exists. When a cloud phone is reachable, sandbox_id is the public sandbox id of its running instance; for a BYOD phone sandbox_id is the byd_… id itself: take either phone over through POST /sandbox/v1/sandboxes/{id}/act, or open the sandbox page's screen tab in the Console; lease_ends_at is when a cloud instance's lease runs out and the sandbox kills it, and is always null for a BYOD phone. archived_at and archive_error describe the last app-state archive, which a fresh instance restores on the next use; both are null for a BYOD phone, which is never archived. Reading never builds a phone. Only a general or assume agent may have one: a service agent, an agent of another organization and a missing agent all answer 404 AGENT_NOT_FOUND. This operation is for people and their tools — the model cannot call it; an agent drives its own phone only through its phone tool, which can act on the device but cannot read this state or release it.
364
364
  */
365
365
  export const agentsPhoneRetrieve = (options) => (options.client ?? client).get({
366
366
  security: [{
@@ -378,7 +378,7 @@ export const agentsPhoneRetrieve = (options) => (options.client ?? client).get({
378
378
  /**
379
379
  * Release agent phone
380
380
  *
381
- * Ask for the agent's cloud phone to go, and answer its state afterwards. The phone is not killed here: its app state is packed first (state archiving), then the instance is killed and the row cleared, so the state answers releasing until that sweep finishes and the next use builds a fresh instance and restores the archive. The configuration is never deleted — the phone block stays and turning the phone off is agents.update with phone null, a different door. With no phone configured, or one that was never built (state none), the call changes nothing and answers none, so it is safe to repeat; repeating it while a release is pending is idempotent. Only a general or assume agent may have a phone: a service agent, an agent of another organization and a missing agent all answer 404 AGENT_NOT_FOUND. This operation is for people and their tools — the model cannot call it.
381
+ * Ask for the agent's cloud phone to go, and answer its state afterwards. The phone is not killed here: its app state is packed first (state archiving), then the instance is killed and the row cleared, so the state answers releasing until that sweep finishes and the next use builds a fresh instance and restores the archive. The configuration is never deleted — the phone block stays and turning the phone off is agents.update with phone null, a different door. With no phone configured, or one that was never built (state none), the call changes nothing and answers none, so it is safe to repeat; repeating it while a release is pending is idempotent. A BYOD phone (the organization's own device) is not the platform's to kill, so the call changes nothing and answers online or offline. Only a general or assume agent may have a phone: a service agent, an agent of another organization and a missing agent all answer 404 AGENT_NOT_FOUND. This operation is for people and their tools — the model cannot call it.
382
382
  */
383
383
  export const agentsPhoneRelease = (options) => (options.client ?? client).post({
384
384
  security: [{
@@ -626,6 +626,31 @@ export const computersFilesContent = (options) => (options.client ?? client).get
626
626
  url: '/agent/v1/computers/{computer_id}/files/content',
627
627
  ...options
628
628
  });
629
+ /**
630
+ * Write computer file content
631
+ *
632
+ * Write the bytes of one existing file on a computer, only if the file is still the version you read.
633
+ *
634
+ * Send the raw bytes as the body (at most 16 MiB) and the version you edited in `If-Match`: the `version` field of the file listing (`<size>-<mtimeMs>`). The file must already exist; the write replaces it whole and keeps its permissions. A request without `If-Match` answers 428 FILE_VERSION_REQUIRED and nothing is written. When the file has changed since that version, the answer is 412 FILE_VERSION_MISMATCH with `error.current_version`, and nothing is written: read the file again, redo the edit and write with the new version. The version is checked against the file's current size and modification time, then the content digest is bound into the write itself, so a change that lands while the bytes are being written is refused instead of overwritten. Paths under /attachments and /skills are read-only (403 READ_ONLY). A successful write answers the new path, size, mtime and version; use that version for the next write.
635
+ */
636
+ export const updateComputerFileContent = (options) => (options.client ?? client).put({
637
+ bodySerializer: null,
638
+ security: [{
639
+ key: 'BearerAuth',
640
+ scheme: 'bearer',
641
+ type: 'http'
642
+ }, {
643
+ key: 'ApiKeyAuth',
644
+ name: 'X-API-Key',
645
+ type: 'apiKey'
646
+ }],
647
+ url: '/agent/v1/computers/{computer_id}/files/content',
648
+ ...options,
649
+ headers: {
650
+ 'Content-Type': 'application/octet-stream',
651
+ ...options.headers
652
+ }
653
+ });
629
654
  /**
630
655
  * Preview a computer file
631
656
  *
@@ -733,7 +758,7 @@ export const releaseComputerLease = (options) => (options.client ?? client).dele
733
758
  /**
734
759
  * List Toolsets
735
760
  *
736
- * Discover tool names, input schemas, read-only status and default permission policies before configuring an agent. The catalog is read-only: enable tools through agents.create or agents.update. agent_toolset_20260401 includes bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message, codemode and skill, plus todo_write, ask_user_question and goal_read, which are listed so they can be switched off. Native additions require bash enabled; codemode requires bash (enabling it with bash disabled returns 400; keep bash enabled with permission_policy always_ask to restrict it); send_message also requires agent. To keep only some tools, set default_config.enabled to false and enable the wanted tools in configs; unlisted tools follow default_config. The catalog includes plugin names and versions. Sessions created through /anthropic/v1 expose only the eight official tools.
761
+ * Discover tool names, input schemas, read-only status and default permission policies before configuring an agent. The catalog is read-only: enable tools through agents.create or agents.update. agent_toolset_20260401 includes bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message, codemode and skill, plus todo_write and goal_read, which are listed so they can be switched off. Native additions require bash enabled; codemode requires bash (enabling it with bash disabled returns 400; keep bash enabled with permission_policy always_ask to restrict it); send_message also requires agent. To keep only some tools, set default_config.enabled to false and enable the wanted tools in configs; unlisted tools follow default_config. The catalog includes plugin names and versions. Sessions created through /anthropic/v1 expose only the eight official tools.
737
762
  */
738
763
  export const listToolsets = (options) => (options?.client ?? client).get({
739
764
  security: [{
@@ -889,7 +914,7 @@ export const createSessionArtifactContentUrl = (options) => (options.client ?? c
889
914
  *
890
915
  * List the requests a session is waiting on; an end-customer token reads its own session.
891
916
  *
892
- * Own-face extension. When a session stops at session.status_idle with stop_reason requires_action, read what it waits on here instead of replaying events. Returns { data: Request[] } ordered by create_time, an empty array when nothing is pending, not paginated. Each request has id (the pending tool call id), object (request), kind (question for the ask_user_question tool, approval for any other tool that waits for permission), status (pending), tool_name, input (the same input the agent.tool_use event shows), create_time and expire_time. Answer a request as before: send a user.tool_confirmation event for its id. expire_time is set only for a session with no collaboration mode while the requests-v1 release is on (create_time plus 24 hours; an expired request counts as declined), otherwise null. Answered, expired and superseded requests are not listed, and neither are pending custom tool results (user.custom_tool_result). Whoever may read the session may read its requests; a session that is missing or not yours returns 404.
917
+ * Own-face extension. When a session stops at session.status_idle with stop_reason requires_action, read what it waits on here instead of replaying events. Returns { data: Request[] } ordered by create_time, an empty array when nothing is pending, not paginated. Each request has id (the pending tool call id), object (request), kind (always approval, a tool waiting for permission; question is kept for compatibility and is never returned), status (pending), tool_name, input (the same input the agent.tool_use event shows), create_time and expire_time. Answer a request as before: send a user.tool_confirmation event for its id. expire_time is set only for a session with no collaboration mode while the requests-v1 release is on (create_time plus 24 hours; an expired request counts as declined), otherwise null. Answered, expired and superseded requests are not listed, and neither are pending custom tool results (user.custom_tool_result). Whoever may read the session may read its requests; a session that is missing or not yours returns 404.
893
918
  */
894
919
  export const listSessionRequests = (options) => (options.client ?? client).get({
895
920
  security: [{
@@ -1429,9 +1454,10 @@ export const browserSeleniumUnsupported = (options) => (options?.client ?? clien
1429
1454
  /**
1430
1455
  * List files
1431
1456
  *
1432
- * List live files owned by your tenant, optionally filtered by purpose or session scope_id. Results default to descending creation order with a limit of 10000. Page using after or before with a file ID from the list; these cursors are mutually exclusive. Deleted and expired files are excluded.
1457
+ * List live files owned by your tenant, optionally filtered by purpose, session scope_id or up to 100 file ids. Results default to descending creation order with a limit of 10000. Page using after or before with a file ID from the list; these cursors are mutually exclusive. Deleted and expired files are excluded.
1433
1458
  */
1434
1459
  export const fileListFiles = (options) => (options?.client ?? client).get({
1460
+ querySerializer: { parameters: { ids: { array: { explode: false } } } },
1435
1461
  security: [{
1436
1462
  key: 'BearerAuth',
1437
1463
  scheme: 'bearer',
@@ -2641,11 +2667,11 @@ export const exportOrganizationCharges = (options) => (options.client ?? client)
2641
2667
  ...options
2642
2668
  });
2643
2669
  /**
2644
- * List departments
2670
+ * Upgrade to a full sandbox
2645
2671
  *
2646
- * Lists the departments of your organization's tree, including the root department; use it to find a department id or to walk the tree one level at a time with parent_id. Dissolved departments are included unless you filter status=active. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/departments?status=active.
2672
+ * 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.
2647
2673
  */
2648
- export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
2674
+ export const upgradeSandbox = (options) => (options.client ?? client).post({
2649
2675
  security: [{
2650
2676
  key: 'BearerAuth',
2651
2677
  scheme: 'bearer',
@@ -2655,15 +2681,19 @@ export const listOrganizationDepartments = (options) => (options?.client ?? clie
2655
2681
  name: 'X-API-Key',
2656
2682
  type: 'apiKey'
2657
2683
  }],
2658
- url: '/organization/v1/departments',
2659
- ...options
2684
+ url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
2685
+ ...options,
2686
+ headers: {
2687
+ 'Content-Type': 'application/json',
2688
+ ...options.headers
2689
+ }
2660
2690
  });
2661
2691
  /**
2662
- * Establish a department
2692
+ * Extend a running sandbox without shortening its deadline
2663
2693
  *
2664
- * Creates a department under an existing active parent department; use it to grow the tree, and use reorganize to rename or move one that already exists. order defaults to one after the last active sibling. The new department has no head position and no charter: open a position in it, then designate that position as head. Requires an organization owner or admin, or the head of the parent department or of a department above it. Errors: 400 INVALID_PARAMS for a missing or empty name, a name over 100 characters, an unknown body field or an active sibling with the same name; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND when the parent does not exist; 409 DEPARTMENT_DISSOLVED when the parent is dissolved. Example body: {"parent_id":"dept_123","name":"Support"}.
2694
+ * 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.
2665
2695
  */
2666
- export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
2696
+ export const extendSandbox = (options) => (options.client ?? client).post({
2667
2697
  security: [{
2668
2698
  key: 'BearerAuth',
2669
2699
  scheme: 'bearer',
@@ -2673,7 +2703,7 @@ export const establishOrganizationDepartment = (options) => (options.client ?? c
2673
2703
  name: 'X-API-Key',
2674
2704
  type: 'apiKey'
2675
2705
  }],
2676
- url: '/organization/v1/departments',
2706
+ url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
2677
2707
  ...options,
2678
2708
  headers: {
2679
2709
  'Content-Type': 'application/json',
@@ -2681,11 +2711,11 @@ export const establishOrganizationDepartment = (options) => (options.client ?? c
2681
2711
  }
2682
2712
  });
2683
2713
  /**
2684
- * Get a department
2714
+ * List live processes and retained observations
2685
2715
  *
2686
- * Reads one department with its head position id and its charter, including the charter revision you need before amending the charter. Read-only. Errors: 404 DEPARTMENT_NOT_FOUND when the id is not a department of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
2716
+ * 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.
2687
2717
  */
2688
- export const getOrganizationDepartment = (options) => (options.client ?? client).get({
2718
+ export const listObservedProcesses = (options) => (options.client ?? client).get({
2689
2719
  security: [{
2690
2720
  key: 'BearerAuth',
2691
2721
  scheme: 'bearer',
@@ -2695,15 +2725,33 @@ export const getOrganizationDepartment = (options) => (options.client ?? client)
2695
2725
  name: 'X-API-Key',
2696
2726
  type: 'apiKey'
2697
2727
  }],
2698
- url: '/organization/v1/departments/{id}',
2728
+ url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
2699
2729
  ...options
2700
2730
  });
2701
2731
  /**
2702
- * Reorganize a department
2732
+ * Read bounded observed process output
2703
2733
  *
2704
- * Renames a department, moves it under another parent, or changes its sort order; send at least one of parent_id, name and order. Sub-departments and positions move with it. Requires an organization owner or admin. The root department is the organization itself: its name is the organization's name and cannot be changed here (rename the organization in its settings), and it can never be moved, but its order can change. Errors: 400 INVALID_PARAMS when no field is given, a name is empty or over 100 characters, or a department already has that name under the same parent; 400 DEPARTMENT_CYCLE when the new parent is the department itself or one of its descendants; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND for the department or the new parent; 409 DEPARTMENT_DISSOLVED when either is dissolved; 409 DEPARTMENT_ROOT_IMMUTABLE when parent_id or name is sent for the root.
2734
+ * 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.
2705
2735
  */
2706
- export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
2736
+ export const getObservedProcessOutput = (options) => (options.client ?? client).get({
2737
+ security: [{
2738
+ key: 'BearerAuth',
2739
+ scheme: 'bearer',
2740
+ type: 'http'
2741
+ }, {
2742
+ key: 'ApiKeyAuth',
2743
+ name: 'X-API-Key',
2744
+ type: 'apiKey'
2745
+ }],
2746
+ url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
2747
+ ...options
2748
+ });
2749
+ /**
2750
+ * Start a task whose output is pushed off the machine while it runs
2751
+ *
2752
+ * 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.
2753
+ */
2754
+ export const startSandboxTask = (options) => (options.client ?? client).post({
2707
2755
  security: [{
2708
2756
  key: 'BearerAuth',
2709
2757
  scheme: 'bearer',
@@ -2713,7 +2761,7 @@ export const reorganizeOrganizationDepartment = (options) => (options.client ??
2713
2761
  name: 'X-API-Key',
2714
2762
  type: 'apiKey'
2715
2763
  }],
2716
- url: '/organization/v1/departments/{id}',
2764
+ url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
2717
2765
  ...options,
2718
2766
  headers: {
2719
2767
  'Content-Type': 'application/json',
@@ -2721,11 +2769,11 @@ export const reorganizeOrganizationDepartment = (options) => (options.client ??
2721
2769
  }
2722
2770
  });
2723
2771
  /**
2724
- * Dissolve a department
2772
+ * Read a range of a task's pushed output
2725
2773
  *
2726
- * Dissolves an empty department: it leaves the active tree, keeps its record for history, and takes no new sub-departments or positions. This API has no operation to reopen it. Requires an organization owner or admin. The department must have no active sub-department and no position that is not closed; dissolve or close those first. Takes no body. Errors: 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_NOT_EMPTY while an active sub-department or an unclosed position remains; 409 DEPARTMENT_ROOT_IMMUTABLE for the root; 409 DEPARTMENT_DISSOLVED when it is already dissolved.
2774
+ * 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.
2727
2775
  */
2728
- export const dissolveOrganizationDepartment = (options) => (options.client ?? client).post({
2776
+ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
2729
2777
  security: [{
2730
2778
  key: 'BearerAuth',
2731
2779
  scheme: 'bearer',
@@ -2735,15 +2783,89 @@ export const dissolveOrganizationDepartment = (options) => (options.client ?? cl
2735
2783
  name: 'X-API-Key',
2736
2784
  type: 'apiKey'
2737
2785
  }],
2738
- url: '/organization/v1/departments/{id}/dissolve',
2786
+ url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
2739
2787
  ...options
2740
2788
  });
2741
2789
  /**
2742
- * Amend a department charter
2790
+ * Kill sandbox
2743
2791
  *
2744
- * Replaces the charter of a department: free-text rules that apply to the department and are inherited by every department below it. Send the charter.revision you last read as expected_revision (0 when the department has no charter yet); each successful amendment raises the revision by one. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for text over 2000 characters or a non-integer expected_revision; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_DISSOLVED; 409 REVISION_CONFLICT when the charter moved on, so get the department again, merge your change and retry with its revision.
2792
+ * 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.
2745
2793
  */
2746
- export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
2794
+ export const deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
2795
+ security: [
2796
+ {
2797
+ key: 'sandbox-ApiKeyAuth',
2798
+ name: 'X-API-Key',
2799
+ type: 'apiKey'
2800
+ },
2801
+ {
2802
+ key: 'sandbox-AuthProviderBearerAuth',
2803
+ scheme: 'bearer',
2804
+ type: 'http'
2805
+ },
2806
+ {
2807
+ key: 'sandbox-AuthProviderTeamAuth',
2808
+ name: 'X-Team-ID',
2809
+ type: 'apiKey'
2810
+ },
2811
+ { name: 'X-Admin-Token', type: 'apiKey' },
2812
+ {
2813
+ key: 'sandbox-AdminTeamAuth',
2814
+ name: 'X-Team-ID',
2815
+ type: 'apiKey'
2816
+ },
2817
+ {
2818
+ key: 'sandbox-AdminJWTAuth',
2819
+ scheme: 'bearer',
2820
+ type: 'http'
2821
+ }
2822
+ ],
2823
+ url: '/sandbox/v1/sandboxes/{sandboxID}',
2824
+ ...options
2825
+ });
2826
+ /**
2827
+ * Sandbox
2828
+ *
2829
+ * 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.
2830
+ */
2831
+ export const getSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).get({
2832
+ security: [
2833
+ {
2834
+ key: 'sandbox-ApiKeyAuth',
2835
+ name: 'X-API-Key',
2836
+ type: 'apiKey'
2837
+ },
2838
+ {
2839
+ key: 'sandbox-AuthProviderBearerAuth',
2840
+ scheme: 'bearer',
2841
+ type: 'http'
2842
+ },
2843
+ {
2844
+ key: 'sandbox-AuthProviderTeamAuth',
2845
+ name: 'X-Team-ID',
2846
+ type: 'apiKey'
2847
+ },
2848
+ { name: 'X-Admin-Token', type: 'apiKey' },
2849
+ {
2850
+ key: 'sandbox-AdminTeamAuth',
2851
+ name: 'X-Team-ID',
2852
+ type: 'apiKey'
2853
+ },
2854
+ {
2855
+ key: 'sandbox-AdminJWTAuth',
2856
+ scheme: 'bearer',
2857
+ type: 'http'
2858
+ }
2859
+ ],
2860
+ url: '/sandbox/v1/sandboxes/{sandboxID}',
2861
+ ...options
2862
+ });
2863
+ /**
2864
+ * Rename a sandbox
2865
+ *
2866
+ * 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.
2867
+ */
2868
+ export const renameSandbox = (options) => (options.client ?? client).patch({
2747
2869
  security: [{
2748
2870
  key: 'BearerAuth',
2749
2871
  scheme: 'bearer',
@@ -2753,7 +2875,7 @@ export const amendOrganizationDepartmentCharter = (options) => (options.client ?
2753
2875
  name: 'X-API-Key',
2754
2876
  type: 'apiKey'
2755
2877
  }],
2756
- url: '/organization/v1/departments/{id}/charter',
2878
+ url: '/sandbox/v1/sandboxes/{sandboxID}',
2757
2879
  ...options,
2758
2880
  headers: {
2759
2881
  'Content-Type': 'application/json',
@@ -2761,11 +2883,13 @@ export const amendOrganizationDepartmentCharter = (options) => (options.client ?
2761
2883
  }
2762
2884
  });
2763
2885
  /**
2764
- * List jobs
2886
+ * Act on a phone sandbox's screen
2765
2887
  *
2766
- * Lists the jobs of your organization ordered by code; use it to find the job_id to open positions from. Retired jobs are included unless you filter status=active. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
2888
+ * 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.
2889
+ *
2890
+ * 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.
2767
2891
  */
2768
- export const listOrganizationJobs = (options) => (options?.client ?? client).get({
2892
+ export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
2769
2893
  security: [{
2770
2894
  key: 'BearerAuth',
2771
2895
  scheme: 'bearer',
@@ -2775,15 +2899,19 @@ export const listOrganizationJobs = (options) => (options?.client ?? client).get
2775
2899
  name: 'X-API-Key',
2776
2900
  type: 'apiKey'
2777
2901
  }],
2778
- url: '/organization/v1/jobs',
2779
- ...options
2902
+ url: '/sandbox/v1/sandboxes/{sandboxID}/act',
2903
+ ...options,
2904
+ headers: {
2905
+ 'Content-Type': 'application/json',
2906
+ ...options.headers
2907
+ }
2780
2908
  });
2781
2909
  /**
2782
- * Define a job
2910
+ * Remove a file or directory in the sandbox
2783
2911
  *
2784
- * Creates a job: a reusable template of duties and methods that is copied onto each position opened from it. The new job starts at revision 1 and status active. code is your own unique key for the job inside the organization. level_ids restricts the levels positions of this job may carry (empty or omitted allows any level). Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty or duplicate code, a name over 100 characters, text over 4000 characters or an unknown body field; 403 PERMISSION_DENIED; 404 JOB_LEVEL_NOT_FOUND when a level id does not exist. Example body: {"code":"support-agent","name":"Support agent","duties":"Answer customer tickets."}.
2912
+ * 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.
2785
2913
  */
2786
- export const defineOrganizationJob = (options) => (options.client ?? client).post({
2914
+ export const removeSandboxFile = (options) => (options.client ?? client).delete({
2787
2915
  security: [{
2788
2916
  key: 'BearerAuth',
2789
2917
  scheme: 'bearer',
@@ -2793,19 +2921,15 @@ export const defineOrganizationJob = (options) => (options.client ?? client).pos
2793
2921
  name: 'X-API-Key',
2794
2922
  type: 'apiKey'
2795
2923
  }],
2796
- url: '/organization/v1/jobs',
2797
- ...options,
2798
- headers: {
2799
- 'Content-Type': 'application/json',
2800
- ...options.headers
2801
- }
2924
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
2925
+ ...options
2802
2926
  });
2803
2927
  /**
2804
- * Get a job
2928
+ * Read a file in the sandbox
2805
2929
  *
2806
- * Reads one job with its current revision, which you need before revising it. Read-only. Errors: 404 JOB_NOT_FOUND when the id is not a job of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
2930
+ * 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.
2807
2931
  */
2808
- export const getOrganizationJob = (options) => (options.client ?? client).get({
2932
+ export const readSandboxFile = (options) => (options.client ?? client).get({
2809
2933
  security: [{
2810
2934
  key: 'BearerAuth',
2811
2935
  scheme: 'bearer',
@@ -2815,15 +2939,15 @@ export const getOrganizationJob = (options) => (options.client ?? client).get({
2815
2939
  name: 'X-API-Key',
2816
2940
  type: 'apiKey'
2817
2941
  }],
2818
- url: '/organization/v1/jobs/{id}',
2942
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
2819
2943
  ...options
2820
2944
  });
2821
2945
  /**
2822
- * Revise a job
2946
+ * Write a file in the sandbox
2823
2947
  *
2824
- * Changes the name, duties, methods or allowed levels of a job; send expected_revision and at least one of those fields. Positions already opened keep their own copy and level, and only positions opened afterwards use the revised text. level_ids replaces the whole list. Each success raises the job revision by one. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when no field is given or a value breaks its limits; 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND when a level id does not exist; 409 REVISION_CONFLICT when the job moved on, so get the job again and retry with its revision.
2948
+ * 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"}.
2825
2949
  */
2826
- export const reviseOrganizationJob = (options) => (options.client ?? client).patch({
2950
+ export const writeSandboxFile = (options) => (options.client ?? client).put({
2827
2951
  security: [{
2828
2952
  key: 'BearerAuth',
2829
2953
  scheme: 'bearer',
@@ -2833,7 +2957,7 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
2833
2957
  name: 'X-API-Key',
2834
2958
  type: 'apiKey'
2835
2959
  }],
2836
- url: '/organization/v1/jobs/{id}',
2960
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
2837
2961
  ...options,
2838
2962
  headers: {
2839
2963
  'Content-Type': 'application/json',
@@ -2841,11 +2965,11 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
2841
2965
  }
2842
2966
  });
2843
2967
  /**
2844
- * Retire a job
2968
+ * List files in a sandbox directory
2845
2969
  *
2846
- * Retires a job so no new position can be opened from it; positions already opened are unchanged. Retiring a job that is already retired returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND.
2970
+ * 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.
2847
2971
  */
2848
- export const retireOrganizationJob = (options) => (options.client ?? client).post({
2972
+ export const listSandboxFiles = (options) => (options.client ?? client).get({
2849
2973
  security: [{
2850
2974
  key: 'BearerAuth',
2851
2975
  scheme: 'bearer',
@@ -2855,15 +2979,15 @@ export const retireOrganizationJob = (options) => (options.client ?? client).pos
2855
2979
  name: 'X-API-Key',
2856
2980
  type: 'apiKey'
2857
2981
  }],
2858
- url: '/organization/v1/jobs/{id}/retire',
2982
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
2859
2983
  ...options
2860
2984
  });
2861
2985
  /**
2862
- * List job ladders
2986
+ * Create a directory in the sandbox
2863
2987
  *
2864
- * Lists the job ladders of your organization, oldest first, each with its levels in ascending order; use it to find the level ids for jobs and positions. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
2988
+ * 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.
2865
2989
  */
2866
- export const listOrganizationLadders = (options) => (options?.client ?? client).get({
2990
+ export const makeSandboxDirectory = (options) => (options.client ?? client).post({
2867
2991
  security: [{
2868
2992
  key: 'BearerAuth',
2869
2993
  scheme: 'bearer',
@@ -2873,15 +2997,15 @@ export const listOrganizationLadders = (options) => (options?.client ?? client).
2873
2997
  name: 'X-API-Key',
2874
2998
  type: 'apiKey'
2875
2999
  }],
2876
- url: '/organization/v1/ladders',
3000
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
2877
3001
  ...options
2878
3002
  });
2879
3003
  /**
2880
- * Define a job ladder
3004
+ * Run a command in the sandbox
2881
3005
  *
2882
- * Creates a job ladder: a named, ordered set of job levels such as junior to senior. Each level gets its own id (lvl_...), which jobs and positions refer to. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, an empty levels array, two levels with the same order or an unknown body field; 403 PERMISSION_DENIED. Example body: {"name":"Support","levels":[{"name":"Junior","order":1},{"name":"Senior","order":2}]}.
3006
+ * 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"}.
2883
3007
  */
2884
- export const defineOrganizationLadder = (options) => (options.client ?? client).post({
3008
+ export const runSandboxCommand = (options) => (options.client ?? client).post({
2885
3009
  security: [{
2886
3010
  key: 'BearerAuth',
2887
3011
  scheme: 'bearer',
@@ -2891,7 +3015,7 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
2891
3015
  name: 'X-API-Key',
2892
3016
  type: 'apiKey'
2893
3017
  }],
2894
- url: '/organization/v1/ladders',
3018
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
2895
3019
  ...options,
2896
3020
  headers: {
2897
3021
  'Content-Type': 'application/json',
@@ -2899,11 +3023,11 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
2899
3023
  }
2900
3024
  });
2901
3025
  /**
2902
- * Get a job ladder
3026
+ * Start adding a phone of your own
2903
3027
  *
2904
- * Reads one job ladder with its levels in ascending order. Read-only. Errors: 404 LADDER_NOT_FOUND when the id is not a ladder of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3028
+ * 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'}.
2905
3029
  */
2906
- export const getOrganizationLadder = (options) => (options.client ?? client).get({
3030
+ export const createByodPairing = (options) => (options?.client ?? client).post({
2907
3031
  security: [{
2908
3032
  key: 'BearerAuth',
2909
3033
  scheme: 'bearer',
@@ -2913,15 +3037,15 @@ export const getOrganizationLadder = (options) => (options.client ?? client).get
2913
3037
  name: 'X-API-Key',
2914
3038
  type: 'apiKey'
2915
3039
  }],
2916
- url: '/organization/v1/ladders/{id}',
3040
+ url: '/sandbox/v1/byod/pairings',
2917
3041
  ...options
2918
3042
  });
2919
3043
  /**
2920
- * Revise a job ladder
3044
+ * List your organization's own devices
2921
3045
  *
2922
- * Replaces all levels of a ladder with the array you send. A level with an id keeps that id and takes the new name and order, a level without an id is created, and an existing level you leave out is deleted. A level cannot be deleted while an open position or a job's level_ids still refers to it; first regrade those positions or revise those jobs. Send name to rename the ladder; leave it out to keep the name. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty levels array, duplicate order values, a level id sent twice or a level that is still referenced; 403 PERMISSION_DENIED; 404 LADDER_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND when a level id does not belong to this ladder.
3046
+ * 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:[]}]}.
2923
3047
  */
2924
- export const reviseOrganizationLadder = (options) => (options.client ?? client).put({
3048
+ export const listByodDevices = (options) => (options?.client ?? client).get({
2925
3049
  security: [{
2926
3050
  key: 'BearerAuth',
2927
3051
  scheme: 'bearer',
@@ -2931,19 +3055,15 @@ export const reviseOrganizationLadder = (options) => (options.client ?? client).
2931
3055
  name: 'X-API-Key',
2932
3056
  type: 'apiKey'
2933
3057
  }],
2934
- url: '/organization/v1/ladders/{id}',
2935
- ...options,
2936
- headers: {
2937
- 'Content-Type': 'application/json',
2938
- ...options.headers
2939
- }
3058
+ url: '/sandbox/v1/byod/devices',
3059
+ ...options
2940
3060
  });
2941
3061
  /**
2942
- * List positions
3062
+ * Read one of your organization's devices
2943
3063
  *
2944
- * Lists positions across the organization ordered by department and then number, vacant ones included; narrow it with department_id, job_id, status or is_head. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean is_head or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/positions?department_id=dept_123&status=active.
3064
+ * 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.
2945
3065
  */
2946
- export const listOrganizationPositions = (options) => (options?.client ?? client).get({
3066
+ export const getByodDevice = (options) => (options.client ?? client).get({
2947
3067
  security: [{
2948
3068
  key: 'BearerAuth',
2949
3069
  scheme: 'bearer',
@@ -2953,15 +3073,15 @@ export const listOrganizationPositions = (options) => (options?.client ?? client
2953
3073
  name: 'X-API-Key',
2954
3074
  type: 'apiKey'
2955
3075
  }],
2956
- url: '/organization/v1/positions',
3076
+ url: '/sandbox/v1/byod/devices/{deviceID}',
2957
3077
  ...options
2958
3078
  });
2959
3079
  /**
2960
- * Open positions
3080
+ * Rename one of your organization's devices
2961
3081
  *
2962
- * Opens one or more vacant positions in a department, optionally from a job: the job's name becomes the title and its duties and methods are copied onto each position. Without job_id a title is required. Positions get consecutive numbers in the department that are never reused. Open a position and then hire into it; the root department's head position already exists and is held by the organization's owner, seated automatically when the organization is first used. request_id makes the call idempotent: repeating it returns the first result and opens nothing more. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for a count outside 1 to 100, a missing request_id or an unknown body field; 400 POSITION_NAME_REQUIRED without job_id and title; 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND, JOB_NOT_FOUND, JOB_LEVEL_NOT_FOUND or POSITION_NOT_FOUND; 409 DEPARTMENT_DISSOLVED, JOB_RETIRED or POSITION_CLOSED (the reports_to target). Example body: {"department_id":"dept_123","job_id":"jpr_123","count":2,"request_id":"open-support-2026-11"}.
3082
+ * 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.
2963
3083
  */
2964
- export const openOrganizationPositions = (options) => (options.client ?? client).post({
3084
+ export const updateByodDevice = (options) => (options.client ?? client).patch({
2965
3085
  security: [{
2966
3086
  key: 'BearerAuth',
2967
3087
  scheme: 'bearer',
@@ -2971,7 +3091,7 @@ export const openOrganizationPositions = (options) => (options.client ?? client)
2971
3091
  name: 'X-API-Key',
2972
3092
  type: 'apiKey'
2973
3093
  }],
2974
- url: '/organization/v1/positions',
3094
+ url: '/sandbox/v1/byod/devices/{deviceID}',
2975
3095
  ...options,
2976
3096
  headers: {
2977
3097
  'Content-Type': 'application/json',
@@ -2979,11 +3099,11 @@ export const openOrganizationPositions = (options) => (options.client ?? client)
2979
3099
  }
2980
3100
  });
2981
3101
  /**
2982
- * Get a position
3102
+ * Disconnect a device and revoke its credential
2983
3103
  *
2984
- * Reads one position with its derived effective_reports_to line. Read-only. Errors: 404 POSITION_NOT_FOUND when the id is not a position of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3104
+ * 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}.
2985
3105
  */
2986
- export const getOrganizationPosition = (options) => (options.client ?? client).get({
3106
+ export const disconnectByodDevice = (options) => (options.client ?? client).post({
2987
3107
  security: [{
2988
3108
  key: 'BearerAuth',
2989
3109
  scheme: 'bearer',
@@ -2993,15 +3113,15 @@ export const getOrganizationPosition = (options) => (options.client ?? client).g
2993
3113
  name: 'X-API-Key',
2994
3114
  type: 'apiKey'
2995
3115
  }],
2996
- url: '/organization/v1/positions/{id}',
3116
+ url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
2997
3117
  ...options
2998
3118
  });
2999
3119
  /**
3000
- * Revise a position
3120
+ * Read a pairing for the phone's Allow screen
3001
3121
  *
3002
- * Changes the title, duties or methods of one position; the job it was opened from is not touched, and the position's own copy is what changes. Sending no field returns the position unchanged. Requires an organization owner or admin, or the head of the position's department or of a department above it. A frozen position can still be revised. Errors: 400 INVALID_PARAMS for an empty title, a title over 100 characters or text over 4000 characters; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED.
3122
+ * 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'}.
3003
3123
  */
3004
- export const reviseOrganizationPosition = (options) => (options.client ?? client).patch({
3124
+ export const getByodPairing = (options) => (options.client ?? client).get({
3005
3125
  security: [{
3006
3126
  key: 'BearerAuth',
3007
3127
  scheme: 'bearer',
@@ -3011,19 +3131,15 @@ export const reviseOrganizationPosition = (options) => (options.client ?? client
3011
3131
  name: 'X-API-Key',
3012
3132
  type: 'apiKey'
3013
3133
  }],
3014
- url: '/organization/v1/positions/{id}',
3015
- ...options,
3016
- headers: {
3017
- 'Content-Type': 'application/json',
3018
- ...options.headers
3019
- }
3134
+ url: '/sandbox/v1/byod/pairings/{code}',
3135
+ ...options
3020
3136
  });
3021
3137
  /**
3022
- * Close a position
3138
+ * Claim a pairing and register the phone
3023
3139
  *
3024
- * Closes a vacant position for good; its number stays used and the record stays for history. A closed head position stops being the head, so the department has no head until you designate another. Closing a closed position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_OCCUPIED while someone still holds the position.
3140
+ * 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/'}.
3025
3141
  */
3026
- export const closeOrganizationPosition = (options) => (options.client ?? client).post({
3142
+ export const claimByodPairing = (options) => (options.client ?? client).post({
3027
3143
  security: [{
3028
3144
  key: 'BearerAuth',
3029
3145
  scheme: 'bearer',
@@ -3033,15 +3149,19 @@ export const closeOrganizationPosition = (options) => (options.client ?? client)
3033
3149
  name: 'X-API-Key',
3034
3150
  type: 'apiKey'
3035
3151
  }],
3036
- url: '/organization/v1/positions/{id}/close',
3037
- ...options
3038
- });
3152
+ url: '/sandbox/v1/byod/pairings/{code}/claim',
3153
+ ...options,
3154
+ headers: {
3155
+ 'Content-Type': 'application/json',
3156
+ ...options.headers
3157
+ }
3158
+ });
3039
3159
  /**
3040
- * Freeze a position
3160
+ * List departments
3041
3161
  *
3042
- * Freezes a vacant position to keep it without using it, for example while hiring is paused; unfreeze brings it back. Freezing a frozen position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED; 409 POSITION_OCCUPIED while someone still holds the position.
3162
+ * 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.
3043
3163
  */
3044
- export const freezeOrganizationPosition = (options) => (options.client ?? client).post({
3164
+ export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
3045
3165
  security: [{
3046
3166
  key: 'BearerAuth',
3047
3167
  scheme: 'bearer',
@@ -3051,15 +3171,37 @@ export const freezeOrganizationPosition = (options) => (options.client ?? client
3051
3171
  name: 'X-API-Key',
3052
3172
  type: 'apiKey'
3053
3173
  }],
3054
- url: '/organization/v1/positions/{id}/freeze',
3174
+ url: '/workforce/v1/departments',
3055
3175
  ...options
3056
3176
  });
3057
3177
  /**
3058
- * Unfreeze a position
3178
+ * Establish a department
3059
3179
  *
3060
- * Returns a frozen position to active. Unfreezing an active position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED.
3180
+ * 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"}.
3061
3181
  */
3062
- export const unfreezeOrganizationPosition = (options) => (options.client ?? client).post({
3182
+ export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
3183
+ security: [{
3184
+ key: 'BearerAuth',
3185
+ scheme: 'bearer',
3186
+ type: 'http'
3187
+ }, {
3188
+ key: 'ApiKeyAuth',
3189
+ name: 'X-API-Key',
3190
+ type: 'apiKey'
3191
+ }],
3192
+ url: '/workforce/v1/departments',
3193
+ ...options,
3194
+ headers: {
3195
+ 'Content-Type': 'application/json',
3196
+ ...options.headers
3197
+ }
3198
+ });
3199
+ /**
3200
+ * Get a department
3201
+ *
3202
+ * 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.
3203
+ */
3204
+ export const getOrganizationDepartment = (options) => (options.client ?? client).get({
3063
3205
  security: [{
3064
3206
  key: 'BearerAuth',
3065
3207
  scheme: 'bearer',
@@ -3069,15 +3211,15 @@ export const unfreezeOrganizationPosition = (options) => (options.client ?? clie
3069
3211
  name: 'X-API-Key',
3070
3212
  type: 'apiKey'
3071
3213
  }],
3072
- url: '/organization/v1/positions/{id}/unfreeze',
3214
+ url: '/workforce/v1/departments/{id}',
3073
3215
  ...options
3074
3216
  });
3075
3217
  /**
3076
- * Reassign a position's manager
3218
+ * Reorganize a department
3077
3219
  *
3078
- * Sets the position this position reports to, or sends null to return to the default line: the head position of its department, and for a head position the head of the parent department. Requires an organization owner or admin, or the head of the position's department or of a department above it. The target may be in any department. Errors: 400 REPORTING_CYCLE when the new line would loop back to this position; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND for the position or the target; 409 POSITION_CLOSED when either is closed.
3220
+ * 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.
3079
3221
  */
3080
- export const reassignOrganizationPositionManager = (options) => (options.client ?? client).put({
3222
+ export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
3081
3223
  security: [{
3082
3224
  key: 'BearerAuth',
3083
3225
  scheme: 'bearer',
@@ -3087,7 +3229,7 @@ export const reassignOrganizationPositionManager = (options) => (options.client
3087
3229
  name: 'X-API-Key',
3088
3230
  type: 'apiKey'
3089
3231
  }],
3090
- url: '/organization/v1/positions/{id}/manager',
3232
+ url: '/workforce/v1/departments/{id}',
3091
3233
  ...options,
3092
3234
  headers: {
3093
3235
  'Content-Type': 'application/json',
@@ -3095,11 +3237,29 @@ export const reassignOrganizationPositionManager = (options) => (options.client
3095
3237
  }
3096
3238
  });
3097
3239
  /**
3098
- * Regrade a position
3240
+ * Dissolve a department
3099
3241
  *
3100
- * Sets the job level of a position. If the position was opened from a job that lists allowed levels, the level must be one of them. Requires an organization owner or admin; a department head cannot regrade. Errors: 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND; 409 POSITION_CLOSED.
3242
+ * 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.
3101
3243
  */
3102
- export const regradeOrganizationPosition = (options) => (options.client ?? client).put({
3244
+ export const dissolveOrganizationDepartment = (options) => (options.client ?? client).post({
3245
+ security: [{
3246
+ key: 'BearerAuth',
3247
+ scheme: 'bearer',
3248
+ type: 'http'
3249
+ }, {
3250
+ key: 'ApiKeyAuth',
3251
+ name: 'X-API-Key',
3252
+ type: 'apiKey'
3253
+ }],
3254
+ url: '/workforce/v1/departments/{id}/dissolve',
3255
+ ...options
3256
+ });
3257
+ /**
3258
+ * Amend a department charter
3259
+ *
3260
+ * 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.
3261
+ */
3262
+ export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
3103
3263
  security: [{
3104
3264
  key: 'BearerAuth',
3105
3265
  scheme: 'bearer',
@@ -3109,7 +3269,7 @@ export const regradeOrganizationPosition = (options) => (options.client ?? clien
3109
3269
  name: 'X-API-Key',
3110
3270
  type: 'apiKey'
3111
3271
  }],
3112
- url: '/organization/v1/positions/{id}/level',
3272
+ url: '/workforce/v1/departments/{id}/charter',
3113
3273
  ...options,
3114
3274
  headers: {
3115
3275
  'Content-Type': 'application/json',
@@ -3117,11 +3277,11 @@ export const regradeOrganizationPosition = (options) => (options.client ?? clien
3117
3277
  }
3118
3278
  });
3119
3279
  /**
3120
- * Designate a department head position
3280
+ * List jobs
3121
3281
  *
3122
- * Makes this position the head of its department; the previous head position stays an ordinary position. The head is a position, not a person, and positions in the department with no explicit manager report to it. Takes no body. Requires an organization owner or admin. Errors: 400 REPORTING_CYCLE when the change would make a position report into its own line; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED or POSITION_FROZEN, because only an active position can be head.
3282
+ * 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.
3123
3283
  */
3124
- export const designateOrganizationPositionHead = (options) => (options.client ?? client).post({
3284
+ export const listOrganizationJobs = (options) => (options?.client ?? client).get({
3125
3285
  security: [{
3126
3286
  key: 'BearerAuth',
3127
3287
  scheme: 'bearer',
@@ -3131,15 +3291,15 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
3131
3291
  name: 'X-API-Key',
3132
3292
  type: 'apiKey'
3133
3293
  }],
3134
- url: '/organization/v1/positions/{id}/designate_head',
3294
+ url: '/workforce/v1/jobs',
3135
3295
  ...options
3136
3296
  });
3137
3297
  /**
3138
- * Hire into a position
3298
+ * Define a job
3139
3299
  *
3140
- * Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. An agent created moments ago may not be in the organization roster yet (agents enter it asynchronously): that answers 503 ACTOR_SYNCING with a Retry-After header and retryable true, and the same call succeeds after that wait. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
3300
+ * 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."}.
3141
3301
  */
3142
- export const hireOrganizationPosition = (options) => (options.client ?? client).post({
3302
+ export const defineOrganizationJob = (options) => (options.client ?? client).post({
3143
3303
  security: [{
3144
3304
  key: 'BearerAuth',
3145
3305
  scheme: 'bearer',
@@ -3149,7 +3309,7 @@ export const hireOrganizationPosition = (options) => (options.client ?? client).
3149
3309
  name: 'X-API-Key',
3150
3310
  type: 'apiKey'
3151
3311
  }],
3152
- url: '/organization/v1/positions/{id}/hire',
3312
+ url: '/workforce/v1/jobs',
3153
3313
  ...options,
3154
3314
  headers: {
3155
3315
  'Content-Type': 'application/json',
@@ -3157,11 +3317,29 @@ export const hireOrganizationPosition = (options) => (options.client ?? client).
3157
3317
  }
3158
3318
  });
3159
3319
  /**
3160
- * Replace a position's holder
3320
+ * Get a job
3161
3321
  *
3162
- * Ends the current holder's assignment with reason replaced and seats the successor in the same step, so the position is never vacant in between; the ended assignment records the successor's assignment id as successor_assignment_id. Nothing the predecessor learned or remembered passes to the successor, because experience belongs to the actor, not the position. The successor must exist in your organization and not be archived; it becomes primary if it holds nothing else, otherwise a concurrent assignment. If the predecessor was primary and holds other positions, the earliest of those becomes its primary. request_id makes the call idempotent: repeating it returns the first result and replaces nobody again. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing successor or request_id, a successor that already holds this position or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND for the successor; 409 POSITION_VACANT when nobody holds the position, so use hire instead. Example body: {"successor":"agent:agent_123","request_id":"replace-support-1"}.
3322
+ * 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.
3163
3323
  */
3164
- export const replaceOrganizationPositionHolder = (options) => (options.client ?? client).post({
3324
+ export const getOrganizationJob = (options) => (options.client ?? client).get({
3325
+ security: [{
3326
+ key: 'BearerAuth',
3327
+ scheme: 'bearer',
3328
+ type: 'http'
3329
+ }, {
3330
+ key: 'ApiKeyAuth',
3331
+ name: 'X-API-Key',
3332
+ type: 'apiKey'
3333
+ }],
3334
+ url: '/workforce/v1/jobs/{id}',
3335
+ ...options
3336
+ });
3337
+ /**
3338
+ * Revise a job
3339
+ *
3340
+ * 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.
3341
+ */
3342
+ export const reviseOrganizationJob = (options) => (options.client ?? client).patch({
3165
3343
  security: [{
3166
3344
  key: 'BearerAuth',
3167
3345
  scheme: 'bearer',
@@ -3171,7 +3349,7 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
3171
3349
  name: 'X-API-Key',
3172
3350
  type: 'apiKey'
3173
3351
  }],
3174
- url: '/organization/v1/positions/{id}/replace_holder',
3352
+ url: '/workforce/v1/jobs/{id}',
3175
3353
  ...options,
3176
3354
  headers: {
3177
3355
  'Content-Type': 'application/json',
@@ -3179,11 +3357,11 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
3179
3357
  }
3180
3358
  });
3181
3359
  /**
3182
- * List assignments
3360
+ * Retire a job
3183
3361
  *
3184
- * Lists assignments, newest start first, each tying one actor (person or agent) to one position; use it to see who holds what, or the history of a position or an actor. Ended assignments are included unless you filter active=true. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean active or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/assignments?position_id=pos_123&active=true.
3362
+ * 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.
3185
3363
  */
3186
- export const listOrganizationAssignments = (options) => (options?.client ?? client).get({
3364
+ export const retireOrganizationJob = (options) => (options.client ?? client).post({
3187
3365
  security: [{
3188
3366
  key: 'BearerAuth',
3189
3367
  scheme: 'bearer',
@@ -3193,15 +3371,15 @@ export const listOrganizationAssignments = (options) => (options?.client ?? clie
3193
3371
  name: 'X-API-Key',
3194
3372
  type: 'apiKey'
3195
3373
  }],
3196
- url: '/organization/v1/assignments',
3374
+ url: '/workforce/v1/jobs/{id}/retire',
3197
3375
  ...options
3198
3376
  });
3199
3377
  /**
3200
- * Get an assignment
3378
+ * List job ladders
3201
3379
  *
3202
- * Reads one assignment, current or ended, with who appointed and ended it and, for a replaced holder, the successor's assignment id. Read-only. Errors: 404 ASSIGNMENT_NOT_FOUND when the id is not an assignment of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3380
+ * 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.
3203
3381
  */
3204
- export const getOrganizationAssignment = (options) => (options.client ?? client).get({
3382
+ export const listOrganizationLadders = (options) => (options?.client ?? client).get({
3205
3383
  security: [{
3206
3384
  key: 'BearerAuth',
3207
3385
  scheme: 'bearer',
@@ -3211,15 +3389,15 @@ export const getOrganizationAssignment = (options) => (options.client ?? client)
3211
3389
  name: 'X-API-Key',
3212
3390
  type: 'apiKey'
3213
3391
  }],
3214
- url: '/organization/v1/assignments/{id}',
3392
+ url: '/workforce/v1/ladders',
3215
3393
  ...options
3216
3394
  });
3217
3395
  /**
3218
- * Transfer an assignment to another position
3396
+ * Define a job ladder
3219
3397
  *
3220
- * Moves the actor from its current position to another vacant one: the current assignment ends with reason transferred and a new one starts in the target position, keeping the primary flag, so a primary assignment stays primary. Use it for a move or promotion; use terminate when the actor leaves the position without another. Only a current assignment can be transferred. The target must be active and vacant. Needs write rights over both departments: an organization owner or admin, or a head whose department is, or is above, both the department being left and the target's department. Errors: 400 INVALID_PARAMS for a missing to_position_id or a target equal to the current position; 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or already ended assignment; 404 POSITION_NOT_FOUND for the target; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED for the target. Example body: {"to_position_id":"pos_456"}.
3398
+ * 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}]}.
3221
3399
  */
3222
- export const transferOrganizationAssignment = (options) => (options.client ?? client).post({
3400
+ export const defineOrganizationLadder = (options) => (options.client ?? client).post({
3223
3401
  security: [{
3224
3402
  key: 'BearerAuth',
3225
3403
  scheme: 'bearer',
@@ -3229,7 +3407,7 @@ export const transferOrganizationAssignment = (options) => (options.client ?? cl
3229
3407
  name: 'X-API-Key',
3230
3408
  type: 'apiKey'
3231
3409
  }],
3232
- url: '/organization/v1/assignments/{id}/transfer',
3410
+ url: '/workforce/v1/ladders',
3233
3411
  ...options,
3234
3412
  headers: {
3235
3413
  'Content-Type': 'application/json',
@@ -3237,11 +3415,11 @@ export const transferOrganizationAssignment = (options) => (options.client ?? cl
3237
3415
  }
3238
3416
  });
3239
3417
  /**
3240
- * End an assignment
3418
+ * Get a job ladder
3241
3419
  *
3242
- * Ends a current assignment with the reason you give; the position becomes vacant and the assignment stays as history that never revives. If it was the actor's primary and the actor still holds other positions, the earliest of those becomes primary. Use transfer instead to move the actor to another position. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing reason or one outside the list; 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or already ended assignment. Example body: {"reason":"resigned"}.
3420
+ * 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.
3243
3421
  */
3244
- export const terminateOrganizationAssignment = (options) => (options.client ?? client).post({
3422
+ export const getOrganizationLadder = (options) => (options.client ?? client).get({
3245
3423
  security: [{
3246
3424
  key: 'BearerAuth',
3247
3425
  scheme: 'bearer',
@@ -3251,19 +3429,15 @@ export const terminateOrganizationAssignment = (options) => (options.client ?? c
3251
3429
  name: 'X-API-Key',
3252
3430
  type: 'apiKey'
3253
3431
  }],
3254
- url: '/organization/v1/assignments/{id}/terminate',
3255
- ...options,
3256
- headers: {
3257
- 'Content-Type': 'application/json',
3258
- ...options.headers
3259
- }
3432
+ url: '/workforce/v1/ladders/{id}',
3433
+ ...options
3260
3434
  });
3261
3435
  /**
3262
- * Make an assignment primary
3436
+ * Revise a job ladder
3263
3437
  *
3264
- * Makes this assignment the actor's primary one; the actor's previous primary becomes a concurrent assignment in the same step. Use it when an actor holds several positions and its main one changes. An assignment that is already primary is returned unchanged. Takes no body. Requires an organization owner or admin; a department head cannot call this. Errors: 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or ended assignment.
3438
+ * 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.
3265
3439
  */
3266
- export const makePrimaryOrganizationAssignment = (options) => (options.client ?? client).post({
3440
+ export const reviseOrganizationLadder = (options) => (options.client ?? client).put({
3267
3441
  security: [{
3268
3442
  key: 'BearerAuth',
3269
3443
  scheme: 'bearer',
@@ -3273,15 +3447,19 @@ export const makePrimaryOrganizationAssignment = (options) => (options.client ??
3273
3447
  name: 'X-API-Key',
3274
3448
  type: 'apiKey'
3275
3449
  }],
3276
- url: '/organization/v1/assignments/{id}/make_primary',
3277
- ...options
3450
+ url: '/workforce/v1/ladders/{id}',
3451
+ ...options,
3452
+ headers: {
3453
+ 'Content-Type': 'application/json',
3454
+ ...options.headers
3455
+ }
3278
3456
  });
3279
3457
  /**
3280
- * List actors holding positions
3458
+ * List positions
3281
3459
  *
3282
- * Lists every actor, person or agent, that currently holds at least one position, ordered by actor address, each with its primary position and all positions it holds; use it to see who works where. Actors holding nothing are not listed. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/actors?department_id=dept_123.
3460
+ * 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.
3283
3461
  */
3284
- export const listOrganizationActors = (options) => (options?.client ?? client).get({
3462
+ export const listOrganizationPositions = (options) => (options?.client ?? client).get({
3285
3463
  security: [{
3286
3464
  key: 'BearerAuth',
3287
3465
  scheme: 'bearer',
@@ -3291,15 +3469,15 @@ export const listOrganizationActors = (options) => (options?.client ?? client).g
3291
3469
  name: 'X-API-Key',
3292
3470
  type: 'apiKey'
3293
3471
  }],
3294
- url: '/organization/v1/actors',
3472
+ url: '/workforce/v1/positions',
3295
3473
  ...options
3296
3474
  });
3297
3475
  /**
3298
- * Get the position chain of an actor
3476
+ * Open positions
3299
3477
  *
3300
- * Reads where an actor, person or agent, sits in the organization: its primary position and its concurrent positions, each with the department path from the root down with every level's charter, the job, title and level name, the manager (the first filled position up the reporting line), the position's own duties and methods, and objectives. Use it to answer who this actor is and what it is responsible for. An actor that holds no position is not an error: primary is null and concurrent is empty. Read-only. Errors: 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3478
+ * 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"}.
3301
3479
  */
3302
- export const getOrganizationActor = (options) => (options.client ?? client).get({
3480
+ export const openOrganizationPositions = (options) => (options.client ?? client).post({
3303
3481
  security: [{
3304
3482
  key: 'BearerAuth',
3305
3483
  scheme: 'bearer',
@@ -3309,15 +3487,19 @@ export const getOrganizationActor = (options) => (options.client ?? client).get(
3309
3487
  name: 'X-API-Key',
3310
3488
  type: 'apiKey'
3311
3489
  }],
3312
- url: '/organization/v1/actors/{actor}',
3313
- ...options
3490
+ url: '/workforce/v1/positions',
3491
+ ...options,
3492
+ headers: {
3493
+ 'Content-Type': 'application/json',
3494
+ ...options.headers
3495
+ }
3314
3496
  });
3315
3497
  /**
3316
- * List periods
3498
+ * Get a position
3317
3499
  *
3318
- * Lists the periods of your organization's OKR calendar, newest start first; use it to find the period_id to set objectives in, or to see which periods are still open for grading. Closed periods are included. Filter cadence to read one level of the calendar. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/periods?cadence=quarter.
3500
+ * 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.
3319
3501
  */
3320
- export const listOrganizationPeriods = (options) => (options?.client ?? client).get({
3502
+ export const getOrganizationPosition = (options) => (options.client ?? client).get({
3321
3503
  security: [{
3322
3504
  key: 'BearerAuth',
3323
3505
  scheme: 'bearer',
@@ -3327,15 +3509,15 @@ export const listOrganizationPeriods = (options) => (options?.client ?? client).
3327
3509
  name: 'X-API-Key',
3328
3510
  type: 'apiKey'
3329
3511
  }],
3330
- url: '/organization/v1/periods',
3512
+ url: '/workforce/v1/positions/{id}',
3331
3513
  ...options
3332
3514
  });
3333
3515
  /**
3334
- * Open a period
3516
+ * Revise a position
3335
3517
  *
3336
- * Opens a period in your organization's single OKR calendar of years, halves and quarters; objectives are set inside a period. Its status is derived, never sent: planning before start_on, active from start_on through end_on inclusive, grading after end_on, and closed only when you close it. Periods of the same cadence never overlap. Give parent_id to place a half or quarter inside a coarser period (year > half > quarter) that contains its whole range. Dates are calendar dates, and today is read as the UTC date. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, a name over 100 characters, a cadence outside the list, a date that is not YYYY-MM-DD, start_on after end_on or an unknown body field; 400 PERIOD_OVERLAP when a period of the same cadence already covers part of the range, or the parent is not coarser or does not contain the range; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND when parent_id does not exist. Example body: {"name":"2026 Q4","cadence":"quarter","start_on":"2026-10-01","end_on":"2026-12-31"}.
3518
+ * 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.
3337
3519
  */
3338
- export const openOrganizationPeriod = (options) => (options.client ?? client).post({
3520
+ export const reviseOrganizationPosition = (options) => (options.client ?? client).patch({
3339
3521
  security: [{
3340
3522
  key: 'BearerAuth',
3341
3523
  scheme: 'bearer',
@@ -3345,7 +3527,7 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
3345
3527
  name: 'X-API-Key',
3346
3528
  type: 'apiKey'
3347
3529
  }],
3348
- url: '/organization/v1/periods',
3530
+ url: '/workforce/v1/positions/{id}',
3349
3531
  ...options,
3350
3532
  headers: {
3351
3533
  'Content-Type': 'application/json',
@@ -3353,11 +3535,11 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
3353
3535
  }
3354
3536
  });
3355
3537
  /**
3356
- * Get a period
3538
+ * Close a position
3357
3539
  *
3358
- * Reads one period with its derived status, so you can tell whether it is still planning, active, in grading or closed. Read-only. Errors: 404 PERIOD_NOT_FOUND when the id is not a period of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3540
+ * 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.
3359
3541
  */
3360
- export const getOrganizationPeriod = (options) => (options.client ?? client).get({
3542
+ export const closeOrganizationPosition = (options) => (options.client ?? client).post({
3361
3543
  security: [{
3362
3544
  key: 'BearerAuth',
3363
3545
  scheme: 'bearer',
@@ -3367,15 +3549,15 @@ export const getOrganizationPeriod = (options) => (options.client ?? client).get
3367
3549
  name: 'X-API-Key',
3368
3550
  type: 'apiKey'
3369
3551
  }],
3370
- url: '/organization/v1/periods/{id}',
3552
+ url: '/workforce/v1/positions/{id}/close',
3371
3553
  ...options
3372
3554
  });
3373
3555
  /**
3374
- * Close a period
3556
+ * Freeze a position
3375
3557
  *
3376
- * Closes a period once its objectives are graded: closed is the only status you set yourself, and it never reverts. After it, objectives and key results of the period can no longer be set or revised. Closing does not grade or change any objective. Closing a period that is already closed returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND.
3558
+ * 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.
3377
3559
  */
3378
- export const closeOrganizationPeriod = (options) => (options.client ?? client).post({
3560
+ export const freezeOrganizationPosition = (options) => (options.client ?? client).post({
3379
3561
  security: [{
3380
3562
  key: 'BearerAuth',
3381
3563
  scheme: 'bearer',
@@ -3385,15 +3567,15 @@ export const closeOrganizationPeriod = (options) => (options.client ?? client).p
3385
3567
  name: 'X-API-Key',
3386
3568
  type: 'apiKey'
3387
3569
  }],
3388
- url: '/organization/v1/periods/{id}/close',
3570
+ url: '/workforce/v1/positions/{id}/freeze',
3389
3571
  ...options
3390
3572
  });
3391
3573
  /**
3392
- * List objectives
3574
+ * Unfreeze a position
3393
3575
  *
3394
- * Lists objectives, oldest first, each with its scope, the parents it aligns to and, once graded, its result and score; use it to find an objective id or to read one period or one department's objectives. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/objectives?period_id=prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38&status=active.
3576
+ * 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.
3395
3577
  */
3396
- export const listOrganizationObjectives = (options) => (options?.client ?? client).get({
3578
+ export const unfreezeOrganizationPosition = (options) => (options.client ?? client).post({
3397
3579
  security: [{
3398
3580
  key: 'BearerAuth',
3399
3581
  scheme: 'bearer',
@@ -3403,15 +3585,15 @@ export const listOrganizationObjectives = (options) => (options?.client ?? clien
3403
3585
  name: 'X-API-Key',
3404
3586
  type: 'apiKey'
3405
3587
  }],
3406
- url: '/organization/v1/objectives',
3588
+ url: '/workforce/v1/positions/{id}/unfreeze',
3407
3589
  ...options
3408
3590
  });
3409
3591
  /**
3410
- * Set an objective
3592
+ * Reassign a position's manager
3411
3593
  *
3412
- * Sets an objective: what a department or a position is trying to reach in one open period. It hangs on a department or a position of your organization's tree, and company objectives hang on the root department. It starts active with no parents; align it to higher objectives with the align operation, and add key results with the key results operations. Requires an organization owner or admin, or the head of the objective's home department (the department itself, or the department of the position). Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a description over 2000 characters, a scope kind outside the list or an unknown body field; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND, DEPARTMENT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED, DEPARTMENT_DISSOLVED or POSITION_CLOSED. Example body: {"period_id":"prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38","scope":{"kind":"department","id":"dept_4c2e9a17d0b34f58a6e1b3c7d9f20e84"},"title":"Cut first-response time"}.
3594
+ * 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.
3413
3595
  */
3414
- export const setOrganizationObjective = (options) => (options.client ?? client).post({
3596
+ export const reassignOrganizationPositionManager = (options) => (options.client ?? client).put({
3415
3597
  security: [{
3416
3598
  key: 'BearerAuth',
3417
3599
  scheme: 'bearer',
@@ -3421,7 +3603,7 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
3421
3603
  name: 'X-API-Key',
3422
3604
  type: 'apiKey'
3423
3605
  }],
3424
- url: '/organization/v1/objectives',
3606
+ url: '/workforce/v1/positions/{id}/manager',
3425
3607
  ...options,
3426
3608
  headers: {
3427
3609
  'Content-Type': 'application/json',
@@ -3429,11 +3611,11 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
3429
3611
  }
3430
3612
  });
3431
3613
  /**
3432
- * Get an objective
3614
+ * Regrade a position
3433
3615
  *
3434
- * Reads one objective with its scope, the parents it aligns to with their weights, its status and, once graded, its result, score and grade note. Its key results are read with the key results list filtered by objective_id. Read-only. Errors: 404 OBJECTIVE_NOT_FOUND when the id is not an objective of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3616
+ * 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.
3435
3617
  */
3436
- export const getOrganizationObjective = (options) => (options.client ?? client).get({
3618
+ export const regradeOrganizationPosition = (options) => (options.client ?? client).put({
3437
3619
  security: [{
3438
3620
  key: 'BearerAuth',
3439
3621
  scheme: 'bearer',
@@ -3443,15 +3625,37 @@ export const getOrganizationObjective = (options) => (options.client ?? client).
3443
3625
  name: 'X-API-Key',
3444
3626
  type: 'apiKey'
3445
3627
  }],
3446
- url: '/organization/v1/objectives/{id}',
3628
+ url: '/workforce/v1/positions/{id}/level',
3629
+ ...options,
3630
+ headers: {
3631
+ 'Content-Type': 'application/json',
3632
+ ...options.headers
3633
+ }
3634
+ });
3635
+ /**
3636
+ * Designate a department head position
3637
+ *
3638
+ * 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.
3639
+ */
3640
+ export const designateOrganizationPositionHead = (options) => (options.client ?? client).post({
3641
+ security: [{
3642
+ key: 'BearerAuth',
3643
+ scheme: 'bearer',
3644
+ type: 'http'
3645
+ }, {
3646
+ key: 'ApiKeyAuth',
3647
+ name: 'X-API-Key',
3648
+ type: 'apiKey'
3649
+ }],
3650
+ url: '/workforce/v1/positions/{id}/designate_head',
3447
3651
  ...options
3448
3652
  });
3449
3653
  /**
3450
- * Revise an objective
3654
+ * Hire into a position
3451
3655
  *
3452
- * Rewords an active objective: change its title, its description or both; send at least one. Its period, scope and alignment do not change here; use align for parents, and grade to close it. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS when no field is given, a title is empty or over 200 characters, or a description is over 2000 characters; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 409 PERIOD_CLOSED when the objective was already graded or its period is closed. Example body: {"title":"Cut first-response time to under 2 hours"}.
3656
+ * 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"}.
3453
3657
  */
3454
- export const reviseOrganizationObjective = (options) => (options.client ?? client).patch({
3658
+ export const hireOrganizationPosition = (options) => (options.client ?? client).post({
3455
3659
  security: [{
3456
3660
  key: 'BearerAuth',
3457
3661
  scheme: 'bearer',
@@ -3461,7 +3665,7 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
3461
3665
  name: 'X-API-Key',
3462
3666
  type: 'apiKey'
3463
3667
  }],
3464
- url: '/organization/v1/objectives/{id}',
3668
+ url: '/workforce/v1/positions/{id}/hire',
3465
3669
  ...options,
3466
3670
  headers: {
3467
3671
  'Content-Type': 'application/json',
@@ -3469,11 +3673,11 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
3469
3673
  }
3470
3674
  });
3471
3675
  /**
3472
- * Align an objective to parent objectives
3676
+ * Replace a position's holder
3473
3677
  *
3474
- * Replaces the whole set of parent objectives this objective contributes to; send an empty parents array to remove its alignment. An objective aligns only upward: each parent must hang on the objective's own department or on a department above it, the objective cannot be its own parent, and the alignment graph must stay free of cycles. Each weight is greater than 0 and at most 1, and a parent may appear once. A closed parent is refused. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for a weight outside the range, a repeated parent or an unknown body field; 400 ALIGNMENT_CYCLE when a parent is the objective itself or the alignment would loop; 400 SCOPE_MISMATCH when a parent hangs outside the objective's department and its ancestors; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND for the objective or a parent; 409 PERIOD_CLOSED when a parent is closed. Example body: {"parents":[{"objective_id":"obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96","weight":1}]}.
3678
+ * 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"}.
3475
3679
  */
3476
- export const alignOrganizationObjective = (options) => (options.client ?? client).put({
3680
+ export const replaceOrganizationPositionHolder = (options) => (options.client ?? client).post({
3477
3681
  security: [{
3478
3682
  key: 'BearerAuth',
3479
3683
  scheme: 'bearer',
@@ -3483,7 +3687,7 @@ export const alignOrganizationObjective = (options) => (options.client ?? client
3483
3687
  name: 'X-API-Key',
3484
3688
  type: 'apiKey'
3485
3689
  }],
3486
- url: '/organization/v1/objectives/{id}/parents',
3690
+ url: '/workforce/v1/positions/{id}/replace_holder',
3487
3691
  ...options,
3488
3692
  headers: {
3489
3693
  'Content-Type': 'application/json',
@@ -3491,11 +3695,29 @@ export const alignOrganizationObjective = (options) => (options.client ?? client
3491
3695
  }
3492
3696
  });
3493
3697
  /**
3494
- * Grade an objective
3698
+ * List assignments
3495
3699
  *
3496
- * Grades an objective and closes it in place: records its result, its score from 0 to 1, an optional note, and the scores of the key results you list. A key result you leave out keeps no score. Grading happens once; a closed objective cannot be graded again. When the objective has any committed key result and the result is not achieved, a note is required. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for a result outside the list, a non-numeric score or a note over 2000 characters; 400 SCORE_OUT_OF_RANGE when any score is outside 0 to 1; 400 GRADE_NOTE_REQUIRED when a committed objective is graded other than achieved without a note; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 404 KEY_RESULT_NOT_FOUND when a listed key result does not belong to this objective; 409 PERIOD_CLOSED when the objective is already closed. Example body: {"result":"partial","score":0.6,"note":"Hiring slipped a month."}.
3700
+ * 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.
3497
3701
  */
3498
- export const gradeOrganizationObjective = (options) => (options.client ?? client).post({
3702
+ export const listOrganizationAssignments = (options) => (options?.client ?? client).get({
3703
+ security: [{
3704
+ key: 'BearerAuth',
3705
+ scheme: 'bearer',
3706
+ type: 'http'
3707
+ }, {
3708
+ key: 'ApiKeyAuth',
3709
+ name: 'X-API-Key',
3710
+ type: 'apiKey'
3711
+ }],
3712
+ url: '/workforce/v1/assignments',
3713
+ ...options
3714
+ });
3715
+ /**
3716
+ * Get an assignment
3717
+ *
3718
+ * 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.
3719
+ */
3720
+ export const getOrganizationAssignment = (options) => (options.client ?? client).get({
3499
3721
  security: [{
3500
3722
  key: 'BearerAuth',
3501
3723
  scheme: 'bearer',
@@ -3505,7 +3727,25 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
3505
3727
  name: 'X-API-Key',
3506
3728
  type: 'apiKey'
3507
3729
  }],
3508
- url: '/organization/v1/objectives/{id}/grade',
3730
+ url: '/workforce/v1/assignments/{id}',
3731
+ ...options
3732
+ });
3733
+ /**
3734
+ * Transfer an assignment to another position
3735
+ *
3736
+ * 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"}.
3737
+ */
3738
+ export const transferOrganizationAssignment = (options) => (options.client ?? client).post({
3739
+ security: [{
3740
+ key: 'BearerAuth',
3741
+ scheme: 'bearer',
3742
+ type: 'http'
3743
+ }, {
3744
+ key: 'ApiKeyAuth',
3745
+ name: 'X-API-Key',
3746
+ type: 'apiKey'
3747
+ }],
3748
+ url: '/workforce/v1/assignments/{id}/transfer',
3509
3749
  ...options,
3510
3750
  headers: {
3511
3751
  'Content-Type': 'application/json',
@@ -3513,11 +3753,33 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
3513
3753
  }
3514
3754
  });
3515
3755
  /**
3516
- * List key results
3756
+ * End an assignment
3517
3757
  *
3518
- * Lists key results, oldest first, each with its metric, health, done flag and, once its objective is graded, its score; use it to read the key results of one objective or the ones a position owns. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/key_results?objective_id=obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96.
3758
+ * 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"}.
3519
3759
  */
3520
- export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
3760
+ export const terminateOrganizationAssignment = (options) => (options.client ?? client).post({
3761
+ security: [{
3762
+ key: 'BearerAuth',
3763
+ scheme: 'bearer',
3764
+ type: 'http'
3765
+ }, {
3766
+ key: 'ApiKeyAuth',
3767
+ name: 'X-API-Key',
3768
+ type: 'apiKey'
3769
+ }],
3770
+ url: '/workforce/v1/assignments/{id}/terminate',
3771
+ ...options,
3772
+ headers: {
3773
+ 'Content-Type': 'application/json',
3774
+ ...options.headers
3775
+ }
3776
+ });
3777
+ /**
3778
+ * Make an assignment primary
3779
+ *
3780
+ * 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.
3781
+ */
3782
+ export const makePrimaryOrganizationAssignment = (options) => (options.client ?? client).post({
3521
3783
  security: [{
3522
3784
  key: 'BearerAuth',
3523
3785
  scheme: 'bearer',
@@ -3527,15 +3789,69 @@ export const listOrganizationKeyResults = (options) => (options?.client ?? clien
3527
3789
  name: 'X-API-Key',
3528
3790
  type: 'apiKey'
3529
3791
  }],
3530
- url: '/organization/v1/key_results',
3792
+ url: '/workforce/v1/assignments/{id}/make_primary',
3531
3793
  ...options
3532
3794
  });
3533
3795
  /**
3534
- * Set a key result
3796
+ * List actors holding positions
3535
3797
  *
3536
- * Sets a key result under an active objective: a measurable outcome owned by one position, whose current holder moves its progress. Give a metric to measure it by numbers; omit metric for a binary key result, whose progress is its done flag. It starts with health on_track, done false and no score. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a commitment outside the list, a metric whose target equals its initial value or whose unit is outside the list, or an unknown body field; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED when the objective is graded or its period is closed; 409 POSITION_CLOSED when the owner position is closed. Example body: {"objective_id":"obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96","title":"Median first response under 2 hours","owner_position_id":"pos_7a1c5e92d3b84f60a9e2c4d8b1f30a57","commitment":"committed","metric":{"initial":6,"target":2,"unit":"none"}}.
3798
+ * 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.
3537
3799
  */
3538
- export const setOrganizationKeyResult = (options) => (options.client ?? client).post({
3800
+ export const listOrganizationActors = (options) => (options?.client ?? client).get({
3801
+ security: [{
3802
+ key: 'BearerAuth',
3803
+ scheme: 'bearer',
3804
+ type: 'http'
3805
+ }, {
3806
+ key: 'ApiKeyAuth',
3807
+ name: 'X-API-Key',
3808
+ type: 'apiKey'
3809
+ }],
3810
+ url: '/workforce/v1/actors',
3811
+ ...options
3812
+ });
3813
+ /**
3814
+ * Get the position chain of an actor
3815
+ *
3816
+ * 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.
3817
+ */
3818
+ export const getOrganizationActor = (options) => (options.client ?? client).get({
3819
+ security: [{
3820
+ key: 'BearerAuth',
3821
+ scheme: 'bearer',
3822
+ type: 'http'
3823
+ }, {
3824
+ key: 'ApiKeyAuth',
3825
+ name: 'X-API-Key',
3826
+ type: 'apiKey'
3827
+ }],
3828
+ url: '/workforce/v1/actors/{actor}',
3829
+ ...options
3830
+ });
3831
+ /**
3832
+ * List periods
3833
+ *
3834
+ * 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.
3835
+ */
3836
+ export const listOrganizationPeriods = (options) => (options?.client ?? client).get({
3837
+ security: [{
3838
+ key: 'BearerAuth',
3839
+ scheme: 'bearer',
3840
+ type: 'http'
3841
+ }, {
3842
+ key: 'ApiKeyAuth',
3843
+ name: 'X-API-Key',
3844
+ type: 'apiKey'
3845
+ }],
3846
+ url: '/workforce/v1/periods',
3847
+ ...options
3848
+ });
3849
+ /**
3850
+ * Open a period
3851
+ *
3852
+ * 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"}.
3853
+ */
3854
+ export const openOrganizationPeriod = (options) => (options.client ?? client).post({
3539
3855
  security: [{
3540
3856
  key: 'BearerAuth',
3541
3857
  scheme: 'bearer',
@@ -3545,7 +3861,7 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
3545
3861
  name: 'X-API-Key',
3546
3862
  type: 'apiKey'
3547
3863
  }],
3548
- url: '/organization/v1/key_results',
3864
+ url: '/workforce/v1/periods',
3549
3865
  ...options,
3550
3866
  headers: {
3551
3867
  'Content-Type': 'application/json',
@@ -3553,11 +3869,11 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
3553
3869
  }
3554
3870
  });
3555
3871
  /**
3556
- * Get a key result
3872
+ * Get a period
3557
3873
  *
3558
- * Reads one key result with its metric, its health, its done flag, its owner position and its score. Progress of a metric key result is (current - initial) / (target - initial), clamped between 0 and 1; a key result without a metric counts as 1 when done is true and 0 otherwise. Read-only. Errors: 404 KEY_RESULT_NOT_FOUND when the id is not a key result of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3874
+ * 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.
3559
3875
  */
3560
- export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
3876
+ export const getOrganizationPeriod = (options) => (options.client ?? client).get({
3561
3877
  security: [{
3562
3878
  key: 'BearerAuth',
3563
3879
  scheme: 'bearer',
@@ -3567,15 +3883,15 @@ export const getOrganizationKeyResult = (options) => (options.client ?? client).
3567
3883
  name: 'X-API-Key',
3568
3884
  type: 'apiKey'
3569
3885
  }],
3570
- url: '/organization/v1/key_results/{id}',
3886
+ url: '/workforce/v1/periods/{id}',
3571
3887
  ...options
3572
3888
  });
3573
3889
  /**
3574
- * Revise a key result
3890
+ * Close a period
3575
3891
  *
3576
- * Edits a key result; send at least one field. Progress is updated by this edit, not by check-in records: write metric.current for a metric key result, or done for a binary one, and set health as it changes. The holder of the owner position, when a person, may change only metric.current, health and done; an organization owner or admin, or the head of the objective's home department or of a department above it, may change any field. An agent holding the position cannot write it. metric replaces the whole metric; done applies only to a key result without a metric. Errors: 400 INVALID_PARAMS when no field is given, done is sent for a key result that has a metric, or a field is malformed; 403 NOT_POSITION_HOLDER when the caller is neither a manager nor the position's person holder; 403 PERMISSION_DENIED when a holder changes more than progress; 404 KEY_RESULT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED when the objective is graded or its period is closed; 409 POSITION_CLOSED for a closed new owner. Example body: {"metric":{"initial":6,"current":3.5,"target":2,"unit":"none"},"health":"at_risk"}.
3892
+ * 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.
3577
3893
  */
3578
- export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
3894
+ export const closeOrganizationPeriod = (options) => (options.client ?? client).post({
3579
3895
  security: [{
3580
3896
  key: 'BearerAuth',
3581
3897
  scheme: 'bearer',
@@ -3585,7 +3901,43 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
3585
3901
  name: 'X-API-Key',
3586
3902
  type: 'apiKey'
3587
3903
  }],
3588
- url: '/organization/v1/key_results/{id}',
3904
+ url: '/workforce/v1/periods/{id}/close',
3905
+ ...options
3906
+ });
3907
+ /**
3908
+ * List objectives
3909
+ *
3910
+ * 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.
3911
+ */
3912
+ export const listOrganizationObjectives = (options) => (options?.client ?? client).get({
3913
+ security: [{
3914
+ key: 'BearerAuth',
3915
+ scheme: 'bearer',
3916
+ type: 'http'
3917
+ }, {
3918
+ key: 'ApiKeyAuth',
3919
+ name: 'X-API-Key',
3920
+ type: 'apiKey'
3921
+ }],
3922
+ url: '/workforce/v1/objectives',
3923
+ ...options
3924
+ });
3925
+ /**
3926
+ * Set an objective
3927
+ *
3928
+ * 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"}.
3929
+ */
3930
+ export const setOrganizationObjective = (options) => (options.client ?? client).post({
3931
+ security: [{
3932
+ key: 'BearerAuth',
3933
+ scheme: 'bearer',
3934
+ type: 'http'
3935
+ }, {
3936
+ key: 'ApiKeyAuth',
3937
+ name: 'X-API-Key',
3938
+ type: 'apiKey'
3939
+ }],
3940
+ url: '/workforce/v1/objectives',
3589
3941
  ...options,
3590
3942
  headers: {
3591
3943
  'Content-Type': 'application/json',
@@ -3593,11 +3945,11 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
3593
3945
  }
3594
3946
  });
3595
3947
  /**
3596
- * Upgrade to a full sandbox
3948
+ * Get an objective
3597
3949
  *
3598
- * 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.
3950
+ * 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.
3599
3951
  */
3600
- export const upgradeSandbox = (options) => (options.client ?? client).post({
3952
+ export const getOrganizationObjective = (options) => (options.client ?? client).get({
3601
3953
  security: [{
3602
3954
  key: 'BearerAuth',
3603
3955
  scheme: 'bearer',
@@ -3607,7 +3959,25 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
3607
3959
  name: 'X-API-Key',
3608
3960
  type: 'apiKey'
3609
3961
  }],
3610
- url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
3962
+ url: '/workforce/v1/objectives/{id}',
3963
+ ...options
3964
+ });
3965
+ /**
3966
+ * Revise an objective
3967
+ *
3968
+ * 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"}.
3969
+ */
3970
+ export const reviseOrganizationObjective = (options) => (options.client ?? client).patch({
3971
+ security: [{
3972
+ key: 'BearerAuth',
3973
+ scheme: 'bearer',
3974
+ type: 'http'
3975
+ }, {
3976
+ key: 'ApiKeyAuth',
3977
+ name: 'X-API-Key',
3978
+ type: 'apiKey'
3979
+ }],
3980
+ url: '/workforce/v1/objectives/{id}',
3611
3981
  ...options,
3612
3982
  headers: {
3613
3983
  'Content-Type': 'application/json',
@@ -3615,11 +3985,11 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
3615
3985
  }
3616
3986
  });
3617
3987
  /**
3618
- * Extend a running sandbox without shortening its deadline
3988
+ * Align an objective to parent objectives
3619
3989
  *
3620
- * 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.
3990
+ * 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}]}.
3621
3991
  */
3622
- export const extendSandbox = (options) => (options.client ?? client).post({
3992
+ export const alignOrganizationObjective = (options) => (options.client ?? client).put({
3623
3993
  security: [{
3624
3994
  key: 'BearerAuth',
3625
3995
  scheme: 'bearer',
@@ -3629,7 +3999,7 @@ export const extendSandbox = (options) => (options.client ?? client).post({
3629
3999
  name: 'X-API-Key',
3630
4000
  type: 'apiKey'
3631
4001
  }],
3632
- url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
4002
+ url: '/workforce/v1/objectives/{id}/parents',
3633
4003
  ...options,
3634
4004
  headers: {
3635
4005
  'Content-Type': 'application/json',
@@ -3637,11 +4007,11 @@ export const extendSandbox = (options) => (options.client ?? client).post({
3637
4007
  }
3638
4008
  });
3639
4009
  /**
3640
- * List live processes and retained observations
4010
+ * Grade an objective
3641
4011
  *
3642
- * 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.
4012
+ * 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."}.
3643
4013
  */
3644
- export const listObservedProcesses = (options) => (options.client ?? client).get({
4014
+ export const gradeOrganizationObjective = (options) => (options.client ?? client).post({
3645
4015
  security: [{
3646
4016
  key: 'BearerAuth',
3647
4017
  scheme: 'bearer',
@@ -3651,15 +4021,19 @@ export const listObservedProcesses = (options) => (options.client ?? client).get
3651
4021
  name: 'X-API-Key',
3652
4022
  type: 'apiKey'
3653
4023
  }],
3654
- url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
3655
- ...options
4024
+ url: '/workforce/v1/objectives/{id}/grade',
4025
+ ...options,
4026
+ headers: {
4027
+ 'Content-Type': 'application/json',
4028
+ ...options.headers
4029
+ }
3656
4030
  });
3657
4031
  /**
3658
- * Read bounded observed process output
4032
+ * List key results
3659
4033
  *
3660
- * 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.
4034
+ * 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.
3661
4035
  */
3662
- export const getObservedProcessOutput = (options) => (options.client ?? client).get({
4036
+ export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
3663
4037
  security: [{
3664
4038
  key: 'BearerAuth',
3665
4039
  scheme: 'bearer',
@@ -3669,15 +4043,15 @@ export const getObservedProcessOutput = (options) => (options.client ?? client).
3669
4043
  name: 'X-API-Key',
3670
4044
  type: 'apiKey'
3671
4045
  }],
3672
- url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
4046
+ url: '/workforce/v1/key_results',
3673
4047
  ...options
3674
4048
  });
3675
4049
  /**
3676
- * Start a task whose output is pushed off the machine while it runs
4050
+ * Set a key result
3677
4051
  *
3678
- * 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.
4052
+ * 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"}}.
3679
4053
  */
3680
- export const startSandboxTask = (options) => (options.client ?? client).post({
4054
+ export const setOrganizationKeyResult = (options) => (options.client ?? client).post({
3681
4055
  security: [{
3682
4056
  key: 'BearerAuth',
3683
4057
  scheme: 'bearer',
@@ -3687,7 +4061,7 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
3687
4061
  name: 'X-API-Key',
3688
4062
  type: 'apiKey'
3689
4063
  }],
3690
- url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
4064
+ url: '/workforce/v1/key_results',
3691
4065
  ...options,
3692
4066
  headers: {
3693
4067
  'Content-Type': 'application/json',
@@ -3695,11 +4069,11 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
3695
4069
  }
3696
4070
  });
3697
4071
  /**
3698
- * Read a range of a task's pushed output
4072
+ * Get a key result
3699
4073
  *
3700
- * 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.
4074
+ * 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.
3701
4075
  */
3702
- export const getSandboxTaskLog = (options) => (options.client ?? client).get({
4076
+ export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
3703
4077
  security: [{
3704
4078
  key: 'BearerAuth',
3705
4079
  scheme: 'bearer',
@@ -3709,89 +4083,73 @@ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
3709
4083
  name: 'X-API-Key',
3710
4084
  type: 'apiKey'
3711
4085
  }],
3712
- url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
4086
+ url: '/workforce/v1/key_results/{id}',
3713
4087
  ...options
3714
4088
  });
3715
4089
  /**
3716
- * Kill sandbox
4090
+ * Revise a key result
3717
4091
  *
3718
- * 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.
4092
+ * 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"}.
3719
4093
  */
3720
- export const deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
3721
- security: [
3722
- {
3723
- key: 'sandbox-ApiKeyAuth',
3724
- name: 'X-API-Key',
3725
- type: 'apiKey'
3726
- },
3727
- {
3728
- key: 'sandbox-AuthProviderBearerAuth',
4094
+ export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
4095
+ security: [{
4096
+ key: 'BearerAuth',
3729
4097
  scheme: 'bearer',
3730
4098
  type: 'http'
3731
- },
3732
- {
3733
- key: 'sandbox-AuthProviderTeamAuth',
3734
- name: 'X-Team-ID',
3735
- type: 'apiKey'
3736
- },
3737
- { name: 'X-Admin-Token', type: 'apiKey' },
3738
- {
3739
- key: 'sandbox-AdminTeamAuth',
3740
- name: 'X-Team-ID',
4099
+ }, {
4100
+ key: 'ApiKeyAuth',
4101
+ name: 'X-API-Key',
3741
4102
  type: 'apiKey'
3742
- },
3743
- {
3744
- key: 'sandbox-AdminJWTAuth',
4103
+ }],
4104
+ url: '/workforce/v1/key_results/{id}',
4105
+ ...options,
4106
+ headers: {
4107
+ 'Content-Type': 'application/json',
4108
+ ...options.headers
4109
+ }
4110
+ });
4111
+ /**
4112
+ * List specs
4113
+ *
4114
+ * 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.
4115
+ */
4116
+ export const listOrganizationSpecs = (options) => (options?.client ?? client).get({
4117
+ security: [{
4118
+ key: 'BearerAuth',
3745
4119
  scheme: 'bearer',
3746
4120
  type: 'http'
3747
- }
3748
- ],
3749
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4121
+ }, {
4122
+ key: 'ApiKeyAuth',
4123
+ name: 'X-API-Key',
4124
+ type: 'apiKey'
4125
+ }],
4126
+ url: '/workforce/v1/specs',
3750
4127
  ...options
3751
4128
  });
3752
4129
  /**
3753
- * Sandbox
4130
+ * Get a spec
3754
4131
  *
3755
- * 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.
4132
+ * 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.
3756
4133
  */
3757
- export const getSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).get({
3758
- security: [
3759
- {
3760
- key: 'sandbox-ApiKeyAuth',
3761
- name: 'X-API-Key',
3762
- type: 'apiKey'
3763
- },
3764
- {
3765
- key: 'sandbox-AuthProviderBearerAuth',
4134
+ export const getOrganizationSpec = (options) => (options.client ?? client).get({
4135
+ security: [{
4136
+ key: 'BearerAuth',
3766
4137
  scheme: 'bearer',
3767
4138
  type: 'http'
3768
- },
3769
- {
3770
- key: 'sandbox-AuthProviderTeamAuth',
3771
- name: 'X-Team-ID',
3772
- type: 'apiKey'
3773
- },
3774
- { name: 'X-Admin-Token', type: 'apiKey' },
3775
- {
3776
- key: 'sandbox-AdminTeamAuth',
3777
- name: 'X-Team-ID',
4139
+ }, {
4140
+ key: 'ApiKeyAuth',
4141
+ name: 'X-API-Key',
3778
4142
  type: 'apiKey'
3779
- },
3780
- {
3781
- key: 'sandbox-AdminJWTAuth',
3782
- scheme: 'bearer',
3783
- type: 'http'
3784
- }
3785
- ],
3786
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4143
+ }],
4144
+ url: '/workforce/v1/specs/{kind}/{id}',
3787
4145
  ...options
3788
4146
  });
3789
4147
  /**
3790
- * Rename a sandbox
4148
+ * Revise a spec
3791
4149
  *
3792
- * 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.
4150
+ * 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"}}}}.
3793
4151
  */
3794
- export const renameSandbox = (options) => (options.client ?? client).patch({
4152
+ export const reviseOrganizationSpec = (options) => (options.client ?? client).put({
3795
4153
  security: [{
3796
4154
  key: 'BearerAuth',
3797
4155
  scheme: 'bearer',
@@ -3801,7 +4159,7 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
3801
4159
  name: 'X-API-Key',
3802
4160
  type: 'apiKey'
3803
4161
  }],
3804
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4162
+ url: '/workforce/v1/specs/{kind}/{id}',
3805
4163
  ...options,
3806
4164
  headers: {
3807
4165
  'Content-Type': 'application/json',
@@ -3809,13 +4167,11 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
3809
4167
  }
3810
4168
  });
3811
4169
  /**
3812
- * Act on a phone sandbox's screen
3813
- *
3814
- * 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.
4170
+ * List spec revisions
3815
4171
  *
3816
- * 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.
4172
+ * 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.
3817
4173
  */
3818
- export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
4174
+ export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
3819
4175
  security: [{
3820
4176
  key: 'BearerAuth',
3821
4177
  scheme: 'bearer',
@@ -3825,19 +4181,15 @@ export const actOnSandboxDisplay = (options) => (options.client ?? client).post(
3825
4181
  name: 'X-API-Key',
3826
4182
  type: 'apiKey'
3827
4183
  }],
3828
- url: '/sandbox/v1/sandboxes/{sandboxID}/act',
3829
- ...options,
3830
- headers: {
3831
- 'Content-Type': 'application/json',
3832
- ...options.headers
3833
- }
4184
+ url: '/workforce/v1/specs/{kind}/{id}/revisions',
4185
+ ...options
3834
4186
  });
3835
4187
  /**
3836
- * Remove a file or directory in the sandbox
4188
+ * Diff two spec revisions
3837
4189
  *
3838
- * 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.
4190
+ * 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.
3839
4191
  */
3840
- export const removeSandboxFile = (options) => (options.client ?? client).delete({
4192
+ export const diffOrganizationSpec = (options) => (options.client ?? client).get({
3841
4193
  security: [{
3842
4194
  key: 'BearerAuth',
3843
4195
  scheme: 'bearer',
@@ -3847,15 +4199,15 @@ export const removeSandboxFile = (options) => (options.client ?? client).delete(
3847
4199
  name: 'X-API-Key',
3848
4200
  type: 'apiKey'
3849
4201
  }],
3850
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4202
+ url: '/workforce/v1/specs/{kind}/{id}/diff',
3851
4203
  ...options
3852
4204
  });
3853
4205
  /**
3854
- * Read a file in the sandbox
4206
+ * Read the effective spec
3855
4207
  *
3856
- * 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.
4208
+ * 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.
3857
4209
  */
3858
- export const readSandboxFile = (options) => (options.client ?? client).get({
4210
+ export const getOrganizationEffectiveSpec = (options) => (options?.client ?? client).get({
3859
4211
  security: [{
3860
4212
  key: 'BearerAuth',
3861
4213
  scheme: 'bearer',
@@ -3865,15 +4217,15 @@ export const readSandboxFile = (options) => (options.client ?? client).get({
3865
4217
  name: 'X-API-Key',
3866
4218
  type: 'apiKey'
3867
4219
  }],
3868
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4220
+ url: '/workforce/v1/effective_spec',
3869
4221
  ...options
3870
4222
  });
3871
4223
  /**
3872
- * Write a file in the sandbox
4224
+ * Read the spec schema
3873
4225
  *
3874
- * 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"}.
4226
+ * 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.
3875
4227
  */
3876
- export const writeSandboxFile = (options) => (options.client ?? client).put({
4228
+ export const getOrganizationSpecSchema = (options) => (options?.client ?? client).get({
3877
4229
  security: [{
3878
4230
  key: 'BearerAuth',
3879
4231
  scheme: 'bearer',
@@ -3883,19 +4235,15 @@ export const writeSandboxFile = (options) => (options.client ?? client).put({
3883
4235
  name: 'X-API-Key',
3884
4236
  type: 'apiKey'
3885
4237
  }],
3886
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
3887
- ...options,
3888
- headers: {
3889
- 'Content-Type': 'application/json',
3890
- ...options.headers
3891
- }
4238
+ url: '/workforce/v1/spec_schema',
4239
+ ...options
3892
4240
  });
3893
4241
  /**
3894
- * List files in a sandbox directory
4242
+ * Plan reconciliation
3895
4243
  *
3896
- * 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.
4244
+ * 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.
3897
4245
  */
3898
- export const listSandboxFiles = (options) => (options.client ?? client).get({
4246
+ export const planOrganizationReconcile = (options) => (options.client ?? client).get({
3899
4247
  security: [{
3900
4248
  key: 'BearerAuth',
3901
4249
  scheme: 'bearer',
@@ -3905,15 +4253,15 @@ export const listSandboxFiles = (options) => (options.client ?? client).get({
3905
4253
  name: 'X-API-Key',
3906
4254
  type: 'apiKey'
3907
4255
  }],
3908
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
4256
+ url: '/workforce/v1/reconcile/plan',
3909
4257
  ...options
3910
4258
  });
3911
4259
  /**
3912
- * Create a directory in the sandbox
4260
+ * Read reconcile status
3913
4261
  *
3914
- * 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.
4262
+ * 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 /workforce/v1/reconcile/status?actor=agent:agent_123.
3915
4263
  */
3916
- export const makeSandboxDirectory = (options) => (options.client ?? client).post({
4264
+ export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
3917
4265
  security: [{
3918
4266
  key: 'BearerAuth',
3919
4267
  scheme: 'bearer',
@@ -3923,15 +4271,15 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
3923
4271
  name: 'X-API-Key',
3924
4272
  type: 'apiKey'
3925
4273
  }],
3926
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
4274
+ url: '/workforce/v1/reconcile/status',
3927
4275
  ...options
3928
4276
  });
3929
4277
  /**
3930
- * Run a command in the sandbox
4278
+ * Run reconciliation now
3931
4279
  *
3932
- * 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"}.
4280
+ * 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"}.
3933
4281
  */
3934
- export const runSandboxCommand = (options) => (options.client ?? client).post({
4282
+ export const runOrganizationReconcile = (options) => (options.client ?? client).post({
3935
4283
  security: [{
3936
4284
  key: 'BearerAuth',
3937
4285
  scheme: 'bearer',
@@ -3941,7 +4289,51 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
3941
4289
  name: 'X-API-Key',
3942
4290
  type: 'apiKey'
3943
4291
  }],
3944
- url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
4292
+ url: '/workforce/v1/reconcile/run',
4293
+ ...options,
4294
+ headers: {
4295
+ 'Content-Type': 'application/json',
4296
+ ...options.headers
4297
+ }
4298
+ });
4299
+ /**
4300
+ * Pause reconciliation
4301
+ *
4302
+ * 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"}.
4303
+ */
4304
+ export const pauseOrganizationReconcile = (options) => (options.client ?? client).post({
4305
+ security: [{
4306
+ key: 'BearerAuth',
4307
+ scheme: 'bearer',
4308
+ type: 'http'
4309
+ }, {
4310
+ key: 'ApiKeyAuth',
4311
+ name: 'X-API-Key',
4312
+ type: 'apiKey'
4313
+ }],
4314
+ url: '/workforce/v1/reconcile/pause',
4315
+ ...options,
4316
+ headers: {
4317
+ 'Content-Type': 'application/json',
4318
+ ...options.headers
4319
+ }
4320
+ });
4321
+ /**
4322
+ * Resume reconciliation
4323
+ *
4324
+ * 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"}.
4325
+ */
4326
+ export const resumeOrganizationReconcile = (options) => (options.client ?? client).post({
4327
+ security: [{
4328
+ key: 'BearerAuth',
4329
+ scheme: 'bearer',
4330
+ type: 'http'
4331
+ }, {
4332
+ key: 'ApiKeyAuth',
4333
+ name: 'X-API-Key',
4334
+ type: 'apiKey'
4335
+ }],
4336
+ url: '/workforce/v1/reconcile/resume',
3945
4337
  ...options,
3946
4338
  headers: {
3947
4339
  'Content-Type': 'application/json',
@@ -4027,7 +4419,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
4027
4419
  /**
4028
4420
  * Create agent
4029
4421
  *
4030
- * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. Omit kind to create a service agent (Managed Agents behaviour: a fresh environment per session). Pass kind: "general" for an employee-style agent with its own computer, created with it; size and template come from the agent's computers configuration. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. A general or assume agent created without computer_id gets a new computer registered in the same request, named after the agent; a service agent with computer_id returns 400. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
4422
+ * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. Omit kind to create a service agent (Managed Agents behaviour: a fresh environment per session). Pass kind: "general" for an employee-style agent with its own computer, created with it; size and template come from the agent's computers configuration. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. A general or assume agent created without computer_id gets a new computer registered in the same request, named after the agent; a service agent with computer_id returns 400. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. phone gives the agent one phone, in one of two mutually exclusive forms: {sku, name?, archive: {exclude}} is a cloud Android device the platform builds on demand from that Sandbox SKU, and {byod, name?} is your organization's own device, named by a byd_… id it already owns (Brought Your Own Device), which the platform drives but never builds. A body naming both sku and byod returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. Only a general or assume agent may have a phone: a service agent with phone returns 400. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
4031
4423
  */
4032
4424
  export const agentsCreate = (options) => (options.client ?? client).post({
4033
4425
  security: [{
@@ -4067,7 +4459,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
4067
4459
  /**
4068
4460
  * Update agent
4069
4461
  *
4070
- * Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Assume agents reject model, models, subagent_model, subagents and multiagent on every update; other fields follow the general agent rules, with vault_ids also accepted.
4462
+ * Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. phone takes the same two mutually exclusive forms as agents.create: {sku, name?, archive} for a cloud device, or {byod, name?} for your organization's own device (a byd_… id); naming both returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. phone: null turns the phone off and releases a cloud device; a BYOD phone is the organization's and is never killed. Assume agents reject model, models, subagent_model, subagents and multiagent on every update; other fields follow the general agent rules, with vault_ids also accepted.
4071
4463
  */
4072
4464
  export const agentsUpdate = (options) => (options.client ?? client).post({
4073
4465
  security: [{
@@ -5169,7 +5561,7 @@ export const applicationListGrants = (options) => (options.client ?? client).get
5169
5561
  /**
5170
5562
  * Create grant
5171
5563
  *
5172
- * Record access to an organization-owned database or knowledge base, all organization files (files, id *), or models (models, id *, read only). Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
5564
+ * Record access to an organization-owned database, knowledge base, file, media library, workflow, script, agent or another Worker, to models (id *, read only), or to a whole service (search, browser, ticket, crm, canvas, cut, studio, ontology, workspace: id *, read_write; feedback: read), or to full authority (organization: id *, read_write), which excludes every other grant. The types are the ones a service agent can bind. The retired files type is refused; grant one file by its file-… id. A Worker's platform calls reach only what its grants name, and nothing with no grant; an agent grant at read_write is what lets it issue that agent's customer grant codes. Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
5173
5565
  */
5174
5566
  export const applicationCreateGrant = (options) => (options.client ?? client).post({
5175
5567
  security: [{
@@ -5757,7 +6149,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
5757
6149
  /**
5758
6150
  * Create a workflow
5759
6151
  *
5760
- * Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 5 min (run-sandbox 6 h), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. To pause for a person, call praxis/approval (it opens a human task; the step output is the decision); agents answer with praxis.automation.humanTasks.respond on behalf of their user. Guide: /docs/developers/automation/guides/approvals Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
6152
+ * Workflow syntax reference: https://docs.deepraxis.com/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 5 min (run-sandbox 6 h), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. To pause for a person, call praxis/approval (it opens a human task; the step output is the decision); agents answer with praxis.automation.humanTasks.respond on behalf of their user. Guide: /developers/automation/guides/approvals Guide: /developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
5761
6153
  */
5762
6154
  export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
5763
6155
  security: [{
@@ -5797,7 +6189,7 @@ export const automationWorkflowsGet = (options) => (options.client ?? client).ge
5797
6189
  /**
5798
6190
  * Update a workflow draft
5799
6191
  *
5800
- * Update description, labels or draft with the current draft revision in If-Match, taken from draft.revision in the get-workflow response. Even metadata-only updates create a new draft revision. A mismatch returns 412 PRECONDITION_FAILED; read the draft again, merge and retry. The draft is not validated here, so check it with validate (kind=workflow) before publishing. Error details are in errors[]. See the workflow syntax reference at https://deepraxis.com/docs/developers/automation/reference/workflow-syntax.
6192
+ * Update description, labels or draft with the current draft revision in If-Match, taken from draft.revision in the get-workflow response. Even metadata-only updates create a new draft revision. A mismatch returns 412 PRECONDITION_FAILED; read the draft again, merge and retry. The draft is not validated here, so check it with validate (kind=workflow) before publishing. Error details are in errors[]. See the workflow syntax reference at https://docs.deepraxis.com/developers/automation/reference/workflow-syntax.
5801
6193
  */
5802
6194
  export const automationWorkflowsPatch = (options) => (options.client ?? client).patch({
5803
6195
  security: [{
@@ -6001,7 +6393,7 @@ export const automationWorkflowsSetDistTag = (options) => (options.client ?? cli
6001
6393
  /**
6002
6394
  * Validate a definition
6003
6395
  *
6004
- * Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation. For kind=workflow the YAML needs document (dsl, namespace, name, version) and do; each problem is one entry in errors[] (pointer, detail, hint), so read the first one. A listen outside the supported subset (to.all, inside a fork) and emit are not reported here and fail with DEFINITION_INVALID only when a run is created. Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax.
6396
+ * Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation. For kind=workflow the YAML needs document (dsl, namespace, name, version) and do; each problem is one entry in errors[] (pointer, detail, hint), so read the first one. A listen outside the supported subset (to.all, inside a fork) and emit are not reported here and fail with DEFINITION_INVALID only when a run is created. Workflow syntax reference: https://docs.deepraxis.com/developers/automation/reference/workflow-syntax.
6005
6397
  */
6006
6398
  export const automationValidateValidate = (options) => (options.client ?? client).post({
6007
6399
  security: [{
@@ -8244,7 +8636,7 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
8244
8636
  * codemode.describe("praxis.cut.script") // names, one page at a time
8245
8637
  * ```
8246
8638
  *
8247
- * Published at https://docs.deepraxis.com/docs/developers/cut/script-reference with one anchor per entry. Names below omit the `praxis.cut.<kind>.` prefix.
8639
+ * Published at https://docs.deepraxis.com/developers/cut/script-reference with one anchor per entry. Names below omit the `praxis.cut.<kind>.` prefix.
8248
8640
  *
8249
8641
  * #### Script functions (script)
8250
8642
  *
@@ -9349,7 +9741,7 @@ export const devopsTestExecutionsGet = (options) => (options.client ?? client).g
9349
9741
  /**
9350
9742
  * Upload an external test report
9351
9743
  *
9352
- * Record the results of a run executed outside Praxis by uploading a CTRF or JUnit report. Nothing has to exist first: a first upload from CI creates the run it reports on (executor external) and catalogues the cases the report names, so there is no setup call before the first result. When the report already belongs to a run, pass ref and the upload joins it; the run's counts and verdict are recomputed from the report. Uploading the same reportId again is idempotent and counts once, so a retry after a timeout is safe — and a reported case is catalogued once, however many reports carry it. The report's bytes are kept as a file (the file field of the answer) rather than in the results database, so the original document stays retrievable. Send purpose feedback instead when the report is your own local run rather than evidence: the document is stored as an organization-private file and nothing else happens — no run is created or joined, no case state changes and the merge gate never reads it — so a developer's machine can publish what it ran without any commit being credited as tested.
9744
+ * Record the results of a run executed outside Praxis by uploading a CTRF or JUnit report. Nothing has to exist first: a first upload from CI creates the run it reports on (executor external) and catalogues the cases the report names, so there is no setup call before the first result. When the report already belongs to a run, pass ref and the upload joins it; the run's counts and verdict are recomputed from the report. Uploading the same reportId again is idempotent and counts once, so a retry after a timeout is safe — and a reported case is catalogued once, however many reports carry it. The report's bytes are kept as a file (the file field of the answer) rather than in the results database, so the original document stays retrievable. Send purpose feedback instead when the report is your own local run rather than evidence: the document is stored as an organization-private file and nothing else happens — no run is created or joined, no case state changes and the merge gate never reads it — so a developer's machine can publish what it ran without any commit being credited as tested. With purpose evidence the report is also filed as test evidence, package by package: DevOps recomputes each package's input hash from ref.commit (so the commit must already be pushed; an unreadable commit records the run but no evidence), and writes passed or failed only for a package whose every case at the gate's sizes the report carries — a report of a few files leaves that package without evidence. Pass ref.branch and ref.pullRequest so the run says where it came from; devops.projects.retrieveTestPlan at the commit then shows what the gate will read.
9353
9745
  */
9354
9746
  export const devopsTestReportsUpload = (options) => (options.client ?? client).post({
9355
9747
  security: [{
@@ -9367,7 +9759,7 @@ export const devopsTestReportsUpload = (options) => (options.client ?? client).p
9367
9759
  /**
9368
9760
  * Retrieve the merge gate's test plan at a commit
9369
9761
  *
9370
- * Ask what the merge gate would require at one commit before running anything: the packages the base...commit diff affects, each package's input hash at that commit's own tree, and whether evidence already answers it. Read a package as passed when a recorded run covered every case the package has at the gate's sizes and they passed, failed when the newest evidence at its input hash failed, and missing when no run has a row for that (package, input hash). Use it before running tests — `praxis devops test --gate` asks this and runs exactly the missing and failed packages — or to explain a gate verdict, because it is the same required set and the same (package, input hash) lookup the gate itself decides on. The call is read-only: it starts no run, runs no case and writes nothing. The commit must already be pushed, since the hashes are recomputed from the tree GitHub holds; a commit whose tree cannot be read answers COMMIT_NOT_FOUND instead of an empty plan. A selection of nothing means every changed path belongs to no test package, which is a pass and not a failure.
9762
+ * Ask what the merge gate would require at one commit before running anything: the packages the base...commit diff affects, each package's input hash at that commit's own tree, and whether evidence already answers it. The answer also carries cases: every feature scenario of the affected packages at the gate's sizes, each with required (whether this diff can affect it, chosen by the files the scenario was recorded running), the reason, the deps hash it is judged at and its own evidence. A merge needs evidence only for the required cases; run `praxis devops test <package> --record-impact` to record coverage and results. Read a package as passed when a recorded run covered every case the package has at the gate's sizes and they passed, failed when the newest evidence at its input hash failed, and missing when no run has a row for that (package, input hash). Use it before running tests — run `praxis devops test <package>` for each missing or failed package on a clean, pushed commit and the run files the evidence itself — or to explain a gate verdict, because it is the same required set and the same (package, input hash) lookup the gate itself decides on. The call is read-only: it starts no run, runs no case and writes nothing. The commit must already be pushed, since the hashes are recomputed from the tree GitHub holds; a commit whose tree cannot be read answers COMMIT_NOT_FOUND instead of an empty plan. A selection of nothing means every changed path belongs to no test package, which is a pass and not a failure.
9371
9763
  */
9372
9764
  export const devopsTestPlanGet = (options) => (options.client ?? client).get({
9373
9765
  security: [{
@@ -9381,7 +9773,7 @@ export const devopsTestPlanGet = (options) => (options.client ?? client).get({
9381
9773
  /**
9382
9774
  * List projects
9383
9775
  *
9384
- * List the delivery projects this organization has, newest first, with each project's repository binding and settings. Call this first when you do not already hold a project id: every other operation in this domain is addressed by one. A project from another organization is never listed, so an empty page means this organization has none rather than that they are hidden. The order is by creation time descending; follow nextPageToken until it is empty to see them all.
9776
+ * List the delivery projects this organization has, newest first, with each project's repository binding and settings. Call this first when you do not already hold a project id: every other operation in this domain is addressed by one. A project from another organization is never listed, so an empty page means this organization has none rather than that they are hidden. The order is by creation time descending; follow nextPageToken until it is empty to see them all. The page always carries visibleProjects: how many projects the caller's own organization has in total, deleted ones excluded. Those are the projects visible to the credential's organization — the count filters by organization_id and is not a permission check — so an empty items array reads as "this organization has none yet" instead of leaving you to guess whether the read was lost or the credential points at another organization. It is the organization's total across all pages, not this page's length.
9385
9777
  */
9386
9778
  export const devopsProjectsList = (options) => (options?.client ?? client).get({
9387
9779
  security: [{
@@ -9392,6 +9784,42 @@ export const devopsProjectsList = (options) => (options?.client ?? client).get({
9392
9784
  url: '/devops/v1/projects',
9393
9785
  ...options
9394
9786
  });
9787
+ /**
9788
+ * Create a project
9789
+ *
9790
+ * Create a delivery project and its two default environments (develop, production). The code lives in one of two places. Our own Git: pass provider platform and package, the id (pkg_...) of a git package in your organization's registry (the registry domain lists packages and creates git libraries); there is no install flow and no connection, the project records the provider, the package and the package's default branch, and from then on pull requests, the merge gate, changes and cloud workspaces use that package and DevOps merges a pull request itself. A package backs at most one project (REPOSITORY_ALREADY_BOUND) and a package that is not a git package of your organization is INVALID_ARGUMENT. If the package has no default branch yet, which is usual for a library imported from elsewhere, pass initialRef, an existing branch such as import: the default branch is created at its head while the project is created, and no change can be opened before it exists. If the default branch already exists the call is refused with DEFAULT_BRANCH_EXISTS, and a missing initialRef branch with REF_NOT_FOUND; neither leaves a project behind. For a package whose project already exists, use devops.projects.initializeDefaultBranch instead. GitHub (the default): pass the connection of a completed GitHub App install and the repository (owner/name) it can see; leave both out to create a project with no repository yet. A name must be kebab-case and unused in the organization (PROJECT_NAME_TAKEN).
9791
+ */
9792
+ export const devopsProjectsCreate = (options) => (options.client ?? client).post({
9793
+ security: [{
9794
+ key: 'devops-bearerAuth',
9795
+ scheme: 'bearer',
9796
+ type: 'http'
9797
+ }],
9798
+ url: '/devops/v1/projects',
9799
+ ...options,
9800
+ headers: {
9801
+ 'Content-Type': 'application/json',
9802
+ ...options.headers
9803
+ }
9804
+ });
9805
+ /**
9806
+ * Create a project's default branch
9807
+ *
9808
+ * Create the default branch of a project on our own Git, once. A git package imported from elsewhere can hold branches and no default branch, and every change is cut from the default branch, so until it exists no change can be opened. The default branch is protected and only DevOps holds the credential that may write it, so this call is the one way to create it: it points the default branch at the head of the existing branch named in from (for example import). It only creates: a default branch that already exists is refused with DEFAULT_BRANCH_EXISTS and is never moved, a from that is not a branch of the repository is REF_NOT_FOUND, and a GitHub project is INVALID_ARGUMENT because GitHub's branches are GitHub's. The push reaches the project like any other push to its default branch. Read the project first (devops.projects.retrieve) for the package's default branch name.
9809
+ */
9810
+ export const devopsProjectsInitializeDefaultBranch = (options) => (options.client ?? client).post({
9811
+ security: [{
9812
+ key: 'devops-bearerAuth',
9813
+ scheme: 'bearer',
9814
+ type: 'http'
9815
+ }],
9816
+ url: '/devops/v1/projects/{id}/default-branch:initialize',
9817
+ ...options,
9818
+ headers: {
9819
+ 'Content-Type': 'application/json',
9820
+ ...options.headers
9821
+ }
9822
+ });
9395
9823
  /**
9396
9824
  * Retrieve a project
9397
9825
  *
@@ -9491,7 +9919,7 @@ export const devopsReleasesAbandon = (options) => (options.client ?? client).pos
9491
9919
  /**
9492
9920
  * Create a promotion
9493
9921
  *
9494
- * Promote a release into one environment: this is the operation that actually schedules a deployment. Name the release and the environment; path is regular for an ordinary promotion, targeted to deploy only the targets you list, patch to carry a patch release, and rollback to return the environment to an earlier release. A regular promotion promotes EVERY target the release changed in that environment and refuses a targets list (to promote a subset use path targeted, so a narrowing is never silently ignored). A targeted promotion requires targets: each item is a target id from the target list or the workspace path the console shows (services/devops), and the call resolves the path to the id. A target the release does not carry is refused with the targets the release does deploy; so is a target this environment never runs. Naming a target also deploys the targets it depends on, which come first and are reported in plan.addedDependencies. The targets that changed but were not named are listed in plan.skipped with reason not_requested, so a reader sees what the promotion left behind. Callees upgrade first by default: naming a target brings the targets it depends on, because a caller cannot run on a callee it did not deploy. To leave one of those callees behind, pass withoutCallees, a list of { target, reason } on a targeted promotion. Each entry names a callee the named targets depend on — by target id or workspace path, as in targets — and carries a required, non-empty reason, because an exception nobody can justify afterwards is indistinguishable from a mistake. An excluded callee is subtracted rather than deferred: it is not deployed, and a target that entered the plan only through it leaves the plan too, so nothing is deployed that would have needed it. The exclusion is visible in the plan (plan.skipped with reason callee_excluded, carrying the reason in message) and on the promotion (withoutCallees), and a retry repeats it. Excluding a target you named is refused (take it out of targets instead), as is excluding a target the named ones do not depend on; a regular promotion refuses withoutCallees the same way it refuses targets. A targeted promotion's success verifies only the targets it deployed, not the whole release, so the upstream gate still requires the untouched targets before a later environment may take them. The service reads the environment's promotion order and refuses when an upstream environment has not verified this release yet, unless a bypass carries the authorization for that gate. An environment takes one promotion at a time, so a create while another is running is queued behind it rather than refused; only a regular promotion supersedes waiting regular ones, and a targeted promotion neither overtakes another ride nor is overtaken. Set validateOnly to read the plan and its refusals — layers, skipped targets, pending migrations, missing configuration keys — without scheduling anything, which is the safe way to find out what a promotion will do; the same plan is on the promotion this call answers and on `praxis api devops promotion get`, which reads it again with the promotion's progress as the rollout advances. patch and rollback are not creatable here yet and are refused with NOT_IMPLEMENTED. The answer is the promotion: the plan it will execute is in its plan field (layers, skipped, refusals, pending migrations) and its progress is in state; `praxis api devops promotion get <id>` shows both again at any time. With an environment that requires approval the promotion waits in awaiting_approval until `praxis api devops promotion approve`.
9922
+ * Promote a release into one environment: this is the operation that actually schedules a deployment. Name the release and the environment; path is regular for an ordinary promotion, targeted to deploy only the targets you list, patch to carry a patch release, and rollback to return the environment to an earlier release. A regular promotion promotes EVERY target the release changed in that environment and refuses a targets list (to promote a subset use path targeted, so a narrowing is never silently ignored). A targeted promotion requires targets: each item is a target id from the target list or the workspace path the console shows (services/devops), and the call resolves the path to the id. A target the release does not carry is refused with the targets the release does deploy; so is a target this environment never runs. Naming a target also deploys the targets it depends on, which come first and are reported in plan.addedDependencies. The targets that changed but were not named are listed in plan.skipped with reason not_requested, so a reader sees what the promotion left behind. Callees upgrade first by default: naming a target brings the targets it depends on, because a caller cannot run on a callee it did not deploy. To skip that on purpose, pass dependencies skip, a forced express that deploys only the named targets and records that it did so (see dependencies). Every promotion runs one version of the deploy engine, resolved from the project's settings.deploy.engine when the promotion is created and recorded as engineVersion; a request that engine version cannot serve is refused with ENGINE_TOO_OLD, which names the option and the first version that has it. To leave one of those callees behind, pass withoutCallees, a list of { target, reason } on a targeted promotion. Each entry names a callee the named targets depend on — by target id or workspace path, as in targets — and carries a required, non-empty reason, because an exception nobody can justify afterwards is indistinguishable from a mistake. An excluded callee is subtracted rather than deferred: it is not deployed, and a target that entered the plan only through it leaves the plan too, so nothing is deployed that would have needed it. The exclusion is visible in the plan (plan.skipped with reason callee_excluded, carrying the reason in message) and on the promotion (withoutCallees), and a retry repeats it. Excluding a target you named is refused (take it out of targets instead), as is excluding a target the named ones do not depend on; a regular promotion refuses withoutCallees the same way it refuses targets. A targeted promotion's success verifies only the targets it deployed, not the whole release, so the upstream gate still requires the untouched targets before a later environment may take them. The service reads the environment's promotion order and refuses when an upstream environment has not verified this release yet, unless a bypass carries the authorization for that gate. An environment takes one promotion at a time, so a create while another is running is queued behind it rather than refused; only a regular promotion supersedes waiting regular ones, and a targeted promotion neither overtakes another ride nor is overtaken. Set validateOnly to read the plan and its refusals — layers, skipped targets, pending migrations, missing configuration keys — without scheduling anything, which is the safe way to find out what a promotion will do; the answer then carries validateOnly true and the placeholder id prm_validate_only, because nothing was stored and there is no promotion to read again; the same plan is on the promotion a real call answers and on `praxis api devops promotion get`, which reads it again with the promotion's progress as the rollout advances. patch and rollback are not creatable here yet and are refused with NOT_IMPLEMENTED: a rollback is created with environments.rollback, not with path rollback on this call. An environment whose blocksLater is true stays held during its observation window: a promotion created for it waits queued (its stateDescription names the promotion it waits for) until promotions.conclude ends the window, and the environment list shows the queue as busy with that promotion as active. A promotion in which every rollout was skipped as artifact_identical (the change did not alter the built artifact, such as a comment) succeeds and moves the checkpoints but deploys nothing; promotions.retrieve counts it in summary.identical. The answer is the promotion: the plan it will execute is in its plan field (layers, skipped, refusals, pending migrations) and its progress is in state; `praxis api devops promotion get <id>` shows both again at any time. With an environment that requires approval the promotion waits in awaiting_approval until `praxis api devops promotion approve`.
9495
9923
  */
9496
9924
  export const devopsPromotionsCreate = (options) => (options.client ?? client).post({
9497
9925
  security: [{
@@ -9509,7 +9937,7 @@ export const devopsPromotionsCreate = (options) => (options.client ?? client).po
9509
9937
  /**
9510
9938
  * List promotions
9511
9939
  *
9512
- * List the project's promotions, newest first, across every environment. Use it to see what is queued, what is observing, and what finished recently, without reading each environment separately. A promotion in a terminal state stays in this list, which is how a caller tells "never promoted" apart from "promoted and then rolled back". Neither filter nor orderBy is accepted yet, so page through with pageToken instead of narrowing the query.
9940
+ * List the project's promotions, newest first, across every environment. Use it to see what is queued, what is observing, and what finished recently, without reading each environment separately. A promotion in a terminal state stays in this list, which is how a caller tells "never promoted" apart from "promoted and then rolled back". The one filter is the forced query parameter (true or false, sent as text in the query string); a filter expression and orderBy are not accepted yet, so page through with pageToken instead of narrowing further.
9513
9941
  */
9514
9942
  export const devopsPromotionsList = (options) => (options.client ?? client).get({
9515
9943
  security: [{
@@ -9523,7 +9951,7 @@ export const devopsPromotionsList = (options) => (options.client ?? client).get(
9523
9951
  /**
9524
9952
  * Retrieve a promotion
9525
9953
  *
9526
- * Read one promotion: its state, its approval, its plan, and the failure that stopped it when there is one. Poll this after creating a promotion to follow it to a terminal state, or read it to find out why a deployment stopped — failure.cause tells plan refusal apart from a failed deploy, and executor names the runs involved. Pass expand=rollouts to receive the per-target rollouts in the same answer instead of listing them separately. state observing means the environment is deployed and the observation window is running, so the promotion is not finished and conclude is still to come. The plan is in the plan field of the answer (null until one is made) and the promotion's state is in state, so this is where to read both before approve (needs awaiting_approval) or conclude (needs observing).
9954
+ * Read one promotion: its state, its approval, its plan, and the failure that stopped it when there is one. Poll this after creating a promotion to follow it to a terminal state, or read it to find out why a deployment stopped — failure.cause tells plan refusal apart from a failed deploy, and executor names the runs involved. Pass expand=rollouts to receive the per-target rollouts in the same answer instead of listing them separately. state observing means the environment is deployed and the observation window is running, so the promotion is not finished and conclude is still to come; the window holds the environment, so a promotion queued behind it waits until conclude. Once a rollout has ended, summary says how many targets were really deployed (deployed), how many were skipped as artifact_identical (identical: the change did not alter the built artifact, such as a comment, so nothing was deployed although the promotion succeeds and its checkpoints advance) and how many ended any other way (other). The plan is in the plan field of the answer (null until one is made) and the promotion's state is in state, so this is where to read both before approve (needs awaiting_approval) or conclude (needs observing).
9527
9955
  */
9528
9956
  export const devopsPromotionsGet = (options) => (options.client ?? client).get({
9529
9957
  security: [{
@@ -9602,6 +10030,20 @@ export const devopsPromotionsConclude = (options) => (options.client ?? client).
9602
10030
  ...options.headers
9603
10031
  }
9604
10032
  });
10033
+ /**
10034
+ * Get the checkout credential of a running promotion
10035
+ *
10036
+ * Issue the credential the deploy machine fetches a platform-Git project's code with. The caller is the deploy machine itself, during a run: its `devops/prepare` step sends the API key it already holds and receives the clone URL of the project's repository plus a pull-only credential for exactly that one repository. The credential lives 15 minutes and is issued again on every request, so it never sits in the run's stored input or log, and a leaked copy is useless almost at once. A run that needs the code later, such as an engine checkout after a long install, asks again. It answers only while the promotion is deploying (a rollback is a promotion and deploys too) or halted; a promotion that is queued, waiting for approval, observing or finished is refused with PROMOTION_NOT_RUNNING, because no machine should be fetching code for it. A project whose code is on GitHub is refused with SOURCE_NOT_PLATFORM: its checkout uses the GitHub App token, not this. The key must belong to the promotion's organization, the same check as reading the promotion with `praxis api devops promotion get <id>`. People do not need this call: to read a platform project's code use the code browser calls instead.
10037
+ */
10038
+ export const devopsPromotionsCheckoutCredential = (options) => (options.client ?? client).post({
10039
+ security: [{
10040
+ key: 'devops-bearerAuth',
10041
+ scheme: 'bearer',
10042
+ type: 'http'
10043
+ }],
10044
+ url: '/devops/v1/promotions/{id}:checkoutCredential',
10045
+ ...options
10046
+ });
9605
10047
  /**
9606
10048
  * List a promotion's rollouts
9607
10049
  *
@@ -9679,7 +10121,7 @@ export const devopsEnvironmentsCheckpointsList = (options) => (options.client ??
9679
10121
  /**
9680
10122
  * Roll an environment back
9681
10123
  *
9682
- * Put targets of an environment back on the versions they ran before, the way Cloud Deploy rolls a target back: the earlier release is deployed again, and the live version and the deployment state move back together, so the next promotion does not quietly undo it. With no targets it undoes the environment's latest successful promotion, every target that promotion deployed; targets narrows that to some of them, by target id or workspace path such as services/agent. Each target returns to the version it ran just before that promotion; toRelease names an older release instead, which must be one every target has already run in this environment. Callers go back before their callees, and a caller that the undone promotion deployed together with a callee you roll back is brought along (listed in plan.addedDependencies). The request is the approval: reason is recorded as the approval comment, so the rollback does not wait in awaiting_approval, and a promotion still in its observation window is concluded as rolled back. Database migrations are not reversed. Send validateOnly true to see the plan without creating anything. Refusals: ROLLBACK_NOTHING_TO_ROLL_BACK when no promotion has succeeded here, ROLLBACK_NO_PREVIOUS when a target has no earlier version, ROLLBACK_AMBIGUOUS when the targets ran different earlier releases (roll them back separately or name toRelease), ROLLBACK_NOT_RUN_HERE when toRelease carries a version a target never ran here.
10124
+ * Put targets of an environment back on the versions they ran before, the way Cloud Deploy rolls a target back: the earlier release is deployed again, and the live version and the deployment state move back together, so the next promotion does not quietly undo it. With no targets it undoes the environment's latest successful promotion, every target that promotion deployed; targets narrows that to some of them, by target id or workspace path such as services/agent. Each target returns to the version it ran just before that promotion; toRelease names an older release instead, which must be one every target has already run in this environment. Callers go back before their callees, and a caller that the undone promotion deployed together with a callee you roll back is brought along (listed in plan.addedDependencies). The request is the approval: reason is recorded as the approval comment, so the rollback does not wait in awaiting_approval, and a promotion still in its observation window is concluded as rolled back. Database migrations are not reversed. Send validateOnly true to see the plan without creating anything; the answer then carries validateOnly true and the placeholder id prm_validate_only, because no promotion was stored. This is the way to create a rollback; promotions.create does not take path rollback. Refusals: ROLLBACK_NOTHING_TO_ROLL_BACK when no promotion has succeeded here, ROLLBACK_NO_PREVIOUS when a target has no earlier version, ROLLBACK_AMBIGUOUS when the targets ran different earlier releases (roll them back separately or name toRelease), ROLLBACK_NOT_RUN_HERE when toRelease carries a version a target never ran here.
9683
10125
  */
9684
10126
  export const devopsEnvironmentsRollback = (options) => (options.client ?? client).post({
9685
10127
  security: [{
@@ -10153,7 +10595,7 @@ export const devopsPullRequestsList = (options) => (options.client ?? client).ge
10153
10595
  /**
10154
10596
  * Retrieve a pull request
10155
10597
  *
10156
- * Read one pull request in full: its state, its head and base, its changed paths, the exposure its description declares, and — the part this call exists for — its gate. The gate is a list of named checks (the declaration, the flag duties, the affected tests, and the one judgement only a person makes), each with a result and, when it failed or is pending, the sentence saying what is missing; the gate's own state is passed only when no check failed and none is still pending. Read the gate here before merging or before recording a verdict, and read it again after a rerun: the checks are facts about the current head, and a new head starts a new gate. Add expand=runs to also get the affected test runs reported at the head commit, newest first, which is how you see why the tests check came out the way it did.
10598
+ * Read one pull request in full: its state, its head and base, its changed paths, the exposure its description declares, and — the part this call exists for — its gate. The gate is a list of named checks (the declaration, the flag duties, the affected tests, and the one judgement only a person makes), each with a result and, when it failed or is pending, the sentence saying what is missing; the tests check is never pending, because DevOps runs no tests for a pull request: it is passed, or failed naming the missing or failed cases and the command `praxis devops test <package> --record-impact` the author runs on the pushed head; the gate's own state is passed only when no check failed and none is still pending. Read the gate here before merging or before recording a verdict, and read it again after a rerun: the checks are facts about the current head, and a new head starts a new gate. Add expand=runs to also get the test runs reported at the head commit (uploaded by the author, never started by DevOps), newest first.
10157
10599
  */
10158
10600
  export const devopsPullRequestsGet = (options) => (options.client ?? client).get({
10159
10601
  security: [{
@@ -10167,7 +10609,7 @@ export const devopsPullRequestsGet = (options) => (options.client ?? client).get
10167
10609
  /**
10168
10610
  * Decide a pull request's merge gate again
10169
10611
  *
10170
- * Decide the merge gate again at the pull request's current head and report the result on GitHub as the "Praxis DevOps / gate" check run. Use it when a fact the gate reads has changed without a new push — a test run finished, a flag was registered, or a check that had no evidence now has some — so nobody has to push an empty commit to make the check move. The answer is the pull request with the gate it now reaches. A head whose earlier gate already had a verdict and comes back pending opens a NEW check run, because GitHub will not reopen a completed one; while the same head is still deciding, the run it already owns is updated in place. Nothing else on the pull request changes, and repeating the call is safe: the same facts decide the same gate.
10612
+ * Decide the merge gate again at the pull request's current head and report the result on GitHub as the "Praxis DevOps / gate" check run. Use it when a fact the gate reads has changed without a new push — a flag was registered, or a check that had no evidence now has some (test evidence uploaded for the head already decides the gate again by itself) — so nobody has to push an empty commit to make the check move. The answer is the pull request with the gate it now reaches. A head whose earlier gate already had a verdict and comes back pending opens a NEW check run, because GitHub will not reopen a completed one; while the same head is still deciding, the run it already owns is updated in place. Nothing else on the pull request changes, and repeating the call is safe: the same facts decide the same gate.
10171
10613
  */
10172
10614
  export const devopsPullRequestsRerunGate = (options) => (options.client ?? client).post({
10173
10615
  security: [{
@@ -10181,7 +10623,7 @@ export const devopsPullRequestsRerunGate = (options) => (options.client ?? clien
10181
10623
  /**
10182
10624
  * Merge a pull request through its gate
10183
10625
  *
10184
- * Land a pull request by having DevOps call GitHub, so the merge goes through the platform's own merge gate instead of around it. The gate is the permission: while the gate is pending or failed the merge is refused with GATE_NOT_PASSED, and a pull request that is already merged or closed is refused with PULL_REQUEST_NOT_OPEN. Only the commit the gate decided on may land — that commit is sent to GitHub as the merge sha, so a head that moved underneath is refused with HEAD_MOVED rather than merged untested — and GitHub's own refusal, such as a conflict, comes back as MERGE_REFUSED carrying its words. method picks the merge shape and defaults to merge. queue true does not merge now: it puts the pull request into its (project, base) merge queue, where the commit that eventually lands is one GitHub built from the current base and a test run proved. Send requestId to make a retry safe — a retry that reaches a pull request DevOps itself already merged answers that merge without calling GitHub again; it does not make the merge wait. Merging something already merged by somebody else stays a refusal rather than a replay.
10626
+ * Land a pull request by having DevOps call GitHub, so the merge goes through the platform's own merge gate instead of around it. The gate is the permission: while the gate is pending or failed the merge is refused with GATE_NOT_PASSED, and a pull request that is already merged or closed is refused with PULL_REQUEST_NOT_OPEN. Only the commit the gate decided on may land — that commit is sent to GitHub as the merge sha, so a head that moved underneath is refused with HEAD_MOVED rather than merged untested — and GitHub's own refusal, such as a conflict, comes back as MERGE_REFUSED carrying its words. method picks the merge shape; on GitHub it defaults to rebase. A project on our own Git (provider platform) merges by squash only: no method means squash, and rebase or merge is refused with INVALID_ARGUMENT naming squash. queue true does not merge now: it puts the pull request into its (project, base) merge queue, where the commit that eventually lands is one GitHub built from the current base and a test run proved. Send requestId to make a retry safe — a retry that reaches a pull request DevOps itself already merged answers that merge without calling GitHub again; it does not make the merge wait. Merging something already merged by somebody else stays a refusal rather than a replay.
10185
10627
  */
10186
10628
  export const devopsPullRequestsMerge = (options) => (options.client ?? client).post({
10187
10629
  security: [{
@@ -10197,9 +10639,9 @@ export const devopsPullRequestsMerge = (options) => (options.client ?? client).p
10197
10639
  }
10198
10640
  });
10199
10641
  /**
10200
- * Record a gatekeeper's verdict on a direct change
10642
+ * Record a review verdict on a pull request
10201
10643
  *
10202
- * A gatekeeper's judgement of a change declared direct — the one gate check a person answers, because a direct change has no flag to hold it back. Send result passed to let it through, or failed to hold it, with reason saying in a sentence a reviewer can act on why; the reason becomes the message of the gate's exposure-judged check. The verdict is about ONE commit: headSha must be the pull request's current head, and a verdict for any other commit is refused with INVALID_ARGUMENT rather than applied, because a judgement of a version nobody reviewed must never pass the version that is there now — so a recorded verdict stops applying the moment the head moves, and the new head must be judged on its own. Recording it decides the gate again, so a passed verdict makes the gate passed once every other check has too, and the answer is the pull request with the gate it now reaches. A passed verdict for a change whose tests have not run leaves the gate pending: a person's judgement never outvotes a missing test.
10644
+ * Record a reviewer's verdict on a pull request, after the fact (Sean 2026-11-24). The merge gate no longer waits for it: exposure-judged is decided by machine from the declaration for every kind of exposure, so a pull request merges without any verdict. This call is the review record — send result passed or failed with reason saying in a sentence a reviewer can act on why. It is stored on the pull request as review and announced with the event devops.pullRequest.reviewed. A failed verdict on an already merged pull request is a finding for follow-up (the event says finding true): the merge stands, nothing is un-merged, and a rollback or a fix is asked for on the ticket. headSha must be the pull request's head, and a verdict for another commit is refused with INVALID_ARGUMENT. List the merged pull requests nobody reviewed with pullRequests.list reviewed=false.
10203
10645
  */
10204
10646
  export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? client).post({
10205
10647
  security: [{
@@ -10232,6 +10674,24 @@ export const devopsPullRequestsClose = (options) => (options.client ?? client).p
10232
10674
  ...options.headers
10233
10675
  }
10234
10676
  });
10677
+ /**
10678
+ * Review a pull request on our own Git
10679
+ *
10680
+ * Give your verdict on a pull request whose project keeps its code on the platform's own Git, where there is no GitHub to hold reviews. The reviewer is you — the user or agent the credential names, never a name in the body — and the platform stores your verdict on the pull request's reviewers under your id, so an ownership rule that lists principal ids reads it. Send approved to approve, changes_requested to hold it with changes you want, or commented to say something without a verdict. A second review from you replaces your first, and the gate is decided again so a rule that reads reviews sees it at once. Only an open pull request is reviewed: a merged or closed one is refused with PULL_REQUEST_NOT_OPEN. A project connected to GitHub is refused with INVALID_ARGUMENT, because its reviews belong to GitHub and the platform projects them from there, so a verdict is never recorded in two places that can disagree.
10681
+ */
10682
+ export const devopsPullRequestsReviewsCreate = (options) => (options.client ?? client).post({
10683
+ security: [{
10684
+ key: 'devops-bearerAuth',
10685
+ scheme: 'bearer',
10686
+ type: 'http'
10687
+ }],
10688
+ url: '/devops/v1/pull-requests/{id}/reviews',
10689
+ ...options,
10690
+ headers: {
10691
+ 'Content-Type': 'application/json',
10692
+ ...options.headers
10693
+ }
10694
+ });
10235
10695
  /**
10236
10696
  * List connections
10237
10697
  *
@@ -10377,7 +10837,7 @@ export const devopsTestRunsRetryFailed = (options) => (options.client ?? client)
10377
10837
  /**
10378
10838
  * List a project's stage workspaces
10379
10839
  *
10380
- * List the project's three stage workspaces — development, integration and runtime — in that order. Each row says how a machine of that stage is built and how long it lives; it is configuration, not a machine, so listing never opens one. A project whose rows do not exist yet gets all three materialized on this call with the defaults (size medium, prebuild on, idle timeout 30 minutes, retention 7 days), and a later call reads those same rows back rather than replacing them. Read one stage with the workspace retrieve; the machines actually running are units.
10840
+ * List the project's three stage workspaces — development, integration and release — in that order. Each row says how a machine of that stage is built and how long it lives; it is configuration, not a machine, so listing never opens one. A project whose rows do not exist yet gets all three materialized on this call with the defaults (size medium, prebuild on, idle timeout 30 minutes, retention 7 days), and a later call reads those same rows back rather than replacing them. Read one stage with the workspace retrieve; the machines actually running are units.
10381
10841
  */
10382
10842
  export const devopsWorkspacesList = (options) => (options.client ?? client).get({
10383
10843
  security: [{
@@ -10452,6 +10912,20 @@ export const devopsUnitsCreate = (options) => (options.client ?? client).post({
10452
10912
  ...options.headers
10453
10913
  }
10454
10914
  });
10915
+ /**
10916
+ * List a project's cleanup ledger
10917
+ *
10918
+ * List what the daily cleanup job removed or archived for the project, newest decision first: merged branches deleted when their pull request merged, stopped units deleted after the project's window, test evidence past its age, and prebuilds beyond the kept versions. Each row names the kind of thing, which one, whether it was archived (the record stays, the heavy content goes) or deleted, the reason and when it was decided and done; error is set while the last attempt failed and the job will try again. The ledger is read-only: the job is its only writer, and a project changes what is kept through settings.retention on devops.projects.update. A project with no row has had nothing cleaned.
10919
+ */
10920
+ export const devopsCleanupsList = (options) => (options.client ?? client).get({
10921
+ security: [{
10922
+ key: 'devops-bearerAuth',
10923
+ scheme: 'bearer',
10924
+ type: 'http'
10925
+ }],
10926
+ url: '/devops/v1/projects/{project}/cleanups',
10927
+ ...options
10928
+ });
10455
10929
  /**
10456
10930
  * Delete a unit
10457
10931
  *
@@ -11949,7 +12423,7 @@ export const registryRepositoriesList = (options) => (options?.client ?? client)
11949
12423
  /**
11950
12424
  * Create repository
11951
12425
  *
11952
- * 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。
12426
+ * 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。format 默认 oci,库里放技能和插件;要放 git 仓库就传 format=git,建库后 format 不能改。git 库需要这个组织已开放 git 功能,否则返回 409。
11953
12427
  */
11954
12428
  export const registryRepositoriesCreate = (options) => (options.client ?? client).post({
11955
12429
  security: [{
@@ -12025,12 +12499,11 @@ export const registryRepositoriesPackagesList = (options) => (options.client ??
12025
12499
  ...options
12026
12500
  });
12027
12501
  /**
12028
- * Publish a package
12502
+ * Create a package
12029
12503
  *
12030
- * 把一个新包发布进这个库,一次调用建立包并上传它的第一个版本。发布内容是 multipart:version 必填,archive 给一个 zip,或者 files 给一组文件(每个文件的 filename 是相对上传根的路径,例如 pdf/SKILL.md)。单个顶层目录会被剥掉。种类按根上有什么判:有 SKILL.md 就是 skill,有 .claude-plugin/plugin.json 就是 plugin;两者都没有、或都有,会被拒。名字从 SKILL.md 或 plugin.json 里读,不从路径或 query 猜。限额:上传 ≤25 MiB,解压后 ≤50 MiB,≤1000 个文件。版本必须是 semver 且严格递增;第一个版本可以是任意合法 semver,之后每个新版本都要比已发布的最高版本高。把已有智能体的技能搬过来时,先用 GET /agent/v1/skills/{id}/versions/{v}/content 导出 zip,再在这里作为 archive 发布。
12504
+ * 在一个库里建新包,按库的 format 走两条路。git 库(format=git):Content-Type 用 application/json,请求体 {name, format:"git", default_branch?, description?, import?},建一个空的 git 仓库,或者用 import.url(公开 https 仓库)从现有仓库导入;成功返回的包带 clone_url、default_branch 和 protected_refs(默认只保护默认分支),接着调用 packages.git-credential 取推拉凭据;组织未开放 git 功能返回 409,往 oci 库里用 JSON 建包也是 409。oci 库(技能和插件):把一个新包发布进这个库,一次调用建立包并上传它的第一个版本,Content-Type 用 multipart/form-data。发布内容是 multipart:version 必填,archive 给一个 zip,或者 files 给一组文件(每个文件的 filename 是相对上传根的路径,例如 pdf/SKILL.md)。单个顶层目录会被剥掉。种类按根上有什么判:有 SKILL.md 就是 skill,有 .claude-plugin/plugin.json 就是 plugin;两者都没有、或都有,会被拒。名字从 SKILL.md 或 plugin.json 里读,不从路径或 query 猜。限额:上传 ≤25 MiB,解压后 ≤50 MiB,≤1000 个文件。版本必须是 semver 且严格递增;第一个版本可以是任意合法 semver,之后每个新版本都要比已发布的最高版本高。把已有智能体的技能搬过来时,先用 GET /agent/v1/skills/{id}/versions/{v}/content 导出 zip,再在这里作为 archive 发布。
12031
12505
  */
12032
12506
  export const registryRepositoriesPackagesCreate = (options) => (options.client ?? client).post({
12033
- ...formDataBodySerializer,
12034
12507
  security: [{
12035
12508
  key: 'registry-bearerAuth',
12036
12509
  scheme: 'bearer',
@@ -12039,7 +12512,7 @@ export const registryRepositoriesPackagesCreate = (options) => (options.client ?
12039
12512
  url: '/registry/v1/repositories/{repository_id}/packages',
12040
12513
  ...options,
12041
12514
  headers: {
12042
- 'Content-Type': null,
12515
+ 'Content-Type': 'application/json',
12043
12516
  ...options.headers
12044
12517
  }
12045
12518
  });
@@ -12090,6 +12563,24 @@ export const registryPackagesVersionsCreate = (options) => (options.client ?? cl
12090
12563
  ...options.headers
12091
12564
  }
12092
12565
  });
12566
+ /**
12567
+ * Create a git credential
12568
+ *
12569
+ * 给一个 git 包换一个短期的 git 凭据,用来 git clone / git push。access 选 pull(只读,用来克隆和拉取)或 push(推分支,同时可以克隆和拉取)。push-protected(更新受保护分支)暂不发放,请推到别的分支再合并,请求它返回 400。ttl_seconds 是有效秒数,1-3600,默认 3600;到期后重新调用本接口,不要缓存过期的凭据。返回的 password 是敏感信息,只出现这一次,不要写进日志或提交。用法:git clone https://x-access-token:$PASSWORD@host/git/组织/库/包.git,或把 url 里的地址配上 http.extraHeader。组织未开放 git 功能返回 409;另一个组织的包、已被删除的包和 oci 包都返回 404。同一个 package_id 可以多次取,每次是一个新凭据,互不影响。
12570
+ */
12571
+ export const registryPackagesGitCredentialCreate = (options) => (options.client ?? client).post({
12572
+ security: [{
12573
+ key: 'registry-bearerAuth',
12574
+ scheme: 'bearer',
12575
+ type: 'http'
12576
+ }],
12577
+ url: '/registry/v1/packages/{package_id}/git-credential',
12578
+ ...options,
12579
+ headers: {
12580
+ 'Content-Type': 'application/json',
12581
+ ...options.headers
12582
+ }
12583
+ });
12093
12584
  /**
12094
12585
  * List commits
12095
12586
  *
@@ -12107,7 +12598,7 @@ export const registryGitLog = (options) => (options.client ?? client).get({
12107
12598
  /**
12108
12599
  * Read a commit
12109
12600
  *
12110
- * 按对象 id 读一个提交(完整 sha,不解析缩写)。返回提交信息、作者、提交时间与父提交。仓库里没有这个对象返回 404。
12601
+ * 按对象 id 读一个提交(完整 sha,不解析缩写)。返回提交信息、作者、提交时间与父提交;changed_files=true 时再返回它相对第一个父提交改了哪些文件(根提交的全部文件算新增),文件列表被上限截断时 changed_files_truncated 为 true。仓库里没有这个对象返回 404。
12111
12602
  */
12112
12603
  export const registryGitCommitsRetrieve = (options) => (options.client ?? client).get({
12113
12604
  security: [{
@@ -12132,6 +12623,62 @@ export const registryGitTreesRetrieve = (options) => (options.client ?? client).
12132
12623
  url: '/registry/v1/packages/{package_id}/git/trees/{sha}',
12133
12624
  ...options
12134
12625
  });
12626
+ /**
12627
+ * List branches and tags
12628
+ *
12629
+ * 列出一个 git 包的分支和标签,按名字排序;prefix 只取 refs/heads/(分支)或 refs/tags/(标签),不给就两者都列。page 从 1 起,size 1 到 500,默认 100;has_more 为 true 表示还有下一页。带注解的标签返回它指向的提交 id,不是标签对象的 id。想把一个名字换成提交 id 用 git/resolve,不要自己在这个列表里找。只读;OCI 包返回 404。
12630
+ */
12631
+ export const registryGitRefs = (options) => (options.client ?? client).get({
12632
+ security: [{
12633
+ key: 'registry-bearerAuth',
12634
+ scheme: 'bearer',
12635
+ type: 'http'
12636
+ }],
12637
+ url: '/registry/v1/packages/{package_id}/git/refs',
12638
+ ...options
12639
+ });
12640
+ /**
12641
+ * Resolve a ref
12642
+ *
12643
+ * 把一个引用换成它指向的提交 id:ref 可以是分支名、标签名、refs/… 全名、HEAD 或完整对象 id(40 或 64 位十六进制,缩写不解析)。名字既是标签又是分支时取标签。完整对象 id 只在仓库里真有这个提交时才返回。仓库没有这个引用或提交返回 404(GIT_OBJECT_NOT_FOUND),不会返回空值。要比较两个引用用 git/compare。
12644
+ */
12645
+ export const registryGitResolve = (options) => (options.client ?? client).get({
12646
+ security: [{
12647
+ key: 'registry-bearerAuth',
12648
+ scheme: 'bearer',
12649
+ type: 'http'
12650
+ }],
12651
+ url: '/registry/v1/packages/{package_id}/git/resolve',
12652
+ ...options
12653
+ });
12654
+ /**
12655
+ * Compare two refs
12656
+ *
12657
+ * 比较 base 与 head(引用名或完整对象 id):status 是 identical、ahead(head 在 base 之上有新提交)、behind(head 已包含在 base 里)或 diverged(两边各有提交);merge_base 是找到的最近共同祖先;files 是 head 相对 merge_base 改了哪些文件(added、modified、removed、renamed,renamed 带 previous_path),commits 是 head 比 base 多出的提交,最新的在前。Artifacts 无法低成本回答祖先关系,所以这里只沿两边的第一父链各走最多 300 个提交,并在有界读取下比对树:找不到共同祖先时返回 diverged、merge_base 为 null;files 被上限(3000 个文件、1000 次树读取)截断时 truncated 为 true;commits 被截断、或合并提交藏起了被合并分支上的提交时 commits_truncated 为 true。truncated 或 commits_truncated 为 true 时不要把列表当作完整结果。引用不存在返回 404。只读。
12658
+ */
12659
+ export const registryGitCompare = (options) => (options.client ?? client).get({
12660
+ security: [{
12661
+ key: 'registry-bearerAuth',
12662
+ scheme: 'bearer',
12663
+ type: 'http'
12664
+ }],
12665
+ url: '/registry/v1/packages/{package_id}/git/compare',
12666
+ ...options
12667
+ });
12668
+ /**
12669
+ * List a tree recursively
12670
+ *
12671
+ * 读一个提交(或树对象)下的全部条目,递归,每个条目用相对根的完整路径命名,目录和子模块也是条目(子模块不展开)。适合要拿到整个仓库文件清单的场景(例如 DevOps 的构建判断);只想看一个目录用 git/trees/{sha}。相同的子树只读一次。条目上限 20000、树读取上限 1000 次,撞到上限时 truncated 为 true、entries 只是前一部分,不要当作全部。sha 通常来自 git/resolve。仓库里没有这个对象返回 404。只读。
12672
+ */
12673
+ export const registryGitTreesRecursive = (options) => (options.client ?? client).get({
12674
+ security: [{
12675
+ key: 'registry-bearerAuth',
12676
+ scheme: 'bearer',
12677
+ type: 'http'
12678
+ }],
12679
+ url: '/registry/v1/packages/{package_id}/git/trees/{sha}/recursive',
12680
+ ...options
12681
+ });
12135
12682
  /**
12136
12683
  * Download a file from a ref
12137
12684
  *
@@ -15195,7 +15742,7 @@ export const vaultListTemplates = (options) => (options?.client ?? client).get({
15195
15742
  /**
15196
15743
  * Create authorization
15197
15744
  *
15198
- * Connect an OAuth service to an active vault using either an OAuth template or a resource URL. Unlike Anthropic mcp_oauth credential creation, this flow obtains tokens through user consent rather than accepting an auth token bundle; compatible mcp_oauth creation and updates return 501. Open connect_url, then poll praxis.vault.authorizations.retrieve until completed, failed or expired; only completed supplies the resulting secret_id. This stores a credential but does not enable vault-backed MCP authentication in Agent sessions.
15745
+ * Connect an OAuth service to an active vault using either an OAuth template or a resource URL. Unlike Anthropic mcp_oauth credential creation, this flow obtains tokens through user consent rather than accepting an auth token bundle; compatible mcp_oauth creation and updates return 501. Open connect_url, then poll praxis.vault.authorizations.retrieve until completed, failed or expired; only completed supplies the resulting secret_id. The resulting oauth secret serves vault-backed MCP authentication — an Agent session or deployment whose vault_ids include this vault sends it to the MCP server whose URL equals this authorization's resource URL (normalized), and the platform refreshes the token once when that server answers 401.
15199
15746
  */
15200
15747
  export const vaultCreateAuthorization = (options) => (options.client ?? client).post({
15201
15748
  security: [{