@deepraxis/sdk 0.1.1-dev.cfc116e → 0.1.1-dev.d03c066

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.
@@ -357,10 +357,46 @@ export const getAgentAppearance = (options) => (options.client ?? client).get({
357
357
  url: '/agent/v1/agents/{agent_id}/appearance',
358
358
  ...options
359
359
  });
360
+ /**
361
+ * Retrieve agent phone
362
+ *
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
+ */
365
+ export const agentsPhoneRetrieve = (options) => (options.client ?? client).get({
366
+ security: [{
367
+ key: 'BearerAuth',
368
+ scheme: 'bearer',
369
+ type: 'http'
370
+ }, {
371
+ key: 'ApiKeyAuth',
372
+ name: 'X-API-Key',
373
+ type: 'apiKey'
374
+ }],
375
+ url: '/agent/v1/agents/{agent_id}/phone',
376
+ ...options
377
+ });
378
+ /**
379
+ * Release agent phone
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. 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
+ */
383
+ export const agentsPhoneRelease = (options) => (options.client ?? client).post({
384
+ security: [{
385
+ key: 'BearerAuth',
386
+ scheme: 'bearer',
387
+ type: 'http'
388
+ }, {
389
+ key: 'ApiKeyAuth',
390
+ name: 'X-API-Key',
391
+ type: 'apiKey'
392
+ }],
393
+ url: '/agent/v1/agents/{agent_id}/phone/release',
394
+ ...options
395
+ });
360
396
  /**
361
397
  * Get agent embed policy
362
398
  *
363
- * Read a service agent's embed settings: the pages allowed to open its Kit chat (allowed_origins), the development switch (allow_localhost) and what an embedded end user may upload (uploads). The allow list decides where the agent can be embedded at all, so after deploying an application, add that application's URL origin here (scheme, host and port, never a path) before the page loads the agent — otherwise its Kit chat answers ORIGIN_NOT_ALLOWED. Budgets, monthly caps and token lifetime are set in the console and are not part of this API. An agent of another organization answers 404; an agent that is not a service agent answers 400.
399
+ * Read a service agent's embed settings: the pages allowed to open its Kit chat (allowed_origins), the development switch (allow_localhost), what an embedded end user may upload (uploads) and whether the agent may be shared by link with the daily caps its visitors count against (share_links). The allow list decides where the agent can be embedded at all, so after deploying an application, add that application's URL origin here (scheme, host and port, never a path) before the page loads the agent — otherwise its Kit chat answers ORIGIN_NOT_ALLOWED. Budgets, monthly caps and token lifetime are set in the console and are not part of this API. An agent of another organization answers 404; an agent that is not a service agent answers 400.
364
400
  */
365
401
  export const getAgentEmbedPolicy = (options) => (options.client ?? client).get({
366
402
  security: [{
@@ -378,7 +414,7 @@ export const getAgentEmbedPolicy = (options) => (options.client ?? client).get({
378
414
  /**
379
415
  * Update agent embed policy
380
416
  *
381
- * Change some of a service agent's embed settings. Only the fields you send change: everything you leave out, including the budgets and the token lifetime set in the console, is kept exactly as it was. Send allowed_origins so the pages that load the agent are allowed — an application's URL origin must be in the list before the application can embed the agent, or its Kit chat answers ORIGIN_NOT_ALLOWED. Send allow_localhost while developing on http://localhost, and uploads to open, close or bound file attachments for the embedded end user. Values are checked by the service: an origin is normalized and must be https, and at most one leading wildcard label may match a single subdomain level. max_file_bytes is 1 to 104857600 bytes and max_files_per_session is 1 to 100. Example: POST /agent/v1/agents/{agent_id}/embed_policy with {"allowed_origins": ["https://my-app.example.com"]}.
417
+ * Change some of a service agent's embed settings. Only the fields you send change: everything you leave out, including the budgets and the token lifetime set in the console, is kept exactly as it was. Send allowed_origins so the pages that load the agent are allowed — an application's URL origin must be in the list before the application can embed the agent, or its Kit chat answers ORIGIN_NOT_ALLOWED. Send allow_localhost while developing on http://localhost, and uploads to open, close or bound file attachments for the embedded end user. Send share_links to let the agent be shared by link and to set the daily session and spending caps its share links count against; turning it on is refused unless the agent has an identity number. Values are checked by the service: an origin is normalized and must be https, and at most one leading wildcard label may match a single subdomain level. max_file_bytes is 1 to 104857600 bytes and max_files_per_session is 1 to 100. Example: POST /agent/v1/agents/{agent_id}/embed_policy with {"allowed_origins": ["https://my-app.example.com"]}.
382
418
  */
383
419
  export const updateAgentEmbedPolicy = (options) => (options.client ?? client).post({
384
420
  security: [{
@@ -402,7 +438,7 @@ export const updateAgentEmbedPolicy = (options) => (options.client ?? client).po
402
438
  *
403
439
  * List the computers of your organization, archived ones included.
404
440
  *
405
- * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
441
+ * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
406
442
  */
407
443
  export const computersList = (options) => (options?.client ?? client).get({
408
444
  security: [{
@@ -422,7 +458,7 @@ export const computersList = (options) => (options?.client ?? client).get({
422
458
  *
423
459
  * Create a durable computer: a named machine whose files outlive sessions, for general agents.
424
460
  *
425
- * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
461
+ * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
426
462
  */
427
463
  export const computersCreate = (options) => (options.client ?? client).post({
428
464
  security: [{
@@ -466,7 +502,7 @@ export const computersDelete = (options) => (options.client ?? client).delete({
466
502
  *
467
503
  * Read one computer's status, storage use and sandbox id.
468
504
  *
469
- * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
505
+ * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
470
506
  */
471
507
  export const computersRetrieve = (options) => (options.client ?? client).get({
472
508
  security: [{
@@ -486,7 +522,7 @@ export const computersRetrieve = (options) => (options.client ?? client).get({
486
522
  *
487
523
  * Rename a computer.
488
524
  *
489
- * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
525
+ * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
490
526
  */
491
527
  export const computersUpdate = (options) => (options.client ?? client).post({
492
528
  security: [{
@@ -510,7 +546,7 @@ export const computersUpdate = (options) => (options.client ?? client).post({
510
546
  *
511
547
  * Archive a computer: its files stay readable but new sessions cannot use it.
512
548
  *
513
- * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
549
+ * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers. A computer an active agent holds is refused with 409 COMPUTER_IN_USE; archive the agent first.
514
550
  */
515
551
  export const computersArchive = (options) => (options.client ?? client).post({
516
552
  security: [{
@@ -555,7 +591,7 @@ export const computersAttachmentsCreate = (options) => (options.client ?? client
555
591
  *
556
592
  * List the entries of one directory on a computer.
557
593
  *
558
- * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
594
+ * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
559
595
  */
560
596
  export const computersFilesList = (options) => (options.client ?? client).get({
561
597
  security: [{
@@ -575,7 +611,7 @@ export const computersFilesList = (options) => (options.client ?? client).get({
575
611
  *
576
612
  * Download the bytes of one file on a computer, up to 16 MiB, with single-range support.
577
613
  *
578
- * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
614
+ * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
579
615
  */
580
616
  export const computersFilesContent = (options) => (options.client ?? client).get({
581
617
  security: [{
@@ -590,6 +626,49 @@ export const computersFilesContent = (options) => (options.client ?? client).get
590
626
  url: '/agent/v1/computers/{computer_id}/files/content',
591
627
  ...options
592
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
+ });
654
+ /**
655
+ * Preview a computer file
656
+ *
657
+ * The preview product of one version of one computer file: an image becomes a 1600 px WebP, an Office document a linearized PDF, text and source the first 64 KiB, and PDF, xlsx, epub, GIF, SVG and unknown types their original bytes. Products live in the File service and are keyed by computer, path, size, mtime, variant and format version. A request that pins `v` answers from that registry without stat'ing or waking the computer; without `v` the file is read and the product generated once. A file over the size threshold, or a deployment without the File service, answers `fallback: "content"` so the caller keeps the ordinary content door.
658
+ */
659
+ export const previewComputerFile = (options) => (options.client ?? client).get({
660
+ security: [{
661
+ key: 'BearerAuth',
662
+ scheme: 'bearer',
663
+ type: 'http'
664
+ }, {
665
+ key: 'ApiKeyAuth',
666
+ name: 'X-API-Key',
667
+ type: 'apiKey'
668
+ }],
669
+ url: '/agent/v1/computers/{computer_id}/files/preview',
670
+ ...options
671
+ });
593
672
  /**
594
673
  * Convert a Computer Document to PDF
595
674
  *
@@ -679,7 +758,7 @@ export const releaseComputerLease = (options) => (options.client ?? client).dele
679
758
  /**
680
759
  * List Toolsets
681
760
  *
682
- * 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.
683
762
  */
684
763
  export const listToolsets = (options) => (options?.client ?? client).get({
685
764
  security: [{
@@ -738,6 +817,30 @@ export const forkSession = (options) => (options.client ?? client).post({
738
817
  ...options.headers
739
818
  }
740
819
  });
820
+ /**
821
+ * Rename Session (Extension)
822
+ *
823
+ * Give a session a short, branch-like name; the main session is always main and cannot be renamed.
824
+ *
825
+ * Available only on /agent/v1. The name is normalized first (surrounding whitespace trimmed, upper case folded to lowercase, runs of whitespace become one hyphen, characters the rule does not admit dropped, and no hyphen left hanging at either end) and then validated: non-empty, at most 32 display columns wide (a Han character counts as two), made only of Han characters, lowercase ASCII letters, digits and hyphens, and never the reserved word main. A name another of the caller's own sessions already holds is not an error: the answer carries a numeric suffix (base-2, base-3, …). Renaming the main session returns 400; a missing session, one that belongs to another caller, or one the caller cannot write returns 404. Returns 200 with the same Session shape as retrieval, name set to the new name; one rename writes a session.renamed event. Example: POST /agent/v1/sessions/sesn_login/name with body {"name":"login-fix"}.
826
+ */
827
+ export const renameSession = (options) => (options.client ?? client).post({
828
+ security: [{
829
+ key: 'BearerAuth',
830
+ scheme: 'bearer',
831
+ type: 'http'
832
+ }, {
833
+ key: 'ApiKeyAuth',
834
+ name: 'X-API-Key',
835
+ type: 'apiKey'
836
+ }],
837
+ url: '/agent/v1/sessions/{session_id}/name',
838
+ ...options,
839
+ headers: {
840
+ 'Content-Type': 'application/json',
841
+ ...options.headers
842
+ }
843
+ });
741
844
  /**
742
845
  * Update session agent version
743
846
  *
@@ -811,7 +914,7 @@ export const createSessionArtifactContentUrl = (options) => (options.client ?? c
811
914
  *
812
915
  * List the requests a session is waiting on; an end-customer token reads its own session.
813
916
  *
814
- * 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.
815
918
  */
816
919
  export const listSessionRequests = (options) => (options.client ?? client).get({
817
920
  security: [{
@@ -1012,6 +1115,12 @@ export const createAudioSpeech = (options) => (options.client ?? client).post({
1012
1115
  ...options.headers
1013
1116
  }
1014
1117
  });
1118
+ /**
1119
+ * List current prices
1120
+ *
1121
+ * Read every open price item with the amount in force now, in USD and CNY, for example to show a pricing page or check what a meter costs before using it. No credential: the response is the public price book, not an organization's prices, so customer-specific prices and cost floors are not part of it (the source does not carry them). Each entry names the item id, the product (the id's namespace such as router, sandbox or search), the meter's unit and how many units one amount covers (per is 1000000 for per-million-token meters). A model with one amount has one entry; a price that varies by tier or by dimensions has one entry per tier or cell, told apart by variant: tier carries up_to, cell carries when, and a matrix default is kind default. Only versions already in force are shown, so an announced price never appears before its effective_from. usd and cny are decimal strings of major units copied from the price book; a currency the item does not price is null and must be shown as "—", never as 0. pricing_version and effective_at identify the catalog this body came from, and the ETag is derived from both: send it as If-None-Match to get 304 until either changes. Cache-Control is public, max-age=60, so revalidate rather than keeping a copy longer. Reading is free.
1122
+ */
1123
+ export const listPublicPrices = (options) => (options?.client ?? client).get({ url: '/billing/v1/prices', ...options });
1015
1124
  /**
1016
1125
  * 列出浏览器会话
1017
1126
  *
@@ -1345,9 +1454,10 @@ export const browserSeleniumUnsupported = (options) => (options?.client ?? clien
1345
1454
  /**
1346
1455
  * List files
1347
1456
  *
1348
- * 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.
1349
1458
  */
1350
1459
  export const fileListFiles = (options) => (options?.client ?? client).get({
1460
+ querySerializer: { parameters: { ids: { array: { explode: false } } } },
1351
1461
  security: [{
1352
1462
  key: 'BearerAuth',
1353
1463
  scheme: 'bearer',
@@ -2502,7 +2612,7 @@ export const listOrganizationUsage = (options) => (options.client ?? client).get
2502
2612
  /**
2503
2613
  * List Organization Usage Events
2504
2614
  *
2505
- * Usage events newest first, one opaque cursor page at a time; a page never duplicates or skips an event. Every item carries its metering lines (meter, display name, consumed quantity and unit, mapped from the billing measurements); the per-line price split (list unit price, pricing unit, billed cost) rides only the single event — fetch /organization/v1/events/{id} for it.
2615
+ * Usage events newest first by occurrence time (occurred_at, when the usage happened), one opaque cursor page at a time; a page never duplicates or skips an event. Every item carries its metering lines (meter, display name, consumed quantity and unit, mapped from the billing measurements); the per-line price split (list unit price, pricing unit, billed cost) rides only the single event — fetch /organization/v1/events/{id} for it. A cursor belongs to the order it was issued under: one obtained before this occurrence-time ordering, or used under the other sort direction, is refused with 400 INVALID_PARAMS instead of being reused — restart the listing.
2506
2616
  *
2507
2617
  */
2508
2618
  export const listOrganizationEvents = (options) => (options.client ?? client).get({
@@ -2557,11 +2667,11 @@ export const exportOrganizationCharges = (options) => (options.client ?? client)
2557
2667
  ...options
2558
2668
  });
2559
2669
  /**
2560
- * List departments
2670
+ * Upgrade to a full sandbox
2561
2671
  *
2562
- * 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.
2563
2673
  */
2564
- export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
2674
+ export const upgradeSandbox = (options) => (options.client ?? client).post({
2565
2675
  security: [{
2566
2676
  key: 'BearerAuth',
2567
2677
  scheme: 'bearer',
@@ -2571,15 +2681,19 @@ export const listOrganizationDepartments = (options) => (options?.client ?? clie
2571
2681
  name: 'X-API-Key',
2572
2682
  type: 'apiKey'
2573
2683
  }],
2574
- url: '/organization/v1/departments',
2575
- ...options
2684
+ url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
2685
+ ...options,
2686
+ headers: {
2687
+ 'Content-Type': 'application/json',
2688
+ ...options.headers
2689
+ }
2576
2690
  });
2577
2691
  /**
2578
- * Establish a department
2692
+ * Extend a running sandbox without shortening its deadline
2579
2693
  *
2580
- * 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.
2581
2695
  */
2582
- export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
2696
+ export const extendSandbox = (options) => (options.client ?? client).post({
2583
2697
  security: [{
2584
2698
  key: 'BearerAuth',
2585
2699
  scheme: 'bearer',
@@ -2589,7 +2703,7 @@ export const establishOrganizationDepartment = (options) => (options.client ?? c
2589
2703
  name: 'X-API-Key',
2590
2704
  type: 'apiKey'
2591
2705
  }],
2592
- url: '/organization/v1/departments',
2706
+ url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
2593
2707
  ...options,
2594
2708
  headers: {
2595
2709
  'Content-Type': 'application/json',
@@ -2597,11 +2711,11 @@ export const establishOrganizationDepartment = (options) => (options.client ?? c
2597
2711
  }
2598
2712
  });
2599
2713
  /**
2600
- * Get a department
2714
+ * List live processes and retained observations
2601
2715
  *
2602
- * 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.
2603
2717
  */
2604
- export const getOrganizationDepartment = (options) => (options.client ?? client).get({
2718
+ export const listObservedProcesses = (options) => (options.client ?? client).get({
2605
2719
  security: [{
2606
2720
  key: 'BearerAuth',
2607
2721
  scheme: 'bearer',
@@ -2611,37 +2725,15 @@ export const getOrganizationDepartment = (options) => (options.client ?? client)
2611
2725
  name: 'X-API-Key',
2612
2726
  type: 'apiKey'
2613
2727
  }],
2614
- url: '/organization/v1/departments/{id}',
2728
+ url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
2615
2729
  ...options
2616
2730
  });
2617
2731
  /**
2618
- * Reorganize a department
2619
- *
2620
- * 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.
2621
- */
2622
- export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
2623
- security: [{
2624
- key: 'BearerAuth',
2625
- scheme: 'bearer',
2626
- type: 'http'
2627
- }, {
2628
- key: 'ApiKeyAuth',
2629
- name: 'X-API-Key',
2630
- type: 'apiKey'
2631
- }],
2632
- url: '/organization/v1/departments/{id}',
2633
- ...options,
2634
- headers: {
2635
- 'Content-Type': 'application/json',
2636
- ...options.headers
2637
- }
2638
- });
2639
- /**
2640
- * Dissolve a department
2732
+ * Read bounded observed process output
2641
2733
  *
2642
- * 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.
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.
2643
2735
  */
2644
- export const dissolveOrganizationDepartment = (options) => (options.client ?? client).post({
2736
+ export const getObservedProcessOutput = (options) => (options.client ?? client).get({
2645
2737
  security: [{
2646
2738
  key: 'BearerAuth',
2647
2739
  scheme: 'bearer',
@@ -2651,15 +2743,15 @@ export const dissolveOrganizationDepartment = (options) => (options.client ?? cl
2651
2743
  name: 'X-API-Key',
2652
2744
  type: 'apiKey'
2653
2745
  }],
2654
- url: '/organization/v1/departments/{id}/dissolve',
2746
+ url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
2655
2747
  ...options
2656
2748
  });
2657
2749
  /**
2658
- * Amend a department charter
2750
+ * Start a task whose output is pushed off the machine while it runs
2659
2751
  *
2660
- * 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.
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.
2661
2753
  */
2662
- export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
2754
+ export const startSandboxTask = (options) => (options.client ?? client).post({
2663
2755
  security: [{
2664
2756
  key: 'BearerAuth',
2665
2757
  scheme: 'bearer',
@@ -2669,7 +2761,7 @@ export const amendOrganizationDepartmentCharter = (options) => (options.client ?
2669
2761
  name: 'X-API-Key',
2670
2762
  type: 'apiKey'
2671
2763
  }],
2672
- url: '/organization/v1/departments/{id}/charter',
2764
+ url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
2673
2765
  ...options,
2674
2766
  headers: {
2675
2767
  'Content-Type': 'application/json',
@@ -2677,11 +2769,11 @@ export const amendOrganizationDepartmentCharter = (options) => (options.client ?
2677
2769
  }
2678
2770
  });
2679
2771
  /**
2680
- * List jobs
2772
+ * Read a range of a task's pushed output
2681
2773
  *
2682
- * 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.
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.
2683
2775
  */
2684
- export const listOrganizationJobs = (options) => (options?.client ?? client).get({
2776
+ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
2685
2777
  security: [{
2686
2778
  key: 'BearerAuth',
2687
2779
  scheme: 'bearer',
@@ -2691,37 +2783,89 @@ export const listOrganizationJobs = (options) => (options?.client ?? client).get
2691
2783
  name: 'X-API-Key',
2692
2784
  type: 'apiKey'
2693
2785
  }],
2694
- url: '/organization/v1/jobs',
2786
+ url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
2695
2787
  ...options
2696
2788
  });
2697
2789
  /**
2698
- * Define a job
2790
+ * Kill sandbox
2699
2791
  *
2700
- * 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."}.
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.
2701
2793
  */
2702
- export const defineOrganizationJob = (options) => (options.client ?? client).post({
2703
- security: [{
2704
- key: 'BearerAuth',
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',
2705
2803
  scheme: 'bearer',
2706
2804
  type: 'http'
2707
- }, {
2708
- key: 'ApiKeyAuth',
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',
2709
2835
  name: 'X-API-Key',
2710
2836
  type: 'apiKey'
2711
- }],
2712
- url: '/organization/v1/jobs',
2713
- ...options,
2714
- headers: {
2715
- 'Content-Type': 'application/json',
2716
- ...options.headers
2717
- }
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
2718
2862
  });
2719
2863
  /**
2720
- * Get a job
2864
+ * Rename a sandbox
2721
2865
  *
2722
- * 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.
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.
2723
2867
  */
2724
- export const getOrganizationJob = (options) => (options.client ?? client).get({
2868
+ export const renameSandbox = (options) => (options.client ?? client).patch({
2725
2869
  security: [{
2726
2870
  key: 'BearerAuth',
2727
2871
  scheme: 'bearer',
@@ -2731,15 +2875,21 @@ export const getOrganizationJob = (options) => (options.client ?? client).get({
2731
2875
  name: 'X-API-Key',
2732
2876
  type: 'apiKey'
2733
2877
  }],
2734
- url: '/organization/v1/jobs/{id}',
2735
- ...options
2878
+ url: '/sandbox/v1/sandboxes/{sandboxID}',
2879
+ ...options,
2880
+ headers: {
2881
+ 'Content-Type': 'application/json',
2882
+ ...options.headers
2883
+ }
2736
2884
  });
2737
2885
  /**
2738
- * Revise a job
2886
+ * Act on a phone sandbox's screen
2739
2887
  *
2740
- * 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.
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.
2741
2891
  */
2742
- export const reviseOrganizationJob = (options) => (options.client ?? client).patch({
2892
+ export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
2743
2893
  security: [{
2744
2894
  key: 'BearerAuth',
2745
2895
  scheme: 'bearer',
@@ -2749,7 +2899,7 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
2749
2899
  name: 'X-API-Key',
2750
2900
  type: 'apiKey'
2751
2901
  }],
2752
- url: '/organization/v1/jobs/{id}',
2902
+ url: '/sandbox/v1/sandboxes/{sandboxID}/act',
2753
2903
  ...options,
2754
2904
  headers: {
2755
2905
  'Content-Type': 'application/json',
@@ -2757,11 +2907,11 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
2757
2907
  }
2758
2908
  });
2759
2909
  /**
2760
- * Retire a job
2910
+ * Remove a file or directory in the sandbox
2761
2911
  *
2762
- * 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.
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.
2763
2913
  */
2764
- export const retireOrganizationJob = (options) => (options.client ?? client).post({
2914
+ export const removeSandboxFile = (options) => (options.client ?? client).delete({
2765
2915
  security: [{
2766
2916
  key: 'BearerAuth',
2767
2917
  scheme: 'bearer',
@@ -2771,11 +2921,461 @@ export const retireOrganizationJob = (options) => (options.client ?? client).pos
2771
2921
  name: 'X-API-Key',
2772
2922
  type: 'apiKey'
2773
2923
  }],
2774
- url: '/organization/v1/jobs/{id}/retire',
2924
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
2775
2925
  ...options
2776
2926
  });
2777
2927
  /**
2778
- * List job ladders
2928
+ * Read a file in the sandbox
2929
+ *
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.
2931
+ */
2932
+ export const readSandboxFile = (options) => (options.client ?? client).get({
2933
+ security: [{
2934
+ key: 'BearerAuth',
2935
+ scheme: 'bearer',
2936
+ type: 'http'
2937
+ }, {
2938
+ key: 'ApiKeyAuth',
2939
+ name: 'X-API-Key',
2940
+ type: 'apiKey'
2941
+ }],
2942
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
2943
+ ...options
2944
+ });
2945
+ /**
2946
+ * Write a file in the sandbox
2947
+ *
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"}.
2949
+ */
2950
+ export const writeSandboxFile = (options) => (options.client ?? client).put({
2951
+ security: [{
2952
+ key: 'BearerAuth',
2953
+ scheme: 'bearer',
2954
+ type: 'http'
2955
+ }, {
2956
+ key: 'ApiKeyAuth',
2957
+ name: 'X-API-Key',
2958
+ type: 'apiKey'
2959
+ }],
2960
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
2961
+ ...options,
2962
+ headers: {
2963
+ 'Content-Type': 'application/json',
2964
+ ...options.headers
2965
+ }
2966
+ });
2967
+ /**
2968
+ * List files in a sandbox directory
2969
+ *
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.
2971
+ */
2972
+ export const listSandboxFiles = (options) => (options.client ?? client).get({
2973
+ security: [{
2974
+ key: 'BearerAuth',
2975
+ scheme: 'bearer',
2976
+ type: 'http'
2977
+ }, {
2978
+ key: 'ApiKeyAuth',
2979
+ name: 'X-API-Key',
2980
+ type: 'apiKey'
2981
+ }],
2982
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
2983
+ ...options
2984
+ });
2985
+ /**
2986
+ * Create a directory in the sandbox
2987
+ *
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.
2989
+ */
2990
+ export const makeSandboxDirectory = (options) => (options.client ?? client).post({
2991
+ security: [{
2992
+ key: 'BearerAuth',
2993
+ scheme: 'bearer',
2994
+ type: 'http'
2995
+ }, {
2996
+ key: 'ApiKeyAuth',
2997
+ name: 'X-API-Key',
2998
+ type: 'apiKey'
2999
+ }],
3000
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
3001
+ ...options
3002
+ });
3003
+ /**
3004
+ * Run a command in the sandbox
3005
+ *
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"}.
3007
+ */
3008
+ export const runSandboxCommand = (options) => (options.client ?? client).post({
3009
+ security: [{
3010
+ key: 'BearerAuth',
3011
+ scheme: 'bearer',
3012
+ type: 'http'
3013
+ }, {
3014
+ key: 'ApiKeyAuth',
3015
+ name: 'X-API-Key',
3016
+ type: 'apiKey'
3017
+ }],
3018
+ url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
3019
+ ...options,
3020
+ headers: {
3021
+ 'Content-Type': 'application/json',
3022
+ ...options.headers
3023
+ }
3024
+ });
3025
+ /**
3026
+ * Start adding a phone of your own
3027
+ *
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'}.
3029
+ */
3030
+ export const createByodPairing = (options) => (options?.client ?? client).post({
3031
+ security: [{
3032
+ key: 'BearerAuth',
3033
+ scheme: 'bearer',
3034
+ type: 'http'
3035
+ }, {
3036
+ key: 'ApiKeyAuth',
3037
+ name: 'X-API-Key',
3038
+ type: 'apiKey'
3039
+ }],
3040
+ url: '/sandbox/v1/byod/pairings',
3041
+ ...options
3042
+ });
3043
+ /**
3044
+ * List your organization's own devices
3045
+ *
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:[]}]}.
3047
+ */
3048
+ export const listByodDevices = (options) => (options?.client ?? client).get({
3049
+ security: [{
3050
+ key: 'BearerAuth',
3051
+ scheme: 'bearer',
3052
+ type: 'http'
3053
+ }, {
3054
+ key: 'ApiKeyAuth',
3055
+ name: 'X-API-Key',
3056
+ type: 'apiKey'
3057
+ }],
3058
+ url: '/sandbox/v1/byod/devices',
3059
+ ...options
3060
+ });
3061
+ /**
3062
+ * Read one of your organization's devices
3063
+ *
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.
3065
+ */
3066
+ export const getByodDevice = (options) => (options.client ?? client).get({
3067
+ security: [{
3068
+ key: 'BearerAuth',
3069
+ scheme: 'bearer',
3070
+ type: 'http'
3071
+ }, {
3072
+ key: 'ApiKeyAuth',
3073
+ name: 'X-API-Key',
3074
+ type: 'apiKey'
3075
+ }],
3076
+ url: '/sandbox/v1/byod/devices/{deviceID}',
3077
+ ...options
3078
+ });
3079
+ /**
3080
+ * Rename one of your organization's devices
3081
+ *
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.
3083
+ */
3084
+ export const updateByodDevice = (options) => (options.client ?? client).patch({
3085
+ security: [{
3086
+ key: 'BearerAuth',
3087
+ scheme: 'bearer',
3088
+ type: 'http'
3089
+ }, {
3090
+ key: 'ApiKeyAuth',
3091
+ name: 'X-API-Key',
3092
+ type: 'apiKey'
3093
+ }],
3094
+ url: '/sandbox/v1/byod/devices/{deviceID}',
3095
+ ...options,
3096
+ headers: {
3097
+ 'Content-Type': 'application/json',
3098
+ ...options.headers
3099
+ }
3100
+ });
3101
+ /**
3102
+ * Disconnect a device and revoke its credential
3103
+ *
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}.
3105
+ */
3106
+ export const disconnectByodDevice = (options) => (options.client ?? client).post({
3107
+ security: [{
3108
+ key: 'BearerAuth',
3109
+ scheme: 'bearer',
3110
+ type: 'http'
3111
+ }, {
3112
+ key: 'ApiKeyAuth',
3113
+ name: 'X-API-Key',
3114
+ type: 'apiKey'
3115
+ }],
3116
+ url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
3117
+ ...options
3118
+ });
3119
+ /**
3120
+ * Read a pairing for the phone's Allow screen
3121
+ *
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'}.
3123
+ */
3124
+ export const getByodPairing = (options) => (options.client ?? client).get({
3125
+ security: [{
3126
+ key: 'BearerAuth',
3127
+ scheme: 'bearer',
3128
+ type: 'http'
3129
+ }, {
3130
+ key: 'ApiKeyAuth',
3131
+ name: 'X-API-Key',
3132
+ type: 'apiKey'
3133
+ }],
3134
+ url: '/sandbox/v1/byod/pairings/{code}',
3135
+ ...options
3136
+ });
3137
+ /**
3138
+ * Claim a pairing and register the phone
3139
+ *
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/'}.
3141
+ */
3142
+ export const claimByodPairing = (options) => (options.client ?? client).post({
3143
+ security: [{
3144
+ key: 'BearerAuth',
3145
+ scheme: 'bearer',
3146
+ type: 'http'
3147
+ }, {
3148
+ key: 'ApiKeyAuth',
3149
+ name: 'X-API-Key',
3150
+ type: 'apiKey'
3151
+ }],
3152
+ url: '/sandbox/v1/byod/pairings/{code}/claim',
3153
+ ...options,
3154
+ headers: {
3155
+ 'Content-Type': 'application/json',
3156
+ ...options.headers
3157
+ }
3158
+ });
3159
+ /**
3160
+ * List departments
3161
+ *
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.
3163
+ */
3164
+ export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
3165
+ security: [{
3166
+ key: 'BearerAuth',
3167
+ scheme: 'bearer',
3168
+ type: 'http'
3169
+ }, {
3170
+ key: 'ApiKeyAuth',
3171
+ name: 'X-API-Key',
3172
+ type: 'apiKey'
3173
+ }],
3174
+ url: '/workforce/v1/departments',
3175
+ ...options
3176
+ });
3177
+ /**
3178
+ * Establish a department
3179
+ *
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"}.
3181
+ */
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({
3205
+ security: [{
3206
+ key: 'BearerAuth',
3207
+ scheme: 'bearer',
3208
+ type: 'http'
3209
+ }, {
3210
+ key: 'ApiKeyAuth',
3211
+ name: 'X-API-Key',
3212
+ type: 'apiKey'
3213
+ }],
3214
+ url: '/workforce/v1/departments/{id}',
3215
+ ...options
3216
+ });
3217
+ /**
3218
+ * Reorganize a department
3219
+ *
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.
3221
+ */
3222
+ export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
3223
+ security: [{
3224
+ key: 'BearerAuth',
3225
+ scheme: 'bearer',
3226
+ type: 'http'
3227
+ }, {
3228
+ key: 'ApiKeyAuth',
3229
+ name: 'X-API-Key',
3230
+ type: 'apiKey'
3231
+ }],
3232
+ url: '/workforce/v1/departments/{id}',
3233
+ ...options,
3234
+ headers: {
3235
+ 'Content-Type': 'application/json',
3236
+ ...options.headers
3237
+ }
3238
+ });
3239
+ /**
3240
+ * Dissolve a department
3241
+ *
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.
3243
+ */
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({
3263
+ security: [{
3264
+ key: 'BearerAuth',
3265
+ scheme: 'bearer',
3266
+ type: 'http'
3267
+ }, {
3268
+ key: 'ApiKeyAuth',
3269
+ name: 'X-API-Key',
3270
+ type: 'apiKey'
3271
+ }],
3272
+ url: '/workforce/v1/departments/{id}/charter',
3273
+ ...options,
3274
+ headers: {
3275
+ 'Content-Type': 'application/json',
3276
+ ...options.headers
3277
+ }
3278
+ });
3279
+ /**
3280
+ * List jobs
3281
+ *
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.
3283
+ */
3284
+ export const listOrganizationJobs = (options) => (options?.client ?? client).get({
3285
+ security: [{
3286
+ key: 'BearerAuth',
3287
+ scheme: 'bearer',
3288
+ type: 'http'
3289
+ }, {
3290
+ key: 'ApiKeyAuth',
3291
+ name: 'X-API-Key',
3292
+ type: 'apiKey'
3293
+ }],
3294
+ url: '/workforce/v1/jobs',
3295
+ ...options
3296
+ });
3297
+ /**
3298
+ * Define a job
3299
+ *
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."}.
3301
+ */
3302
+ export const defineOrganizationJob = (options) => (options.client ?? client).post({
3303
+ security: [{
3304
+ key: 'BearerAuth',
3305
+ scheme: 'bearer',
3306
+ type: 'http'
3307
+ }, {
3308
+ key: 'ApiKeyAuth',
3309
+ name: 'X-API-Key',
3310
+ type: 'apiKey'
3311
+ }],
3312
+ url: '/workforce/v1/jobs',
3313
+ ...options,
3314
+ headers: {
3315
+ 'Content-Type': 'application/json',
3316
+ ...options.headers
3317
+ }
3318
+ });
3319
+ /**
3320
+ * Get a job
3321
+ *
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.
3323
+ */
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({
3343
+ security: [{
3344
+ key: 'BearerAuth',
3345
+ scheme: 'bearer',
3346
+ type: 'http'
3347
+ }, {
3348
+ key: 'ApiKeyAuth',
3349
+ name: 'X-API-Key',
3350
+ type: 'apiKey'
3351
+ }],
3352
+ url: '/workforce/v1/jobs/{id}',
3353
+ ...options,
3354
+ headers: {
3355
+ 'Content-Type': 'application/json',
3356
+ ...options.headers
3357
+ }
3358
+ });
3359
+ /**
3360
+ * Retire a job
3361
+ *
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.
3363
+ */
3364
+ export const retireOrganizationJob = (options) => (options.client ?? client).post({
3365
+ security: [{
3366
+ key: 'BearerAuth',
3367
+ scheme: 'bearer',
3368
+ type: 'http'
3369
+ }, {
3370
+ key: 'ApiKeyAuth',
3371
+ name: 'X-API-Key',
3372
+ type: 'apiKey'
3373
+ }],
3374
+ url: '/workforce/v1/jobs/{id}/retire',
3375
+ ...options
3376
+ });
3377
+ /**
3378
+ * List job ladders
2779
3379
  *
2780
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.
2781
3381
  */
@@ -2789,7 +3389,7 @@ export const listOrganizationLadders = (options) => (options?.client ?? client).
2789
3389
  name: 'X-API-Key',
2790
3390
  type: 'apiKey'
2791
3391
  }],
2792
- url: '/organization/v1/ladders',
3392
+ url: '/workforce/v1/ladders',
2793
3393
  ...options
2794
3394
  });
2795
3395
  /**
@@ -2807,7 +3407,7 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
2807
3407
  name: 'X-API-Key',
2808
3408
  type: 'apiKey'
2809
3409
  }],
2810
- url: '/organization/v1/ladders',
3410
+ url: '/workforce/v1/ladders',
2811
3411
  ...options,
2812
3412
  headers: {
2813
3413
  'Content-Type': 'application/json',
@@ -2829,7 +3429,7 @@ export const getOrganizationLadder = (options) => (options.client ?? client).get
2829
3429
  name: 'X-API-Key',
2830
3430
  type: 'apiKey'
2831
3431
  }],
2832
- url: '/organization/v1/ladders/{id}',
3432
+ url: '/workforce/v1/ladders/{id}',
2833
3433
  ...options
2834
3434
  });
2835
3435
  /**
@@ -2847,7 +3447,7 @@ export const reviseOrganizationLadder = (options) => (options.client ?? client).
2847
3447
  name: 'X-API-Key',
2848
3448
  type: 'apiKey'
2849
3449
  }],
2850
- url: '/organization/v1/ladders/{id}',
3450
+ url: '/workforce/v1/ladders/{id}',
2851
3451
  ...options,
2852
3452
  headers: {
2853
3453
  'Content-Type': 'application/json',
@@ -2857,7 +3457,7 @@ export const reviseOrganizationLadder = (options) => (options.client ?? client).
2857
3457
  /**
2858
3458
  * List positions
2859
3459
  *
2860
- * 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.
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.
2861
3461
  */
2862
3462
  export const listOrganizationPositions = (options) => (options?.client ?? client).get({
2863
3463
  security: [{
@@ -2869,7 +3469,7 @@ export const listOrganizationPositions = (options) => (options?.client ?? client
2869
3469
  name: 'X-API-Key',
2870
3470
  type: 'apiKey'
2871
3471
  }],
2872
- url: '/organization/v1/positions',
3472
+ url: '/workforce/v1/positions',
2873
3473
  ...options
2874
3474
  });
2875
3475
  /**
@@ -2887,7 +3487,7 @@ export const openOrganizationPositions = (options) => (options.client ?? client)
2887
3487
  name: 'X-API-Key',
2888
3488
  type: 'apiKey'
2889
3489
  }],
2890
- url: '/organization/v1/positions',
3490
+ url: '/workforce/v1/positions',
2891
3491
  ...options,
2892
3492
  headers: {
2893
3493
  'Content-Type': 'application/json',
@@ -2909,7 +3509,7 @@ export const getOrganizationPosition = (options) => (options.client ?? client).g
2909
3509
  name: 'X-API-Key',
2910
3510
  type: 'apiKey'
2911
3511
  }],
2912
- url: '/organization/v1/positions/{id}',
3512
+ url: '/workforce/v1/positions/{id}',
2913
3513
  ...options
2914
3514
  });
2915
3515
  /**
@@ -2927,7 +3527,7 @@ export const reviseOrganizationPosition = (options) => (options.client ?? client
2927
3527
  name: 'X-API-Key',
2928
3528
  type: 'apiKey'
2929
3529
  }],
2930
- url: '/organization/v1/positions/{id}',
3530
+ url: '/workforce/v1/positions/{id}',
2931
3531
  ...options,
2932
3532
  headers: {
2933
3533
  'Content-Type': 'application/json',
@@ -2949,7 +3549,7 @@ export const closeOrganizationPosition = (options) => (options.client ?? client)
2949
3549
  name: 'X-API-Key',
2950
3550
  type: 'apiKey'
2951
3551
  }],
2952
- url: '/organization/v1/positions/{id}/close',
3552
+ url: '/workforce/v1/positions/{id}/close',
2953
3553
  ...options
2954
3554
  });
2955
3555
  /**
@@ -2967,7 +3567,7 @@ export const freezeOrganizationPosition = (options) => (options.client ?? client
2967
3567
  name: 'X-API-Key',
2968
3568
  type: 'apiKey'
2969
3569
  }],
2970
- url: '/organization/v1/positions/{id}/freeze',
3570
+ url: '/workforce/v1/positions/{id}/freeze',
2971
3571
  ...options
2972
3572
  });
2973
3573
  /**
@@ -2985,7 +3585,7 @@ export const unfreezeOrganizationPosition = (options) => (options.client ?? clie
2985
3585
  name: 'X-API-Key',
2986
3586
  type: 'apiKey'
2987
3587
  }],
2988
- url: '/organization/v1/positions/{id}/unfreeze',
3588
+ url: '/workforce/v1/positions/{id}/unfreeze',
2989
3589
  ...options
2990
3590
  });
2991
3591
  /**
@@ -3003,7 +3603,7 @@ export const reassignOrganizationPositionManager = (options) => (options.client
3003
3603
  name: 'X-API-Key',
3004
3604
  type: 'apiKey'
3005
3605
  }],
3006
- url: '/organization/v1/positions/{id}/manager',
3606
+ url: '/workforce/v1/positions/{id}/manager',
3007
3607
  ...options,
3008
3608
  headers: {
3009
3609
  'Content-Type': 'application/json',
@@ -3025,7 +3625,7 @@ export const regradeOrganizationPosition = (options) => (options.client ?? clien
3025
3625
  name: 'X-API-Key',
3026
3626
  type: 'apiKey'
3027
3627
  }],
3028
- url: '/organization/v1/positions/{id}/level',
3628
+ url: '/workforce/v1/positions/{id}/level',
3029
3629
  ...options,
3030
3630
  headers: {
3031
3631
  'Content-Type': 'application/json',
@@ -3047,7 +3647,7 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
3047
3647
  name: 'X-API-Key',
3048
3648
  type: 'apiKey'
3049
3649
  }],
3050
- url: '/organization/v1/positions/{id}/designate_head',
3650
+ url: '/workforce/v1/positions/{id}/designate_head',
3051
3651
  ...options
3052
3652
  });
3053
3653
  /**
@@ -3065,7 +3665,7 @@ export const hireOrganizationPosition = (options) => (options.client ?? client).
3065
3665
  name: 'X-API-Key',
3066
3666
  type: 'apiKey'
3067
3667
  }],
3068
- url: '/organization/v1/positions/{id}/hire',
3668
+ url: '/workforce/v1/positions/{id}/hire',
3069
3669
  ...options,
3070
3670
  headers: {
3071
3671
  'Content-Type': 'application/json',
@@ -3087,7 +3687,7 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
3087
3687
  name: 'X-API-Key',
3088
3688
  type: 'apiKey'
3089
3689
  }],
3090
- url: '/organization/v1/positions/{id}/replace_holder',
3690
+ url: '/workforce/v1/positions/{id}/replace_holder',
3091
3691
  ...options,
3092
3692
  headers: {
3093
3693
  'Content-Type': 'application/json',
@@ -3097,7 +3697,7 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
3097
3697
  /**
3098
3698
  * List assignments
3099
3699
  *
3100
- * 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.
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.
3101
3701
  */
3102
3702
  export const listOrganizationAssignments = (options) => (options?.client ?? client).get({
3103
3703
  security: [{
@@ -3109,7 +3709,7 @@ export const listOrganizationAssignments = (options) => (options?.client ?? clie
3109
3709
  name: 'X-API-Key',
3110
3710
  type: 'apiKey'
3111
3711
  }],
3112
- url: '/organization/v1/assignments',
3712
+ url: '/workforce/v1/assignments',
3113
3713
  ...options
3114
3714
  });
3115
3715
  /**
@@ -3127,7 +3727,7 @@ export const getOrganizationAssignment = (options) => (options.client ?? client)
3127
3727
  name: 'X-API-Key',
3128
3728
  type: 'apiKey'
3129
3729
  }],
3130
- url: '/organization/v1/assignments/{id}',
3730
+ url: '/workforce/v1/assignments/{id}',
3131
3731
  ...options
3132
3732
  });
3133
3733
  /**
@@ -3145,7 +3745,7 @@ export const transferOrganizationAssignment = (options) => (options.client ?? cl
3145
3745
  name: 'X-API-Key',
3146
3746
  type: 'apiKey'
3147
3747
  }],
3148
- url: '/organization/v1/assignments/{id}/transfer',
3748
+ url: '/workforce/v1/assignments/{id}/transfer',
3149
3749
  ...options,
3150
3750
  headers: {
3151
3751
  'Content-Type': 'application/json',
@@ -3167,7 +3767,7 @@ export const terminateOrganizationAssignment = (options) => (options.client ?? c
3167
3767
  name: 'X-API-Key',
3168
3768
  type: 'apiKey'
3169
3769
  }],
3170
- url: '/organization/v1/assignments/{id}/terminate',
3770
+ url: '/workforce/v1/assignments/{id}/terminate',
3171
3771
  ...options,
3172
3772
  headers: {
3173
3773
  'Content-Type': 'application/json',
@@ -3189,13 +3789,13 @@ export const makePrimaryOrganizationAssignment = (options) => (options.client ??
3189
3789
  name: 'X-API-Key',
3190
3790
  type: 'apiKey'
3191
3791
  }],
3192
- url: '/organization/v1/assignments/{id}/make_primary',
3792
+ url: '/workforce/v1/assignments/{id}/make_primary',
3193
3793
  ...options
3194
3794
  });
3195
3795
  /**
3196
3796
  * List actors holding positions
3197
3797
  *
3198
- * 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.
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.
3199
3799
  */
3200
3800
  export const listOrganizationActors = (options) => (options?.client ?? client).get({
3201
3801
  security: [{
@@ -3207,7 +3807,7 @@ export const listOrganizationActors = (options) => (options?.client ?? client).g
3207
3807
  name: 'X-API-Key',
3208
3808
  type: 'apiKey'
3209
3809
  }],
3210
- url: '/organization/v1/actors',
3810
+ url: '/workforce/v1/actors',
3211
3811
  ...options
3212
3812
  });
3213
3813
  /**
@@ -3225,13 +3825,13 @@ export const getOrganizationActor = (options) => (options.client ?? client).get(
3225
3825
  name: 'X-API-Key',
3226
3826
  type: 'apiKey'
3227
3827
  }],
3228
- url: '/organization/v1/actors/{actor}',
3828
+ url: '/workforce/v1/actors/{actor}',
3229
3829
  ...options
3230
3830
  });
3231
3831
  /**
3232
3832
  * List periods
3233
3833
  *
3234
- * 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.
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.
3235
3835
  */
3236
3836
  export const listOrganizationPeriods = (options) => (options?.client ?? client).get({
3237
3837
  security: [{
@@ -3243,7 +3843,7 @@ export const listOrganizationPeriods = (options) => (options?.client ?? client).
3243
3843
  name: 'X-API-Key',
3244
3844
  type: 'apiKey'
3245
3845
  }],
3246
- url: '/organization/v1/periods',
3846
+ url: '/workforce/v1/periods',
3247
3847
  ...options
3248
3848
  });
3249
3849
  /**
@@ -3261,7 +3861,7 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
3261
3861
  name: 'X-API-Key',
3262
3862
  type: 'apiKey'
3263
3863
  }],
3264
- url: '/organization/v1/periods',
3864
+ url: '/workforce/v1/periods',
3265
3865
  ...options,
3266
3866
  headers: {
3267
3867
  'Content-Type': 'application/json',
@@ -3283,7 +3883,7 @@ export const getOrganizationPeriod = (options) => (options.client ?? client).get
3283
3883
  name: 'X-API-Key',
3284
3884
  type: 'apiKey'
3285
3885
  }],
3286
- url: '/organization/v1/periods/{id}',
3886
+ url: '/workforce/v1/periods/{id}',
3287
3887
  ...options
3288
3888
  });
3289
3889
  /**
@@ -3301,13 +3901,13 @@ export const closeOrganizationPeriod = (options) => (options.client ?? client).p
3301
3901
  name: 'X-API-Key',
3302
3902
  type: 'apiKey'
3303
3903
  }],
3304
- url: '/organization/v1/periods/{id}/close',
3904
+ url: '/workforce/v1/periods/{id}/close',
3305
3905
  ...options
3306
3906
  });
3307
3907
  /**
3308
3908
  * List objectives
3309
3909
  *
3310
- * 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.
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.
3311
3911
  */
3312
3912
  export const listOrganizationObjectives = (options) => (options?.client ?? client).get({
3313
3913
  security: [{
@@ -3319,7 +3919,7 @@ export const listOrganizationObjectives = (options) => (options?.client ?? clien
3319
3919
  name: 'X-API-Key',
3320
3920
  type: 'apiKey'
3321
3921
  }],
3322
- url: '/organization/v1/objectives',
3922
+ url: '/workforce/v1/objectives',
3323
3923
  ...options
3324
3924
  });
3325
3925
  /**
@@ -3337,7 +3937,7 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
3337
3937
  name: 'X-API-Key',
3338
3938
  type: 'apiKey'
3339
3939
  }],
3340
- url: '/organization/v1/objectives',
3940
+ url: '/workforce/v1/objectives',
3341
3941
  ...options,
3342
3942
  headers: {
3343
3943
  'Content-Type': 'application/json',
@@ -3359,7 +3959,7 @@ export const getOrganizationObjective = (options) => (options.client ?? client).
3359
3959
  name: 'X-API-Key',
3360
3960
  type: 'apiKey'
3361
3961
  }],
3362
- url: '/organization/v1/objectives/{id}',
3962
+ url: '/workforce/v1/objectives/{id}',
3363
3963
  ...options
3364
3964
  });
3365
3965
  /**
@@ -3377,7 +3977,7 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
3377
3977
  name: 'X-API-Key',
3378
3978
  type: 'apiKey'
3379
3979
  }],
3380
- url: '/organization/v1/objectives/{id}',
3980
+ url: '/workforce/v1/objectives/{id}',
3381
3981
  ...options,
3382
3982
  headers: {
3383
3983
  'Content-Type': 'application/json',
@@ -3399,7 +3999,7 @@ export const alignOrganizationObjective = (options) => (options.client ?? client
3399
3999
  name: 'X-API-Key',
3400
4000
  type: 'apiKey'
3401
4001
  }],
3402
- url: '/organization/v1/objectives/{id}/parents',
4002
+ url: '/workforce/v1/objectives/{id}/parents',
3403
4003
  ...options,
3404
4004
  headers: {
3405
4005
  'Content-Type': 'application/json',
@@ -3421,47 +4021,7 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
3421
4021
  name: 'X-API-Key',
3422
4022
  type: 'apiKey'
3423
4023
  }],
3424
- url: '/organization/v1/objectives/{id}/grade',
3425
- ...options,
3426
- headers: {
3427
- 'Content-Type': 'application/json',
3428
- ...options.headers
3429
- }
3430
- });
3431
- /**
3432
- * List key results
3433
- *
3434
- * 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.
3435
- */
3436
- export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
3437
- security: [{
3438
- key: 'BearerAuth',
3439
- scheme: 'bearer',
3440
- type: 'http'
3441
- }, {
3442
- key: 'ApiKeyAuth',
3443
- name: 'X-API-Key',
3444
- type: 'apiKey'
3445
- }],
3446
- url: '/organization/v1/key_results',
3447
- ...options
3448
- });
3449
- /**
3450
- * Set a key result
3451
- *
3452
- * 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"}}.
3453
- */
3454
- export const setOrganizationKeyResult = (options) => (options.client ?? client).post({
3455
- security: [{
3456
- key: 'BearerAuth',
3457
- scheme: 'bearer',
3458
- type: 'http'
3459
- }, {
3460
- key: 'ApiKeyAuth',
3461
- name: 'X-API-Key',
3462
- type: 'apiKey'
3463
- }],
3464
- url: '/organization/v1/key_results',
4024
+ url: '/workforce/v1/objectives/{id}/grade',
3465
4025
  ...options,
3466
4026
  headers: {
3467
4027
  'Content-Type': 'application/json',
@@ -3469,11 +4029,11 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
3469
4029
  }
3470
4030
  });
3471
4031
  /**
3472
- * Get a key result
4032
+ * List key results
3473
4033
  *
3474
- * 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.
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.
3475
4035
  */
3476
- export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
4036
+ export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
3477
4037
  security: [{
3478
4038
  key: 'BearerAuth',
3479
4039
  scheme: 'bearer',
@@ -3483,15 +4043,15 @@ export const getOrganizationKeyResult = (options) => (options.client ?? client).
3483
4043
  name: 'X-API-Key',
3484
4044
  type: 'apiKey'
3485
4045
  }],
3486
- url: '/organization/v1/key_results/{id}',
4046
+ url: '/workforce/v1/key_results',
3487
4047
  ...options
3488
4048
  });
3489
4049
  /**
3490
- * Revise a key result
4050
+ * Set a key result
3491
4051
  *
3492
- * 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"}.
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"}}.
3493
4053
  */
3494
- export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
4054
+ export const setOrganizationKeyResult = (options) => (options.client ?? client).post({
3495
4055
  security: [{
3496
4056
  key: 'BearerAuth',
3497
4057
  scheme: 'bearer',
@@ -3501,7 +4061,7 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
3501
4061
  name: 'X-API-Key',
3502
4062
  type: 'apiKey'
3503
4063
  }],
3504
- url: '/organization/v1/key_results/{id}',
4064
+ url: '/workforce/v1/key_results',
3505
4065
  ...options,
3506
4066
  headers: {
3507
4067
  'Content-Type': 'application/json',
@@ -3509,11 +4069,11 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
3509
4069
  }
3510
4070
  });
3511
4071
  /**
3512
- * Upgrade to a full sandbox
4072
+ * Get a key result
3513
4073
  *
3514
- * 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.
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.
3515
4075
  */
3516
- export const upgradeSandbox = (options) => (options.client ?? client).post({
4076
+ export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
3517
4077
  security: [{
3518
4078
  key: 'BearerAuth',
3519
4079
  scheme: 'bearer',
@@ -3523,19 +4083,15 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
3523
4083
  name: 'X-API-Key',
3524
4084
  type: 'apiKey'
3525
4085
  }],
3526
- url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
3527
- ...options,
3528
- headers: {
3529
- 'Content-Type': 'application/json',
3530
- ...options.headers
3531
- }
4086
+ url: '/workforce/v1/key_results/{id}',
4087
+ ...options
3532
4088
  });
3533
4089
  /**
3534
- * Extend a running sandbox without shortening its deadline
4090
+ * Revise a key result
3535
4091
  *
3536
- * 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.
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"}.
3537
4093
  */
3538
- export const extendSandbox = (options) => (options.client ?? client).post({
4094
+ export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
3539
4095
  security: [{
3540
4096
  key: 'BearerAuth',
3541
4097
  scheme: 'bearer',
@@ -3545,7 +4101,7 @@ export const extendSandbox = (options) => (options.client ?? client).post({
3545
4101
  name: 'X-API-Key',
3546
4102
  type: 'apiKey'
3547
4103
  }],
3548
- url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
4104
+ url: '/workforce/v1/key_results/{id}',
3549
4105
  ...options,
3550
4106
  headers: {
3551
4107
  'Content-Type': 'application/json',
@@ -3553,11 +4109,11 @@ export const extendSandbox = (options) => (options.client ?? client).post({
3553
4109
  }
3554
4110
  });
3555
4111
  /**
3556
- * List live processes and retained observations
4112
+ * List specs
3557
4113
  *
3558
- * 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.
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.
3559
4115
  */
3560
- export const listObservedProcesses = (options) => (options.client ?? client).get({
4116
+ export const listOrganizationSpecs = (options) => (options?.client ?? client).get({
3561
4117
  security: [{
3562
4118
  key: 'BearerAuth',
3563
4119
  scheme: 'bearer',
@@ -3567,15 +4123,15 @@ export const listObservedProcesses = (options) => (options.client ?? client).get
3567
4123
  name: 'X-API-Key',
3568
4124
  type: 'apiKey'
3569
4125
  }],
3570
- url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
4126
+ url: '/workforce/v1/specs',
3571
4127
  ...options
3572
4128
  });
3573
4129
  /**
3574
- * Read bounded observed process output
4130
+ * Get a spec
3575
4131
  *
3576
- * 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.
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.
3577
4133
  */
3578
- export const getObservedProcessOutput = (options) => (options.client ?? client).get({
4134
+ export const getOrganizationSpec = (options) => (options.client ?? client).get({
3579
4135
  security: [{
3580
4136
  key: 'BearerAuth',
3581
4137
  scheme: 'bearer',
@@ -3585,15 +4141,15 @@ export const getObservedProcessOutput = (options) => (options.client ?? client).
3585
4141
  name: 'X-API-Key',
3586
4142
  type: 'apiKey'
3587
4143
  }],
3588
- url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
4144
+ url: '/workforce/v1/specs/{kind}/{id}',
3589
4145
  ...options
3590
4146
  });
3591
4147
  /**
3592
- * Start a task whose output is pushed off the machine while it runs
4148
+ * Revise a spec
3593
4149
  *
3594
- * 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.
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"}}}}.
3595
4151
  */
3596
- export const startSandboxTask = (options) => (options.client ?? client).post({
4152
+ export const reviseOrganizationSpec = (options) => (options.client ?? client).put({
3597
4153
  security: [{
3598
4154
  key: 'BearerAuth',
3599
4155
  scheme: 'bearer',
@@ -3603,7 +4159,7 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
3603
4159
  name: 'X-API-Key',
3604
4160
  type: 'apiKey'
3605
4161
  }],
3606
- url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
4162
+ url: '/workforce/v1/specs/{kind}/{id}',
3607
4163
  ...options,
3608
4164
  headers: {
3609
4165
  'Content-Type': 'application/json',
@@ -3611,11 +4167,11 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
3611
4167
  }
3612
4168
  });
3613
4169
  /**
3614
- * Read a range of a task's pushed output
4170
+ * List spec revisions
3615
4171
  *
3616
- * 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.
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.
3617
4173
  */
3618
- export const getSandboxTaskLog = (options) => (options.client ?? client).get({
4174
+ export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
3619
4175
  security: [{
3620
4176
  key: 'BearerAuth',
3621
4177
  scheme: 'bearer',
@@ -3625,89 +4181,33 @@ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
3625
4181
  name: 'X-API-Key',
3626
4182
  type: 'apiKey'
3627
4183
  }],
3628
- url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
4184
+ url: '/workforce/v1/specs/{kind}/{id}/revisions',
3629
4185
  ...options
3630
4186
  });
3631
4187
  /**
3632
- * Kill sandbox
4188
+ * Diff two spec revisions
3633
4189
  *
3634
- * 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.
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.
3635
4191
  */
3636
- export const deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
3637
- security: [
3638
- {
3639
- key: 'sandbox-ApiKeyAuth',
3640
- name: 'X-API-Key',
3641
- type: 'apiKey'
3642
- },
3643
- {
3644
- key: 'sandbox-AuthProviderBearerAuth',
3645
- scheme: 'bearer',
3646
- type: 'http'
3647
- },
3648
- {
3649
- key: 'sandbox-AuthProviderTeamAuth',
3650
- name: 'X-Team-ID',
3651
- type: 'apiKey'
3652
- },
3653
- { name: 'X-Admin-Token', type: 'apiKey' },
3654
- {
3655
- key: 'sandbox-AdminTeamAuth',
3656
- name: 'X-Team-ID',
3657
- type: 'apiKey'
3658
- },
3659
- {
3660
- key: 'sandbox-AdminJWTAuth',
4192
+ export const diffOrganizationSpec = (options) => (options.client ?? client).get({
4193
+ security: [{
4194
+ key: 'BearerAuth',
3661
4195
  scheme: 'bearer',
3662
4196
  type: 'http'
3663
- }
3664
- ],
3665
- url: '/sandbox/v1/sandboxes/{sandboxID}',
3666
- ...options
3667
- });
3668
- /**
3669
- * Sandbox
3670
- *
3671
- * 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.
3672
- */
3673
- export const getSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).get({
3674
- security: [
3675
- {
3676
- key: 'sandbox-ApiKeyAuth',
4197
+ }, {
4198
+ key: 'ApiKeyAuth',
3677
4199
  name: 'X-API-Key',
3678
4200
  type: 'apiKey'
3679
- },
3680
- {
3681
- key: 'sandbox-AuthProviderBearerAuth',
3682
- scheme: 'bearer',
3683
- type: 'http'
3684
- },
3685
- {
3686
- key: 'sandbox-AuthProviderTeamAuth',
3687
- name: 'X-Team-ID',
3688
- type: 'apiKey'
3689
- },
3690
- { name: 'X-Admin-Token', type: 'apiKey' },
3691
- {
3692
- key: 'sandbox-AdminTeamAuth',
3693
- name: 'X-Team-ID',
3694
- type: 'apiKey'
3695
- },
3696
- {
3697
- key: 'sandbox-AdminJWTAuth',
3698
- scheme: 'bearer',
3699
- type: 'http'
3700
- }
3701
- ],
3702
- url: '/sandbox/v1/sandboxes/{sandboxID}',
4201
+ }],
4202
+ url: '/workforce/v1/specs/{kind}/{id}/diff',
3703
4203
  ...options
3704
4204
  });
3705
4205
  /**
3706
- * Rename a sandbox
4206
+ * Read the effective spec
3707
4207
  *
3708
- * 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.
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.
3709
4209
  */
3710
- export const renameSandbox = (options) => (options.client ?? client).patch({
4210
+ export const getOrganizationEffectiveSpec = (options) => (options?.client ?? client).get({
3711
4211
  security: [{
3712
4212
  key: 'BearerAuth',
3713
4213
  scheme: 'bearer',
@@ -3717,19 +4217,15 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
3717
4217
  name: 'X-API-Key',
3718
4218
  type: 'apiKey'
3719
4219
  }],
3720
- url: '/sandbox/v1/sandboxes/{sandboxID}',
3721
- ...options,
3722
- headers: {
3723
- 'Content-Type': 'application/json',
3724
- ...options.headers
3725
- }
4220
+ url: '/workforce/v1/effective_spec',
4221
+ ...options
3726
4222
  });
3727
4223
  /**
3728
- * Remove a file or directory in the sandbox
4224
+ * Read the spec schema
3729
4225
  *
3730
- * 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.
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.
3731
4227
  */
3732
- export const removeSandboxFile = (options) => (options.client ?? client).delete({
4228
+ export const getOrganizationSpecSchema = (options) => (options?.client ?? client).get({
3733
4229
  security: [{
3734
4230
  key: 'BearerAuth',
3735
4231
  scheme: 'bearer',
@@ -3739,15 +4235,15 @@ export const removeSandboxFile = (options) => (options.client ?? client).delete(
3739
4235
  name: 'X-API-Key',
3740
4236
  type: 'apiKey'
3741
4237
  }],
3742
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4238
+ url: '/workforce/v1/spec_schema',
3743
4239
  ...options
3744
4240
  });
3745
4241
  /**
3746
- * Read a file in the sandbox
4242
+ * Plan reconciliation
3747
4243
  *
3748
- * 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.
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.
3749
4245
  */
3750
- export const readSandboxFile = (options) => (options.client ?? client).get({
4246
+ export const planOrganizationReconcile = (options) => (options.client ?? client).get({
3751
4247
  security: [{
3752
4248
  key: 'BearerAuth',
3753
4249
  scheme: 'bearer',
@@ -3757,15 +4253,15 @@ export const readSandboxFile = (options) => (options.client ?? client).get({
3757
4253
  name: 'X-API-Key',
3758
4254
  type: 'apiKey'
3759
4255
  }],
3760
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
4256
+ url: '/workforce/v1/reconcile/plan',
3761
4257
  ...options
3762
4258
  });
3763
4259
  /**
3764
- * Write a file in the sandbox
4260
+ * Read reconcile status
3765
4261
  *
3766
- * 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"}.
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.
3767
4263
  */
3768
- export const writeSandboxFile = (options) => (options.client ?? client).put({
4264
+ export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
3769
4265
  security: [{
3770
4266
  key: 'BearerAuth',
3771
4267
  scheme: 'bearer',
@@ -3775,19 +4271,15 @@ export const writeSandboxFile = (options) => (options.client ?? client).put({
3775
4271
  name: 'X-API-Key',
3776
4272
  type: 'apiKey'
3777
4273
  }],
3778
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
3779
- ...options,
3780
- headers: {
3781
- 'Content-Type': 'application/json',
3782
- ...options.headers
3783
- }
4274
+ url: '/workforce/v1/reconcile/status',
4275
+ ...options
3784
4276
  });
3785
4277
  /**
3786
- * List files in a sandbox directory
4278
+ * Run reconciliation now
3787
4279
  *
3788
- * 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.
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"}.
3789
4281
  */
3790
- export const listSandboxFiles = (options) => (options.client ?? client).get({
4282
+ export const runOrganizationReconcile = (options) => (options.client ?? client).post({
3791
4283
  security: [{
3792
4284
  key: 'BearerAuth',
3793
4285
  scheme: 'bearer',
@@ -3797,15 +4289,19 @@ export const listSandboxFiles = (options) => (options.client ?? client).get({
3797
4289
  name: 'X-API-Key',
3798
4290
  type: 'apiKey'
3799
4291
  }],
3800
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
3801
- ...options
4292
+ url: '/workforce/v1/reconcile/run',
4293
+ ...options,
4294
+ headers: {
4295
+ 'Content-Type': 'application/json',
4296
+ ...options.headers
4297
+ }
3802
4298
  });
3803
4299
  /**
3804
- * Create a directory in the sandbox
4300
+ * Pause reconciliation
3805
4301
  *
3806
- * 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.
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"}.
3807
4303
  */
3808
- export const makeSandboxDirectory = (options) => (options.client ?? client).post({
4304
+ export const pauseOrganizationReconcile = (options) => (options.client ?? client).post({
3809
4305
  security: [{
3810
4306
  key: 'BearerAuth',
3811
4307
  scheme: 'bearer',
@@ -3815,15 +4311,19 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
3815
4311
  name: 'X-API-Key',
3816
4312
  type: 'apiKey'
3817
4313
  }],
3818
- url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
3819
- ...options
4314
+ url: '/workforce/v1/reconcile/pause',
4315
+ ...options,
4316
+ headers: {
4317
+ 'Content-Type': 'application/json',
4318
+ ...options.headers
4319
+ }
3820
4320
  });
3821
4321
  /**
3822
- * Run a command in the sandbox
4322
+ * Resume reconciliation
3823
4323
  *
3824
- * 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. Example body: {"cmd":"echo hi"}.
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"}.
3825
4325
  */
3826
- export const runSandboxCommand = (options) => (options.client ?? client).post({
4326
+ export const resumeOrganizationReconcile = (options) => (options.client ?? client).post({
3827
4327
  security: [{
3828
4328
  key: 'BearerAuth',
3829
4329
  scheme: 'bearer',
@@ -3833,7 +4333,7 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
3833
4333
  name: 'X-API-Key',
3834
4334
  type: 'apiKey'
3835
4335
  }],
3836
- url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
4336
+ url: '/workforce/v1/reconcile/resume',
3837
4337
  ...options,
3838
4338
  headers: {
3839
4339
  'Content-Type': 'application/json',
@@ -3919,7 +4419,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
3919
4419
  /**
3920
4420
  * Create agent
3921
4421
  *
3922
- * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. 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. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; omit computer_id to register a new computer named after the agent without starting an instance, or provide an existing computer_id; 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.
3923
4423
  */
3924
4424
  export const agentsCreate = (options) => (options.client ?? client).post({
3925
4425
  security: [{
@@ -3959,7 +4459,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
3959
4459
  /**
3960
4460
  * Update agent
3961
4461
  *
3962
- * 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.
3963
4463
  */
3964
4464
  export const agentsUpdate = (options) => (options.client ?? client).post({
3965
4465
  security: [{
@@ -4415,7 +4915,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
4415
4915
  /**
4416
4916
  * Create deployment
4417
4917
  *
4418
- * Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.
4918
+ * Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400. Example, a weekly cron deployment on the agent's computer: {"agent":"agent_123","name":"weekly report","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Write the weekly report."}]}],"target":{"type":"computer"},"schedule":{"type":"cron","expression":"0 9 * * 1","timezone":"America/Los_Angeles"}}.
4419
4919
  */
4420
4920
  export const deploymentsCreate = (options) => (options.client ?? client).post({
4421
4921
  security: [{
@@ -4895,7 +5395,7 @@ export const applicationListVersions = (options) => (options.client ?? client).g
4895
5395
  /**
4896
5396
  * Create version
4897
5397
  *
4898
- * Upload code and bindings as a new version; a version serves nothing until deployed. Set deploy true to create the pending deployment in the same call. Rejected binding types return UNSUPPORTED.
5398
+ * Upload code and bindings as a new version; a version serves nothing until deployed. Set deploy true to create the pending deployment in the same call. Rejected binding types return UNSUPPORTED. Send an Idempotency-Key to make a create safe to retry: within 24 hours the same key with the same body answers the first version (and its deployment) again instead of creating a second one, and the same key with a different body is refused.
4899
5399
  */
4900
5400
  export const applicationCreateVersion = (options) => (options.client ?? client).post({
4901
5401
  security: [{
@@ -5061,7 +5561,7 @@ export const applicationListGrants = (options) => (options.client ?? client).get
5061
5561
  /**
5062
5562
  * Create grant
5063
5563
  *
5064
- * 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).
5065
5565
  */
5066
5566
  export const applicationCreateGrant = (options) => (options.client ?? client).post({
5067
5567
  security: [{
@@ -5649,7 +6149,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
5649
6149
  /**
5650
6150
  * Create a workflow
5651
6151
  *
5652
- * 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.
5653
6153
  */
5654
6154
  export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
5655
6155
  security: [{
@@ -5689,7 +6189,7 @@ export const automationWorkflowsGet = (options) => (options.client ?? client).ge
5689
6189
  /**
5690
6190
  * Update a workflow draft
5691
6191
  *
5692
- * 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.
5693
6193
  */
5694
6194
  export const automationWorkflowsPatch = (options) => (options.client ?? client).patch({
5695
6195
  security: [{
@@ -5893,7 +6393,7 @@ export const automationWorkflowsSetDistTag = (options) => (options.client ?? cli
5893
6393
  /**
5894
6394
  * Validate a definition
5895
6395
  *
5896
- * 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.
5897
6397
  */
5898
6398
  export const automationValidateValidate = (options) => (options.client ?? client).post({
5899
6399
  security: [{
@@ -8136,7 +8636,7 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
8136
8636
  * codemode.describe("praxis.cut.script") // names, one page at a time
8137
8637
  * ```
8138
8638
  *
8139
- * 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.
8140
8640
  *
8141
8641
  * #### Script functions (script)
8142
8642
  *
@@ -8205,8 +8705,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
8205
8705
  * - `transform` — Position, scale, rotation, opacity, crop, blur.
8206
8706
  * - `fit` — contain, cover, fill or none.
8207
8707
  * - `blend` — Layer blend mode; null clears.
8208
- * - `style` — Text styling: font, fill, strokes, glow, position.
8209
- * - `style.position` — top, middle or bottom; omit it, never null.
8708
+ * - `style` — Text styling in Shotstack's rich shape: font, gradient, stroke, shadow, box, border, align, per-word animation.
8709
+ * - `style.align.vertical` — top, middle or bottom; omit it, never null.
8210
8710
  * - `playback` — Rate, direction, audio policy, or freeze.
8211
8711
  * - `volumeDb` — Audio level in dB; 0 is source level.
8212
8712
  * - `gain` — Keyframed audio level in dB.
@@ -8227,6 +8727,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
8227
8727
  * - `JOIN_CONFLICT` — A join is invalid or blocks this edit.
8228
8728
  * - `INVALID_TRANSITION` — Bad transition kind, parameter or length.
8229
8729
  * - `INVALID_STYLE` — A style value is out of range.
8730
+ * - `UNSUPPORTED_STYLE_FIELD` — A Shotstack style field this platform cannot render yet.
8731
+ * - `STYLE_LEGACY_FIELDS` — A style written in the old flat shape; it still works.
8230
8732
  * - `INVALID_MASK` — A mask definition is malformed.
8231
8733
  * - `MASK_IN_USE` — The edit would break a live mask.
8232
8734
  * - `TOO_MANY_MASKS` — At most 16 masks per project.
@@ -8653,7 +9155,7 @@ export const databaseListDatabases = (options) => (options?.client ?? client).ge
8653
9155
  /**
8654
9156
  * Create database
8655
9157
  *
8656
- * Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
9158
+ * Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. kind is optional: table (the default) for tables and rows, kv for Redis-style keys and values; it cannot change later, and creating kv where it is not available returns 400 INVALID_PARAMS: kind kv is not available. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
8657
9159
  */
8658
9160
  export const databaseCreateDatabase = (options) => (options.client ?? client).post({
8659
9161
  security: [{
@@ -8841,29 +9343,123 @@ export const databaseAddField = (options) => (options.client ?? client).post({
8841
9343
  /**
8842
9344
  * Delete field
8843
9345
  *
8844
- * Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
9346
+ * Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
9347
+ */
9348
+ export const databaseDeleteField = (options) => (options.client ?? client).delete({
9349
+ security: [{
9350
+ key: 'database-bearerAuth',
9351
+ scheme: 'bearer',
9352
+ type: 'http'
9353
+ }],
9354
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
9355
+ ...options
9356
+ });
9357
+ /**
9358
+ * Update field
9359
+ *
9360
+ * Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
9361
+ */
9362
+ export const databaseUpdateField = (options) => (options.client ?? client).patch({
9363
+ security: [{
9364
+ key: 'database-bearerAuth',
9365
+ scheme: 'bearer',
9366
+ type: 'http'
9367
+ }],
9368
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
9369
+ ...options,
9370
+ headers: {
9371
+ 'Content-Type': 'application/json',
9372
+ ...options.headers
9373
+ }
9374
+ });
9375
+ /**
9376
+ * List events
9377
+ *
9378
+ * Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
9379
+ */
9380
+ export const databaseListEvents = (options) => (options.client ?? client).get({
9381
+ security: [{
9382
+ key: 'database-bearerAuth',
9383
+ scheme: 'bearer',
9384
+ type: 'http'
9385
+ }],
9386
+ url: '/database/v1/databases/{database_id}/events',
9387
+ ...options
9388
+ });
9389
+ /**
9390
+ * Delete rows
9391
+ *
9392
+ * Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
9393
+ */
9394
+ export const databaseDelete = (options) => (options.client ?? client).delete({
9395
+ security: [{
9396
+ key: 'database-bearerAuth',
9397
+ scheme: 'bearer',
9398
+ type: 'http'
9399
+ }],
9400
+ url: '/database/v1/databases/{database_id}/rest/{table}',
9401
+ ...options
9402
+ });
9403
+ /**
9404
+ * Select rows
9405
+ *
9406
+ * Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
9407
+ */
9408
+ export const databaseSelect = (options) => (options.client ?? client).get({
9409
+ security: [{
9410
+ key: 'database-bearerAuth',
9411
+ scheme: 'bearer',
9412
+ type: 'http'
9413
+ }],
9414
+ url: '/database/v1/databases/{database_id}/rest/{table}',
9415
+ ...options
9416
+ });
9417
+ /**
9418
+ * Count rows
9419
+ *
9420
+ * Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
9421
+ */
9422
+ export const databaseHead = (options) => (options.client ?? client).head({
9423
+ security: [{
9424
+ key: 'database-bearerAuth',
9425
+ scheme: 'bearer',
9426
+ type: 'http'
9427
+ }],
9428
+ url: '/database/v1/databases/{database_id}/rest/{table}',
9429
+ ...options
9430
+ });
9431
+ /**
9432
+ * Update rows
9433
+ *
9434
+ * Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
8845
9435
  */
8846
- export const databaseDeleteField = (options) => (options.client ?? client).delete({
9436
+ export const databaseUpdate = (options) => (options.client ?? client).patch({
8847
9437
  security: [{
8848
9438
  key: 'database-bearerAuth',
8849
9439
  scheme: 'bearer',
8850
9440
  type: 'http'
8851
9441
  }],
8852
- url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
8853
- ...options
9442
+ url: '/database/v1/databases/{database_id}/rest/{table}',
9443
+ ...options,
9444
+ headers: {
9445
+ 'Content-Type': 'application/json',
9446
+ ...options.headers
9447
+ }
8854
9448
  });
8855
9449
  /**
8856
- * Update field
9450
+ * Insert rows
8857
9451
  *
8858
- * Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
9452
+ * Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
9453
+ * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
9454
+ * The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
8859
9455
  */
8860
- export const databaseUpdateField = (options) => (options.client ?? client).patch({
9456
+ export const databaseInsert = (options) => (options.client ?? client).post({
8861
9457
  security: [{
8862
9458
  key: 'database-bearerAuth',
8863
9459
  scheme: 'bearer',
8864
9460
  type: 'http'
8865
9461
  }],
8866
- url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
9462
+ url: '/database/v1/databases/{database_id}/rest/{table}',
8867
9463
  ...options,
8868
9464
  headers: {
8869
9465
  'Content-Type': 'application/json',
@@ -8871,73 +9467,77 @@ export const databaseUpdateField = (options) => (options.client ?? client).patch
8871
9467
  }
8872
9468
  });
8873
9469
  /**
8874
- * List events
9470
+ * List keys
8875
9471
  *
8876
- * Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
9472
+ * Browse the keys of a key-value database (kind kv): use it to see what is stored before reading one key with databaseGetKey; to run an arbitrary Redis command (counters, ranges, scans) use databaseExecuteCommand instead. Keys come back in lexicographic key order, one page at a time, as summaries (key, type, remaining TTL, size) without values; expired keys are never returned. pattern filters with a Redis glob (* ? [abc] [^abc]) matched against the whole key, and type keeps one value type. limit is 1–500, default 50; while next_cursor is a string, pass it back unchanged as cursor for the next page; null means this is the last page. Needs a read credential. Errors: 400 INVALID_PARAMS for a limit outside 1–500 or a malformed query; 404 DATABASE_NOT_FOUND for an unknown id; 409 DATABASE_KIND_MISMATCH when the database is a table database.
8877
9473
  */
8878
- export const databaseListEvents = (options) => (options.client ?? client).get({
9474
+ export const databaseListKeys = (options) => (options.client ?? client).get({
8879
9475
  security: [{
8880
9476
  key: 'database-bearerAuth',
8881
9477
  scheme: 'bearer',
8882
9478
  type: 'http'
8883
9479
  }],
8884
- url: '/database/v1/databases/{database_id}/events',
9480
+ url: '/database/v1/databases/{database_id}/keys',
8885
9481
  ...options
8886
9482
  });
8887
9483
  /**
8888
- * Delete rows
9484
+ * Delete key
8889
9485
  *
8890
- * Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
9486
+ * Delete one key of a key-value database together with its value; the data cannot be recovered. A key that is absent or has already expired is not an error: the call succeeds with deleted false, so it is safe to retry. To delete many keys at once or by pattern, list them with databaseListKeys or run DEL / UNLINK through databaseExecuteCommand. Needs a read-write credential. Errors: 404 DATABASE_NOT_FOUND for an unknown id; 409 DATABASE_KIND_MISMATCH for a table database; 403 BINDING_READ_ONLY for a read-only credential.
8891
9487
  */
8892
- export const databaseDelete = (options) => (options.client ?? client).delete({
9488
+ export const databaseDeleteKey = (options) => (options.client ?? client).delete({
8893
9489
  security: [{
8894
9490
  key: 'database-bearerAuth',
8895
9491
  scheme: 'bearer',
8896
9492
  type: 'http'
8897
9493
  }],
8898
- url: '/database/v1/databases/{database_id}/rest/{table}',
9494
+ url: '/database/v1/databases/{database_id}/keys/{key}',
8899
9495
  ...options
8900
9496
  });
8901
9497
  /**
8902
- * Select rows
9498
+ * Get key
8903
9499
  *
8904
- * Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
9500
+ * Read one key of a key-value database with its type, TTL, size and value; use databaseListKeys first to find key names. A string value is returned whole. A hash, list, set or zset is returned a page of entries at a time: limit is 1–1000, default 100, and while next_cursor is a string, pass it back unchanged as cursor to read the next page; string values and the last page return next_cursor null. value takes the shape of type: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}]. Needs a read credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS for a limit outside 1–1000; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH for a table database.
8905
9501
  */
8906
- export const databaseSelect = (options) => (options.client ?? client).get({
9502
+ export const databaseGetKey = (options) => (options.client ?? client).get({
8907
9503
  security: [{
8908
9504
  key: 'database-bearerAuth',
8909
9505
  scheme: 'bearer',
8910
9506
  type: 'http'
8911
9507
  }],
8912
- url: '/database/v1/databases/{database_id}/rest/{table}',
9508
+ url: '/database/v1/databases/{database_id}/keys/{key}',
8913
9509
  ...options
8914
9510
  });
8915
9511
  /**
8916
- * Count rows
9512
+ * Update key
8917
9513
  *
8918
- * Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
9514
+ * Change only the TTL of an existing key of a key-value database, leaving its value alone. update_mask must be ttl_ms (the only writable field) and ttl_ms is required: a positive integer is the new TTL in milliseconds (Redis PEXPIRE), null removes the TTL so the key never expires (PERSIST). To replace the value use databaseSetKey. Returns the key after the change. Needs a read-write credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS when update_mask is not ttl_ms or ttl_ms is neither a positive integer nor null; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY.
8919
9515
  */
8920
- export const databaseHead = (options) => (options.client ?? client).head({
9516
+ export const databaseUpdateKey = (options) => (options.client ?? client).patch({
8921
9517
  security: [{
8922
9518
  key: 'database-bearerAuth',
8923
9519
  scheme: 'bearer',
8924
9520
  type: 'http'
8925
9521
  }],
8926
- url: '/database/v1/databases/{database_id}/rest/{table}',
8927
- ...options
9522
+ url: '/database/v1/databases/{database_id}/keys/{key}',
9523
+ ...options,
9524
+ headers: {
9525
+ 'Content-Type': 'application/json',
9526
+ ...options.headers
9527
+ }
8928
9528
  });
8929
9529
  /**
8930
- * Update rows
9530
+ * Set key
8931
9531
  *
8932
- * Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
9532
+ * Overwrite one key of a key-value database with a whole new value in a single transaction, creating it if absent; the previous value is dropped first and never merged, even when the type changes. To change only the TTL use databaseUpdateKey; to add to a counter or push onto a list use databaseExecuteCommand. type decides the shape of value: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}] with finite scores. Containers must not be empty, and hash fields and set members must be unique. ttl_ms omitted keeps the key's existing TTL, a positive integer sets a new one in milliseconds, null makes the key permanent. A value is at most 1 MiB and a key at most 1 KiB. Returns the stored key (first page for a container). Needs a read-write credential. Errors: 400 INVALID_PARAMS for an empty container, duplicate field or member, non-finite score or bad ttl_ms; 400 LIMIT_EXCEEDED for an oversized key or value; 503 CAPACITY when the database is full; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY for a read-only credential.
8933
9533
  */
8934
- export const databaseUpdate = (options) => (options.client ?? client).patch({
9534
+ export const databaseSetKey = (options) => (options.client ?? client).put({
8935
9535
  security: [{
8936
9536
  key: 'database-bearerAuth',
8937
9537
  scheme: 'bearer',
8938
9538
  type: 'http'
8939
9539
  }],
8940
- url: '/database/v1/databases/{database_id}/rest/{table}',
9540
+ url: '/database/v1/databases/{database_id}/keys/{key}',
8941
9541
  ...options,
8942
9542
  headers: {
8943
9543
  'Content-Type': 'application/json',
@@ -8945,19 +9545,17 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
8945
9545
  }
8946
9546
  });
8947
9547
  /**
8948
- * Insert rows
9548
+ * Execute command
8949
9549
  *
8950
- * Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
8951
- * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
8952
- * The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
9550
+ * Run one Redis command with Redis 7 semantics against a key-value database and get its reply; use it for what the key operations cannot do: counters (INCR), list and set operations, ranges (LRANGE, ZRANGE), scans (SCAN, HSCAN) and expiry commands. For one whole-value read or write use databaseGetKey / databaseSetKey; for existing Redis clients use the Upstash-compatible face under /redis. command is the command name followed by its arguments, every element a string, for example ["SET","k","v"] or ["LRANGE","queue","0","9"]. result is Redis's reply as plain JSON (integers, strings, arrays, null), never base64. Not supported: Lua scripting (EVAL), blocking commands, Pub/Sub and Streams. A value is at most 1 MiB, a key at most 1 KiB, a reply at most 8 MiB (read big collections in ranges with SCAN, HSCAN, LRANGE or ZRANGE) and the database at most 1 GiB. A read command needs a read credential; a write command, or a command that cannot be parsed, needs a read-write credential. Errors: 400 KV_COMMAND_ERROR when Redis rejects the command, with Redis's own text in message (for example WRONGTYPE Operation against a key holding the wrong kind of value or ERR unknown command); 400 INVALID_PARAMS for a missing or empty command; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY for a write on a read-only credential.
8953
9551
  */
8954
- export const databaseInsert = (options) => (options.client ?? client).post({
9552
+ export const databaseExecuteCommand = (options) => (options.client ?? client).post({
8955
9553
  security: [{
8956
9554
  key: 'database-bearerAuth',
8957
9555
  scheme: 'bearer',
8958
9556
  type: 'http'
8959
9557
  }],
8960
- url: '/database/v1/databases/{database_id}/rest/{table}',
9558
+ url: '/database/v1/databases/{database_id}/commands',
8961
9559
  ...options,
8962
9560
  headers: {
8963
9561
  'Content-Type': 'application/json',
@@ -9239,7 +9837,7 @@ export const devopsTestExecutionsGet = (options) => (options.client ?? client).g
9239
9837
  /**
9240
9838
  * Upload an external test report
9241
9839
  *
9242
- * 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.
9840
+ * 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.
9243
9841
  */
9244
9842
  export const devopsTestReportsUpload = (options) => (options.client ?? client).post({
9245
9843
  security: [{
@@ -9257,7 +9855,7 @@ export const devopsTestReportsUpload = (options) => (options.client ?? client).p
9257
9855
  /**
9258
9856
  * Retrieve the merge gate's test plan at a commit
9259
9857
  *
9260
- * 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.
9858
+ * 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.
9261
9859
  */
9262
9860
  export const devopsTestPlanGet = (options) => (options.client ?? client).get({
9263
9861
  security: [{
@@ -9271,7 +9869,7 @@ export const devopsTestPlanGet = (options) => (options.client ?? client).get({
9271
9869
  /**
9272
9870
  * List projects
9273
9871
  *
9274
- * 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.
9872
+ * 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.
9275
9873
  */
9276
9874
  export const devopsProjectsList = (options) => (options?.client ?? client).get({
9277
9875
  security: [{
@@ -9282,6 +9880,42 @@ export const devopsProjectsList = (options) => (options?.client ?? client).get({
9282
9880
  url: '/devops/v1/projects',
9283
9881
  ...options
9284
9882
  });
9883
+ /**
9884
+ * Create a project
9885
+ *
9886
+ * 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).
9887
+ */
9888
+ export const devopsProjectsCreate = (options) => (options.client ?? client).post({
9889
+ security: [{
9890
+ key: 'devops-bearerAuth',
9891
+ scheme: 'bearer',
9892
+ type: 'http'
9893
+ }],
9894
+ url: '/devops/v1/projects',
9895
+ ...options,
9896
+ headers: {
9897
+ 'Content-Type': 'application/json',
9898
+ ...options.headers
9899
+ }
9900
+ });
9901
+ /**
9902
+ * Create a project's default branch
9903
+ *
9904
+ * 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.
9905
+ */
9906
+ export const devopsProjectsInitializeDefaultBranch = (options) => (options.client ?? client).post({
9907
+ security: [{
9908
+ key: 'devops-bearerAuth',
9909
+ scheme: 'bearer',
9910
+ type: 'http'
9911
+ }],
9912
+ url: '/devops/v1/projects/{id}/default-branch:initialize',
9913
+ ...options,
9914
+ headers: {
9915
+ 'Content-Type': 'application/json',
9916
+ ...options.headers
9917
+ }
9918
+ });
9285
9919
  /**
9286
9920
  * Retrieve a project
9287
9921
  *
@@ -9381,7 +10015,7 @@ export const devopsReleasesAbandon = (options) => (options.client ?? client).pos
9381
10015
  /**
9382
10016
  * Create a promotion
9383
10017
  *
9384
- * 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`.
10018
+ * 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`.
9385
10019
  */
9386
10020
  export const devopsPromotionsCreate = (options) => (options.client ?? client).post({
9387
10021
  security: [{
@@ -9399,7 +10033,7 @@ export const devopsPromotionsCreate = (options) => (options.client ?? client).po
9399
10033
  /**
9400
10034
  * List promotions
9401
10035
  *
9402
- * 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.
10036
+ * 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.
9403
10037
  */
9404
10038
  export const devopsPromotionsList = (options) => (options.client ?? client).get({
9405
10039
  security: [{
@@ -9413,7 +10047,7 @@ export const devopsPromotionsList = (options) => (options.client ?? client).get(
9413
10047
  /**
9414
10048
  * Retrieve a promotion
9415
10049
  *
9416
- * 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).
10050
+ * 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).
9417
10051
  */
9418
10052
  export const devopsPromotionsGet = (options) => (options.client ?? client).get({
9419
10053
  security: [{
@@ -9463,7 +10097,7 @@ export const devopsPromotionsCancel = (options) => (options.client ?? client).po
9463
10097
  /**
9464
10098
  * Retry a promotion
9465
10099
  *
9466
- * Continue a promotion that stopped part-way, such as one in halted where some targets succeeded and others failed. The retry re-runs the targets that did not succeed and leaves the ones that did alone, so a partially deployed environment is completed rather than redeployed from the start. A promotion that is still running is refused, and so is one that already reached a terminal state; read the promotion first and retry only a halted or errored one. The retry is attributed to the credential that sends it and is recorded on the promotion.
10100
+ * Continue a promotion that stopped part-way: one in halted (some targets deployed, some failed, some never started) or one in failed. The answer is a NEW promotion whose plan names only the targets that did not reach the release, so a partially deployed environment is completed rather than redeployed from the start. A halted promotion is stopped first — its run is asked to cancel and the executor is read back until the run is no longer running — because a new plan that starts while the old run still deploys the same targets would deploy them twice; when the run will not stop, the call is refused with PROMOTION_RUN_STILL_RUNNING and creates nothing. Once that run is over the halt is closed as the partial deploy it is (the targets that really deployed move their checkpoints) and the new promotion is planned from those checkpoints. Any other state is refused with PROMOTION_NOT_RETRYABLE, whose message names the state and what to do instead: a promotion that is still deploying has nothing to continue (cancel it to stop it), and a succeeded, cancelled or superseded one has nothing left — promote the release again if this environment must take it. The retry is attributed to the credential that sends it and is recorded on the promotion.
9467
10101
  */
9468
10102
  export const devopsPromotionsRetry = (options) => (options.client ?? client).post({
9469
10103
  security: [{
@@ -9492,6 +10126,20 @@ export const devopsPromotionsConclude = (options) => (options.client ?? client).
9492
10126
  ...options.headers
9493
10127
  }
9494
10128
  });
10129
+ /**
10130
+ * Get the checkout credential of a running promotion
10131
+ *
10132
+ * 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.
10133
+ */
10134
+ export const devopsPromotionsCheckoutCredential = (options) => (options.client ?? client).post({
10135
+ security: [{
10136
+ key: 'devops-bearerAuth',
10137
+ scheme: 'bearer',
10138
+ type: 'http'
10139
+ }],
10140
+ url: '/devops/v1/promotions/{id}:checkoutCredential',
10141
+ ...options
10142
+ });
9495
10143
  /**
9496
10144
  * List a promotion's rollouts
9497
10145
  *
@@ -9569,7 +10217,7 @@ export const devopsEnvironmentsCheckpointsList = (options) => (options.client ??
9569
10217
  /**
9570
10218
  * Roll an environment back
9571
10219
  *
9572
- * 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.
10220
+ * 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.
9573
10221
  */
9574
10222
  export const devopsEnvironmentsRollback = (options) => (options.client ?? client).post({
9575
10223
  security: [{
@@ -9961,7 +10609,7 @@ export const devopsChangesGet = (options) => (options.client ?? client).get({
9961
10609
  /**
9962
10610
  * Abandon a change
9963
10611
  *
9964
- * Stop a change for good: it no longer moves forward and its stage becomes abandoned. reason is required and is kept with the change. Pull requests that were already merged are not undone — the system cleans them up, or a new change reverts them — so abandoning is a statement about the change, not a rollback of code. The id is the branch name and its slash must be percent-encoded in the path (feat%2Frun-page-v2). A change that is already abandoned is refused with INVALID_ARGUMENT, which is how a caller tells an earlier abandon apart from a call that had no effect.
10612
+ * Stop a change for good: it no longer moves forward and its stage becomes abandoned. reason is required and is kept with the change. Pull requests it has not merged are closed with it: each one is closed on GitHub with a note naming the change and this reason, so an abandoned change never leaves an open pull request behind for someone else to clean up — a change with no open pull request makes no GitHub call at all. That close happens BEFORE the change is marked, so an abandon that cannot close them is refused with GITHUB_UNAVAILABLE and nothing has changed; send it again. Pull requests that were already merged are not undone — the system cleans them up, or a new change reverts them — so abandoning is a statement about the change, not a rollback of code. The id is the branch name and its slash must be percent-encoded in the path (feat%2Frun-page-v2). Repeating the call on a change that is already abandoned answers the change as it stands instead of refusing it: the first abandon is the fact, and a caller that lost the answer gets it back.
9965
10613
  */
9966
10614
  export const devopsChangesAbandon = (options) => (options.client ?? client).post({
9967
10615
  security: [{
@@ -9997,7 +10645,7 @@ export const devopsChangesMarkLastSlice = (options) => (options.client ?? client
9997
10645
  /**
9998
10646
  * Open a change's pull request
9999
10647
  *
10000
- * Open the pull request for a change: its branch into the project's default branch, opened by DevOps's own GitHub App. A cloud workspace holds no GitHub credential, so this is how work pushed with the unit push becomes a pull request; `praxis devops change pr` calls it from the workspace. Push first: a branch with no commits beyond the default branch is refused with PULL_REQUEST_REFUSED and GitHub's words. A branch that already has an open pull request answers that one with created=false, so calling again is safe; when the call passes a title or a body, those fields are written onto that pull request (GitHub PATCH /pulls/{number}) and the answer says updated=true, while a field not passed is left as it is — which is how a wrong or missing description is corrected, and how the merge gate's exposure-declared check is re-evaluated from the new body. The pull request then appears on the change and runs its merge gate as usual. The id is the branch name and its slash must be percent-encoded in the path (fix%2Fexpired-links).
10648
+ * Open the pull request for a change: its branch into the project's default branch, opened by DevOps's own GitHub App. A cloud workspace holds no GitHub credential, so this is how work pushed with the unit push becomes a pull request; `praxis devops change pr` calls it from the workspace. Push first: a branch with no commits beyond the default branch is refused with PULL_REQUEST_REFUSED and GitHub's words. A branch that already has an open pull request answers that one with created=false, so calling again is safe; when the call passes a title or a body, those fields are written onto that pull request (GitHub PATCH /pulls/{number}) and the answer says updated=true, while a field not passed is left as it is — which is how a wrong or missing description is corrected, and how the merge gate's exposure-declared check is re-evaluated from the new body. Only an open pull request can be rewritten: once it is merged or closed its head branch is usually deleted with it, so a call that names a title or a body is refused with PULL_REQUEST_NOT_OPEN, naming that pull request and the branch, instead of trying to open a second one. The pull request then appears on the change and runs its merge gate as usual. The id is the branch name; give it as it comes back (fix/expired-links) — the SDK and the CLI encode the slash themselves, and only a hand-written HTTP request sends fix%2Fexpired-links.
10001
10649
  */
10002
10650
  export const devopsChangesOpenPullRequest = (options) => (options.client ?? client).post({
10003
10651
  security: [{
@@ -10043,7 +10691,7 @@ export const devopsPullRequestsList = (options) => (options.client ?? client).ge
10043
10691
  /**
10044
10692
  * Retrieve a pull request
10045
10693
  *
10046
- * 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.
10694
+ * 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.
10047
10695
  */
10048
10696
  export const devopsPullRequestsGet = (options) => (options.client ?? client).get({
10049
10697
  security: [{
@@ -10057,7 +10705,7 @@ export const devopsPullRequestsGet = (options) => (options.client ?? client).get
10057
10705
  /**
10058
10706
  * Decide a pull request's merge gate again
10059
10707
  *
10060
- * 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.
10708
+ * 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.
10061
10709
  */
10062
10710
  export const devopsPullRequestsRerunGate = (options) => (options.client ?? client).post({
10063
10711
  security: [{
@@ -10071,7 +10719,7 @@ export const devopsPullRequestsRerunGate = (options) => (options.client ?? clien
10071
10719
  /**
10072
10720
  * Merge a pull request through its gate
10073
10721
  *
10074
- * 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.
10722
+ * 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.
10075
10723
  */
10076
10724
  export const devopsPullRequestsMerge = (options) => (options.client ?? client).post({
10077
10725
  security: [{
@@ -10087,9 +10735,9 @@ export const devopsPullRequestsMerge = (options) => (options.client ?? client).p
10087
10735
  }
10088
10736
  });
10089
10737
  /**
10090
- * Record a gatekeeper's verdict on a direct change
10738
+ * Record a review verdict on a pull request
10091
10739
  *
10092
- * 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.
10740
+ * 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.
10093
10741
  */
10094
10742
  export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? client).post({
10095
10743
  security: [{
@@ -10104,6 +10752,42 @@ export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? c
10104
10752
  ...options.headers
10105
10753
  }
10106
10754
  });
10755
+ /**
10756
+ * Close a pull request without merging it
10757
+ *
10758
+ * End a pull request that will never land, without abandoning the change it belongs to. DevOps closes it on GitHub through the project's own App installation, after writing this reason on the pull request, so it leaves the review queue instead of waiting for a merge that is not coming and whoever finds it later sees who ended it and why. Use it when one slice of a change is dropped while the change continues; abandoning the CHANGE closes its unmerged pull requests on its own and needs no second call. Only an open pull request can be closed: a merged one is refused with PULL_REQUEST_NOT_OPEN, because closing does not undo a merge and GitHub will not move a merged pull request back to closed, and one that is already closed answers itself unchanged, so repeating the call is safe. A pull request GitHub no longer has open is refused the same way — nothing was closed, and the platform's record catches up with GitHub on its next delivery.
10759
+ */
10760
+ export const devopsPullRequestsClose = (options) => (options.client ?? client).post({
10761
+ security: [{
10762
+ key: 'devops-bearerAuth',
10763
+ scheme: 'bearer',
10764
+ type: 'http'
10765
+ }],
10766
+ url: '/devops/v1/pull-requests/{id}:close',
10767
+ ...options,
10768
+ headers: {
10769
+ 'Content-Type': 'application/json',
10770
+ ...options.headers
10771
+ }
10772
+ });
10773
+ /**
10774
+ * Review a pull request on our own Git
10775
+ *
10776
+ * 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.
10777
+ */
10778
+ export const devopsPullRequestsReviewsCreate = (options) => (options.client ?? client).post({
10779
+ security: [{
10780
+ key: 'devops-bearerAuth',
10781
+ scheme: 'bearer',
10782
+ type: 'http'
10783
+ }],
10784
+ url: '/devops/v1/pull-requests/{id}/reviews',
10785
+ ...options,
10786
+ headers: {
10787
+ 'Content-Type': 'application/json',
10788
+ ...options.headers
10789
+ }
10790
+ });
10107
10791
  /**
10108
10792
  * List connections
10109
10793
  *
@@ -10249,7 +10933,7 @@ export const devopsTestRunsRetryFailed = (options) => (options.client ?? client)
10249
10933
  /**
10250
10934
  * List a project's stage workspaces
10251
10935
  *
10252
- * 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.
10936
+ * 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.
10253
10937
  */
10254
10938
  export const devopsWorkspacesList = (options) => (options.client ?? client).get({
10255
10939
  security: [{
@@ -10324,6 +11008,20 @@ export const devopsUnitsCreate = (options) => (options.client ?? client).post({
10324
11008
  ...options.headers
10325
11009
  }
10326
11010
  });
11011
+ /**
11012
+ * List a project's cleanup ledger
11013
+ *
11014
+ * 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.
11015
+ */
11016
+ export const devopsCleanupsList = (options) => (options.client ?? client).get({
11017
+ security: [{
11018
+ key: 'devops-bearerAuth',
11019
+ scheme: 'bearer',
11020
+ type: 'http'
11021
+ }],
11022
+ url: '/devops/v1/projects/{project}/cleanups',
11023
+ ...options
11024
+ });
10327
11025
  /**
10328
11026
  * Delete a unit
10329
11027
  *
@@ -11195,7 +11893,7 @@ export const mediaBatchAssets = (options) => (options.client ?? client).post({
11195
11893
  /**
11196
11894
  * Get job
11197
11895
  *
11198
- * Read a generation, edit or batch Job; poll it after every generation or edit until status is terminal, every few seconds (an image takes seconds, a video a few minutes; an edit of a video took about four). status: queued is waiting (queue_reason says why, queue_position its place in line); in_progress or running is generating; completed means every output succeeded; completed_with_errors means some did; failed means none did; canceled or cancelled means it was stopped. Read the result output by output. A succeeded entry of outputs[] has asset_id and viewer_url, because the output is already a library asset: give viewer_url to the person. Its seed is present only when the model reports one (Doubao Seedance 2.x neither takes nor reports a seed); where present, send it back as seed with an adjusted prompt to vary that take. A failed entry has its reason in the failures[] entry with the same index: code is the error to branch on, for example CONTENT_REJECTED when the model's moderation refused an input or the result (a real human face in a reference is one cause; change the prompt or the reference, because retrying unchanged fails again) or GENERATION_FAILED when the model call failed (retrying may succeed); detail_code is the model's finer reason and model_request_id the model call to trace. usage is what the job has cost so far and is final at a terminal status; failed and refused outputs are not charged, so usage counts succeeded outputs only, and it is absent when nothing was charged.
11896
+ * Read a generation, edit or batch Job; poll it after every generation or edit until status is terminal, every few seconds (an image takes seconds, a video a few minutes; an edit of a video took about four). status: queued is waiting (queue_reason says why, queue_position its place in line; provider_queue means the model’s supplier holds the task in its own queue, which can take hours when it is busy — the job keeps waiting for as long as the supplier keeps the task, and only past the supplier’s own task lifetime fails with detail_code UPSTREAM_WAIT_EXCEEDED, uncharged); in_progress or running is generating; completed means every output succeeded; completed_with_errors means some did; failed means none did; canceled or cancelled means it was stopped. Read the result output by output. A succeeded entry of outputs[] has asset_id and viewer_url, because the output is already a library asset: give viewer_url to the person. Its seed is present only when the model reports one (Doubao Seedance 2.x neither takes nor reports a seed); where present, send it back as seed with an adjusted prompt to vary that take. A failed entry has its reason in the failures[] entry with the same index: code is the error to branch on, for example CONTENT_REJECTED when the model's moderation refused an input or the result (a real human face in a reference is one cause; change the prompt or the reference, because retrying unchanged fails again) or GENERATION_FAILED when the model call failed (retrying may succeed); detail_code is the model's finer reason and model_request_id the model call to trace. usage is what the job has cost so far and is final at a terminal status; failed and refused outputs are not charged, so usage counts succeeded outputs only, and it is absent when nothing was charged.
11199
11897
  */
11200
11898
  export const mediaGetJob = (options) => (options.client ?? client).get({
11201
11899
  security: [{
@@ -11323,7 +12021,7 @@ export const mediaGenerateVideo = (options) => (options.client ?? client).post({
11323
12021
  /**
11324
12022
  * Edit asset
11325
12023
  *
11326
- * Change an existing asset and store the result as a new asset; the source is never overwritten. {library_id} also accepts default, the organization’s default library. The body is operation (its type selects the edit and carries that edit’s own fields) plus optional model, asset_folder, understanding and idempotency_key. Edits by material: on an image, variations (near copies of a take you like), inpaint (mask, a PNG File id beginning with file-, whose transparent area is replaced by what prompt describes), erase, replace_object, recolor, replace_background, remove_background and upscale; on a video, upscale, reframe, redact, trim, mute, crop, erase (removes burned-in subtitles, captions and corner watermarks, found automatically or inside the boxes given), replace_person (puts the person of an image of the same library in place of the video’s person) and remove_background; on a recording or a video’s audio, enhance_voice; and to_video, frame and resynthesize on the material each takes. Any other type answers OPERATION_NOT_SUPPORTED, and an edit that does not fit the source’s material answers REFERENCE_TYPE_MISMATCH. Video and audio edits take their model from the platform catalogue (override with operation.model); an edit whose catalogue is empty answers OPERATION_NOT_SUPPORTED, 尚未上架. remove_background on a video makes a portrait matte: output mask is a small black-and-white video to use as a Cut track mask (the choice for compositing), output alpha (the default) a transparent ProRes 4444 file of about 870 MB per 15 s of 1080p, for when the transparent file itself is the deliverable; pick model from types.matting.models of the generation capabilities. output and model on an image source answer INVALID_PARAMS. The new asset records the source in derived_from; assets.lineage reads the whole edit chain. Charges are at the model API prices (video and audio edits per second of input) and appear in the Job’s usage; repeating the same edit of the same source answers the asset already made instead of paying again. The response is 202 with a queued Job whose source_asset_id is the edited asset; poll GET /media/v1/libraries/{library_id}/jobs/{job_id}, give the output’s viewer_url to the person and tell them usage.
12024
+ * Change an existing asset and store the result as a new asset; the source is never overwritten. {library_id} also accepts default, the organization’s default library. The body is operation (its type selects the edit and carries that edit’s own fields) plus optional model, asset_folder, understanding and idempotency_key. Edits by material: on an image, variations (near copies of a take you like), inpaint (mask, a PNG File id beginning with file-, whose transparent area is replaced by what prompt describes), erase, replace_object, recolor, replace_background, remove_background, upscale and talking_avatar (the portrait speaks a recording of the same library); on a video, upscale, reframe, redact, trim, mute, crop, extract_audio (pulls the sound out of a video as its own audio asset), erase (removes burned-in subtitles, captions and corner watermarks, found automatically or inside the boxes given), replace_person (puts the person of an image of the same library in place of the video’s person), lip_sync (re-syncs the lips to a recording of the same library), animate_person (an image of the same library performs the video’s motion), edit_video (the video changed by a one-line instruction, optionally guided by one image of the same library) and remove_background; on a recording or a video’s audio, enhance_voice; and to_video, frame and resynthesize on the material each takes. Any other type answers OPERATION_NOT_SUPPORTED, and an edit that does not fit the source’s material answers REFERENCE_TYPE_MISMATCH. Video and audio edits take their model from the platform catalogue (override with operation.model; extract_audio takes no model, it has exactly one function); an edit whose catalogue is empty answers OPERATION_NOT_SUPPORTED, 尚未上架. remove_background on a video makes a portrait matte: output mask is a small black-and-white video to use as a Cut track mask (the choice for compositing), output alpha (the default) a transparent ProRes 4444 file of about 870 MB per 15 s of 1080p, for when the transparent file itself is the deliverable; pick model from types.matting.models of the generation capabilities. output and model on an image source answer INVALID_PARAMS. The new asset records the source in derived_from; assets.lineage reads the whole edit chain. Charges are at the model API prices (video and audio edits per second of input) and appear in the Job’s usage; repeating the same edit of the same source answers the asset already made instead of paying again. The response is 202 with a queued Job whose source_asset_id is the edited asset; poll GET /media/v1/libraries/{library_id}/jobs/{job_id}, give the output’s viewer_url to the person and tell them usage.
11327
12025
  */
11328
12026
  export const mediaEditAsset = (options) => (options.client ?? client).post({
11329
12027
  security: [{
@@ -11341,7 +12039,7 @@ export const mediaEditAsset = (options) => (options.client ?? client).post({
11341
12039
  /**
11342
12040
  * Create speech
11343
12041
  *
11344
- * Synthesise speech from text and store the recording straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still synthesise. input is the text to speak. voice is optional and may be omitted, in which case the model’s default voice is used; when it is given it must be one of the voices of the model being used — read them from the types.speech list of GET /media/v1/generation/capabilities, which gives each voice an id, a name, a gender, a language and a style, or pass a voice material id of this same library — and a voice that is neither is refused with INVALID_PARAMS in the voice field before any job exists, so a wrong name is free to try but reading the capabilities first is free without trying. Do not use OpenAI voice names such as alloy or aura: they are not valid here. speed is passed to the provider unchanged, and instructions and language are refused with OPERATION_NOT_SUPPORTED in this release. Cloning a voice from recordings is not available yet. The provider caps one request at a short stretch of text, so a long input is cut into segments at paragraph and sentence boundaries and synthesised in order, then joined into the single recording the library receives: nothing is spoken twice and nothing is dropped. Because the segments are joined byte for byte, a multi-segment input accepts only response_format mp3 (the default) or pcm; opus is available for a single-segment input. A speech job has one result however many segments it took. Synthesis is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals, the sum over every segment) and the recording carries it in provenance.cost; a request refused before it starts costs nothing. When the job is done, tell the person the usage amount and give them the output’s viewer_url. The response is 202 with a queued Job whose type is speech and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced asset from the library — the recording carries material_type audio, audio_role voice, ai_generated true, and provenance naming this job, the text spoken and the model. Send Idempotency-Key, or idempotency_key in the body, to retry without synthesising and charging twice. Example: POST /media/v1/libraries/default/audio/speech with {"input":"A red kite above a calm sea at sunrise."}, or with {"input":"A red kite above a calm sea at sunrise.","voice":"zh_female_wenroumama_uranus_bigtts"} for a gentle female voice.
12042
+ * Synthesise speech from text and store the recording straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still synthesise. input is the text to speak. voice is optional and may be omitted, in which case the model’s default voice is used; when it is given it must be one of the voices of the model being used — read them from the types.speech list of GET /media/v1/generation/capabilities, which gives each voice an id, a name, a gender, a language and a style, or pass a voice material id of this same library — and a voice that is neither is refused with INVALID_PARAMS in the voice field before any job exists, so a wrong name is free to try but reading the capabilities first is free without trying. Do not use OpenAI voice names such as alloy or aura: they are not valid here. tier chooses which speech model speaks, instead of naming one: economy is the cheapest and fastest, balanced the best value and quality the best result, and the tier picks among the models that carry the voice you name — a voice a model does not offer is never selected and then refused. model is the transition-window parameter and names the same choice, so send only one of the two; omitting both speaks with the library’s speech model, or by its default tier once the platform turns the media-tier-defaults switch on. speed is passed to the provider unchanged, and instructions and language are refused with OPERATION_NOT_SUPPORTED in this release. Cloning a voice from recordings is not available yet. The provider caps one request at a short stretch of text, so a long input is cut into segments at paragraph and sentence boundaries and synthesised in order, then joined into the single recording the library receives: nothing is spoken twice and nothing is dropped. Because the segments are joined byte for byte, a multi-segment input accepts only response_format mp3 (the default) or pcm; opus is available for a single-segment input. A speech job has one result however many segments it took. Synthesis is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals, the sum over every segment) and the recording carries it in provenance.cost; a request refused before it starts costs nothing. When the job is done, tell the person the usage amount and give them the output’s viewer_url. The response is 202 with a queued Job whose type is speech and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced asset from the library — the recording carries material_type audio, audio_role voice, ai_generated true, and provenance naming this job, the text spoken and the model. Send Idempotency-Key, or idempotency_key in the body, to retry without synthesising and charging twice. Example: POST /media/v1/libraries/default/audio/speech with {"input":"A red kite above a calm sea at sunrise."}, or with {"input":"A red kite above a calm sea at sunrise.","voice":"zh_female_wenroumama_uranus_bigtts"} for a gentle female voice.
11345
12043
  */
11346
12044
  export const mediaCreateSpeech = (options) => (options.client ?? client).post({
11347
12045
  security: [{
@@ -11526,6 +12224,42 @@ export const mediaRequestHlsRenditions = (options) => (options.client ?? client)
11526
12224
  ...options.headers
11527
12225
  }
11528
12226
  });
12227
+ /**
12228
+ * Create voice
12229
+ *
12230
+ * Create a voice for this library. Send exactly one of the two shapes: consent_id with samples (a real person’s recordings, a consented voice, cloned before it can speak) or design_asset_id (a preview the voice-design run produced in this library, a generated voice). A generated voice is not cloned: it is ready when the call answers, its job already completed, and it speaks only through the speech model recorded on it, so speech naming another model is refused with INVALID_PARAMS. Each preview builds at most one voice, and building one gives back the design’s other previews, which then cannot be used. Sending both shapes, or neither, is refused with INVALID_PARAMS, and origin is written by the platform only. Answers 202 with a job.
12231
+ */
12232
+ export const mediaCreateVoice = (options) => (options.client ?? client).post({
12233
+ security: [{
12234
+ key: 'media-BearerAuth',
12235
+ scheme: 'bearer',
12236
+ type: 'http'
12237
+ }],
12238
+ url: '/media/v1/libraries/{library_id}/voices',
12239
+ ...options,
12240
+ headers: {
12241
+ 'Content-Type': 'application/json',
12242
+ ...options.headers
12243
+ }
12244
+ });
12245
+ /**
12246
+ * Design a voice
12247
+ *
12248
+ * Design a voice from a text description. The model makes count preview recordings (default 3), each stored in this library as an audio asset; listen, then create a voice whose design_asset_id names the preview you chose. Send description (1 to 500 characters), preview_text (15 to 200 characters, the line each preview speaks), language (zh or en) and optionally count (1 to 3). A description that fails review fails the slot with CONTENT_REJECTED and is never retried, so changing the words is the fix. Answers 202 with a job to poll.
12249
+ */
12250
+ export const mediaDesignVoice = (options) => (options.client ?? client).post({
12251
+ security: [{
12252
+ key: 'media-BearerAuth',
12253
+ scheme: 'bearer',
12254
+ type: 'http'
12255
+ }],
12256
+ url: '/media/v1/libraries/{library_id}/voices/designs',
12257
+ ...options,
12258
+ headers: {
12259
+ 'Content-Type': 'application/json',
12260
+ ...options.headers
12261
+ }
12262
+ });
11529
12263
  /**
11530
12264
  * List types
11531
12265
  *
@@ -11785,7 +12519,7 @@ export const registryRepositoriesList = (options) => (options?.client ?? client)
11785
12519
  /**
11786
12520
  * Create repository
11787
12521
  *
11788
- * 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。
12522
+ * 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。format 默认 oci,库里放技能和插件;要放 git 仓库就传 format=git,建库后 format 不能改。git 库需要这个组织已开放 git 功能,否则返回 409。
11789
12523
  */
11790
12524
  export const registryRepositoriesCreate = (options) => (options.client ?? client).post({
11791
12525
  security: [{
@@ -11861,12 +12595,11 @@ export const registryRepositoriesPackagesList = (options) => (options.client ??
11861
12595
  ...options
11862
12596
  });
11863
12597
  /**
11864
- * Publish a package
12598
+ * Create a package
11865
12599
  *
11866
- * 把一个新包发布进这个库,一次调用建立包并上传它的第一个版本。发布内容是 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 发布。
12600
+ * 在一个库里建新包,按库的 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 发布。
11867
12601
  */
11868
12602
  export const registryRepositoriesPackagesCreate = (options) => (options.client ?? client).post({
11869
- ...formDataBodySerializer,
11870
12603
  security: [{
11871
12604
  key: 'registry-bearerAuth',
11872
12605
  scheme: 'bearer',
@@ -11875,14 +12608,14 @@ export const registryRepositoriesPackagesCreate = (options) => (options.client ?
11875
12608
  url: '/registry/v1/repositories/{repository_id}/packages',
11876
12609
  ...options,
11877
12610
  headers: {
11878
- 'Content-Type': null,
12611
+ 'Content-Type': 'application/json',
11879
12612
  ...options.headers
11880
12613
  }
11881
12614
  });
11882
12615
  /**
11883
12616
  * Retrieve package
11884
12617
  *
11885
- * 读一个包的元数据:种类、所属库、当前 latest_version、作者、标签和累计下载量。package_id 来自 packages.list 或 packages.create;另一个组织或不存在都返回 404。
12618
+ * 读一个包的元数据:种类、所属库、当前 latest_version、作者、标签和累计下载量。package_id 来自 packages.list 或 packages.create;另一个组织或不存在都返回 404。软删期间这个包一律 404,恢复后才重新出现。
11886
12619
  */
11887
12620
  export const registryPackagesRetrieve = (options) => (options.client ?? client).get({
11888
12621
  security: [{
@@ -11926,6 +12659,136 @@ export const registryPackagesVersionsCreate = (options) => (options.client ?? cl
11926
12659
  ...options.headers
11927
12660
  }
11928
12661
  });
12662
+ /**
12663
+ * Create a git credential
12664
+ *
12665
+ * 给一个 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 可以多次取,每次是一个新凭据,互不影响。
12666
+ */
12667
+ export const registryPackagesGitCredentialCreate = (options) => (options.client ?? client).post({
12668
+ security: [{
12669
+ key: 'registry-bearerAuth',
12670
+ scheme: 'bearer',
12671
+ type: 'http'
12672
+ }],
12673
+ url: '/registry/v1/packages/{package_id}/git-credential',
12674
+ ...options,
12675
+ headers: {
12676
+ 'Content-Type': 'application/json',
12677
+ ...options.headers
12678
+ }
12679
+ });
12680
+ /**
12681
+ * List commits
12682
+ *
12683
+ * 列出一个 git 包的提交历史,最新的在前。ref 不给就是包的默认分支;limit 与 offset 分页,has_more 为 true 表示还有下一页。只读:提交只能通过 git 协议推送(clone 地址在包的 clone_url)。OCI 包没有 git 读接口,返回 404。
12684
+ */
12685
+ export const registryGitLog = (options) => (options.client ?? client).get({
12686
+ security: [{
12687
+ key: 'registry-bearerAuth',
12688
+ scheme: 'bearer',
12689
+ type: 'http'
12690
+ }],
12691
+ url: '/registry/v1/packages/{package_id}/git/log',
12692
+ ...options
12693
+ });
12694
+ /**
12695
+ * Read a commit
12696
+ *
12697
+ * 按对象 id 读一个提交(完整 sha,不解析缩写)。返回提交信息、作者、提交时间与父提交;changed_files=true 时再返回它相对第一个父提交改了哪些文件(根提交的全部文件算新增),文件列表被上限截断时 changed_files_truncated 为 true。仓库里没有这个对象返回 404。
12698
+ */
12699
+ export const registryGitCommitsRetrieve = (options) => (options.client ?? client).get({
12700
+ security: [{
12701
+ key: 'registry-bearerAuth',
12702
+ scheme: 'bearer',
12703
+ type: 'http'
12704
+ }],
12705
+ url: '/registry/v1/packages/{package_id}/git/commits/{sha}',
12706
+ ...options
12707
+ });
12708
+ /**
12709
+ * List a tree
12710
+ *
12711
+ * 读一个树对象(或一个提交的根树)的条目:名字、类型(blob / tree / commit)、模式、对象 id,以及已知时的大小。只列这一层,不递归。
12712
+ */
12713
+ export const registryGitTreesRetrieve = (options) => (options.client ?? client).get({
12714
+ security: [{
12715
+ key: 'registry-bearerAuth',
12716
+ scheme: 'bearer',
12717
+ type: 'http'
12718
+ }],
12719
+ url: '/registry/v1/packages/{package_id}/git/trees/{sha}',
12720
+ ...options
12721
+ });
12722
+ /**
12723
+ * List branches and tags
12724
+ *
12725
+ * 列出一个 git 包的分支和标签,按名字排序;prefix 只取 refs/heads/(分支)或 refs/tags/(标签),不给就两者都列。page 从 1 起,size 1 到 500,默认 100;has_more 为 true 表示还有下一页。带注解的标签返回它指向的提交 id,不是标签对象的 id。想把一个名字换成提交 id 用 git/resolve,不要自己在这个列表里找。只读;OCI 包返回 404。
12726
+ */
12727
+ export const registryGitRefs = (options) => (options.client ?? client).get({
12728
+ security: [{
12729
+ key: 'registry-bearerAuth',
12730
+ scheme: 'bearer',
12731
+ type: 'http'
12732
+ }],
12733
+ url: '/registry/v1/packages/{package_id}/git/refs',
12734
+ ...options
12735
+ });
12736
+ /**
12737
+ * Resolve a ref
12738
+ *
12739
+ * 把一个引用换成它指向的提交 id:ref 可以是分支名、标签名、refs/… 全名、HEAD 或完整对象 id(40 或 64 位十六进制,缩写不解析)。名字既是标签又是分支时取标签。完整对象 id 只在仓库里真有这个提交时才返回。仓库没有这个引用或提交返回 404(GIT_OBJECT_NOT_FOUND),不会返回空值。要比较两个引用用 git/compare。
12740
+ */
12741
+ export const registryGitResolve = (options) => (options.client ?? client).get({
12742
+ security: [{
12743
+ key: 'registry-bearerAuth',
12744
+ scheme: 'bearer',
12745
+ type: 'http'
12746
+ }],
12747
+ url: '/registry/v1/packages/{package_id}/git/resolve',
12748
+ ...options
12749
+ });
12750
+ /**
12751
+ * Compare two refs
12752
+ *
12753
+ * 比较 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。只读。
12754
+ */
12755
+ export const registryGitCompare = (options) => (options.client ?? client).get({
12756
+ security: [{
12757
+ key: 'registry-bearerAuth',
12758
+ scheme: 'bearer',
12759
+ type: 'http'
12760
+ }],
12761
+ url: '/registry/v1/packages/{package_id}/git/compare',
12762
+ ...options
12763
+ });
12764
+ /**
12765
+ * List a tree recursively
12766
+ *
12767
+ * 读一个提交(或树对象)下的全部条目,递归,每个条目用相对根的完整路径命名,目录和子模块也是条目(子模块不展开)。适合要拿到整个仓库文件清单的场景(例如 DevOps 的构建判断);只想看一个目录用 git/trees/{sha}。相同的子树只读一次。条目上限 20000、树读取上限 1000 次,撞到上限时 truncated 为 true、entries 只是前一部分,不要当作全部。sha 通常来自 git/resolve。仓库里没有这个对象返回 404。只读。
12768
+ */
12769
+ export const registryGitTreesRecursive = (options) => (options.client ?? client).get({
12770
+ security: [{
12771
+ key: 'registry-bearerAuth',
12772
+ scheme: 'bearer',
12773
+ type: 'http'
12774
+ }],
12775
+ url: '/registry/v1/packages/{package_id}/git/trees/{sha}/recursive',
12776
+ ...options
12777
+ });
12778
+ /**
12779
+ * Download a file from a ref
12780
+ *
12781
+ * 按引用读一个文件的原始字节,边读边发(流式),没有大小上限。path 是仓库内相对路径,可以含斜杠;ref 不给就是默认分支。路径不是文件或引用不存在返回 404。
12782
+ */
12783
+ export const registryGitFilesRetrieve = (options) => (options.client ?? client).get({
12784
+ security: [{
12785
+ key: 'registry-bearerAuth',
12786
+ scheme: 'bearer',
12787
+ type: 'http'
12788
+ }],
12789
+ url: '/registry/v1/packages/{package_id}/git/files/{path}',
12790
+ ...options
12791
+ });
11929
12792
  /**
11930
12793
  * List version contents
11931
12794
  *
@@ -12087,7 +12950,7 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
12087
12950
  /**
12088
12951
  * Create sandbox (v2)
12089
12952
  *
12090
- * Create a sandbox from a template. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, cannot be snapshotted, deleted when it ends; for jobs such as transcodes, scripts and builds) or ephemeral: false for a persistent one (pauses and resumes, snapshots, mounts volumes, kept after it stops; for long-lived computers). Leaving ephemeral out returns INVALID_PARAMS. autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention and volumes belong to persistent sandboxes and need ephemeral: false. Choose persistent only for long-lived computers. On the E2B-compatible face autoPause is the declaration: true is persistent, false or absent is ephemeral and ends at its timeout. Responses carry ephemeral. When a sandbox's machine has ended (timeout, kill, retention, provider loss), reaching it returns SANDBOX_EXPIRED (410) with terminationReason in the message: its files are gone, create a new sandbox. To keep results, declare outputs: [{ path }] on the own face (up to eight absolute paths, a directory or a file): when the sandbox ends for any reason except provider loss or a failed start, each path is packed as .tar.gz and stored in File, and the killed event of GET /sandbox/v1/events/sandboxes/{sandboxID} lists each fileId or the reason it was not kept. Paths not declared are not kept. The E2B face refuses outputs.
12953
+ * Create a sandbox from a template. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, cannot be snapshotted, deleted when it ends; for jobs such as transcodes, scripts and builds) or ephemeral: false for a persistent one (pauses and resumes, snapshots, mounts volumes, kept after it stops; for long-lived computers). Leaving ephemeral out returns INVALID_PARAMS. autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention and volumes belong to persistent sandboxes and need ephemeral: false. Choose persistent only for long-lived computers. On the E2B-compatible face autoPause is the declaration: true is persistent, false or absent is ephemeral and ends at its timeout. Responses carry ephemeral. When a sandbox's machine has ended (timeout, kill, retention, provider loss), reaching it returns SANDBOX_EXPIRED (410) with terminationReason in the message: its files are gone, create a new sandbox. To keep results, declare outputs: [{ path }] on the own face (up to eight absolute paths, a directory or a file): when the sandbox ends for any reason except provider loss or a failed start, each path is packed as .tar.gz and stored in File, and the killed event of GET /sandbox/v1/events/sandboxes/{sandboxID} lists each fileId or the reason it was not kept. Paths not declared are not kept. The E2B face refuses outputs. On the own face an android phone accepts waitForReady: true, an own-face-only option: the create then waits until the phone program has connected (state running) or 55 seconds have passed since the request arrived (the vendor create itself takes about 48 s, so this is often not enough), and answers with the state it reached — a timeout is not an error; omit it (the default) and the create answers at once, before the phone connects, with state starting or booting, which you follow with the detail read or the act socket.
12091
12954
  */
12092
12955
  export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
12093
12956
  security: [
@@ -13183,7 +14046,7 @@ export const shareListPermissions = (options) => (options?.client ?? client).get
13183
14046
  /**
13184
14047
  * Create share
13185
14048
  *
13186
- * Make one file readable by anyone holding a link, before sending the link to a person or embedding it. Name the object as resource {type, id}, with the file id from the File API. The response is 201 and is the only time link.web_url is returned; store it, because later reads omit it and a lost address means creating another share (the old one keeps working until you delete it). The link is anonymous and read-only. A type other than file answers 400 RESOURCE_TYPE_UNSUPPORTED, and a file that is missing or outside your organization answers 404 RESOURCE_NOT_FOUND.
14049
+ * Make one object readable by anyone holding a link, before sending the link to a person or embedding it. Name the object as resource {type, id} — a file id from the File API, a canvas id, a media asset's library_id/asset_id, or an agent id (agent_...) of a service agent whose owner turned share links on. The response is 201 and is the only time link.web_url is returned; store it, because later reads omit it and a lost address means creating another share (the old one keeps working until you delete it). Opening a file or media link signs a short-lived read address; opening a canvas link shows a snapshot rendered at that moment; opening an agent link starts a Hosted conversation with that agent as the visitor, so each browser keeps its own history. The link is anonymous, and for every type so far read-only. A type that cannot be shared answers 400 RESOURCE_TYPE_UNSUPPORTED; an agent whose share links are switched off answers 400 RESOURCE_NOT_SHAREABLE and its owner turns them on in the agent's embed settings (share_links), which also requires the agent to have a short number; an object that is missing or outside your organization answers 404 RESOURCE_NOT_FOUND.
13187
14050
  */
13188
14051
  export const shareCreatePermission = (options) => (options.client ?? client).post({
13189
14052
  security: [{
@@ -14833,7 +15696,7 @@ export const vaultListSecrets = (options) => (options.client ?? client).get({
14833
15696
  /**
14834
15697
  * Create secret
14835
15698
  *
14836
- * Store a manually supplied token in an active vault. Omit allowed_hosts for name-based resolution only; host-based redemption never matches an empty host list. Unlike Anthropic credentials, this native operation takes name and value directly, with optional allowed_hosts and creates only static secrets; use praxis.vault.authorizations.create for OAuth. Its name must be unused by any non-archived secret in that vault; the response contains metadata but never the supplied value. Application praxis_vault_ref bindings declare vault_id and secret (the secret name), but currently return 501; do not copy the value into a plain-text binding or metadata as a substitute.
15699
+ * Store a manually supplied token in an active vault. Declare allowed_hosts (1–16 domains) to let the value be redeemed for those destinations; omit it to store an empty list, which name-based resolution still returns but no destination can redeem, and which a service agent's session environment never receives either way. MCP credential matching reads the same declarations, so a `*.` entry covers subdomains there too. Unlike Anthropic credentials, this native operation takes name and value directly and creates only static secrets; use praxis.vault.authorizations.create for OAuth. Its name must be unused by any non-archived secret in that vault; the response contains metadata but never the supplied value. Application praxis_vault_ref bindings declare vault_id and secret (the secret name), but currently return 501; do not copy the value into a plain-text binding or metadata as a substitute.
14837
15700
  */
14838
15701
  export const vaultCreateSecret = (options) => (options.client ?? client).post({
14839
15702
  security: [{
@@ -14851,7 +15714,7 @@ export const vaultCreateSecret = (options) => (options.client ?? client).post({
14851
15714
  /**
14852
15715
  * Import secrets
14853
15716
  *
14854
- * Import lines or dotenv text into an active vault, reporting success or failure for each entry. Existing names have their values replaced; their hosts change only when that line supplies allowed_hosts. Shared hosts apply only to newly created secrets; if neither shared nor per-line hosts are supplied, new secrets use an empty host list for name-based resolution only.
15717
+ * Import lines or dotenv text into an active vault, reporting success or failure for each entry. Existing names have their values replaced; their hosts change only when that line supplies allowed_hosts. Shared hosts apply only to newly created secrets; if neither shared nor per-line hosts are supplied, new secrets get an empty host list, which name-based resolution still returns but no destination can redeem. Imported entries carry the same host rules as Create secret, and a service agent's session environment never receives a credential that declares hosts.
14855
15718
  */
14856
15719
  export const vaultImportSecrets = (options) => (options.client ?? client).post({
14857
15720
  security: [{
@@ -14975,7 +15838,7 @@ export const vaultListTemplates = (options) => (options?.client ?? client).get({
14975
15838
  /**
14976
15839
  * Create authorization
14977
15840
  *
14978
- * 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.
15841
+ * 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.
14979
15842
  */
14980
15843
  export const vaultCreateAuthorization = (options) => (options.client ?? client).post({
14981
15844
  security: [{