@deepraxis/sdk 0.1.1-dev.0a48184 → 0.1.1-dev.0b2b6b3

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.
@@ -4,7 +4,7 @@ import { client } from './client.gen.js';
4
4
  /**
5
5
  * Read your conversation with an agent
6
6
  *
7
- * Read your conversation with a personal or general agent: the events of your own main session with that agent, the same page sessions.events.list returns — same query parameters, same data + next_page envelope, same event shapes. {agent_id} takes the agent_… id, the eight character identity number or the handle; a service or assume agent answers 400. Use it to collect a reply, to find tool calls waiting for approval, or to learn the real session id without ever asking for one.
7
+ * Read your conversation with a general agent: the events of your own main session with that agent, the same page sessions.events.list returns — same query parameters, same data + next_page envelope, same event shapes. {agent_id} takes the agent_… id, the eight character identity number or the handle; a service or assume agent answers 400. Use it to collect a reply, to find tool calls waiting for approval, or to learn the real session id without ever asking for one.
8
8
  */
9
9
  export const listAgentEvents = (options) => (options.client ?? client).get({
10
10
  security: [{
@@ -22,7 +22,7 @@ export const listAgentEvents = (options) => (options.client ?? client).get({
22
22
  /**
23
23
  * Send events to an agent
24
24
  *
25
- * Talk to a personal or general agent: the message goes to your own main session with that agent — one entry per person, created on first use and the same every time after — so no session id is needed. This is sessions.events.send addressed by the agent instead of the session: the same body (user.message with exactly one nonempty text block, user.interrupt, user.tool_confirmation, user.custom_tool_result, user.steer, user.withdraw), the same acknowledgement and the same billing. {agent_id} takes the agent_… id, the eight character identity number or the handle. A service or assume agent answers 400 — it has no main session: reach a service agent over A2A, or open a session explicitly with sessions.create. Read the reply with agents.events.list, or follow it while it is produced with agents.events.stream. Example: POST /agent/v1/agents/agent_example/events with {"events":[{"type":"user.message","content":[{"type":"text","text":"你好"}]}]}.
25
+ * Talk to a general agent: the message goes to your own main session with that agent — one entry per person, created on first use and the same every time after — so no session id is needed. This is sessions.events.send addressed by the agent instead of the session: the same body (user.message with exactly one nonempty text block, user.interrupt, user.tool_confirmation, user.custom_tool_result, user.steer, user.withdraw), the same acknowledgement and the same billing. {agent_id} takes the agent_… id, the eight character identity number or the handle. A service or assume agent answers 400 — it has no main session: reach a service agent over A2A, or open a session explicitly with sessions.create. Read the reply with agents.events.list, or follow it while it is produced with agents.events.stream. Example: POST /agent/v1/agents/agent_example/events with {"events":[{"type":"user.message","content":[{"type":"text","text":"你好"}]}]}.
26
26
  */
27
27
  export const sendAgentEvents = (options) => (options.client ?? client).post({
28
28
  security: [{
@@ -42,9 +42,9 @@ export const sendAgentEvents = (options) => (options.client ?? client).post({
42
42
  }
43
43
  });
44
44
  /**
45
- * Follow your conversation with an agent live
45
+ * Follow an agent live
46
46
  *
47
- * Follow your conversation with a personal or general agent live over Server-Sent Events: the stream of your own main session with that agent, the same stream sessions.events.stream opens, event_deltas[] previews included. {agent_id} takes the agent_… id, the eight character identity number or the handle; a service or assume agent answers 400. Closing the stream only drops your subscription and does not stop the agent; read past events with agents.events.list.
47
+ * Follow an agent live over Server-Sent Events. For a general agent it is the stream of your own main session with that agent, the same stream sessions.events.stream opens, event_deltas[] previews included; read past events with agents.events.list. An assume agent has no main session: its body is its MCP connections, and this stream is its broadcast point, which every live connection of the agent hears at once. It carries two events, each with an SSE id: inbox.letter_delivered { letter_id, sender, sender_name, summary, thread, create_time } when a letter arrives (the letter stays unread; take it with the agent's inbox tool, the body is not in the event), and cognition.ritual_held { ritual, owner, title, engram, create_time } when a domain gives the agent a memory. Reconnect with the Last-Event-ID header to receive what you missed from a short recent buffer (about an hour); a first connection replays nothing, so read agents.inbox.letters.list for mail already waiting. {agent_id} takes the agent_… id, the eight character identity number or the handle; a service agent answers 400. Closing the stream only drops your subscription and does not stop the agent.
48
48
  */
49
49
  export const streamAgentEvents = (options) => (options.client ?? client).sse.get({
50
50
  security: [{
@@ -99,6 +99,24 @@ export const getAgentConsolidation = (options) => (options.client ?? client).get
99
99
  url: '/agent/v1/agents/{agent_id}/consolidations/{consolidation_id}',
100
100
  ...options
101
101
  });
102
+ /**
103
+ * List an assume agent's waiting letters
104
+ *
105
+ * Check whether mail waits for an assume agent without taking it: answers unread, the count of delivered letters the agent has not read, and letters, the newest unread ones (id, sender address, summary, thread, create_time; never the body). Nothing is marked read, so calling it again answers the same until the agent reads its mail with its own inbox tool (praxis_assume_inbox, action "read"). Use it when something outside the agent has to learn that mail arrived: the local `praxis agent events wait` reads it once on start and after every reconnect to its agent's event stream, so no letter that arrived while nothing listened is missed. {agent_id} takes the agent_… id, the eight character identity number or the handle of an assume agent in your organization; any other kind answers 400 ASSUME_AGENT_REQUIRED. To read or answer the letters, use the agent's inbox tool, not this read. Example: GET /agent/v1/agents/R1M9TQ2X/inbox/letters?unread=true&limit=5.
106
+ */
107
+ export const listAgentInboxLetters = (options) => (options.client ?? client).get({
108
+ security: [{
109
+ key: 'BearerAuth',
110
+ scheme: 'bearer',
111
+ type: 'http'
112
+ }, {
113
+ key: 'ApiKeyAuth',
114
+ name: 'X-API-Key',
115
+ type: 'apiKey'
116
+ }],
117
+ url: '/agent/v1/agents/{agent_id}/inbox/letters',
118
+ ...options
119
+ });
102
120
  /**
103
121
  * Apply Agent Version
104
122
  *
@@ -340,13 +358,11 @@ export const getAgentAppearance = (options) => (options.client ?? client).get({
340
358
  ...options
341
359
  });
342
360
  /**
343
- * Create customer grant code
361
+ * Retrieve agent phone
344
362
  *
345
- * Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.
346
- *
347
- * Call this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget (US dollars, at most 2 decimals), system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {"customer_id":"cus_8f2a91","origin":"https://shop.example.com"}.
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.
348
364
  */
349
- export const createCustomerGrantCode = (options) => (options.client ?? client).post({
365
+ export const agentsPhoneRetrieve = (options) => (options.client ?? client).get({
350
366
  security: [{
351
367
  key: 'BearerAuth',
352
368
  scheme: 'bearer',
@@ -356,36 +372,33 @@ export const createCustomerGrantCode = (options) => (options.client ?? client).p
356
372
  name: 'X-API-Key',
357
373
  type: 'apiKey'
358
374
  }],
359
- url: '/agent/v1/agents/{agent_id}/customers/auth/grant_codes',
360
- ...options,
361
- headers: {
362
- 'Content-Type': 'application/json',
363
- ...options.headers
364
- }
375
+ url: '/agent/v1/agents/{agent_id}/phone',
376
+ ...options
365
377
  });
366
378
  /**
367
- * Create customer access token
368
- *
369
- * Exchange a grant code, or the agent's publishable key for an anonymous visitor, for a customer access token that authorizes the agent's embedded sessions.
379
+ * Release agent phone
370
380
  *
371
- * No Authorization header is required: the grant code or the publishable key is the credential. Agent Kit calls this from the browser, so send the page Origin. With grant_code, the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, used, expired and other-agent codes all return the same 401 GRANT_CODE_INVALID. The sign-in starts now and lasts the code's max_session_seconds. Unlike Shopify, a visitor without an account gets a token too: send publishable_key instead and a new anonymous customer (anon_…) is created, bound to the request Origin, for 7 days. The access token lasts at most two hours and never outlives the sign-in; renew it with access_tokens/renew before expires_at. Both forms share the per-IP minute limit of anonymous issuance (default 20). Example body: {"grant_code":"cgc_…"}.
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.
372
382
  */
373
- export const createCustomerAccessToken = (options) => (options.client ?? client).post({
374
- url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens',
375
- ...options,
376
- headers: {
377
- 'Content-Type': 'application/json',
378
- ...options.headers
379
- }
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
380
395
  });
381
396
  /**
382
- * Renew customer access token
383
- *
384
- * Get a fresh customer access token in the same sign-in, authenticated with the current one.
397
+ * Get agent embed policy
385
398
  *
386
- * Send the current customer access token as the Bearer credential, with no body, a few minutes before expires_at. The new token keeps the version, budget, context, metadata and origin binding of the sign-in and lasts at most two hours, never past session_expires_at. Unlike Shopify, renewal does not revoke the presented token: it stays valid until its own expiry, so a reply that is streaming on it is not cut off. When less than 60 seconds of the sign-in remain, renewal returns 401 CUSTOMER_SESSION_EXPIRED; sign the customer in again with a new grant code from your backend. A token that was logged out or merged returns 401 ACCESS_TOKEN_REVOKED.
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.
387
400
  */
388
- export const renewCustomerAccessToken = (options) => (options.client ?? client).post({
401
+ export const getAgentEmbedPolicy = (options) => (options.client ?? client).get({
389
402
  security: [{
390
403
  key: 'BearerAuth',
391
404
  scheme: 'bearer',
@@ -395,17 +408,15 @@ export const renewCustomerAccessToken = (options) => (options.client ?? client).
395
408
  name: 'X-API-Key',
396
409
  type: 'apiKey'
397
410
  }],
398
- url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/renew',
411
+ url: '/agent/v1/agents/{agent_id}/embed_policy',
399
412
  ...options
400
413
  });
401
414
  /**
402
- * Log out customer
415
+ * Update agent embed policy
403
416
  *
404
- * Log the customer out by revoking the sign-in of the presented access token and every token issued in it.
405
- *
406
- * Send the current customer access token as the Bearer credential, with no body, when the customer logs out of your site. Every token of the sign-in, including renewed ones, stops working, and their live event streams close; the customer's conversations are kept. Returns 204. Calling it again with the same token returns 401 ACCESS_TOKEN_REVOKED, so treat that as already logged out.
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"]}.
407
418
  */
408
- export const deleteCurrentCustomerAccessToken = (options) => (options.client ?? client).delete({
419
+ export const updateAgentEmbedPolicy = (options) => (options.client ?? client).post({
409
420
  security: [{
410
421
  key: 'BearerAuth',
411
422
  scheme: 'bearer',
@@ -415,15 +426,19 @@ export const deleteCurrentCustomerAccessToken = (options) => (options.client ??
415
426
  name: 'X-API-Key',
416
427
  type: 'apiKey'
417
428
  }],
418
- url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/current',
419
- ...options
429
+ url: '/agent/v1/agents/{agent_id}/embed_policy',
430
+ ...options,
431
+ headers: {
432
+ 'Content-Type': 'application/json',
433
+ ...options.headers
434
+ }
420
435
  });
421
436
  /**
422
437
  * List Computers
423
438
  *
424
439
  * List the computers of your organization, archived ones included.
425
440
  *
426
- * 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.
427
442
  */
428
443
  export const computersList = (options) => (options?.client ?? client).get({
429
444
  security: [{
@@ -441,9 +456,9 @@ export const computersList = (options) => (options?.client ?? client).get({
441
456
  /**
442
457
  * Create Computer
443
458
  *
444
- * Create a durable computer: a named machine whose files outlive sessions, for general and personal agents.
459
+ * Create a durable computer: a named machine whose files outlive sessions, for general agents.
445
460
  *
446
- * 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.
447
462
  */
448
463
  export const computersCreate = (options) => (options.client ?? client).post({
449
464
  security: [{
@@ -487,7 +502,7 @@ export const computersDelete = (options) => (options.client ?? client).delete({
487
502
  *
488
503
  * Read one computer's status, storage use and sandbox id.
489
504
  *
490
- * 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.
491
506
  */
492
507
  export const computersRetrieve = (options) => (options.client ?? client).get({
493
508
  security: [{
@@ -507,7 +522,7 @@ export const computersRetrieve = (options) => (options.client ?? client).get({
507
522
  *
508
523
  * Rename a computer.
509
524
  *
510
- * 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.
511
526
  */
512
527
  export const computersUpdate = (options) => (options.client ?? client).post({
513
528
  security: [{
@@ -531,7 +546,7 @@ export const computersUpdate = (options) => (options.client ?? client).post({
531
546
  *
532
547
  * Archive a computer: its files stay readable but new sessions cannot use it.
533
548
  *
534
- * 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.
535
550
  */
536
551
  export const computersArchive = (options) => (options.client ?? client).post({
537
552
  security: [{
@@ -576,7 +591,7 @@ export const computersAttachmentsCreate = (options) => (options.client ?? client
576
591
  *
577
592
  * List the entries of one directory on a computer.
578
593
  *
579
- * 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.
580
595
  */
581
596
  export const computersFilesList = (options) => (options.client ?? client).get({
582
597
  security: [{
@@ -596,7 +611,7 @@ export const computersFilesList = (options) => (options.client ?? client).get({
596
611
  *
597
612
  * Download the bytes of one file on a computer, up to 16 MiB, with single-range support.
598
613
  *
599
- * 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.
600
615
  */
601
616
  export const computersFilesContent = (options) => (options.client ?? client).get({
602
617
  security: [{
@@ -611,6 +626,24 @@ export const computersFilesContent = (options) => (options.client ?? client).get
611
626
  url: '/agent/v1/computers/{computer_id}/files/content',
612
627
  ...options
613
628
  });
629
+ /**
630
+ * Preview a computer file
631
+ *
632
+ * 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.
633
+ */
634
+ export const previewComputerFile = (options) => (options.client ?? client).get({
635
+ security: [{
636
+ key: 'BearerAuth',
637
+ scheme: 'bearer',
638
+ type: 'http'
639
+ }, {
640
+ key: 'ApiKeyAuth',
641
+ name: 'X-API-Key',
642
+ type: 'apiKey'
643
+ }],
644
+ url: '/agent/v1/computers/{computer_id}/files/preview',
645
+ ...options
646
+ });
614
647
  /**
615
648
  * Convert a Computer Document to PDF
616
649
  *
@@ -700,7 +733,7 @@ export const releaseComputerLease = (options) => (options.client ?? client).dele
700
733
  /**
701
734
  * List Toolsets
702
735
  *
703
- * 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, enter_plan_mode, 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.
736
+ * Discover tool names, input schemas, read-only status and default permission policies before configuring an agent. The catalog is read-only: enable tools through agents.create or agents.update. agent_toolset_20260401 includes bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message, codemode and skill, plus todo_write, ask_user_question and goal_read, which are listed so they can be switched off. Native additions require bash enabled; codemode requires bash (enabling it with bash disabled returns 400; keep bash enabled with permission_policy always_ask to restrict it); send_message also requires agent. To keep only some tools, set default_config.enabled to false and enable the wanted tools in configs; unlisted tools follow default_config. The catalog includes plugin names and versions. Sessions created through /anthropic/v1 expose only the eight official tools.
704
737
  */
705
738
  export const listToolsets = (options) => (options?.client ?? client).get({
706
739
  security: [{
@@ -759,12 +792,60 @@ export const forkSession = (options) => (options.client ?? client).post({
759
792
  ...options.headers
760
793
  }
761
794
  });
795
+ /**
796
+ * Rename Session (Extension)
797
+ *
798
+ * Give a session a short, branch-like name; the main session is always main and cannot be renamed.
799
+ *
800
+ * 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"}.
801
+ */
802
+ export const renameSession = (options) => (options.client ?? client).post({
803
+ security: [{
804
+ key: 'BearerAuth',
805
+ scheme: 'bearer',
806
+ type: 'http'
807
+ }, {
808
+ key: 'ApiKeyAuth',
809
+ name: 'X-API-Key',
810
+ type: 'apiKey'
811
+ }],
812
+ url: '/agent/v1/sessions/{session_id}/name',
813
+ ...options,
814
+ headers: {
815
+ 'Content-Type': 'application/json',
816
+ ...options.headers
817
+ }
818
+ });
819
+ /**
820
+ * Update session agent version
821
+ *
822
+ * Move one session to a version of its agent
823
+ *
824
+ * Without `version`, the session moves to the agent's active version — the version new sessions get now, which is not necessarily the newest saved one. With `version`, it moves to that existing version. The change is idempotent: asking for the version the session is already on answers the session and writes nothing, so the call may be repeated freely. A session that is running a turn answers 409 SESSION_CONFLICT and changes nothing, because a turn finishes on the version it started with; ask again once it is idle. The move writes a `session.updated` event carrying the agent version and the caller as its actor, so every version change is attributable. Main sessions additionally follow their agent's active version at the start of a person-started turn; this endpoint is the same move made explicitly, and it works on every kind of session, including worker sessions that never follow on their own.
825
+ */
826
+ export const updateSessionAgentVersion = (options) => (options.client ?? client).post({
827
+ security: [{
828
+ key: 'BearerAuth',
829
+ scheme: 'bearer',
830
+ type: 'http'
831
+ }, {
832
+ key: 'ApiKeyAuth',
833
+ name: 'X-API-Key',
834
+ type: 'apiKey'
835
+ }],
836
+ url: '/agent/v1/sessions/{session_id}/agent_version',
837
+ ...options,
838
+ headers: {
839
+ 'Content-Type': 'application/json',
840
+ ...options.headers
841
+ }
842
+ });
762
843
  /**
763
844
  * List Session Artifacts (Extension)
764
845
  *
765
846
  * List the files this session delivered; an end-customer token reads its own session.
766
847
  *
767
- * Own-face extension. Returns { data: Artifact[] } ordered by create_time. Each artifact is one file in the session outputs directory with id, name, version, parts, source_hrefs, create_time and update_time. Delivering the same path again keeps the id and adds one to version. Files are captured seconds after the turn ends, so artifacts appear after session.status_idle; also watch the agent.artifact_delivered event. Whoever may read the session may read its artifacts; a session that is missing or not yours returns 404.
848
+ * Own-face extension. Returns { data: Artifact[] } ordered by create_time. Each artifact is one file in the session outputs directory, or one canvas or media asset the reply pointed at (a part with kind object carrying object_type, object_id and href; one artifact per object, pointing at it again adds no version), with id, name, version, parts, source_hrefs, create_time and update_time. Delivering the same path again keeps the id and adds one to version. Files are captured seconds after the turn ends, so artifacts appear after session.status_idle; also watch the agent.artifact_delivered event. Whoever may read the session may read its artifacts; a session that is missing or not yours returns 404.
768
849
  */
769
850
  export const listSessionArtifacts = (options) => (options.client ?? client).get({
770
851
  security: [{
@@ -784,7 +865,7 @@ export const listSessionArtifacts = (options) => (options.client ?? client).get(
784
865
  *
785
866
  * Mint a short-lived download address for one file of an artifact.
786
867
  *
787
- * Own-face extension. The body is optional: part (index into the artifact parts, default 0) and ttl_seconds (60 to 300, default 300). Returns { url, expire_time }. The address works for minutes; do not store or log it. An unknown artifact or an out-of-range part returns 404 ARTIFACT_NOT_FOUND, a session that is missing or not yours returns 404, and a ttl_seconds outside 60 to 300 returns 400.
868
+ * Own-face extension. The body is optional: part (index into the artifact parts, default 0) and ttl_seconds (60 to 300, default 300). Returns { url, expire_time }. The address works for minutes; do not store or log it. For an object part the address serves a snapshot picture of a canvas or the own bytes of the asset; an object that no longer exists returns 404 ARTIFACT_NOT_FOUND and a failing share service returns 502. An unknown artifact or an out-of-range part returns 404 ARTIFACT_NOT_FOUND, a session that is missing or not yours returns 404, and a ttl_seconds outside 60 to 300 returns 400.
788
869
  */
789
870
  export const createSessionArtifactContentUrl = (options) => (options.client ?? client).post({
790
871
  security: [{
@@ -803,6 +884,26 @@ export const createSessionArtifactContentUrl = (options) => (options.client ?? c
803
884
  ...options.headers
804
885
  }
805
886
  });
887
+ /**
888
+ * List Session Requests (Extension)
889
+ *
890
+ * List the requests a session is waiting on; an end-customer token reads its own session.
891
+ *
892
+ * Own-face extension. When a session stops at session.status_idle with stop_reason requires_action, read what it waits on here instead of replaying events. Returns { data: Request[] } ordered by create_time, an empty array when nothing is pending, not paginated. Each request has id (the pending tool call id), object (request), kind (question for the ask_user_question tool, approval for any other tool that waits for permission), status (pending), tool_name, input (the same input the agent.tool_use event shows), create_time and expire_time. Answer a request as before: send a user.tool_confirmation event for its id. expire_time is set only for a session with no collaboration mode while the requests-v1 release is on (create_time plus 24 hours; an expired request counts as declined), otherwise null. Answered, expired and superseded requests are not listed, and neither are pending custom tool results (user.custom_tool_result). Whoever may read the session may read its requests; a session that is missing or not yours returns 404.
893
+ */
894
+ export const listSessionRequests = (options) => (options.client ?? client).get({
895
+ security: [{
896
+ key: 'BearerAuth',
897
+ scheme: 'bearer',
898
+ type: 'http'
899
+ }, {
900
+ key: 'ApiKeyAuth',
901
+ name: 'X-API-Key',
902
+ type: 'apiKey'
903
+ }],
904
+ url: '/agent/v1/sessions/{session_id}/requests',
905
+ ...options
906
+ });
806
907
  /**
807
908
  * List Session Background Tasks (Extension)
808
909
  *
@@ -927,6 +1028,46 @@ export const listSessionCompactions = (options) => (options.client ?? client).ge
927
1028
  url: '/agent/v1/sessions/{session_id}/compactions',
928
1029
  ...options
929
1030
  });
1031
+ /**
1032
+ * Upload a File (Extension)
1033
+ *
1034
+ * Start an upload for an embedded end user, so the browser can PUT the file's bytes straight to the File service and then attach the resulting file id to its own session. Use it only with an end-user token: a grant-bound end_user token uploads for its own agent, and an organization-level customer token must name the agent in the body (agent). A member, robot or user_key credential uses /file/v1 instead and gets 404 here. Body: filename (1–255 characters, its extension decides the blocked-type refusal), bytes (the positive byte length) and content_type (1–255 characters). Returns 201 with the File signed-upload answer: upload_id and expires_at, and url for a small file, or part_size, parts, complete_url and status_url for a large one; the addresses are returned here only and must never be stored or logged. The browser PUTs the bytes to the address (or to each part and then complete_url), which answers the File object and its file_id; then POST the file_id to /agent/v1/sessions/{session_id}/resources, and reference it in the message attachments. Refusals: 403 UPLOADS_DISABLED when uploads are off on the agent, 413 FILE_TOO_LARGE when bytes exceeds its uploads.max_file_bytes, 400 FILE_TYPE_REFUSED for a blocked executable or script extension, and 429 UPLOAD_RATE_LIMITED on the 31st unattached upload from the same user on the same agent within an hour. Example: POST /agent/v1/uploads with {"filename":"report.pdf","bytes":48211,"content_type":"application/pdf"}.
1035
+ */
1036
+ export const createAgentUpload = (options) => (options.client ?? client).post({
1037
+ security: [{
1038
+ key: 'BearerAuth',
1039
+ scheme: 'bearer',
1040
+ type: 'http'
1041
+ }, {
1042
+ key: 'ApiKeyAuth',
1043
+ name: 'X-API-Key',
1044
+ type: 'apiKey'
1045
+ }],
1046
+ url: '/agent/v1/uploads',
1047
+ ...options,
1048
+ headers: {
1049
+ 'Content-Type': 'application/json',
1050
+ ...options.headers
1051
+ }
1052
+ });
1053
+ /**
1054
+ * Create Upload Content URL (Extension)
1055
+ *
1056
+ * Mint a short-lived read address for one file an embedded end user uploaded, so the page can show or download its own file again. Use it only with an end-user token; file_id is the id the File service returned after the bytes were uploaded. Returns 200 with url (an address that works for 900 seconds) and expires_at; never store or log the address. Only the caller's own upload answers: a file that belongs to someone else, a missing one, or one that did not start as an upload returns 404 FILE_NOT_FOUND, so a stranger cannot learn whether another person's file exists. The request body is empty. Example: POST /agent/v1/uploads/file-Ab12.../content_url.
1057
+ */
1058
+ export const createAgentUploadContentUrl = (options) => (options.client ?? client).post({
1059
+ security: [{
1060
+ key: 'BearerAuth',
1061
+ scheme: 'bearer',
1062
+ type: 'http'
1063
+ }, {
1064
+ key: 'ApiKeyAuth',
1065
+ name: 'X-API-Key',
1066
+ type: 'apiKey'
1067
+ }],
1068
+ url: '/agent/v1/uploads/{file_id}/content_url',
1069
+ ...options
1070
+ });
930
1071
  /**
931
1072
  * Generate speech
932
1073
  *
@@ -949,6 +1090,12 @@ export const createAudioSpeech = (options) => (options.client ?? client).post({
949
1090
  ...options.headers
950
1091
  }
951
1092
  });
1093
+ /**
1094
+ * List current prices
1095
+ *
1096
+ * 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.
1097
+ */
1098
+ export const listPublicPrices = (options) => (options?.client ?? client).get({ url: '/billing/v1/prices', ...options });
952
1099
  /**
953
1100
  * 列出浏览器会话
954
1101
  *
@@ -1460,7 +1607,7 @@ export const fileRetrieveUpload = (options) => (options.client ?? client).get({
1460
1607
  /**
1461
1608
  * Create a one-time upload URL
1462
1609
  *
1463
- * Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide filename (the stored basename), exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid, wrong-action or cross-organization URLs return 404. URL lifetime defaults to 900 seconds for single PUT or 604800 (7 days) for multipart, at most 604800; all multipart URLs, including status_url, share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {"filename":"photo.png","bytes":2048,"content_type":"image/png"}.
1610
+ * Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide filename (the stored basename), exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid or cross-organization URLs return 404, and so does a link whose upload record no longer exists. A URL that is authentic but names another action returns 403 CAPABILITY_MISMATCH: a status link posted to complete_url answers it, and so does a completion link fetched as status_url. URL lifetime defaults to 900 seconds for single PUT or 604800 (7 days) for multipart, at most 604800; all multipart URLs, including status_url, share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {"filename":"photo.png","bytes":2048,"content_type":"image/png"}.
1464
1611
  */
1465
1612
  export const fileCreateSignedUpload = (options) => (options.client ?? client).post({
1466
1613
  security: [{
@@ -2439,7 +2586,7 @@ export const listOrganizationUsage = (options) => (options.client ?? client).get
2439
2586
  /**
2440
2587
  * List Organization Usage Events
2441
2588
  *
2442
- * 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.
2589
+ * 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.
2443
2590
  *
2444
2591
  */
2445
2592
  export const listOrganizationEvents = (options) => (options.client ?? client).get({
@@ -2990,7 +3137,7 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
2990
3137
  /**
2991
3138
  * Hire into a position
2992
3139
  *
2993
- * Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
3140
+ * Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. An agent created moments ago may not be in the organization roster yet (agents enter it asynchronously): that answers 503 ACTOR_SYNCING with a Retry-After header and retryable true, and the same call succeeds after that wait. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
2994
3141
  */
2995
3142
  export const hireOrganizationPosition = (options) => (options.client ?? client).post({
2996
3143
  security: [{
@@ -3661,6 +3808,30 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
3661
3808
  ...options.headers
3662
3809
  }
3663
3810
  });
3811
+ /**
3812
+ * Act on a phone sandbox's screen
3813
+ *
3814
+ * See and operate an android sandbox's phone screen: take a screenshot, read the UI hierarchy to get a ref for each node, then tap a node or a screen point, long-press, swipe, scroll, type text, press a key, open or close an app, open a URL, or wait. Use it to drive and automate a mobile app on a phone sandbox created with templateID "android"; those machines have no terminal or file API, so drive the screen with this operation and run shell commands with commands.run. Start with a snapshot to learn what is on screen and to mint the refs the tap-like actions use; a ref names a node in the latest snapshot only, so after a newer snapshot, or after an action that changed the screen, take a fresh snapshot — a stale ref is refused with INVALID_PARAMS. The phone runs one action at a time, so actions on one sandbox are serial: send the next only after the previous call returns. A phone that has just been created may not have connected yet and answers 503 SERVICE_UNAVAILABLE with Retry-After: 2; retry after that delay (measured on develop: the sandbox is created in about 45 s and the phone program connects about 15 s later). Text is entered through the phone's own input, which supports ASCII only, so typing non-ASCII text into a Chinese app is not supported and answers INVALID_PARAMS. A linux sandbox has no screen and answers CAPABILITY_UNSUPPORTED.
3815
+ *
3816
+ * The same path is the caller's action socket: send GET with the standard WebSocket upgrade headers instead of POST and drive many actions over one connection. The server answers {"type":"ready","instanceId":"<id>"} first, then every frame {"id":"<your correlation id>","action":{…}} (an action of the same shape as this operation's body, at most 64 characters of id) is answered by its own id, in submission order, as {"id":"…","result":{…}} or {"id":"…","error":{"code":"…","message":"…","retryable":true}}. At most 8 actions may be in flight on one connection (the next answers RATE_LIMITED), and 10 malformed frames in a row close the connection 1008. Authentication is the caller's own (an organization API key), never the phone's token. Closing the connection ends only that client's view: actions already accepted are answered, and the phone stays connected. Before the handshake, a phone that is still being built or has not connected yet answers 503 DEVICE_NOT_READY with the state it is in and Retry-After: 2.
3817
+ */
3818
+ export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
3819
+ security: [{
3820
+ key: 'BearerAuth',
3821
+ scheme: 'bearer',
3822
+ type: 'http'
3823
+ }, {
3824
+ key: 'ApiKeyAuth',
3825
+ name: 'X-API-Key',
3826
+ type: 'apiKey'
3827
+ }],
3828
+ url: '/sandbox/v1/sandboxes/{sandboxID}/act',
3829
+ ...options,
3830
+ headers: {
3831
+ 'Content-Type': 'application/json',
3832
+ ...options.headers
3833
+ }
3834
+ });
3664
3835
  /**
3665
3836
  * Remove a file or directory in the sandbox
3666
3837
  *
@@ -3758,7 +3929,7 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
3758
3929
  /**
3759
3930
  * Run a command in the sandbox
3760
3931
  *
3761
- * 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"}.
3932
+ * Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–3600000 milliseconds, default 600000, that is 10 minutes; E2B defaults to 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout (timeoutMs 0); output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. On an android sandbox the command runs in the phone's root shell, its stderr is merged into stdout (read stdout and expect stderr to come back empty), and background mode is unavailable. Example body: {"cmd":"echo hi"}.
3762
3933
  */
3763
3934
  export const runSandboxCommand = (options) => (options.client ?? client).post({
3764
3935
  security: [{
@@ -3778,11 +3949,11 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
3778
3949
  }
3779
3950
  });
3780
3951
  /**
3781
- * Delete session
3952
+ * Start adding a phone of your own
3782
3953
  *
3783
- * Delete an idle or terminated session and its event history after saving a deletion snapshot. Supply the session id from creation or listing. Running sessions return 409 INVALID_STATE: interrupt first or wait until idle or terminated. Afterwards retrieval and event listing return 404 and lists omit the session. Example: DELETE /agent/v1/sessions/sesn_example.
3954
+ * 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'}.
3784
3955
  */
3785
- export const sessionsDelete = (options) => (options.client ?? client).delete({
3956
+ export const createByodPairing = (options) => (options?.client ?? client).post({
3786
3957
  security: [{
3787
3958
  key: 'BearerAuth',
3788
3959
  scheme: 'bearer',
@@ -3792,15 +3963,15 @@ export const sessionsDelete = (options) => (options.client ?? client).delete({
3792
3963
  name: 'X-API-Key',
3793
3964
  type: 'apiKey'
3794
3965
  }],
3795
- url: '/agent/v1/sessions/{session_id}',
3966
+ url: '/sandbox/v1/byod/pairings',
3796
3967
  ...options
3797
3968
  });
3798
3969
  /**
3799
- * Get session
3970
+ * List your organization's own devices
3800
3971
  *
3801
- * Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on a light machine; no environment lookup or provisioning is needed for a codemode calculation.
3972
+ * 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. Android is the only platform today. 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'}]}.
3802
3973
  */
3803
- export const sessionsRetrieve = (options) => (options.client ?? client).get({
3974
+ export const listByodDevices = (options) => (options?.client ?? client).get({
3804
3975
  security: [{
3805
3976
  key: 'BearerAuth',
3806
3977
  scheme: 'bearer',
@@ -3810,15 +3981,15 @@ export const sessionsRetrieve = (options) => (options.client ?? client).get({
3810
3981
  name: 'X-API-Key',
3811
3982
  type: 'apiKey'
3812
3983
  }],
3813
- url: '/agent/v1/sessions/{session_id}',
3984
+ url: '/sandbox/v1/byod/devices',
3814
3985
  ...options
3815
3986
  });
3816
3987
  /**
3817
- * Update session
3988
+ * Read one of your organization's devices
3818
3989
  *
3819
- * Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
3990
+ * 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.
3820
3991
  */
3821
- export const sessionsUpdate = (options) => (options.client ?? client).post({
3992
+ export const getByodDevice = (options) => (options.client ?? client).get({
3822
3993
  security: [{
3823
3994
  key: 'BearerAuth',
3824
3995
  scheme: 'bearer',
@@ -3828,19 +3999,15 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
3828
3999
  name: 'X-API-Key',
3829
4000
  type: 'apiKey'
3830
4001
  }],
3831
- url: '/agent/v1/sessions/{session_id}',
3832
- ...options,
3833
- headers: {
3834
- 'Content-Type': 'application/json',
3835
- ...options.headers
3836
- }
4002
+ url: '/sandbox/v1/byod/devices/{deviceID}',
4003
+ ...options
3837
4004
  });
3838
4005
  /**
3839
- * List agents
4006
+ * Rename one of your organization's devices
3840
4007
  *
3841
- * List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general or kind=personal for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.
4008
+ * 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.
3842
4009
  */
3843
- export const agentsList = (options) => (options?.client ?? client).get({
4010
+ export const updateByodDevice = (options) => (options.client ?? client).patch({
3844
4011
  security: [{
3845
4012
  key: 'BearerAuth',
3846
4013
  scheme: 'bearer',
@@ -3850,15 +4017,19 @@ export const agentsList = (options) => (options?.client ?? client).get({
3850
4017
  name: 'X-API-Key',
3851
4018
  type: 'apiKey'
3852
4019
  }],
3853
- url: '/agent/v1/agents',
3854
- ...options
4020
+ url: '/sandbox/v1/byod/devices/{deviceID}',
4021
+ ...options,
4022
+ headers: {
4023
+ 'Content-Type': 'application/json',
4024
+ ...options.headers
4025
+ }
3855
4026
  });
3856
4027
  /**
3857
- * Create agent
4028
+ * Disconnect a device and revoke its credential
3858
4029
  *
3859
- * 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, enter_plan_mode, 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"}]}. 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.
4030
+ * 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}.
3860
4031
  */
3861
- export const agentsCreate = (options) => (options.client ?? client).post({
4032
+ export const disconnectByodDevice = (options) => (options.client ?? client).post({
3862
4033
  security: [{
3863
4034
  key: 'BearerAuth',
3864
4035
  scheme: 'bearer',
@@ -3868,19 +4039,15 @@ export const agentsCreate = (options) => (options.client ?? client).post({
3868
4039
  name: 'X-API-Key',
3869
4040
  type: 'apiKey'
3870
4041
  }],
3871
- url: '/agent/v1/agents',
3872
- ...options,
3873
- headers: {
3874
- 'Content-Type': 'application/json',
3875
- ...options.headers
3876
- }
4042
+ url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
4043
+ ...options
3877
4044
  });
3878
4045
  /**
3879
- * Get agent
4046
+ * Read a pairing for the phone's Allow screen
3880
4047
  *
3881
- * Read the agent configuration currently effective for new sessions. By default, version equals active_version and latest_version identifies the newest saved version, including an unapplied save. Use latest_version for optimistic concurrency when updating. Pass version as a positive integer to read that saved version; version=active is equivalent to omission. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so tools can be sent back unchanged to agents.update. Use agents.versions.list to enumerate saved versions.
4048
+ * 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'}.
3882
4049
  */
3883
- export const agentsRetrieve = (options) => (options.client ?? client).get({
4050
+ export const getByodPairing = (options) => (options.client ?? client).get({
3884
4051
  security: [{
3885
4052
  key: 'BearerAuth',
3886
4053
  scheme: 'bearer',
@@ -3890,15 +4057,15 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
3890
4057
  name: 'X-API-Key',
3891
4058
  type: 'apiKey'
3892
4059
  }],
3893
- url: '/agent/v1/agents/{agent_id}',
4060
+ url: '/sandbox/v1/byod/pairings/{code}',
3894
4061
  ...options
3895
4062
  });
3896
4063
  /**
3897
- * Update agent
4064
+ * Claim a pairing and register the phone
3898
4065
  *
3899
- * 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.
4066
+ * The phone's own final step after the owner taps Allow: it registers the device and answers the device id, a one-time credential and the control socket url the app dials. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and never call it from server code. The claim is single use: the first successful call spends the code and a second call answers 404, as does an unknown or expired code, so the app must store the credential the moment it arrives because it is never shown again. Connect to socket_url with Authorization: Bearer <credential>; the socket speaks the phone channel (hello, ping/pong, act, result/error) and the device's one connection is replaced if the app reconnects. Example: POST /sandbox/v1/byod/pairings/K7M4PQRS/claim with {platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16'} returns {device_id:'byd_0123456789abcdefghijklmno',credential:'…',socket_url:'wss://49982-byd0123456789abcdefghijklmno--sbx-develop.praxisusercontent.com/'}.
3900
4067
  */
3901
- export const agentsUpdate = (options) => (options.client ?? client).post({
4068
+ export const claimByodPairing = (options) => (options.client ?? client).post({
3902
4069
  security: [{
3903
4070
  key: 'BearerAuth',
3904
4071
  scheme: 'bearer',
@@ -3908,7 +4075,7 @@ export const agentsUpdate = (options) => (options.client ?? client).post({
3908
4075
  name: 'X-API-Key',
3909
4076
  type: 'apiKey'
3910
4077
  }],
3911
- url: '/agent/v1/agents/{agent_id}',
4078
+ url: '/sandbox/v1/byod/pairings/{code}/claim',
3912
4079
  ...options,
3913
4080
  headers: {
3914
4081
  'Content-Type': 'application/json',
@@ -3916,11 +4083,11 @@ export const agentsUpdate = (options) => (options.client ?? client).post({
3916
4083
  }
3917
4084
  });
3918
4085
  /**
3919
- * Archive agent
4086
+ * Delete session
3920
4087
  *
3921
- * Archive an agent so it can no longer be updated and no new session can be created from it (AGENT_ARCHIVED). The agent and all of its versions stay readable. Use it to retire an agent you no longer want to run; it does not delete anything.
4088
+ * Delete an idle or terminated session and its event history after saving a deletion snapshot. Supply the session id from creation or listing. Running sessions return 409 INVALID_STATE: interrupt first or wait until idle or terminated. Afterwards retrieval and event listing return 404 and lists omit the session. Example: DELETE /agent/v1/sessions/sesn_example.
3922
4089
  */
3923
- export const agentsArchive = (options) => (options.client ?? client).post({
4090
+ export const sessionsDelete = (options) => (options.client ?? client).delete({
3924
4091
  security: [{
3925
4092
  key: 'BearerAuth',
3926
4093
  scheme: 'bearer',
@@ -3930,15 +4097,15 @@ export const agentsArchive = (options) => (options.client ?? client).post({
3930
4097
  name: 'X-API-Key',
3931
4098
  type: 'apiKey'
3932
4099
  }],
3933
- url: '/agent/v1/agents/{agent_id}/archive',
4100
+ url: '/agent/v1/sessions/{session_id}',
3934
4101
  ...options
3935
4102
  });
3936
4103
  /**
3937
- * List agent versions
4104
+ * Get session
3938
4105
  *
3939
- * List the saved versions of one agent in ascending version number, oldest first, in pages of at most 100 (default 20). Each item is the full agent definition at that saved version, so you can compare configurations. active is true only for the item new sessions use. active_version on every item is the same agent-level currently effective version; it is not that item's version. Use agents.retrieve with version to read a single saved version; agent_id comes from agents.list or agents.create. Pass next_page as page to continue.
4106
+ * Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on the agent version's default environment, node22.
3940
4107
  */
3941
- export const agentsVersionsList = (options) => (options.client ?? client).get({
4108
+ export const sessionsRetrieve = (options) => (options.client ?? client).get({
3942
4109
  security: [{
3943
4110
  key: 'BearerAuth',
3944
4111
  scheme: 'bearer',
@@ -3948,15 +4115,15 @@ export const agentsVersionsList = (options) => (options.client ?? client).get({
3948
4115
  name: 'X-API-Key',
3949
4116
  type: 'apiKey'
3950
4117
  }],
3951
- url: '/agent/v1/agents/{agent_id}/versions',
4118
+ url: '/agent/v1/sessions/{session_id}',
3952
4119
  ...options
3953
4120
  });
3954
4121
  /**
3955
- * List sessions
4122
+ * Update session
3956
4123
  *
3957
- * List sessions of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Archived sessions are hidden unless include_archived is true. Unlike Anthropic Managed Agents, only limit, page, agent_id, deployment_id and include_archived are honored; the other filters declared here (agent_version, created_at ranges, memory_store_id, order, statuses) are not supported and return 400. Use the returned id with sessions.retrieve or sessions.events.list; pass next_page as page for the next page.
4124
+ * Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
3958
4125
  */
3959
- export const sessionsList = (options) => (options?.client ?? client).get({
4126
+ export const sessionsUpdate = (options) => (options.client ?? client).post({
3960
4127
  security: [{
3961
4128
  key: 'BearerAuth',
3962
4129
  scheme: 'bearer',
@@ -3966,15 +4133,19 @@ export const sessionsList = (options) => (options?.client ?? client).get({
3966
4133
  name: 'X-API-Key',
3967
4134
  type: 'apiKey'
3968
4135
  }],
3969
- url: '/agent/v1/sessions',
3970
- ...options
4136
+ url: '/agent/v1/sessions/{session_id}',
4137
+ ...options,
4138
+ headers: {
4139
+ 'Content-Type': 'application/json',
4140
+ ...options.headers
4141
+ }
3971
4142
  });
3972
4143
  /**
3973
- * Create session
4144
+ * List agents
3974
4145
  *
3975
- * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.
4146
+ * List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.
3976
4147
  */
3977
- export const sessionsCreate = (options) => (options.client ?? client).post({
4148
+ export const agentsList = (options) => (options?.client ?? client).get({
3978
4149
  security: [{
3979
4150
  key: 'BearerAuth',
3980
4151
  scheme: 'bearer',
@@ -3984,19 +4155,15 @@ export const sessionsCreate = (options) => (options.client ?? client).post({
3984
4155
  name: 'X-API-Key',
3985
4156
  type: 'apiKey'
3986
4157
  }],
3987
- url: '/agent/v1/sessions',
3988
- ...options,
3989
- headers: {
3990
- 'Content-Type': 'application/json',
3991
- ...options.headers
3992
- }
4158
+ url: '/agent/v1/agents',
4159
+ ...options
3993
4160
  });
3994
4161
  /**
3995
- * Archive session
4162
+ * Create agent
3996
4163
  *
3997
- * Archive a session. An archived session refuses new messages with 400 invalid_request_error, while its details and event history stay readable. Archiving again is idempotent and archived_at keeps the first archive time. Use it when a conversation is finished; it does not delete anything.
4164
+ * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. Omit kind to create a service agent (Managed Agents behaviour: a fresh environment per session). Pass kind: "general" for an employee-style agent with its own computer, created with it; size and template come from the agent's computers configuration. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. A general or assume agent created without computer_id gets a new computer registered in the same request, named after the agent; a service agent with computer_id returns 400. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. 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.
3998
4165
  */
3999
- export const sessionsArchive = (options) => (options.client ?? client).post({
4166
+ export const agentsCreate = (options) => (options.client ?? client).post({
4000
4167
  security: [{
4001
4168
  key: 'BearerAuth',
4002
4169
  scheme: 'bearer',
@@ -4006,13 +4173,151 @@ export const sessionsArchive = (options) => (options.client ?? client).post({
4006
4173
  name: 'X-API-Key',
4007
4174
  type: 'apiKey'
4008
4175
  }],
4009
- url: '/agent/v1/sessions/{session_id}/archive',
4010
- ...options
4176
+ url: '/agent/v1/agents',
4177
+ ...options,
4178
+ headers: {
4179
+ 'Content-Type': 'application/json',
4180
+ ...options.headers
4181
+ }
4182
+ });
4183
+ /**
4184
+ * Get agent
4185
+ *
4186
+ * Read the agent configuration currently effective for new sessions. By default, version equals active_version and latest_version identifies the newest saved version, including an unapplied save. Use latest_version for optimistic concurrency when updating. Pass version as a positive integer to read that saved version; version=active is equivalent to omission. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so tools can be sent back unchanged to agents.update. Use agents.versions.list to enumerate saved versions.
4187
+ */
4188
+ export const agentsRetrieve = (options) => (options.client ?? client).get({
4189
+ security: [{
4190
+ key: 'BearerAuth',
4191
+ scheme: 'bearer',
4192
+ type: 'http'
4193
+ }, {
4194
+ key: 'ApiKeyAuth',
4195
+ name: 'X-API-Key',
4196
+ type: 'apiKey'
4197
+ }],
4198
+ url: '/agent/v1/agents/{agent_id}',
4199
+ ...options
4200
+ });
4201
+ /**
4202
+ * Update agent
4203
+ *
4204
+ * 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.
4205
+ */
4206
+ export const agentsUpdate = (options) => (options.client ?? client).post({
4207
+ security: [{
4208
+ key: 'BearerAuth',
4209
+ scheme: 'bearer',
4210
+ type: 'http'
4211
+ }, {
4212
+ key: 'ApiKeyAuth',
4213
+ name: 'X-API-Key',
4214
+ type: 'apiKey'
4215
+ }],
4216
+ url: '/agent/v1/agents/{agent_id}',
4217
+ ...options,
4218
+ headers: {
4219
+ 'Content-Type': 'application/json',
4220
+ ...options.headers
4221
+ }
4222
+ });
4223
+ /**
4224
+ * Archive agent
4225
+ *
4226
+ * Archive an agent so it can no longer be updated and no new session can be created from it (AGENT_ARCHIVED). The agent and all of its versions stay readable. Use it to retire an agent you no longer want to run; it does not delete anything.
4227
+ */
4228
+ export const agentsArchive = (options) => (options.client ?? client).post({
4229
+ security: [{
4230
+ key: 'BearerAuth',
4231
+ scheme: 'bearer',
4232
+ type: 'http'
4233
+ }, {
4234
+ key: 'ApiKeyAuth',
4235
+ name: 'X-API-Key',
4236
+ type: 'apiKey'
4237
+ }],
4238
+ url: '/agent/v1/agents/{agent_id}/archive',
4239
+ ...options
4240
+ });
4241
+ /**
4242
+ * List agent versions
4243
+ *
4244
+ * List the saved versions of one agent in ascending version number, oldest first, in pages of at most 100 (default 20). Each item is the full agent definition at that saved version, so you can compare configurations. active is true only for the item new sessions use. active_version on every item is the same agent-level currently effective version; it is not that item's version. Use agents.retrieve with version to read a single saved version; agent_id comes from agents.list or agents.create. Pass next_page as page to continue.
4245
+ */
4246
+ export const agentsVersionsList = (options) => (options.client ?? client).get({
4247
+ security: [{
4248
+ key: 'BearerAuth',
4249
+ scheme: 'bearer',
4250
+ type: 'http'
4251
+ }, {
4252
+ key: 'ApiKeyAuth',
4253
+ name: 'X-API-Key',
4254
+ type: 'apiKey'
4255
+ }],
4256
+ url: '/agent/v1/agents/{agent_id}/versions',
4257
+ ...options
4258
+ });
4259
+ /**
4260
+ * List sessions
4261
+ *
4262
+ * List sessions of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Archived sessions are hidden unless include_archived is true. Unlike Anthropic Managed Agents, only limit, page, agent_id, deployment_id and include_archived are honored; the other filters declared here (agent_version, created_at ranges, memory_store_id, order, statuses) are not supported and return 400. Use the returned id with sessions.retrieve or sessions.events.list; pass next_page as page for the next page.
4263
+ */
4264
+ export const sessionsList = (options) => (options?.client ?? client).get({
4265
+ security: [{
4266
+ key: 'BearerAuth',
4267
+ scheme: 'bearer',
4268
+ type: 'http'
4269
+ }, {
4270
+ key: 'ApiKeyAuth',
4271
+ name: 'X-API-Key',
4272
+ type: 'apiKey'
4273
+ }],
4274
+ url: '/agent/v1/sessions',
4275
+ ...options
4276
+ });
4277
+ /**
4278
+ * Create session
4279
+ *
4280
+ * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (node22 for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. The retired "light" returns 400 naming the two forms that work: "node22", or null for no machine. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.
4281
+ */
4282
+ export const sessionsCreate = (options) => (options.client ?? client).post({
4283
+ security: [{
4284
+ key: 'BearerAuth',
4285
+ scheme: 'bearer',
4286
+ type: 'http'
4287
+ }, {
4288
+ key: 'ApiKeyAuth',
4289
+ name: 'X-API-Key',
4290
+ type: 'apiKey'
4291
+ }],
4292
+ url: '/agent/v1/sessions',
4293
+ ...options,
4294
+ headers: {
4295
+ 'Content-Type': 'application/json',
4296
+ ...options.headers
4297
+ }
4298
+ });
4299
+ /**
4300
+ * Archive session
4301
+ *
4302
+ * Archive a session. An archived session refuses new messages with 400 invalid_request_error, while its details and event history stay readable. Archiving again is idempotent and archived_at keeps the first archive time. Use it when a conversation is finished; it does not delete anything.
4303
+ */
4304
+ export const sessionsArchive = (options) => (options.client ?? client).post({
4305
+ security: [{
4306
+ key: 'BearerAuth',
4307
+ scheme: 'bearer',
4308
+ type: 'http'
4309
+ }, {
4310
+ key: 'ApiKeyAuth',
4311
+ name: 'X-API-Key',
4312
+ type: 'apiKey'
4313
+ }],
4314
+ url: '/agent/v1/sessions/{session_id}/archive',
4315
+ ...options
4011
4316
  });
4012
4317
  /**
4013
4318
  * List session events
4014
4319
  *
4015
- * Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter. This operation addresses one session — normally a worker session an agent dispatched; to talk to a personal or general agent itself, use agents.events.list instead. In the path, session_id may also be `main` (your own main session with that agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4320
+ * Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids; a request nobody answered within 24 hours is settled as unanswered and the session goes idle with stop_reason request_expired, which the /anthropic/v1 face shows as end_turn), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, system.notification_suppressed (pending background notifications that hit the wake quota and started no run), system.notification_recorded, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.list instead. In the path, session_id may also be `main` (your own main session with that agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4016
4321
  */
4017
4322
  export const sessionsEventsList = (options) => (options.client ?? client).get({
4018
4323
  security: [{
@@ -4030,7 +4335,7 @@ export const sessionsEventsList = (options) => (options.client ?? client).get({
4030
4335
  /**
4031
4336
  * Send session events
4032
4337
  *
4033
- * Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. This operation addresses one session — normally a worker session an agent dispatched; to talk to a personal or general agent itself, use agents.events.send instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4338
+ * Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.send instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4034
4339
  */
4035
4340
  export const sessionsEventsSend = (options) => (options.client ?? client).post({
4036
4341
  security: [{
@@ -4052,7 +4357,7 @@ export const sessionsEventsSend = (options) => (options.client ?? client).post({
4052
4357
  /**
4053
4358
  * Stream session events
4054
4359
  *
4055
- * Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event. This operation addresses one session — normally a worker session an agent dispatched; to follow a personal or general agent itself, use agents.events.stream instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4360
+ * Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event. This operation addresses one session — normally a worker session an agent dispatched; to follow a general agent itself, use agents.events.stream instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
4056
4361
  */
4057
4362
  export const sessionsEventsStream = (options) => (options.client ?? client).sse.get({
4058
4363
  security: [{
@@ -4352,7 +4657,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
4352
4657
  /**
4353
4658
  * Create deployment
4354
4659
  *
4355
- * 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 and personal 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.
4660
+ * 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"}}.
4356
4661
  */
4357
4662
  export const deploymentsCreate = (options) => (options.client ?? client).post({
4358
4663
  security: [{
@@ -4832,7 +5137,7 @@ export const applicationListVersions = (options) => (options.client ?? client).g
4832
5137
  /**
4833
5138
  * Create version
4834
5139
  *
4835
- * 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.
5140
+ * 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.
4836
5141
  */
4837
5142
  export const applicationCreateVersion = (options) => (options.client ?? client).post({
4838
5143
  security: [{
@@ -6929,36 +7234,39 @@ export const canvasRestoreCanvas = (options) => (options.client ?? client).post(
6929
7234
  }
6930
7235
  });
6931
7236
  /**
6932
- * List records
7237
+ * List contents
6933
7238
  *
6934
- * Browse records of one object type and obtain ids for retrieval or edits. Discover objectType with schemas.list; select properties by internal names from properties.list. Omit after for the first page, then copy paging.next.after until no next page is returned. archived defaults to false; use objects.search for property filters.
7239
+ * Discover the video contents of the API key's organization and obtain the content_id each later call takes. Archived contents stay out of the list unless status is archived; results are ordered by update_time, newest first. Filter with status (draft, published, unpublished or archived), kind (video), asset_id (the Media asset a content was made from) and q (a substring of the title). page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null, keeping the same filters.
6935
7240
  */
6936
- export const crmObjectsList = (options) => (options.client ?? client).get({
6937
- querySerializer: { parameters: {
6938
- associations: { array: { explode: false } },
6939
- properties: { array: { explode: false } },
6940
- propertiesWithHistory: { array: { explode: false } }
6941
- } },
7241
+ export const contentListContents = (options) => (options?.client ?? client).get({
6942
7242
  security: [{
6943
- key: 'crm-bearerAuth',
7243
+ key: 'BearerAuth',
6944
7244
  scheme: 'bearer',
6945
7245
  type: 'http'
7246
+ }, {
7247
+ key: 'ApiKeyAuth',
7248
+ name: 'X-API-Key',
7249
+ type: 'apiKey'
6946
7250
  }],
6947
- url: '/crm/v1/objects/{objectType}',
7251
+ url: '/content/v1/contents',
6948
7252
  ...options
6949
7253
  });
6950
7254
  /**
6951
- * Create record
7255
+ * Create a content
6952
7256
  *
6953
- * Create a customer record with property values and optional initial associations. Discover objectType with schemas.list and allowed property names with properties.list; save the returned id for subsequent calls. Each call creates a record. Example for contacts: {"properties":{"email":"person@example.com"}}. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
7257
+ * Create a video content from one asset of a Media library, before publishing it to end users. Send library_id and asset_id from `praxis.media` (assets.create, assets.list or the asset you uploaded return them); the create pins asset_version (default 1) and immediately asks Media to transcode the wanted renditions, so the content reports readiness processing until they are ready. kind is video, the only kind today. settings is optional and its four groups are merged over the service defaults: source (library_id and asset_id required, asset_version 1, follow_new_versions false, renditions 480/720/1080), access (capability_seconds 600 within 100 to 3000, encryption false, allowed_origins empty), player (poster null, show_title true, accent_color null, default_quality auto, speeds 0.75/1/1.25/1.5/2, storyboard true, autoplay false, remember_position true) and description (at most 2000 characters). An unknown field — including mode, which was removed because a content is always signed — is refused by name with 400. Returns the new content with HTTP 201; save its id for publish, versions and playback calls.
6954
7258
  */
6955
- export const crmObjectsCreate = (options) => (options.client ?? client).post({
7259
+ export const contentCreateContent = (options) => (options.client ?? client).post({
6956
7260
  security: [{
6957
- key: 'crm-bearerAuth',
7261
+ key: 'BearerAuth',
6958
7262
  scheme: 'bearer',
6959
7263
  type: 'http'
7264
+ }, {
7265
+ key: 'ApiKeyAuth',
7266
+ name: 'X-API-Key',
7267
+ type: 'apiKey'
6960
7268
  }],
6961
- url: '/crm/v1/objects/{objectType}',
7269
+ url: '/content/v1/contents',
6962
7270
  ...options,
6963
7271
  headers: {
6964
7272
  'Content-Type': 'application/json',
@@ -6966,50 +7274,39 @@ export const crmObjectsCreate = (options) => (options.client ?? client).post({
6966
7274
  }
6967
7275
  });
6968
7276
  /**
6969
- * Archive record
6970
- *
6971
- * Archive a record selected from objects.list or objects.search when it should leave active results. This removes it from normal lists without deleting its history; archived=true can be used to read archived records. Confirm objectType and objectId before calling. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204.
6972
- */
6973
- export const crmObjectsArchive = (options) => (options.client ?? client).delete({
6974
- security: [{
6975
- key: 'crm-bearerAuth',
6976
- scheme: 'bearer',
6977
- type: 'http'
6978
- }],
6979
- url: '/crm/v1/objects/{objectType}/{objectId}',
6980
- ...options
6981
- });
6982
- /**
6983
- * Retrieve record
7277
+ * Get a content
6984
7278
  *
6985
- * Read one record by id from objects.list, objects.search or objects.create. Select property names with properties and associated object types with associations; use idProperty only when objectId is a value of that unique property. Use archived=true to inspect an archived record.
7279
+ * Read one content with the settings that decide its playback: the source it publishes, its access settings, its player settings, its description, and the version numbers publish and versions calls need. Use it to see the status and readiness before publishing, or to read the live_version a playback will play. A content of another organization, and an archived or unknown id, all answer 404 CONTENT_NOT_FOUND.
6986
7280
  */
6987
- export const crmObjectsRetrieve = (options) => (options.client ?? client).get({
6988
- querySerializer: { parameters: {
6989
- associations: { array: { explode: false } },
6990
- properties: { array: { explode: false } },
6991
- propertiesWithHistory: { array: { explode: false } }
6992
- } },
7281
+ export const contentGetContent = (options) => (options.client ?? client).get({
6993
7282
  security: [{
6994
- key: 'crm-bearerAuth',
7283
+ key: 'BearerAuth',
6995
7284
  scheme: 'bearer',
6996
7285
  type: 'http'
7286
+ }, {
7287
+ key: 'ApiKeyAuth',
7288
+ name: 'X-API-Key',
7289
+ type: 'apiKey'
6997
7290
  }],
6998
- url: '/crm/v1/objects/{objectType}/{objectId}',
7291
+ url: '/content/v1/contents/{content_id}',
6999
7292
  ...options
7000
7293
  });
7001
7294
  /**
7002
- * Update record
7295
+ * Update a content
7003
7296
  *
7004
- * Change only the supplied properties of a record selected from objects.list or objects.search. Omitted properties retain their values. Use property names from properties.list and valid stage ids from pipelines.retrieve. Stage-entry requirements must be satisfied by the resulting record; inspect 400 errors before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
7297
+ * Change a content's title, its settings, or both. Send only what changes: each settings group left out keeps its current value, and a group sent is a deep merge, so changing only access.capability_seconds leaves allowed_origins alone. A settings change makes a new version and never touches the live one, except access settings (capability_seconds, encryption, allowed_origins), which a playback reads from the latest version and so take effect at once with no republish (ADR-145 §4). A title-only change makes no version. Changing source (library_id, asset_id, asset_version, library_id, asset_id or renditions) asks Media to transcode again and needs a republish to play. An archived content is final and answers 409 CONTENT_INVALID_STATE.
7005
7298
  */
7006
- export const crmObjectsUpdate = (options) => (options.client ?? client).patch({
7299
+ export const contentUpdateContent = (options) => (options.client ?? client).patch({
7007
7300
  security: [{
7008
- key: 'crm-bearerAuth',
7301
+ key: 'BearerAuth',
7009
7302
  scheme: 'bearer',
7010
7303
  type: 'http'
7304
+ }, {
7305
+ key: 'ApiKeyAuth',
7306
+ name: 'X-API-Key',
7307
+ type: 'apiKey'
7011
7308
  }],
7012
- url: '/crm/v1/objects/{objectType}/{objectId}',
7309
+ url: '/content/v1/contents/{content_id}',
7013
7310
  ...options,
7014
7311
  headers: {
7015
7312
  'Content-Type': 'application/json',
@@ -7017,17 +7314,21 @@ export const crmObjectsUpdate = (options) => (options.client ?? client).patch({
7017
7314
  }
7018
7315
  });
7019
7316
  /**
7020
- * Search records
7317
+ * Publish a content
7021
7318
  *
7022
- * Find records using text query, property filters and sort order rather than scanning a list. Obtain objectType from schemas.list and filter propertyName values from properties.list. Supply filterGroups, sorts, properties, limit and after; use empty arrays for no filters, sorts or property selection, and an empty after for the first page. Copy paging.next.after with the same query to continue. This operation reads records without changing them.
7319
+ * Make a content playable: publish the latest version, or pin the version you send in version to become the live one. Use it after the content's readiness is ready; publishing a version whose renditions are still transcoding answers 409 SOURCE_NOT_READY, and you retry once Media reports ready. A content that is already published can be published again with another version, which swaps the live one; an archived content answers 409 CONTENT_INVALID_STATE. Returns the content with status published and the new live_version. Only a published content opens a playback session.
7023
7320
  */
7024
- export const crmObjectsSearch = (options) => (options.client ?? client).post({
7321
+ export const contentPublishContent = (options) => (options.client ?? client).post({
7025
7322
  security: [{
7026
- key: 'crm-bearerAuth',
7323
+ key: 'BearerAuth',
7027
7324
  scheme: 'bearer',
7028
7325
  type: 'http'
7326
+ }, {
7327
+ key: 'ApiKeyAuth',
7328
+ name: 'X-API-Key',
7329
+ type: 'apiKey'
7029
7330
  }],
7030
- url: '/crm/v1/objects/{objectType}/search',
7331
+ url: '/content/v1/contents/{content_id}/publish',
7031
7332
  ...options,
7032
7333
  headers: {
7033
7334
  'Content-Type': 'application/json',
@@ -7035,54 +7336,245 @@ export const crmObjectsSearch = (options) => (options.client ?? client).post({
7035
7336
  }
7036
7337
  });
7037
7338
  /**
7038
- * Batch read records
7339
+ * Unpublish a content
7039
7340
  *
7040
- * Read a set of known record ids in one call; use objects.search to discover ids first. Supply inputs with ids plus requested properties; set idProperty only when the inputs use unique-property values rather than record ids.
7341
+ * Take a published content offline without deleting it or losing a version. No playback opens on it afterwards, while capabilities already issued run out by themselves within their lifetime (at most 3000 seconds). Publishing it again with a version brings it back. Only a published content can be unpublished; any other state answers 409 CONTENT_INVALID_STATE. Returns the content with status unpublished and its live_version kept for the next publish.
7041
7342
  */
7042
- export const crmObjectsBatchRead = (options) => (options.client ?? client).post({
7343
+ export const contentUnpublishContent = (options) => (options.client ?? client).post({
7043
7344
  security: [{
7044
- key: 'crm-bearerAuth',
7345
+ key: 'BearerAuth',
7045
7346
  scheme: 'bearer',
7046
7347
  type: 'http'
7348
+ }, {
7349
+ key: 'ApiKeyAuth',
7350
+ name: 'X-API-Key',
7351
+ type: 'apiKey'
7047
7352
  }],
7048
- url: '/crm/v1/objects/{objectType}/batch/read',
7049
- ...options,
7050
- headers: {
7051
- 'Content-Type': 'application/json',
7052
- ...options.headers
7053
- }
7353
+ url: '/content/v1/contents/{content_id}/unpublish',
7354
+ ...options
7054
7355
  });
7055
7356
  /**
7056
- * Batch create records
7357
+ * Archive a content
7057
7358
  *
7058
- * Create several records of one object type using inputs with properties and optional associations. Obtain property names from properties.list; each successful input creates a record, so inspect per-item errors before resubmitting failed inputs. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
7359
+ * Close a content permanently when it is no longer published. A published content must be unpublished first, because a live content is never archived directly; archiving a published content answers 409 CONTENT_INVALID_STATE. An archived content is final: it cannot be republished, edited or archived again, it stays out of the list unless status is archived, and no playback opens on it. Returns the content with status archived and archive_time set.
7059
7360
  */
7060
- export const crmObjectsBatchCreate = (options) => (options.client ?? client).post({
7361
+ export const contentArchiveContent = (options) => (options.client ?? client).post({
7061
7362
  security: [{
7062
- key: 'crm-bearerAuth',
7363
+ key: 'BearerAuth',
7063
7364
  scheme: 'bearer',
7064
7365
  type: 'http'
7366
+ }, {
7367
+ key: 'ApiKeyAuth',
7368
+ name: 'X-API-Key',
7369
+ type: 'apiKey'
7065
7370
  }],
7066
- url: '/crm/v1/objects/{objectType}/batch/create',
7067
- ...options,
7068
- headers: {
7069
- 'Content-Type': 'application/json',
7070
- ...options.headers
7071
- }
7371
+ url: '/content/v1/contents/{content_id}/archive',
7372
+ ...options
7072
7373
  });
7073
7374
  /**
7074
- * Batch update records
7375
+ * List versions
7075
7376
  *
7076
- * Apply distinct property patches to existing records identified by inputs[].id. Obtain ids from objects.list or objects.search and property names from properties.list. Omitted properties retain their values; inspect results and errors for each input. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
7377
+ * Read the immutable version history of a content, newest version first. Each entry is a snapshot of the settings at the time it was saved, with live telling whether that version is the one a playback plays. Use it to find the version number to pin in publish, or to read the access settings a playback is currently reading (they come from the latest version). page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null.
7077
7378
  */
7078
- export const crmObjectsBatchUpdate = (options) => (options.client ?? client).post({
7379
+ export const contentListVersions = (options) => (options.client ?? client).get({
7079
7380
  security: [{
7080
- key: 'crm-bearerAuth',
7381
+ key: 'BearerAuth',
7081
7382
  scheme: 'bearer',
7082
7383
  type: 'http'
7384
+ }, {
7385
+ key: 'ApiKeyAuth',
7386
+ name: 'X-API-Key',
7387
+ type: 'apiKey'
7083
7388
  }],
7084
- url: '/crm/v1/objects/{objectType}/batch/update',
7085
- ...options,
7389
+ url: '/content/v1/contents/{content_id}/versions',
7390
+ ...options
7391
+ });
7392
+ /**
7393
+ * Get a version
7394
+ *
7395
+ * Read one immutable version of a content: the settings exactly as they were saved, the live flag, when it was created and which actor created it. Use it to compare a version with the live one before pinning it in publish, or to check the access settings a playback is currently reading. The version segment is the positive version number from the versions list; an unknown number answers 404 VERSION_NOT_FOUND and an unknown content 404 CONTENT_NOT_FOUND.
7396
+ */
7397
+ export const contentGetVersion = (options) => (options.client ?? client).get({
7398
+ security: [{
7399
+ key: 'BearerAuth',
7400
+ scheme: 'bearer',
7401
+ type: 'http'
7402
+ }, {
7403
+ key: 'ApiKeyAuth',
7404
+ name: 'X-API-Key',
7405
+ type: 'apiKey'
7406
+ }],
7407
+ url: '/content/v1/contents/{content_id}/versions/{version}',
7408
+ ...options
7409
+ });
7410
+ /**
7411
+ * Open a playback session
7412
+ *
7413
+ * Open one playback of a published content for an end user and get the manifest address a player loads. No platform API key is needed: the caller is the end user's own Praxis customer access token carried as `Authorization: Bearer <access_token>`, verified by this door exactly as the customer exchange verifies it. A caller with no token is left to the service, which refuses it RESOURCE_NOT_GRANTED, because a content is always signed and there is no public playback. The organization is taken from the content row, never from the token, and a token that claims another organization is refused. The content must be published (otherwise 403 CONTENT_NOT_PUBLISHED), its allowed_origins must accept the request Origin when the list is not empty (otherwise 403 ORIGIN_NOT_ALLOWED), the token must cover a resource for this content (otherwise 403 RESOURCE_NOT_GRANTED) and the pinned version must be ready (otherwise 409 SOURCE_NOT_READY; retry once readiness is ready). Returns HTTP 201 with the session id, manifest_url (https://content.praxisusercontent.com/{content_id}/{capability}/master.m3u8), expire_time, the renditions, the poster, the title when the player shows it, and the player settings. The playback reads access settings from the content's latest version and source and player from the live version, so a tightened origin or lifetime takes effect without a republish. This door has its own per-IP request budget: over it answers 429 RATE_LIMITED with Retry-After.
7414
+ */
7415
+ export const contentCreatePlaybackSession = (options) => (options.client ?? client).post({
7416
+ url: '/content/v1/playback/sessions',
7417
+ ...options,
7418
+ headers: {
7419
+ 'Content-Type': 'application/json',
7420
+ ...options.headers
7421
+ }
7422
+ });
7423
+ /**
7424
+ * List records
7425
+ *
7426
+ * Browse records of one object type and obtain ids for retrieval or edits. Discover objectType with schemas.list; select properties by internal names from properties.list. Omit after for the first page, then copy paging.next.after until no next page is returned. archived defaults to false; use objects.search for property filters.
7427
+ */
7428
+ export const crmObjectsList = (options) => (options.client ?? client).get({
7429
+ querySerializer: { parameters: {
7430
+ associations: { array: { explode: false } },
7431
+ properties: { array: { explode: false } },
7432
+ propertiesWithHistory: { array: { explode: false } }
7433
+ } },
7434
+ security: [{
7435
+ key: 'crm-bearerAuth',
7436
+ scheme: 'bearer',
7437
+ type: 'http'
7438
+ }],
7439
+ url: '/crm/v1/objects/{objectType}',
7440
+ ...options
7441
+ });
7442
+ /**
7443
+ * Create record
7444
+ *
7445
+ * Create a customer record with property values and optional initial associations. Discover objectType with schemas.list and allowed property names with properties.list; save the returned id for subsequent calls. Each call creates a record. Example for contacts: {"properties":{"email":"person@example.com"}}. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
7446
+ */
7447
+ export const crmObjectsCreate = (options) => (options.client ?? client).post({
7448
+ security: [{
7449
+ key: 'crm-bearerAuth',
7450
+ scheme: 'bearer',
7451
+ type: 'http'
7452
+ }],
7453
+ url: '/crm/v1/objects/{objectType}',
7454
+ ...options,
7455
+ headers: {
7456
+ 'Content-Type': 'application/json',
7457
+ ...options.headers
7458
+ }
7459
+ });
7460
+ /**
7461
+ * Archive record
7462
+ *
7463
+ * Archive a record selected from objects.list or objects.search when it should leave active results. This removes it from normal lists without deleting its history; archived=true can be used to read archived records. Confirm objectType and objectId before calling. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204.
7464
+ */
7465
+ export const crmObjectsArchive = (options) => (options.client ?? client).delete({
7466
+ security: [{
7467
+ key: 'crm-bearerAuth',
7468
+ scheme: 'bearer',
7469
+ type: 'http'
7470
+ }],
7471
+ url: '/crm/v1/objects/{objectType}/{objectId}',
7472
+ ...options
7473
+ });
7474
+ /**
7475
+ * Retrieve record
7476
+ *
7477
+ * Read one record by id from objects.list, objects.search or objects.create. Select property names with properties and associated object types with associations; use idProperty only when objectId is a value of that unique property. Use archived=true to inspect an archived record.
7478
+ */
7479
+ export const crmObjectsRetrieve = (options) => (options.client ?? client).get({
7480
+ querySerializer: { parameters: {
7481
+ associations: { array: { explode: false } },
7482
+ properties: { array: { explode: false } },
7483
+ propertiesWithHistory: { array: { explode: false } }
7484
+ } },
7485
+ security: [{
7486
+ key: 'crm-bearerAuth',
7487
+ scheme: 'bearer',
7488
+ type: 'http'
7489
+ }],
7490
+ url: '/crm/v1/objects/{objectType}/{objectId}',
7491
+ ...options
7492
+ });
7493
+ /**
7494
+ * Update record
7495
+ *
7496
+ * Change only the supplied properties of a record selected from objects.list or objects.search. Omitted properties retain their values. Use property names from properties.list and valid stage ids from pipelines.retrieve. Stage-entry requirements must be satisfied by the resulting record; inspect 400 errors before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
7497
+ */
7498
+ export const crmObjectsUpdate = (options) => (options.client ?? client).patch({
7499
+ security: [{
7500
+ key: 'crm-bearerAuth',
7501
+ scheme: 'bearer',
7502
+ type: 'http'
7503
+ }],
7504
+ url: '/crm/v1/objects/{objectType}/{objectId}',
7505
+ ...options,
7506
+ headers: {
7507
+ 'Content-Type': 'application/json',
7508
+ ...options.headers
7509
+ }
7510
+ });
7511
+ /**
7512
+ * Search records
7513
+ *
7514
+ * Find records using text query, property filters and sort order rather than scanning a list. Obtain objectType from schemas.list and filter propertyName values from properties.list. Supply filterGroups, sorts, properties, limit and after; use empty arrays for no filters, sorts or property selection, and an empty after for the first page. Copy paging.next.after with the same query to continue. This operation reads records without changing them.
7515
+ */
7516
+ export const crmObjectsSearch = (options) => (options.client ?? client).post({
7517
+ security: [{
7518
+ key: 'crm-bearerAuth',
7519
+ scheme: 'bearer',
7520
+ type: 'http'
7521
+ }],
7522
+ url: '/crm/v1/objects/{objectType}/search',
7523
+ ...options,
7524
+ headers: {
7525
+ 'Content-Type': 'application/json',
7526
+ ...options.headers
7527
+ }
7528
+ });
7529
+ /**
7530
+ * Batch read records
7531
+ *
7532
+ * Read a set of known record ids in one call; use objects.search to discover ids first. Supply inputs with ids plus requested properties; set idProperty only when the inputs use unique-property values rather than record ids.
7533
+ */
7534
+ export const crmObjectsBatchRead = (options) => (options.client ?? client).post({
7535
+ security: [{
7536
+ key: 'crm-bearerAuth',
7537
+ scheme: 'bearer',
7538
+ type: 'http'
7539
+ }],
7540
+ url: '/crm/v1/objects/{objectType}/batch/read',
7541
+ ...options,
7542
+ headers: {
7543
+ 'Content-Type': 'application/json',
7544
+ ...options.headers
7545
+ }
7546
+ });
7547
+ /**
7548
+ * Batch create records
7549
+ *
7550
+ * Create several records of one object type using inputs with properties and optional associations. Obtain property names from properties.list; each successful input creates a record, so inspect per-item errors before resubmitting failed inputs. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
7551
+ */
7552
+ export const crmObjectsBatchCreate = (options) => (options.client ?? client).post({
7553
+ security: [{
7554
+ key: 'crm-bearerAuth',
7555
+ scheme: 'bearer',
7556
+ type: 'http'
7557
+ }],
7558
+ url: '/crm/v1/objects/{objectType}/batch/create',
7559
+ ...options,
7560
+ headers: {
7561
+ 'Content-Type': 'application/json',
7562
+ ...options.headers
7563
+ }
7564
+ });
7565
+ /**
7566
+ * Batch update records
7567
+ *
7568
+ * Apply distinct property patches to existing records identified by inputs[].id. Obtain ids from objects.list or objects.search and property names from properties.list. Omitted properties retain their values; inspect results and errors for each input. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
7569
+ */
7570
+ export const crmObjectsBatchUpdate = (options) => (options.client ?? client).post({
7571
+ security: [{
7572
+ key: 'crm-bearerAuth',
7573
+ scheme: 'bearer',
7574
+ type: 'http'
7575
+ }],
7576
+ url: '/crm/v1/objects/{objectType}/batch/update',
7577
+ ...options,
7086
7578
  headers: {
7087
7579
  'Content-Type': 'application/json',
7088
7580
  ...options.headers
@@ -7519,11 +8011,11 @@ export const crmLayoutsUpdate = (options) => (options.client ?? client).put({
7519
8011
  }
7520
8012
  });
7521
8013
  /**
7522
- * List projects
8014
+ * Create a grant code
7523
8015
  *
7524
- * Discover projects owned by the API key organization and obtain project_id values. Results default to active projects ordered by updateTime descending; use filter state = "deleted" to find retained deleted projects for undelete. Continue with next_page_token as page_token until the token is absent.
8016
+ * Sign one of your logged-in end users in from your backend, after your own login succeeded, by handing out a one-time grant code that the browser exchanges for an access token. Call it with the organization API key; never from the browser, because the API key must stay on your server. customer_id is your own identifier for the person (an opaque value such as your database user id, not an email address or phone number); a value starting with anon_ is reserved for anonymous visitors. resources name what the sign-in may reach and is required: each entry is a scope string in the form agent:<id>:chat, content:<id>:play or application:<id>:visit, or an object with that scope plus product params this service stores without interpreting; use the id form for one object and * for every object of a type. expires_in shortens the code's life in seconds (900 seconds, fifteen minutes, by default) and max_session_seconds shortens the sign-in's life (7 days by default); merge_customer_id merges an anonymous visitor's record into this person; origin pins the page the sign-in may be made from. When the browser still holds that visitor's own access token, send it as anonymous_access_token instead of merge_customer_id: the door verifies it and merges the visitor it names, which is the usual way a merchant continues a session the browser already began. The code is single use and unknown, used or expired codes all answer 401 GRANT_CODE_INVALID at the exchange. Returns the code with HTTP 201; pass it to the Kit in the browser and never call this route with it.
7525
8017
  */
7526
- export const cutListProjects = (options) => (options?.client ?? client).get({
8018
+ export const customerCreateGrantCode = (options) => (options.client ?? client).post({
7527
8019
  security: [{
7528
8020
  key: 'BearerAuth',
7529
8021
  scheme: 'bearer',
@@ -7533,15 +8025,62 @@ export const cutListProjects = (options) => (options?.client ?? client).get({
7533
8025
  name: 'X-API-Key',
7534
8026
  type: 'apiKey'
7535
8027
  }],
7536
- url: '/cut/v1/projects',
8028
+ url: '/customer/v1/grant_codes',
8029
+ ...options,
8030
+ headers: {
8031
+ 'Content-Type': 'application/json',
8032
+ ...options.headers
8033
+ }
8034
+ });
8035
+ /**
8036
+ * Exchange a grant code or publishable key
8037
+ *
8038
+ * Turn a grant code, or a publishable key for an anonymous visitor, into the Praxis customer access token that authorizes the Kit's sessions and playbacks. It is PRE-AUTH: no platform API key is needed, because the grant code or the publishable key is the credential; the Kit calls it from the browser, so send the page Origin when the code or key is bound to one. Send exactly one of grant_code or publishable_key — the door refuses any other combination with 400. With grant_code the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, already used, expired and foreign codes all answer 401 GRANT_CODE_INVALID. With publishable_key a new anonymous customer (anon_…) is created and merged into the identified one later if it signs in. The sign-in may be bound to an origin at creation; when the request Origin does not satisfy it, the exchange answers 403 ORIGIN_NOT_ALLOWED, and a blocked end user answers 403 CUSTOMER_BLOCKED. The access token lasts at most two hours and never outlives the sign-in; renew it with praxis.customer.accessTokens.renew before expires_at. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
8039
+ */
8040
+ export const customerCreateAccessToken = (options) => (options.client ?? client).post({
8041
+ url: '/customer/v1/access_tokens',
8042
+ ...options,
8043
+ headers: {
8044
+ 'Content-Type': 'application/json',
8045
+ ...options.headers
8046
+ }
8047
+ });
8048
+ /**
8049
+ * Renew an access token
8050
+ *
8051
+ * Replace a live access token with a fresh one so a signed-in end user stays signed in without signing in again. It is PRE-AUTH: the credential is the token the caller already carries as `Authorization: Bearer <access_token>`, verified by this door, and the token names the sign-in it renews. Call it before the token's expires_at; the sign-in and its resource scopes stay the same, so what the end user may reach does not change. A missing, unverifiable or foreign token answers 401 ACCESS_TOKEN_EXPIRED, and a sign-in that is over answers 401 SIGN_IN_EXPIRED or SIGN_IN_REVOKED, in which case the end user signs in again through praxis.customer.accessTokens.create. A blocked end user answers 403 CUSTOMER_BLOCKED. When the sign-in itself has ended, the renewal does not extend it. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
8052
+ */
8053
+ export const customerRenewAccessToken = (options) => (options?.client ?? client).post({ url: '/customer/v1/access_tokens/renew', ...options });
8054
+ /**
8055
+ * Sign out the current token
8056
+ *
8057
+ * Sign out: end the sign-in the caller's token belongs to and revoke every token issued from it, exactly as a logout does. It is PRE-AUTH: the credential is the token the caller carries as `Authorization: Bearer <access_token>`. Use it when the end user asks to sign out, and after it every token of that sign-in stops working and a later session or playback answers 401 SIGN_IN_REVOKED; other sign-ins of the same end user are untouched (revoke every token of one end user, organization-wide, with praxis.customer.customers.revokeTokens). A missing or unverifiable token answers 401 ACCESS_TOKEN_EXPIRED. The call answers 200 with an empty body. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
8058
+ */
8059
+ export const customerRevokeCurrentTokens = (options) => (options?.client ?? client).delete({ url: '/customer/v1/access_tokens/current', ...options });
8060
+ /**
8061
+ * List end users
8062
+ *
8063
+ * Read the organization's end-user directory and obtain the customer_id the administrative acts take. Results are ordered by last_seen_at, most recently seen first. Filter with type (identified for people who signed in through a grant code, anonymous for visitors admitted with a publishable key), blocked (true or false), resource (one product in the form agent:<id>, content:<id> or application:<id>, giving that product's own view of the directory) and q (a prefix of the customer id). Identified and anonymous end users both appear; an anonymous one that later signs in shows merged_into and its record joins that person. page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null, keeping the same filters.
8064
+ */
8065
+ export const customerListCustomers = (options) => (options?.client ?? client).get({
8066
+ security: [{
8067
+ key: 'BearerAuth',
8068
+ scheme: 'bearer',
8069
+ type: 'http'
8070
+ }, {
8071
+ key: 'ApiKeyAuth',
8072
+ name: 'X-API-Key',
8073
+ type: 'apiKey'
8074
+ }],
8075
+ url: '/customer/v1/customers',
7537
8076
  ...options
7538
8077
  });
7539
8078
  /**
7540
- * Create project
8079
+ * Delete an end user
7541
8080
  *
7542
- * Create a blank editing project in the API key organization before writing a script. First obtain accessible library ids from praxis.media; bindings must include exactly one read_write library with default_upload true. Each call creates a new project and returns HTTP 201; save its id for execute, state and timeline calls. All editing positions use seconds.
8081
+ * Delete one end user on the merchant's own confirmation, for a deletion request the person made to you. The confirm query parameter must repeat the path's customer_id; the door passes it through verbatim and the service refuses any other value with 400 INVALID_PARAMS, so a missing confirm never deletes anything. The deletion is announced on the platform event bus and each product deletes its own sessions, events and files for that person, so the call returns as soon as the directory record is gone, not when every product has finished. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
7543
8082
  */
7544
- export const cutCreateProject = (options) => (options.client ?? client).post({
8083
+ export const customerDeleteCustomer = (options) => (options.client ?? client).delete({
7545
8084
  security: [{
7546
8085
  key: 'BearerAuth',
7547
8086
  scheme: 'bearer',
@@ -7551,19 +8090,15 @@ export const cutCreateProject = (options) => (options.client ?? client).post({
7551
8090
  name: 'X-API-Key',
7552
8091
  type: 'apiKey'
7553
8092
  }],
7554
- url: '/cut/v1/projects',
7555
- ...options,
7556
- headers: {
7557
- 'Content-Type': 'application/json',
7558
- ...options.headers
7559
- }
8093
+ url: '/customer/v1/customers/{customer_id}',
8094
+ ...options
7560
8095
  });
7561
8096
  /**
7562
- * Delete project
8097
+ * Get an end user
7563
8098
  *
7564
- * Soft-delete a project selected from projects.list. The project is retained for seven days until purge_time and can be restored with undelete before that deadline. Deleted projects cannot be edited; list with filter state = "deleted" to locate retained projects.
8099
+ * Read one end user of the organization: the id, its kind, whether it is blocked, its metadata and when it was first and last seen. Add expand=products,sign_ins,usage (comma separated, any combination) to also receive the products it has used with their counts, its sign-ins with their resource scopes, and its recorded usage over the whole time. An unknown id, and an id of another organization, answer 404 CUSTOMER_NOT_FOUND.
7565
8100
  */
7566
- export const cutDeleteProject = (options) => (options.client ?? client).delete({
8101
+ export const customerGetCustomer = (options) => (options.client ?? client).get({
7567
8102
  security: [{
7568
8103
  key: 'BearerAuth',
7569
8104
  scheme: 'bearer',
@@ -7573,15 +8108,15 @@ export const cutDeleteProject = (options) => (options.client ?? client).delete({
7573
8108
  name: 'X-API-Key',
7574
8109
  type: 'apiKey'
7575
8110
  }],
7576
- url: '/cut/v1/projects/{project_id}',
8111
+ url: '/customer/v1/customers/{customer_id}',
7577
8112
  ...options
7578
8113
  });
7579
8114
  /**
7580
- * Retrieve project
8115
+ * Read end-user usage
7581
8116
  *
7582
- * Inspect project metadata, settings and library bindings before editing. Copy id from projects.create or list; expand=timeline,exports,versions includes selected related resources. The expanded timeline uses seconds and the returned revision can guard a later execute call with expected_revision.
8117
+ * Read what one end user has cost the organization, per product and per day. The directory stores no cost itself: this reads billing by the customerId dimension shared by every product, so it is the money figure the platform charged for that person. Send from and/or to as RFC 3339 times to narrow the window; omit both for everything recorded. Returns the total, the per-product breakdown and the per-day breakdown. An unknown id answers 404 CUSTOMER_NOT_FOUND.
7583
8118
  */
7584
- export const cutRetrieveProject = (options) => (options.client ?? client).get({
8119
+ export const customerGetUsage = (options) => (options.client ?? client).get({
7585
8120
  security: [{
7586
8121
  key: 'BearerAuth',
7587
8122
  scheme: 'bearer',
@@ -7591,15 +8126,15 @@ export const cutRetrieveProject = (options) => (options.client ?? client).get({
7591
8126
  name: 'X-API-Key',
7592
8127
  type: 'apiKey'
7593
8128
  }],
7594
- url: '/cut/v1/projects/{project_id}',
8129
+ url: '/customer/v1/customers/{customer_id}/usage',
7595
8130
  ...options
7596
8131
  });
7597
8132
  /**
7598
- * Update project metadata
8133
+ * Block an end user
7599
8134
  *
7600
- * Change the project display name or replace its labels by naming those fields in update_mask. Use execute for clip or track edits. Each successful update commits a new revision; labels are replaced as a whole when selected, so read and merge existing labels before overwriting them.
8135
+ * Block one end user across every product of the organization. From then on no grant code, sign-in, renewal or new session and no playback is accepted for this id — each product's admission door refuses it at once. A stream already running and a playback capability already issued ride out their own token, at most two hours and 3000 seconds; they are not cut off. Send reason to record why, and the response's blocked field carries the block time, the reason and the actor. Blocking an already blocked end user is idempotent: the first block time is kept. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
7601
8136
  */
7602
- export const cutUpdateProject = (options) => (options.client ?? client).patch({
8137
+ export const customerBlockCustomer = (options) => (options.client ?? client).post({
7603
8138
  security: [{
7604
8139
  key: 'BearerAuth',
7605
8140
  scheme: 'bearer',
@@ -7609,7 +8144,7 @@ export const cutUpdateProject = (options) => (options.client ?? client).patch({
7609
8144
  name: 'X-API-Key',
7610
8145
  type: 'apiKey'
7611
8146
  }],
7612
- url: '/cut/v1/projects/{project_id}',
8147
+ url: '/customer/v1/customers/{customer_id}/block',
7613
8148
  ...options,
7614
8149
  headers: {
7615
8150
  'Content-Type': 'application/json',
@@ -7617,11 +8152,11 @@ export const cutUpdateProject = (options) => (options.client ?? client).patch({
7617
8152
  }
7618
8153
  });
7619
8154
  /**
7620
- * Restore deleted project
8155
+ * Unblock an end user
7621
8156
  *
7622
- * Return a retained deleted project to active state before its purge_time. Obtain project_id from projects.list filtered to deleted projects. This restores the project, not an older timeline revision; use versions.restore when reverting editing content.
8157
+ * Lift a block from one end user, so the products accept its grant codes, sign-ins, renewals and new sessions again. Tokens that were revoked to enforce the block are not restored: the end user signs in again for a fresh sign-in. Unblocking an end user that is not blocked is idempotent and returns it unchanged. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
7623
8158
  */
7624
- export const cutUndeleteProject = (options) => (options.client ?? client).post({
8159
+ export const customerUnblockCustomer = (options) => (options.client ?? client).post({
7625
8160
  security: [{
7626
8161
  key: 'BearerAuth',
7627
8162
  scheme: 'bearer',
@@ -7631,25 +8166,217 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
7631
8166
  name: 'X-API-Key',
7632
8167
  type: 'apiKey'
7633
8168
  }],
7634
- url: '/cut/v1/projects/{project_id}:undelete',
8169
+ url: '/customer/v1/customers/{customer_id}/unblock',
7635
8170
  ...options
7636
8171
  });
7637
8172
  /**
7638
- * Execute editing script
7639
- *
7640
- * Edit the current timeline atomically using synchronous JavaScript source. Read state or timeline first, then pass its revision as expected_revision to detect concurrent changes. Unlike Shotstack, execute applies script edits to a persistent project in one transaction. Provide script or a saved edit_id with literal edits, never both; failures roll back writes. A revision conflict while preparing the response may follow a committed edit: retrieve state before retrying. Minimal script after creating a project: `const t = AddTrack("video"); Insert(t, {type: "color", color: "#123456", start: 0, length: 3}); Print(t);`
7641
- *
7642
- * <!-- cut-reference:start -->
7643
- * ### Script function, field and error reference
7644
- *
7645
- * Every script function, clip field and error code has its own section, read one at a time:
8173
+ * Revoke every token of an end user
8174
+ *
8175
+ * End every sign-in of one end user at once, everything of the organization's, not one product's and not one token's. Use it when credentials may have leaked and the end user must not be trusted until it signs in again; a single sign-in is ended instead with praxis.customer.accessTokens.revoke. After it every token of that end user stops working and a new session or playback answers 401 SIGN_IN_REVOKED, while the end user itself stays in the directory and may sign in again. The response counts how many sign-ins were revoked. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
8176
+ */
8177
+ export const customerRevokeTokens = (options) => (options.client ?? client).post({
8178
+ security: [{
8179
+ key: 'BearerAuth',
8180
+ scheme: 'bearer',
8181
+ type: 'http'
8182
+ }, {
8183
+ key: 'ApiKeyAuth',
8184
+ name: 'X-API-Key',
8185
+ type: 'apiKey'
8186
+ }],
8187
+ url: '/customer/v1/customers/{customer_id}/revoke_tokens',
8188
+ ...options
8189
+ });
8190
+ /**
8191
+ * List publishable keys
8192
+ *
8193
+ * List the organization's publishable keys, newest first, so you can see which anonymous admittance is open and what each one may reach. A publishable key is public by design (it ships in the browser page); use it from the Kit to admit anonymous visitors, and never expose an API key this way. The plaintext value is not in this list: it is returned once, by the create call, and only its hash is stored. page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null.
8194
+ */
8195
+ export const customerListPublishableKeys = (options) => (options?.client ?? client).get({
8196
+ security: [{
8197
+ key: 'BearerAuth',
8198
+ scheme: 'bearer',
8199
+ type: 'http'
8200
+ }, {
8201
+ key: 'ApiKeyAuth',
8202
+ name: 'X-API-Key',
8203
+ type: 'apiKey'
8204
+ }],
8205
+ url: '/customer/v1/publishable_keys',
8206
+ ...options
8207
+ });
8208
+ /**
8209
+ * Create a publishable key
8210
+ *
8211
+ * Mint a publishable key so a page can admit anonymous visitors without you signing each one in from your backend. name labels the key for the console and the key list. resources is required and names what an anonymous visitor may reach, in the same form as the grant-code scopes: agent:<id>:chat, content:<id>:play or application:<id>:visit, with * for every object of one type; give it only what the anonymous experience needs, because any visitor who has the page can use the key. The response carries the plaintext key once, in key, and the store keeps only its hash — save it then, because no later call returns it. Returns HTTP 201; the exchange that consumes it is praxis.customer.accessTokens.create with publishable_key.
8212
+ */
8213
+ export const customerCreatePublishableKey = (options) => (options.client ?? client).post({
8214
+ security: [{
8215
+ key: 'BearerAuth',
8216
+ scheme: 'bearer',
8217
+ type: 'http'
8218
+ }, {
8219
+ key: 'ApiKeyAuth',
8220
+ name: 'X-API-Key',
8221
+ type: 'apiKey'
8222
+ }],
8223
+ url: '/customer/v1/publishable_keys',
8224
+ ...options,
8225
+ headers: {
8226
+ 'Content-Type': 'application/json',
8227
+ ...options.headers
8228
+ }
8229
+ });
8230
+ /**
8231
+ * Delete a publishable key
8232
+ *
8233
+ * Delete a publishable key, closing that anonymous admittance for good. A page that still carries the plaintext key can no longer exchange it; any anonymous sign-ins it already made keep working until their own sign-in expires, so end users already admitted are not signed out by this call. Get the key id from the publishable key list, not from the plaintext value (only its hash is stored). An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
8234
+ */
8235
+ export const customerDeletePublishableKey = (options) => (options.client ?? client).delete({
8236
+ security: [{
8237
+ key: 'BearerAuth',
8238
+ scheme: 'bearer',
8239
+ type: 'http'
8240
+ }, {
8241
+ key: 'ApiKeyAuth',
8242
+ name: 'X-API-Key',
8243
+ type: 'apiKey'
8244
+ }],
8245
+ url: '/customer/v1/publishable_keys/{key_id}',
8246
+ ...options
8247
+ });
8248
+ /**
8249
+ * List projects
8250
+ *
8251
+ * Discover projects owned by the API key organization and obtain project_id values. Results default to active projects ordered by updateTime descending; use filter state = "deleted" to find retained deleted projects for undelete. Continue with next_page_token as page_token until the token is absent.
8252
+ */
8253
+ export const cutListProjects = (options) => (options?.client ?? client).get({
8254
+ security: [{
8255
+ key: 'BearerAuth',
8256
+ scheme: 'bearer',
8257
+ type: 'http'
8258
+ }, {
8259
+ key: 'ApiKeyAuth',
8260
+ name: 'X-API-Key',
8261
+ type: 'apiKey'
8262
+ }],
8263
+ url: '/cut/v1/projects',
8264
+ ...options
8265
+ });
8266
+ /**
8267
+ * Create project
8268
+ *
8269
+ * Create a blank editing project in the API key organization before writing a script. First obtain accessible library ids from praxis.media; bindings must include exactly one read_write library with default_upload true. Each call creates a new project and returns HTTP 201; save its id for execute, state and timeline calls. All editing positions use seconds.
8270
+ */
8271
+ export const cutCreateProject = (options) => (options.client ?? client).post({
8272
+ security: [{
8273
+ key: 'BearerAuth',
8274
+ scheme: 'bearer',
8275
+ type: 'http'
8276
+ }, {
8277
+ key: 'ApiKeyAuth',
8278
+ name: 'X-API-Key',
8279
+ type: 'apiKey'
8280
+ }],
8281
+ url: '/cut/v1/projects',
8282
+ ...options,
8283
+ headers: {
8284
+ 'Content-Type': 'application/json',
8285
+ ...options.headers
8286
+ }
8287
+ });
8288
+ /**
8289
+ * Delete project
8290
+ *
8291
+ * Soft-delete a project selected from projects.list. The project is retained for seven days until purge_time and can be restored with undelete before that deadline. Deleted projects cannot be edited; list with filter state = "deleted" to locate retained projects.
8292
+ */
8293
+ export const cutDeleteProject = (options) => (options.client ?? client).delete({
8294
+ security: [{
8295
+ key: 'BearerAuth',
8296
+ scheme: 'bearer',
8297
+ type: 'http'
8298
+ }, {
8299
+ key: 'ApiKeyAuth',
8300
+ name: 'X-API-Key',
8301
+ type: 'apiKey'
8302
+ }],
8303
+ url: '/cut/v1/projects/{project_id}',
8304
+ ...options
8305
+ });
8306
+ /**
8307
+ * Retrieve project
8308
+ *
8309
+ * Inspect project metadata, settings and library bindings before editing. Copy id from projects.create or list; expand=timeline,exports,versions includes selected related resources. The expanded timeline uses seconds and the returned revision can guard a later execute call with expected_revision.
8310
+ */
8311
+ export const cutRetrieveProject = (options) => (options.client ?? client).get({
8312
+ security: [{
8313
+ key: 'BearerAuth',
8314
+ scheme: 'bearer',
8315
+ type: 'http'
8316
+ }, {
8317
+ key: 'ApiKeyAuth',
8318
+ name: 'X-API-Key',
8319
+ type: 'apiKey'
8320
+ }],
8321
+ url: '/cut/v1/projects/{project_id}',
8322
+ ...options
8323
+ });
8324
+ /**
8325
+ * Update project metadata
8326
+ *
8327
+ * Change the project display name or replace its labels by naming those fields in update_mask. Use execute for clip or track edits. Each successful update commits a new revision; labels are replaced as a whole when selected, so read and merge existing labels before overwriting them.
8328
+ */
8329
+ export const cutUpdateProject = (options) => (options.client ?? client).patch({
8330
+ security: [{
8331
+ key: 'BearerAuth',
8332
+ scheme: 'bearer',
8333
+ type: 'http'
8334
+ }, {
8335
+ key: 'ApiKeyAuth',
8336
+ name: 'X-API-Key',
8337
+ type: 'apiKey'
8338
+ }],
8339
+ url: '/cut/v1/projects/{project_id}',
8340
+ ...options,
8341
+ headers: {
8342
+ 'Content-Type': 'application/json',
8343
+ ...options.headers
8344
+ }
8345
+ });
8346
+ /**
8347
+ * Restore deleted project
8348
+ *
8349
+ * Return a retained deleted project to active state before its purge_time. Obtain project_id from projects.list filtered to deleted projects. This restores the project, not an older timeline revision; use versions.restore when reverting editing content.
8350
+ */
8351
+ export const cutUndeleteProject = (options) => (options.client ?? client).post({
8352
+ security: [{
8353
+ key: 'BearerAuth',
8354
+ scheme: 'bearer',
8355
+ type: 'http'
8356
+ }, {
8357
+ key: 'ApiKeyAuth',
8358
+ name: 'X-API-Key',
8359
+ type: 'apiKey'
8360
+ }],
8361
+ url: '/cut/v1/projects/{project_id}:undelete',
8362
+ ...options
8363
+ });
8364
+ /**
8365
+ * Execute editing script
8366
+ *
8367
+ * Edit the current timeline atomically using synchronous JavaScript source. Read state or timeline first, then pass its revision as expected_revision to detect concurrent changes. Unlike Shotstack, execute applies script edits to a persistent project in one transaction. Provide script or a saved edit_id with literal edits, never both; failures roll back writes. A revision conflict while preparing the response may follow a committed edit: retrieve state before retrying. Minimal script after creating a project: `const t = AddTrack("video"); Insert(t, {type: "color", color: "#123456", start: 0, length: 3}); Print(t);`
8368
+ *
8369
+ * <!-- cut-reference:start -->
8370
+ * ### Script function, field and error reference
8371
+ *
8372
+ * Every script function, clip field and error code has its own section, read one at a time:
7646
8373
  *
7647
8374
  * ```
7648
- * codemode.describe("praxis.cut.script.<Name>") // one function: signature, arguments, return, errors, example
7649
- * codemode.describe("praxis.cut.fields.<name>") // one field: type, unit, range, default, where writable
7650
- * codemode.describe("praxis.cut.errors.<CODE>") // one code: meaning, causes, fix
7651
- * codemode.describe("praxis.cut.script") // names, one page at a time
7652
- * ```
8375
+ * codemode.describe("praxis.cut.script.<Name>") // one function: signature, arguments, return, errors, example
8376
+ * codemode.describe("praxis.cut.fields.<name>") // one field: type, unit, range, default, where writable
8377
+ * codemode.describe("praxis.cut.errors.<CODE>") // one code: meaning, causes, fix
8378
+ * codemode.describe("praxis.cut.script") // names, one page at a time
8379
+ * ```
7653
8380
  *
7654
8381
  * Published at https://docs.deepraxis.com/docs/developers/cut/script-reference with one anchor per entry. Names below omit the `praxis.cut.<kind>.` prefix.
7655
8382
  *
@@ -7681,6 +8408,12 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
7681
8408
  * - `RippleDeleteRange` — Cut a time range and close the gap.
7682
8409
  * - `DeleteWords` — Cut transcript words and ripple every track, keeping a breath.
7683
8410
  * - `RemoveFillers` — List and delete filler words by media's own labels; dryRun first.
8411
+ * - `Matte` — Replace the clip's background with media's matte of its source, read as a luma mask.
8412
+ * - `EnhanceVoice` — Replace a clip's sound with media's enhanced speech on its own audio track.
8413
+ * - `AlignByAudio` — Line two recordings of the same sound up by media's measurement of their offset.
8414
+ * - `Reframe` — Swap the clip's media for media's reframed take at the aspect you ask for.
8415
+ * - `Upscale` — Swap the clip's media for media's upscaled take at the height you ask for.
8416
+ * - `Redact` — Pixelate the faces, QR codes or text media marks, leaving the rest of the frame plain.
7684
8417
  * - `AddTrack` — Add a video, audio or caption track.
7685
8418
  * - `MoveTrack` — Move a track between layers; 0 is the topmost.
7686
8419
  * - `UpdateTrack` — Change a track's name, lock, gain or role.
@@ -7714,8 +8447,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
7714
8447
  * - `transform` — Position, scale, rotation, opacity, crop, blur.
7715
8448
  * - `fit` — contain, cover, fill or none.
7716
8449
  * - `blend` — Layer blend mode; null clears.
7717
- * - `style` — Text styling: font, fill, strokes, glow, position.
7718
- * - `style.position` — top, middle or bottom; omit it, never null.
8450
+ * - `style` — Text styling in Shotstack's rich shape: font, gradient, stroke, shadow, box, border, align, per-word animation.
8451
+ * - `style.align.vertical` — top, middle or bottom; omit it, never null.
7719
8452
  * - `playback` — Rate, direction, audio policy, or freeze.
7720
8453
  * - `volumeDb` — Audio level in dB; 0 is source level.
7721
8454
  * - `gain` — Keyframed audio level in dB.
@@ -7736,6 +8469,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
7736
8469
  * - `JOIN_CONFLICT` — A join is invalid or blocks this edit.
7737
8470
  * - `INVALID_TRANSITION` — Bad transition kind, parameter or length.
7738
8471
  * - `INVALID_STYLE` — A style value is out of range.
8472
+ * - `UNSUPPORTED_STYLE_FIELD` — A Shotstack style field this platform cannot render yet.
8473
+ * - `STYLE_LEGACY_FIELDS` — A style written in the old flat shape; it still works.
7739
8474
  * - `INVALID_MASK` — A mask definition is malformed.
7740
8475
  * - `MASK_IN_USE` — The edit would break a live mask.
7741
8476
  * - `TOO_MANY_MASKS` — At most 16 masks per project.
@@ -7784,6 +8519,9 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
7784
8519
  * - `MEDIA_OFFLINE` — The asset cannot be fetched right now.
7785
8520
  * - `MEDIA_UNAVAILABLE` — The asset is not usable for rendering.
7786
8521
  * - `MEDIA_IMPORT_FAILED` — Importing media failed.
8522
+ * - `MEDIA_PROCESSING` — Media is still processing the clip; wait for the job and rerun.
8523
+ * - `MEDIA_PROCESSING_FAILED` — Media's processing job failed; nothing changed.
8524
+ * - `ALIGNMENT_UNCERTAIN` — `AlignByAudio` confidence too low; nothing changed.
7787
8525
  * - `FRAME_OUT_OF_RANGE` — The preview time is outside the project.
7788
8526
  * - `PROJECT_TOO_LARGE` — The project exceeds the size limit.
7789
8527
  * - `RESPONSE_TOO_LARGE` — The response would exceed its budget.
@@ -8760,6 +9498,20 @@ export const devopsTestReportsUpload = (options) => (options.client ?? client).p
8760
9498
  ...options.headers
8761
9499
  }
8762
9500
  });
9501
+ /**
9502
+ * Retrieve the merge gate's test plan at a commit
9503
+ *
9504
+ * 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.
9505
+ */
9506
+ export const devopsTestPlanGet = (options) => (options.client ?? client).get({
9507
+ security: [{
9508
+ key: 'devops-bearerAuth',
9509
+ scheme: 'bearer',
9510
+ type: 'http'
9511
+ }],
9512
+ url: '/devops/v1/projects/{project}/test-plan',
9513
+ ...options
9514
+ });
8763
9515
  /**
8764
9516
  * List projects
8765
9517
  *
@@ -8955,7 +9707,7 @@ export const devopsPromotionsCancel = (options) => (options.client ?? client).po
8955
9707
  /**
8956
9708
  * Retry a promotion
8957
9709
  *
8958
- * 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.
9710
+ * 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.
8959
9711
  */
8960
9712
  export const devopsPromotionsRetry = (options) => (options.client ?? client).post({
8961
9713
  security: [{
@@ -9140,6 +9892,24 @@ export const devopsFlagsCreate = (options) => (options.client ?? client).post({
9140
9892
  ...options.headers
9141
9893
  }
9142
9894
  });
9895
+ /**
9896
+ * Report a project's flag code references
9897
+ *
9898
+ * Store one code-reference scan for a project in a single call: send the commit the scan read (scannedCommit, the checkout's `git rev-parse HEAD`) and, for every flag key the scan knows, the places code reads it ({path, line, snippet}). Send every key the checkout still expects to be referenced, including the ones found nowhere: a project flag with no entry in refs is stored with zero references, and zero is what lets `archive` see the code that named the flag is gone. A key that matches no live flag of the project — one already archived, or from another project — is returned in unknownKeys and stores nothing; reporting it is not an error. updated is how many flags were written, which is every live flag of the project because each gets a row. This is the write side of the archive gate: `POST /v1/flags/{id}:archive` refuses with FLAG_STILL_REFERENCED while the stored count is above zero, and the count it reads is exactly the one stored here. Staleness is not corrected for — the stored scannedCommit and count are used as they stand. At most 500 references are stored per flag; a longer list is truncated for storage while count still reports the true number. Reporting changes no flag's runtime behaviour.
9899
+ */
9900
+ export const devopsFlagsReportCodeRefs = (options) => (options.client ?? client).post({
9901
+ security: [{
9902
+ key: 'devops-bearerAuth',
9903
+ scheme: 'bearer',
9904
+ type: 'http'
9905
+ }],
9906
+ url: '/devops/v1/projects/{project}/flags/code-refs',
9907
+ ...options,
9908
+ headers: {
9909
+ 'Content-Type': 'application/json',
9910
+ ...options.headers
9911
+ }
9912
+ });
9143
9913
  /**
9144
9914
  * Retrieve a flag
9145
9915
  *
@@ -9211,7 +9981,7 @@ export const devopsFlagsConclude = (options) => (options.client ?? client).post(
9211
9981
  /**
9212
9982
  * Archive a flag
9213
9983
  *
9214
- * Archive a flag whose code is gone: it stops evaluating in every environment, leaves the ordinary flag list and keeps its key and history. Archiving changes the flag's lifecycle only and does not check code references: codeRefs.count on the flag is informational, and the call succeeds even while code still names the key (ticket #1881), in which case that code gets its default. It is irreversible through the API: there is no unarchive call, an archived flag cannot be updated or configured, and its key stays reserved, so a later create with the same key is refused; archiving an archived flag just answers it again. A flag that may come back is turned off in its environment instead. The order is: open the flag fully (`praxis api devops flag environment update`), delete the code that names the key and deploy that, run `praxis devops flag remove <key>` (local, lists the references still naming the key), then `praxis api devops flag archive <id>`, then `praxis devops flag sync` so the local registry drops it. There is no separate delete call.
9984
+ * Archive a flag whose code is gone: it stops evaluating in every environment, leaves the ordinary flag list and keeps its key and history. Archiving is the delete, and the platform refuses it while the last reported scan still finds the key in code or while the flag is on in an environment: a flag whose codeRefs.count is above zero is refused with FLAG_STILL_REFERENCED, and a flag whose on state is true in any environment is refused with FLAG_HAS_LIVE_RULES, so archiving succeeds only once the code that names the key is deployed away and every environment is off. The gate reads the stored scan as it stands — an out-of-date scannedCommit is not corrected for — and there is no force flag. It is irreversible through the API: there is no unarchive call, an archived flag cannot be updated or configured, and its key stays reserved, so a later create with the same key is refused; archiving an archived flag just answers it again. A flag that may come back is turned off in its environment instead. The order is: open the flag fully (`praxis api devops flag environment update`), delete the code that names the key and deploy that, run `praxis devops flag remove <key>` (local, lists the references still naming the key), then `praxis api devops flag archive <id>`, then `praxis devops flag sync` so the local registry drops it. There is no separate delete call.
9215
9985
  */
9216
9986
  export const devopsFlagsArchive = (options) => (options.client ?? client).post({
9217
9987
  security: [{
@@ -9435,7 +10205,7 @@ export const devopsChangesGet = (options) => (options.client ?? client).get({
9435
10205
  /**
9436
10206
  * Abandon a change
9437
10207
  *
9438
- * 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.
10208
+ * 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.
9439
10209
  */
9440
10210
  export const devopsChangesAbandon = (options) => (options.client ?? client).post({
9441
10211
  security: [{
@@ -9468,6 +10238,38 @@ export const devopsChangesMarkLastSlice = (options) => (options.client ?? client
9468
10238
  ...options.headers
9469
10239
  }
9470
10240
  });
10241
+ /**
10242
+ * Open a change's pull request
10243
+ *
10244
+ * 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.
10245
+ */
10246
+ export const devopsChangesOpenPullRequest = (options) => (options.client ?? client).post({
10247
+ security: [{
10248
+ key: 'devops-bearerAuth',
10249
+ scheme: 'bearer',
10250
+ type: 'http'
10251
+ }],
10252
+ url: '/devops/v1/changes/{id}:openPullRequest',
10253
+ ...options,
10254
+ headers: {
10255
+ 'Content-Type': 'application/json',
10256
+ ...options.headers
10257
+ }
10258
+ });
10259
+ /**
10260
+ * Get a change workspace's read-only git credential
10261
+ *
10262
+ * A read-only git credential for the repository a change's project is bound to: a GitHub App installation token limited to that one repository with contents read, which GitHub expires within an hour. It exists for git's credential helper inside the change's cloud workspace (`praxis devops change git-credential`, installed by DevOps when it clones the repository), so `git fetch`, history and lazily fetched file contents work there; the helper hands the token to that one git request and keeps nothing. Writing is never possible with it: commits reach the branch only through the unit push. You do not need to call this yourself. Anyone who can read the change can read its repository already through the code reads, so this grants no new access. An abandoned change is refused with INVALID_ARGUMENT and a project without a repository with SOURCE_NOT_CONFIGURED. The id is the branch name and its slash must be percent-encoded in the path (fix%2Fexpired-links).
10263
+ */
10264
+ export const devopsChangesGitCredential = (options) => (options.client ?? client).post({
10265
+ security: [{
10266
+ key: 'devops-bearerAuth',
10267
+ scheme: 'bearer',
10268
+ type: 'http'
10269
+ }],
10270
+ url: '/devops/v1/changes/{id}:gitCredential',
10271
+ ...options
10272
+ });
9471
10273
  /**
9472
10274
  * List a project's pull requests
9473
10275
  *
@@ -9546,6 +10348,24 @@ export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? c
9546
10348
  ...options.headers
9547
10349
  }
9548
10350
  });
10351
+ /**
10352
+ * Close a pull request without merging it
10353
+ *
10354
+ * 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.
10355
+ */
10356
+ export const devopsPullRequestsClose = (options) => (options.client ?? client).post({
10357
+ security: [{
10358
+ key: 'devops-bearerAuth',
10359
+ scheme: 'bearer',
10360
+ type: 'http'
10361
+ }],
10362
+ url: '/devops/v1/pull-requests/{id}:close',
10363
+ ...options,
10364
+ headers: {
10365
+ 'Content-Type': 'application/json',
10366
+ ...options.headers
10367
+ }
10368
+ });
9549
10369
  /**
9550
10370
  * List connections
9551
10371
  *
@@ -9839,7 +10659,7 @@ export const devopsUnitsFetch = (options) => (options.client ?? client).post({
9839
10659
  /**
9840
10660
  * Push a unit's branch
9841
10661
  *
9842
- * Publish the unit's local commits to the remote for the change: the machine itself holds no git credential and cannot reach the remote, so this verb is the way work done on a unit lands. ref says what to push — branch for the change's own branch, wip for this unit's own refs/praxis/wip/<change>, or a full ref name; anything else (the default branch, another change's branch, a tag, another unit's wip ref) is refused with 400 PUSH_REF_FORBIDDEN and nothing is pushed. expectedHead is the commit you believe the remote branch is at now; DevOps checks it before signing anything, and a remote that has moved since answers 409 HEAD_MOVED with nothing pushed, so fetch first when unsure, reconcile, and send the new head. For branch the call also takes a lease on that head, so the push cannot silently overwrite work that landed in between; wip is this change's own ref and is force-pushed. On success the answer is pushedSha, the commit that landed. Commit inside the machine first, through the sandbox instance API — this verb pushes commits, it does not create them. The unit must be available with a machine and a checkout, or the call answers 409 UNIT_INVALID_STATE; a push that fails inside the machine answers 500 EXECUTION_FAILED and the machine's own words are in the unit's transitions.
10662
+ * Publish the unit's local commits to the remote for the change: the machine itself holds no git credential and cannot reach the remote, so this verb is the way work done on a unit lands. ref says what to push — branch for the change's own branch, wip for this unit's own refs/praxis/wip/<change>, or a full ref name; anything else (the default branch, another change's branch, a tag, another unit's wip ref) is refused with 400 PUSH_REF_FORBIDDEN and nothing is pushed. expectedHead is the commit you believe the remote branch is at now; DevOps checks it before signing anything, and a remote that has moved since answers 409 HEAD_MOVED with nothing pushed, so fetch first when unsure, reconcile, and send the new head. For branch the call also takes a lease on that head, so the push cannot silently overwrite work that landed in between; wip is this change's own ref and is force-pushed. On success the answer is pushedSha, the commit that landed. Commit inside the machine first, through the sandbox instance API — this verb pushes commits, it does not create them. The unit must be available with a machine and a checkout, or the call answers 409 UNIT_INVALID_STATE; a push that git refuses inside the machine answers with the cause in the error message and in details.detail (the last 4000 characters of git's output, credentials redacted) and details.exitCode (git's exit code): 409 PUSH_REJECTED_BY_HOOK when a pre-push hook such as lefthook rejected it, so read the hook output, fix the content and push again, 409 PUSH_REJECTED_NON_FAST_FORWARD when the remote moved ahead, so fetch and reconcile, 409 HEAD_MOVED when the lease on expectedHead no longer holds, and 500 PUSH_FAILED for anything else. Do not retry the same push unchanged.
9843
10663
  */
9844
10664
  export const devopsUnitsPush = (options) => (options.client ?? client).post({
9845
10665
  security: [{
@@ -10637,7 +11457,7 @@ export const mediaBatchAssets = (options) => (options.client ?? client).post({
10637
11457
  /**
10638
11458
  * Get job
10639
11459
  *
10640
- * Read the current batch or generation Job status and progress. For generation, inspect outputs and failures; a successful output has already landed in the library as an asset.
11460
+ * 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.
10641
11461
  */
10642
11462
  export const mediaGetJob = (options) => (options.client ?? client).get({
10643
11463
  security: [{
@@ -10729,15 +11549,449 @@ export const mediaGetAssetLineage = (options) => (options.client ?? client).get(
10729
11549
  /**
10730
11550
  * Generate image
10731
11551
  *
10732
- * Generate one or more images from a text prompt and store them 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 generate. The request body is the image request itself: prompt is required, and n, size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Set output to sticker for a cut-out with a transparent background. references attach existing assets with a role — edit_target, style, structure or subject — and a model that cannot honour a role returns REFERENCE_TYPE_MISMATCH. A reference may also be an element id (a character, product, scene or brand from the materials endpoints): the service expands it into the element’s pictures and appends its description to the prompt, so the same subject stays consistent across requests. Aspect ratio is not accepted for images; name size instead. Generation 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, final once the job is completed or failed) and each produced asset carries its own part in provenance.cost; nothing is charged for a request refused before it starts. When the job is done, tell the person the usage amount and give them each output’s viewer_url, which opens the asset in the Console. The response is 202 with a queued Job whose type is image 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 assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/images/generations with {"prompt":"A red kite above a calm sea at sunrise","n":1,"output":"sticker"}.
11552
+ * Generate images into a library from a prompt, optionally guided by existing pictures. {library_id} also accepts default, the organization’s default library. prompt is required; n (1 to 10), size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Name size, not an aspect ratio. Set output to sticker for a cut-out with a transparent background. references attach pictures of the same library with a role: subject keeps a person, product or scene consistent (several subjects put several characters in one picture), edit_target is the picture to change, style is the look to follow, structure the composition. Only a model whose modes in GET /media/v1/generation/capabilities include image takes references; any other answers INVALID_PARAMS naming the models that do, and a role a model cannot honour answers REFERENCE_TYPE_MISMATCH, both before anything is charged. A reference may be an element id (a character, product, scene or brand from the materials endpoints), which expands into its pictures and appends its description to the prompt. To draw several candidates of one key frame, send n and keep the ones you want; delete the rest. Charges are per image at the model API prices and appear in the Job’s usage; a refused or failed image costs nothing. The response is 202 with a queued Job; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} for each output’s asset and viewer_url, give viewer_url to the person and tell them usage. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice.
11553
+ */
11554
+ export const mediaGenerateImage = (options) => (options.client ?? client).post({
11555
+ security: [{
11556
+ key: 'media-BearerAuth',
11557
+ scheme: 'bearer',
11558
+ type: 'http'
11559
+ }],
11560
+ url: '/media/v1/libraries/{library_id}/images/generations',
11561
+ ...options,
11562
+ headers: {
11563
+ 'Content-Type': 'application/json',
11564
+ ...options.headers
11565
+ }
11566
+ });
11567
+ /**
11568
+ * Generate video
11569
+ *
11570
+ * Generate videos into a library: from a prompt, from frames, from reference pictures or videos, or by editing an existing video. {library_id} also accepts default, the organization’s default library. mode picks the anchor: text (prompt only); image (animates first_frame); first_last (between first_frame and last_frame); reference (1 to 9 references: pictures with role subject or style keep a person, product or look consistent, and video assets with role video give the camera and motion to follow; an element id expands into its pictures and description); edit (keeps the video named by source, at least 4 s, and changes what the prompt says, such as replacing its person with a subject picture; the output is as long as the source). Frames and references are assets of the same library; in the prompt call them @video1 and @image1, @image2… in request order. Read GET /media/v1/generation/capabilities first: a model takes only the modes it lists. To draw several takes of one shot and keep the best, send n (1 to 4); 480p is the cheapest way to compare takes. Charges are per output second at the model API prices and appear in the Job’s usage; a job with an input video is metered on input plus output seconds, so it costs more than the output length suggests (a 5 s edit of a 5 s source bills about 6 s); a refused or failed output costs nothing, and so does a request refused before the job starts. A real human face in a source or reference is refused by the model with CONTENT_REJECTED. Refused before any charge: output gif (OPERATION_NOT_SUPPORTED), negative_prompt, references outside reference and edit, and an unknown mode. The response is 202 with a queued Job; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} for each output’s asset and viewer_url, give viewer_url to the person and tell them usage. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice.
11571
+ */
11572
+ export const mediaGenerateVideo = (options) => (options.client ?? client).post({
11573
+ security: [{
11574
+ key: 'media-BearerAuth',
11575
+ scheme: 'bearer',
11576
+ type: 'http'
11577
+ }],
11578
+ url: '/media/v1/libraries/{library_id}/videos/generations',
11579
+ ...options,
11580
+ headers: {
11581
+ 'Content-Type': 'application/json',
11582
+ ...options.headers
11583
+ }
11584
+ });
11585
+ /**
11586
+ * Edit asset
11587
+ *
11588
+ * 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.
11589
+ */
11590
+ export const mediaEditAsset = (options) => (options.client ?? client).post({
11591
+ security: [{
11592
+ key: 'media-BearerAuth',
11593
+ scheme: 'bearer',
11594
+ type: 'http'
11595
+ }],
11596
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/edits',
11597
+ ...options,
11598
+ headers: {
11599
+ 'Content-Type': 'application/json',
11600
+ ...options.headers
11601
+ }
11602
+ });
11603
+ /**
11604
+ * Create speech
11605
+ *
11606
+ * 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.
11607
+ */
11608
+ export const mediaCreateSpeech = (options) => (options.client ?? client).post({
11609
+ security: [{
11610
+ key: 'media-BearerAuth',
11611
+ scheme: 'bearer',
11612
+ type: 'http'
11613
+ }],
11614
+ url: '/media/v1/libraries/{library_id}/audio/speech',
11615
+ ...options,
11616
+ headers: {
11617
+ 'Content-Type': 'application/json',
11618
+ ...options.headers
11619
+ }
11620
+ });
11621
+ /**
11622
+ * Create material
11623
+ *
11624
+ * Create a reusable element in a library: a character, product, scene or brand that image and video generation can name so the same subject stays consistent. Use library_id from creation or listing. Upload the pictures first (character, product and scene need 1 to 8; a brand needs none), then send material_type, name and body; every asset the body names must be in this same library, or the request is refused before anything is saved. To use the element, put its asset_id in references of POST /media/v1/libraries/{library_id}/images/generations, or of video generations with mode reference: the service replaces it with the element’s pictures (keeping your role and strength) and appends its description to the prompt; a brand adds only text and palette. Expanded pictures count against the model’s limit (10 for images, 9 for videos). Creating an element is free. Example: POST /media/v1/libraries/lib_example/materials with {"material_type":"brand","name":"Docs brand","body":{"description":"Calm, plain-spoken tone.","colors":[{"hex":"#1f6feb","name":"Praxis blue"}]}}.
11625
+ */
11626
+ export const mediaCreateMaterial = (options) => (options.client ?? client).post({
11627
+ security: [{
11628
+ key: 'media-BearerAuth',
11629
+ scheme: 'bearer',
11630
+ type: 'http'
11631
+ }],
11632
+ url: '/media/v1/libraries/{library_id}/materials',
11633
+ ...options,
11634
+ headers: {
11635
+ 'Content-Type': 'application/json',
11636
+ ...options.headers
11637
+ }
11638
+ });
11639
+ /**
11640
+ * Get material
11641
+ *
11642
+ * Read one element with its body, its current version and the assets it depends on. Use library_id from creation or listing and asset_id from element creation or from an asset listing filtered by material_type. An id that is not an element of this library answers 404. Example: GET /media/v1/libraries/lib_example/materials/9dfa312ef9bc4b00816339b598b1152c.
11643
+ */
11644
+ export const mediaGetMaterial = (options) => (options.client ?? client).get({
11645
+ security: [{
11646
+ key: 'media-BearerAuth',
11647
+ scheme: 'bearer',
11648
+ type: 'http'
11649
+ }],
11650
+ url: '/media/v1/libraries/{library_id}/materials/{asset_id}',
11651
+ ...options
11652
+ });
11653
+ /**
11654
+ * Update material
11655
+ *
11656
+ * Rename an element, move it, or replace its body. A new body is validated like a new element, replaces the old body whole and bumps version; generations that already used the element keep recording the version they read, and an Idempotency-Key replayed after the change is treated as a different request. Use library_id and asset_id from element creation. Example: PATCH /media/v1/libraries/lib_example/materials/9dfa312ef9bc4b00816339b598b1152c with {"name":"Docs brand v2"}.
11657
+ */
11658
+ export const mediaUpdateMaterial = (options) => (options.client ?? client).patch({
11659
+ security: [{
11660
+ key: 'media-BearerAuth',
11661
+ scheme: 'bearer',
11662
+ type: 'http'
11663
+ }],
11664
+ url: '/media/v1/libraries/{library_id}/materials/{asset_id}',
11665
+ ...options,
11666
+ headers: {
11667
+ 'Content-Type': 'application/json',
11668
+ ...options.headers
11669
+ }
11670
+ });
11671
+ /**
11672
+ * Summarize understanding failures
11673
+ *
11674
+ * Inspect current understanding failures before retrying. Use library_id from library creation or listing. Groups include code, output kind, actual producer model, retryability and up to five sample asset IDs. At most 1024 detailed groups plus two overflow groups are returned; overflow groups separate retryable and unrecoverable entries and mark overflow=true. Unknown failure codes remain retryable. Historical counts are provisional while counts_complete is false. Example: GET /media/v1/libraries/lib_example/understandings/failure_summary.
11675
+ */
11676
+ export const mediaUnderstandingFailureSummary = (options) => (options.client ?? client).get({
11677
+ security: [{
11678
+ key: 'media-BearerAuth',
11679
+ scheme: 'bearer',
11680
+ type: 'http'
11681
+ }],
11682
+ url: '/media/v1/libraries/{library_id}/understandings/failure_summary',
11683
+ ...options
11684
+ });
11685
+ /**
11686
+ * List understanding results across a library
11687
+ *
11688
+ * Read current understanding entries across one library without fetching every asset separately. Use library_id from creation or listing. folder includes descendants; kinds is a comma-separated list of output kinds. Entries are ordered by asset_id and then understanding id. Continue with next_cursor and the same folder and kinds; limit defaults to 100 and cannot exceed 100. Superseded, deleted and old-version entries are excluded. During historical backfill, this method returns 503 CAPACITY rather than incomplete pages; poll failureSummary until counts_complete is true, then start pagination. Example: GET /media/v1/libraries/lib_example/understandings?folder=travel&kinds=caption,transcript&limit=100.
11689
+ */
11690
+ export const mediaListUnderstandingsByLibrary = (options) => (options.client ?? client).get({
11691
+ security: [{
11692
+ key: 'media-BearerAuth',
11693
+ scheme: 'bearer',
11694
+ type: 'http'
11695
+ }],
11696
+ url: '/media/v1/libraries/{library_id}/understandings',
11697
+ ...options
11698
+ });
11699
+ /**
11700
+ * List jobs
11701
+ *
11702
+ * List the batch and generation jobs of a library, newest first, to find a job whose id you lost or to watch several takes at once. Filter by status or by pipeline_run_id (the jobs one automation run started) and continue with next_cursor. Each entry is the same Job that GET /media/v1/libraries/{library_id}/jobs/{job_id} returns, with outputs, failures and usage.
11703
+ */
11704
+ export const mediaListJobs = (options) => (options.client ?? client).get({
11705
+ security: [{
11706
+ key: 'media-BearerAuth',
11707
+ scheme: 'bearer',
11708
+ type: 'http'
11709
+ }],
11710
+ url: '/media/v1/libraries/{library_id}/jobs',
11711
+ ...options
11712
+ });
11713
+ /**
11714
+ * Cancel job
11715
+ *
11716
+ * Stop a generation job you no longer need, for example after the first takes of a draw show the prompt is wrong. Outputs that are queued are cancelled and never charged; outputs already produced stay in the library and stay charged. A video cannot be stopped once the provider has started generating it: the call answers 409 JOB_INVALID_STATE (details VIDEO_ALREADY_RUNNING), and that output still finishes, is saved to the library and is charged. Read the returned Job, or poll it, to see which outputs ended.
11717
+ */
11718
+ export const mediaCancelJob = (options) => (options.client ?? client).post({
11719
+ security: [{
11720
+ key: 'media-BearerAuth',
11721
+ scheme: 'bearer',
11722
+ type: 'http'
11723
+ }],
11724
+ url: '/media/v1/libraries/{library_id}/jobs/{job_id}/cancel',
11725
+ ...options
11726
+ });
11727
+ /**
11728
+ * Get generation capabilities
11729
+ *
11730
+ * Read what Praxis offers for each kind of generation — image, video and speech — before asking for one, and read a speech model’s voices here before naming one. Every type answers the models available for it, the model it uses when a request names none, and what each model costs per unit; a speech model the platform publishes voices for also carries default_voice and voices there, each voice with an id, a name, a gender, a language and a style — so a request for "a gentle female voice" is answered by matching the style and gender rather than by guessing an identifier. Pass a voice id back verbatim as voice, or omit voice to take default_voice; a voice that is neither one of those nor a voice material of the library is refused with INVALID_PARAMS before any job is created. OpenAI voice names such as alloy and aura are not valid here. The video fields beside the types keep their original meaning (intents, default model, duration and aspect-ratio limits, per-library concurrency). The models come from the platform model catalogue, and an id listed here is accepted verbatim as the model field of that type’s generation request. A video model additionally carries the modes it can be driven in and the durations, aspect ratios and resolutions the catalogue has registered for it — modes, duration_seconds, aspect_ratios and resolutions — so read them before requesting video and choose a mode and a value this model lists; an empty list means the platform has not registered that option yet, and then omit the field rather than assume a value. price.amount is a decimal string with its currency; video models that charge by resolution also carry price.by_resolution, whose amount is then the cheapest tier. A model the catalogue cannot route right now is still listed, with available false, so a caller can show it as temporarily unavailable instead of hiding it. When the catalogue cannot be read the endpoint still answers: every type comes back with an empty models list and its real default_model, and the voices a speech model carries are absent rather than empty, because the voices come from the platform and not from the catalogue. Generation is charged per unit and every output is stored in the library.
11731
+ */
11732
+ export const mediaGetGenerationCapabilities = (options) => (options?.client ?? client).get({
11733
+ security: [{
11734
+ key: 'media-BearerAuth',
11735
+ scheme: 'bearer',
11736
+ type: 'http'
11737
+ }],
11738
+ url: '/media/v1/generation/capabilities',
11739
+ ...options
11740
+ });
11741
+ /**
11742
+ * Align asset
11743
+ *
11744
+ * Align two recordings by their sound and learn how they line up, without producing an asset. The route names the source asset; the body names the reference to compare against it. Both must be audio or a video, of the same library; anything else is refused with REFERENCE_TYPE_MISMATCH before a job exists. The call is an analysis: it decides and charges nothing else, bills per second of input, and stores no asset — the completed job carries the answer in result, offset_seconds saying how many seconds later the reference starts (so a caller holding both recordings knows which one to slide) and confidence how sure the correlation is. The analysis is idempotent on the source, the reference and the parameters: asking again with the same pair answers the completed job and its result instead of analysing and charging again. A max_offset_seconds caps how far apart the two may be; alignment needs an alignment model from the platform model catalogue, and with none published the request is refused with OPERATION_NOT_SUPPORTED, 尚未上架. Send Idempotency-Key, or idempotency_key in the body, to retry without analysing twice. The response is 202 with a queued Job whose operation is align; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until it is completed or failed, then read result. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/align with {"reference_asset_id":"3f2a9c1e5b7d4e6f8a0b1c2d3e4f5a6b","max_offset_seconds":30}.
11745
+ */
11746
+ export const mediaAlignAsset = (options) => (options.client ?? client).post({
11747
+ security: [{
11748
+ key: 'media-BearerAuth',
11749
+ scheme: 'bearer',
11750
+ type: 'http'
11751
+ }],
11752
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/align',
11753
+ ...options,
11754
+ headers: {
11755
+ 'Content-Type': 'application/json',
11756
+ ...options.headers
11757
+ }
11758
+ });
11759
+ /**
11760
+ * Get HLS renditions
11761
+ *
11762
+ * Read how ready a video asset’s on-demand ladder is, rung by rung, without building anything. Use library_id and asset_id as everywhere else. The answer names the asset, its current version, the asset’s own facts (resource_type, is_audio and duration) and one entry per recorded rung — name, height, the first indexed piece’s width, the rung’s bitrate and stored bytes, and its state (processing while pieces run, ready when every piece is ready, failed when a piece gave up). A ladder that was never requested, and an asset that is not a video, answer an empty renditions rather than an error. This read mints no capability and signs nothing, so play the ladder through the content service, which issues the short-lived play address for the current version. Example: GET /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/hls.
11763
+ */
11764
+ export const mediaGetHlsRenditions = (options) => (options.client ?? client).get({
11765
+ security: [{
11766
+ key: 'media-BearerAuth',
11767
+ scheme: 'bearer',
11768
+ type: 'http'
11769
+ }],
11770
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/hls',
11771
+ ...options
11772
+ });
11773
+ /**
11774
+ * Request HLS renditions
11775
+ *
11776
+ * Build a video asset’s adaptive HLS ladder for its current version, so one asset plays at several clarities on an ordinary player. Use library_id from creation or listing and the asset_id of a video asset; the ladder belongs to the version the asset has now, and a later version gets its own. heights names the rungs to build: a non-empty subset of 480, 720 and 1080 with no repeats, or omitted to build all three. The ladder never upscales — a rung above the source’s short side is dropped, and a list entirely above it keeps its lowest rung. The call is asynchronous and starts paid transcoding: the work runs as the video-transcode-hls model, one piece per rung per ten minutes of source, and it is charged per output minute at that model’s published price to the organization that owns the asset (ADR-146 §5) — a rung the source cannot carry, and a failed rung, are not charged. A source longer than eight hours (28800 seconds) is refused with SOURCE_TOO_LONG before anything is planned. Repeating the call is safe: a rung already processing, ready or failed is left as it is and is never encoded twice. The response is 202 with the asset_id, its current version and one entry per rung — name, height, width, bitrate, bytes and state, where processing means the rung is still being encoded, ready means it plays and failed means it gave up and can be retried by asking again. Poll GET /media/v1/libraries/{library_id}/assets/{asset_id}/hls until every rung is ready, then play the ladder through the content service, which mints the short-lived play address. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/hls with {"heights":[480,720,1080]}.
11777
+ */
11778
+ export const mediaRequestHlsRenditions = (options) => (options.client ?? client).post({
11779
+ security: [{
11780
+ key: 'media-BearerAuth',
11781
+ scheme: 'bearer',
11782
+ type: 'http'
11783
+ }],
11784
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/hls',
11785
+ ...options,
11786
+ headers: {
11787
+ 'Content-Type': 'application/json',
11788
+ ...options.headers
11789
+ }
11790
+ });
11791
+ /**
11792
+ * Create voice
11793
+ *
11794
+ * 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.
11795
+ */
11796
+ export const mediaCreateVoice = (options) => (options.client ?? client).post({
11797
+ security: [{
11798
+ key: 'media-BearerAuth',
11799
+ scheme: 'bearer',
11800
+ type: 'http'
11801
+ }],
11802
+ url: '/media/v1/libraries/{library_id}/voices',
11803
+ ...options,
11804
+ headers: {
11805
+ 'Content-Type': 'application/json',
11806
+ ...options.headers
11807
+ }
11808
+ });
11809
+ /**
11810
+ * Design a voice
11811
+ *
11812
+ * 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.
11813
+ */
11814
+ export const mediaDesignVoice = (options) => (options.client ?? client).post({
11815
+ security: [{
11816
+ key: 'media-BearerAuth',
11817
+ scheme: 'bearer',
11818
+ type: 'http'
11819
+ }],
11820
+ url: '/media/v1/libraries/{library_id}/voices/designs',
11821
+ ...options,
11822
+ headers: {
11823
+ 'Content-Type': 'application/json',
11824
+ ...options.headers
11825
+ }
11826
+ });
11827
+ /**
11828
+ * List types
11829
+ *
11830
+ * Read the node and relation types registered for this organization before writing, so a create names a type the graph accepts. Each entry is one registrant's registration with its owner, version and definitions. Types cannot be created at runtime; they are registered by the owning service at deploy time, so a type missing here is not available to write.
11831
+ */
11832
+ export const ontologyListTypes = (options) => (options?.client ?? client).get({
11833
+ security: [{
11834
+ key: 'ontology-bearerAuth',
11835
+ scheme: 'bearer',
11836
+ type: 'http'
11837
+ }],
11838
+ url: '/ontology/v1/types',
11839
+ ...options
11840
+ });
11841
+ /**
11842
+ * Register type
11843
+ *
11844
+ * Register a node or relation type for this organization. Not open yet — this call currently answers 501 NOT_IMPLEMENTED and writes nothing, because a registration is checked and stored by the deploy gate that ships the registering service, not by a runtime call. Until it opens, read the types already in force with praxis.ontology.types.list and create records only of those types.
11845
+ */
11846
+ export const ontologyRegisterType = (options) => (options.client ?? client).post({
11847
+ security: [{
11848
+ key: 'ontology-bearerAuth',
11849
+ scheme: 'bearer',
11850
+ type: 'http'
11851
+ }],
11852
+ url: '/ontology/v1/types',
11853
+ ...options,
11854
+ headers: {
11855
+ 'Content-Type': 'application/json',
11856
+ ...options.headers
11857
+ }
11858
+ });
11859
+ /**
11860
+ * Retrieve type
11861
+ *
11862
+ * Read one registered type's definition before writing a record of it, to learn whether it is a node or an edge, which endpoints an edge type admits, and which origins it accepts. The name comes from types.list; a name that is not registered answers ONTOLOGY_TYPE_UNKNOWN, and writes of that type are refused.
11863
+ */
11864
+ export const ontologyRetrieveType = (options) => (options.client ?? client).get({
11865
+ security: [{
11866
+ key: 'ontology-bearerAuth',
11867
+ scheme: 'bearer',
11868
+ type: 'http'
11869
+ }],
11870
+ url: '/ontology/v1/types/{name}',
11871
+ ...options
11872
+ });
11873
+ /**
11874
+ * List nodes
11875
+ *
11876
+ * Discover the entities in this organization's graph and obtain node ids for retrieval, updates and relations. Filter by type, by free text over names, aliases, descriptions and facts, or by owner; limit is 1–100 and defaults to 50. Omit cursor for the first page, then copy next_cursor into the next request until it is null. A node whose content belongs to somebody else comes back as a restricted entry carrying only its id, type and name.
11877
+ */
11878
+ export const ontologyListNodes = (options) => (options?.client ?? client).get({
11879
+ security: [{
11880
+ key: 'ontology-bearerAuth',
11881
+ scheme: 'bearer',
11882
+ type: 'http'
11883
+ }],
11884
+ url: '/ontology/v1/nodes',
11885
+ ...options
11886
+ });
11887
+ /**
11888
+ * Create node
11889
+ *
11890
+ * Record one entity in the graph, for a system mirroring a record it owns. type must already be registered and ref, when given, must match that type's ref_prefix. Send an Idempotency-Key header; repeating the same key with the same content returns the first result instead of creating a second node. This writes structure only; it does not give any agent a memory.
11891
+ */
11892
+ export const ontologyCreateNode = (options) => (options.client ?? client).post({
11893
+ security: [{
11894
+ key: 'ontology-bearerAuth',
11895
+ scheme: 'bearer',
11896
+ type: 'http'
11897
+ }],
11898
+ url: '/ontology/v1/nodes',
11899
+ ...options,
11900
+ headers: {
11901
+ 'Content-Type': 'application/json',
11902
+ ...options.headers
11903
+ }
11904
+ });
11905
+ /**
11906
+ * Retrieve node
11907
+ *
11908
+ * Read one node's content and, with expand=relations, every relation on and around it. as_of reads the node as it was at that time. A node id from another organization, or one that never existed, answers ONTOLOGY_NODE_NOT_FOUND; a node you may reach but not read returns restricted true with its name only.
11909
+ */
11910
+ export const ontologyRetrieveNode = (options) => (options.client ?? client).get({
11911
+ security: [{
11912
+ key: 'ontology-bearerAuth',
11913
+ scheme: 'bearer',
11914
+ type: 'http'
11915
+ }],
11916
+ url: '/ontology/v1/nodes/{node_id}',
11917
+ ...options
11918
+ });
11919
+ /**
11920
+ * Update node
11921
+ *
11922
+ * Change a node's name, aliases or description when the mirrored record was renamed, without touching its type or identity. Send only the fields to change; omitted fields keep their current values and an explicitly null description clears it. Repeating the same edit converges on the same node, so this needs no Idempotency-Key.
11923
+ */
11924
+ export const ontologyUpdateNode = (options) => (options.client ?? client).patch({
11925
+ security: [{
11926
+ key: 'ontology-bearerAuth',
11927
+ scheme: 'bearer',
11928
+ type: 'http'
11929
+ }],
11930
+ url: '/ontology/v1/nodes/{node_id}',
11931
+ ...options,
11932
+ headers: {
11933
+ 'Content-Type': 'application/json',
11934
+ ...options.headers
11935
+ }
11936
+ });
11937
+ /**
11938
+ * Retrieve neighborhood
11939
+ *
11940
+ * Load the subgraph around one node instead of the whole graph — the read to use when a screen or an agent needs the context of one entity. Returns the start node, every node within depth hops of it, the relations whose both ends are in that set, and truncated true when the node limit cut the walk short. direction chooses which way relations are followed; as_of and include_invalid read the graph as those parameters do elsewhere. Visibility is exactly nodes.retrieve's — a node you may reach but not read comes back restricted with its name only, and relations touching it are withheld, so this read never reaches further than a node read does. The node id comes from nodes.list, nodes.create or a changeset; an unknown one answers ONTOLOGY_NODE_NOT_FOUND, the same answer nodes.retrieve gives.
11941
+ */
11942
+ export const ontologyNeighborhood = (options) => (options.client ?? client).get({
11943
+ security: [{
11944
+ key: 'ontology-bearerAuth',
11945
+ scheme: 'bearer',
11946
+ type: 'http'
11947
+ }],
11948
+ url: '/ontology/v1/nodes/{node_id}/neighborhood',
11949
+ ...options
11950
+ });
11951
+ /**
11952
+ * Merge node
11953
+ *
11954
+ * Fold a duplicate node into the node that should survive, when two records are discovered to be the same entity. The merged node's relations and aliases move to the survivor and later reads of the duplicate resolve to it. Send an Idempotency-Key header; repeating the same key replays the first result. Reversal is a staff operation, not available here.
11955
+ */
11956
+ export const ontologyMergeNode = (options) => (options.client ?? client).post({
11957
+ security: [{
11958
+ key: 'ontology-bearerAuth',
11959
+ scheme: 'bearer',
11960
+ type: 'http'
11961
+ }],
11962
+ url: '/ontology/v1/nodes/{node_id}/merge',
11963
+ ...options,
11964
+ headers: {
11965
+ 'Content-Type': 'application/json',
11966
+ ...options.headers
11967
+ }
11968
+ });
11969
+ /**
11970
+ * List relations
11971
+ *
11972
+ * Read the facts in the graph and obtain relation ids for retrieval, invalidation or spreading. Filter by endpoint node, by type and by direction; as_of reads the relations as they were then. Invalidated relations are omitted unless include_invalid is true. limit is 1–100 and defaults to 50; follow next_cursor until it is null.
11973
+ */
11974
+ export const ontologyListRelations = (options) => (options?.client ?? client).get({
11975
+ security: [{
11976
+ key: 'ontology-bearerAuth',
11977
+ scheme: 'bearer',
11978
+ type: 'http'
11979
+ }],
11980
+ url: '/ontology/v1/relations',
11981
+ ...options
11982
+ });
11983
+ /**
11984
+ * Create relation
11985
+ *
11986
+ * Record one fact between two existing nodes, for a system mirroring a relationship it owns. type must be registered and must admit these endpoints; fact states the relationship in one sentence. Send an Idempotency-Key header; repeating the same key returns the first result instead of writing a second relation. This writes structure only; it does not give any agent a memory.
10733
11987
  */
10734
- export const mediaGenerateImage = (options) => (options.client ?? client).post({
11988
+ export const ontologyCreateRelation = (options) => (options.client ?? client).post({
10735
11989
  security: [{
10736
- key: 'media-BearerAuth',
11990
+ key: 'ontology-bearerAuth',
10737
11991
  scheme: 'bearer',
10738
11992
  type: 'http'
10739
11993
  }],
10740
- url: '/media/v1/libraries/{library_id}/images/generations',
11994
+ url: '/ontology/v1/relations',
10741
11995
  ...options,
10742
11996
  headers: {
10743
11997
  'Content-Type': 'application/json',
@@ -10745,35 +11999,31 @@ export const mediaGenerateImage = (options) => (options.client ?? client).post({
10745
11999
  }
10746
12000
  });
10747
12001
  /**
10748
- * Generate video
12002
+ * Retrieve relation
10749
12003
  *
10750
- * Generate one or more videos from a text prompt and store them 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 generate. mode says what the video is anchored to: text needs only a prompt, image animates the existing image named by first_frame, and first_last interpolates between first_frame and last_frame. The frames must be image or sticker assets of the same library; a fetchable URL for each is sent to the model and recorded in the produced asset’s provenance. mode reference keeps 1 to 9 pictures named in references consistent (role subject or style; not combinable with frames; a model may take fewer); a reference may be an element id, which the service expands into the element’s pictures and description. output gif is refused with OPERATION_NOT_SUPPORTED in this release, and negative_prompt, references outside mode reference and an unknown mode are refused before anything is charged. Every output lands in the library as a video asset as soon as it is ready — there is no candidate state and nothing expires, so outputs.save is not part of this lane. Generation is billed per second 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) and each produced asset carries its own part in provenance.cost; a refused request costs nothing. When the job is done, tell the person the usage amount and give them each output’s viewer_url. The response is 202 with a queued Job whose type is video 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 assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/videos/generations with {"prompt":"A red kite above a calm sea at sunrise","mode":"text","n":1}.
12004
+ * Read one relation's fact and both of its clocks — valid_at and invalid_at for when it was true in the world, created_at and expired_at for when it was recorded and retired. An id from another organization, or one that never existed, answers ONTOLOGY_EDGE_NOT_FOUND.
10751
12005
  */
10752
- export const mediaGenerateVideo = (options) => (options.client ?? client).post({
12006
+ export const ontologyRetrieveRelation = (options) => (options.client ?? client).get({
10753
12007
  security: [{
10754
- key: 'media-BearerAuth',
12008
+ key: 'ontology-bearerAuth',
10755
12009
  scheme: 'bearer',
10756
12010
  type: 'http'
10757
12011
  }],
10758
- url: '/media/v1/libraries/{library_id}/videos/generations',
10759
- ...options,
10760
- headers: {
10761
- 'Content-Type': 'application/json',
10762
- ...options.headers
10763
- }
12012
+ url: '/ontology/v1/relations/{relation_id}',
12013
+ ...options
10764
12014
  });
10765
12015
  /**
10766
- * Edit asset
12016
+ * Invalidate relation
10767
12017
  *
10768
- * Edit an existing asset and store the result as a new asset. Use library_id from creation or listing and asset_id from asset creation or listing; library_id also accepts the literal default, which resolves to the organization’s default library before the credential check. The source asset is never overwritten: the new asset hangs under it in the edit chain, records it in derived_from, and reads back with assets.lineage, so earlier steps stay reachable. The body is operation plus the optional model, asset_folder, understanding and idempotency_key; operation.type selects the edit and carries that operation’s own fields. This release performs variations, inpaint, erase, replace_object, recolor and replace_background on images, remove_background on an image or a video, and to_video, frame and resynthesize on the material each takes; every other type in the operation vocabulary is refused with OPERATION_NOT_SUPPORTED. remove_background on a video produces a portrait matte video for compositing without a green screen: output picks mask (a black-and-white matte as a small H.264 video, person white and background black: use it as a Cut track mask with channel luma under the original video to lay a lecturer over slides — the choice for compositing) or alpha (the default: the person on a transparent background as ProRes 4444, which is very large, about 870 MB per 15 seconds of 1080p, so ask for it only when a transparent file itself is the deliverable), and model picks the matting model from types.matting.models of the generation capabilities — read it first, because a request that names none takes the first available matting model and a video is refused with OPERATION_NOT_SUPPORTED, in the model field, when the platform has published none. output and model mean nothing for an image source and are refused with INVALID_PARAMS naming the field rather than ignored. inpaint takes mask, a PNG File identifier beginning with file- whose transparent area marks the region to replace, plus the prompt describing what belongs there. Aspects beyond the source asset’s material type return REFERENCE_TYPE_MISMATCH. Editing 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) and the new asset carries it in provenance.cost; 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 image, whose operation is the edit applied, and whose source_asset_id is the asset edited; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until it is completed or failed, then read the produced asset. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/edits with {"operation":{"type":"variations","strength":"subtle"}}.
12018
+ * Mark a relation as no longer true from a world time, when the mirrored record changed. The relation is kept — invalid_at moves and the relation still reads at an earlier as_of, so history stays answerable. Send an Idempotency-Key header; repeating the same key replays the first result. There is no delete.
10769
12019
  */
10770
- export const mediaEditAsset = (options) => (options.client ?? client).post({
12020
+ export const ontologyInvalidateRelation = (options) => (options.client ?? client).post({
10771
12021
  security: [{
10772
- key: 'media-BearerAuth',
12022
+ key: 'ontology-bearerAuth',
10773
12023
  scheme: 'bearer',
10774
12024
  type: 'http'
10775
12025
  }],
10776
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}/edits',
12026
+ url: '/ontology/v1/relations/{relation_id}/invalidate',
10777
12027
  ...options,
10778
12028
  headers: {
10779
12029
  'Content-Type': 'application/json',
@@ -10781,17 +12031,17 @@ export const mediaEditAsset = (options) => (options.client ?? client).post({
10781
12031
  }
10782
12032
  });
10783
12033
  /**
10784
- * Create speech
12034
+ * Apply changeset
10785
12035
  *
10786
- * 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.
12036
+ * Apply a batch of node, relation and invalidation operations as one transaction, when a mirror has several records to write together and a partial write would leave the graph inconsistent. Every operation succeeds or none is applied. Send an Idempotency-Key header; the same key with the same content replays the first result, and the same key with different content is ONTOLOGY_CONFLICT.
10787
12037
  */
10788
- export const mediaCreateSpeech = (options) => (options.client ?? client).post({
12038
+ export const ontologyApplyChangeset = (options) => (options.client ?? client).post({
10789
12039
  security: [{
10790
- key: 'media-BearerAuth',
12040
+ key: 'ontology-bearerAuth',
10791
12041
  scheme: 'bearer',
10792
12042
  type: 'http'
10793
12043
  }],
10794
- url: '/media/v1/libraries/{library_id}/audio/speech',
12044
+ url: '/ontology/v1/changesets',
10795
12045
  ...options,
10796
12046
  headers: {
10797
12047
  'Content-Type': 'application/json',
@@ -10799,17 +12049,17 @@ export const mediaCreateSpeech = (options) => (options.client ?? client).post({
10799
12049
  }
10800
12050
  });
10801
12051
  /**
10802
- * Create material
12052
+ * Search nodes
10803
12053
  *
10804
- * Create a reusable element in a library: a character, product, scene or brand that image and video generation can name so the same subject stays consistent. Use library_id from creation or listing. Upload the pictures first (character, product and scene need 1 to 8; a brand needs none), then send material_type, name and body; every asset the body names must be in this same library, or the request is refused before anything is saved. To use the element, put its asset_id in references of POST /media/v1/libraries/{library_id}/images/generations, or of video generations with mode reference: the service replaces it with the element’s pictures (keeping your role and strength) and appends its description to the prompt; a brand adds only text and palette. Expanded pictures count against the model’s limit (10 for images, 9 for videos). Creating an element is free. Example: POST /media/v1/libraries/lib_example/materials with {"material_type":"brand","name":"Docs brand","body":{"description":"Calm, plain-spoken tone.","colors":[{"hex":"#1f6feb","name":"Praxis blue"}]}}.
12054
+ * Resolve text to the nodes it most likely names, when a mirror holds a name and needs the node id it corresponds to. Results are ranked candidates, not an answer, each reporting whether the match came from the node's name, an alias, its description or a relation's fact. Narrow with types, and cap the result count with limit (1–50, default 20). This reads structure; it is not an agent's recall, which reads the graph from that agent's own viewpoint inside its sessions.
10805
12055
  */
10806
- export const mediaCreateMaterial = (options) => (options.client ?? client).post({
12056
+ export const ontologySearch = (options) => (options.client ?? client).post({
10807
12057
  security: [{
10808
- key: 'media-BearerAuth',
12058
+ key: 'ontology-bearerAuth',
10809
12059
  scheme: 'bearer',
10810
12060
  type: 'http'
10811
12061
  }],
10812
- url: '/media/v1/libraries/{library_id}/materials',
12062
+ url: '/ontology/v1/search',
10813
12063
  ...options,
10814
12064
  headers: {
10815
12065
  'Content-Type': 'application/json',
@@ -10817,31 +12067,31 @@ export const mediaCreateMaterial = (options) => (options.client ?? client).post(
10817
12067
  }
10818
12068
  });
10819
12069
  /**
10820
- * Get material
12070
+ * List repositories
10821
12071
  *
10822
- * Read one element with its body, its current version and the assets it depends on. Use library_id from creation or listing and asset_id from element creation or from an asset listing filtered by material_type. An id that is not an element of this library answers 404. Example: GET /media/v1/libraries/lib_example/materials/9dfa312ef9bc4b00816339b598b1152c.
12072
+ * 列出这个组织现有的库,默认库也在其中。库很少,一页通常装得下;用 next_cursor 翻页。先在这里拿到 repository_id,再用它列出或发布包。
10823
12073
  */
10824
- export const mediaGetMaterial = (options) => (options.client ?? client).get({
12074
+ export const registryRepositoriesList = (options) => (options?.client ?? client).get({
10825
12075
  security: [{
10826
- key: 'media-BearerAuth',
12076
+ key: 'registry-bearerAuth',
10827
12077
  scheme: 'bearer',
10828
12078
  type: 'http'
10829
12079
  }],
10830
- url: '/media/v1/libraries/{library_id}/materials/{asset_id}',
12080
+ url: '/registry/v1/repositories',
10831
12081
  ...options
10832
12082
  });
10833
12083
  /**
10834
- * Update material
12084
+ * Create repository
10835
12085
  *
10836
- * Rename an element, move it, or replace its body. A new body is validated like a new element, replaces the old body whole and bumps version; generations that already used the element keep recording the version they read, and an Idempotency-Key replayed after the change is treated as a different request. Use library_id and asset_id from element creation. Example: PATCH /media/v1/libraries/lib_example/materials/9dfa312ef9bc4b00816339b598b1152c with {"name":"Docs brand v2"}.
12086
+ * 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。
10837
12087
  */
10838
- export const mediaUpdateMaterial = (options) => (options.client ?? client).patch({
12088
+ export const registryRepositoriesCreate = (options) => (options.client ?? client).post({
10839
12089
  security: [{
10840
- key: 'media-BearerAuth',
12090
+ key: 'registry-bearerAuth',
10841
12091
  scheme: 'bearer',
10842
12092
  type: 'http'
10843
12093
  }],
10844
- url: '/media/v1/libraries/{library_id}/materials/{asset_id}',
12094
+ url: '/registry/v1/repositories',
10845
12095
  ...options,
10846
12096
  headers: {
10847
12097
  'Content-Type': 'application/json',
@@ -10849,275 +12099,269 @@ export const mediaUpdateMaterial = (options) => (options.client ?? client).patch
10849
12099
  }
10850
12100
  });
10851
12101
  /**
10852
- * Summarize understanding failures
12102
+ * Delete repository
10853
12103
  *
10854
- * Inspect current understanding failures before retrying. Use library_id from library creation or listing. Groups include code, output kind, actual producer model, retryability and up to five sample asset IDs. At most 1024 detailed groups plus two overflow groups are returned; overflow groups separate retryable and unrecoverable entries and mark overflow=true. Unknown failure codes remain retryable. Historical counts are provisional while counts_complete is false. Example: GET /media/v1/libraries/lib_example/understandings/failure_summary.
12104
+ * 删一个空的库。默认库不能删(FAILED_PRECONDITION);库里还有包时也不能删,先把包删掉或改用别的库。删除请求重发会 404,所以删除前先读一次确认。
10855
12105
  */
10856
- export const mediaUnderstandingFailureSummary = (options) => (options.client ?? client).get({
12106
+ export const registryRepositoriesDelete = (options) => (options.client ?? client).delete({
10857
12107
  security: [{
10858
- key: 'media-BearerAuth',
12108
+ key: 'registry-bearerAuth',
10859
12109
  scheme: 'bearer',
10860
12110
  type: 'http'
10861
12111
  }],
10862
- url: '/media/v1/libraries/{library_id}/understandings/failure_summary',
12112
+ url: '/registry/v1/repositories/{repository_id}',
10863
12113
  ...options
10864
12114
  });
10865
12115
  /**
10866
- * List understanding results across a library
12116
+ * Retrieve repository
10867
12117
  *
10868
- * Read current understanding entries across one library without fetching every asset separately. Use library_id from creation or listing. folder includes descendants; kinds is a comma-separated list of output kinds. Entries are ordered by asset_id and then understanding id. Continue with next_cursor and the same folder and kinds; limit defaults to 100 and cannot exceed 100. Superseded, deleted and old-version entries are excluded. During historical backfill, this method returns 503 CAPACITY rather than incomplete pages; poll failureSummary until counts_complete is true, then start pagination. Example: GET /media/v1/libraries/lib_example/understandings?folder=travel&kinds=caption,transcript&limit=100.
12118
+ * 读一个库的名称、说明、包数量和默认标记。repository_id 来自 repositories.list 或 repositories.create;另一个组织的库或不存在的库一律 404,不区分两者。
10869
12119
  */
10870
- export const mediaListUnderstandingsByLibrary = (options) => (options.client ?? client).get({
12120
+ export const registryRepositoriesRetrieve = (options) => (options.client ?? client).get({
10871
12121
  security: [{
10872
- key: 'media-BearerAuth',
12122
+ key: 'registry-bearerAuth',
10873
12123
  scheme: 'bearer',
10874
12124
  type: 'http'
10875
12125
  }],
10876
- url: '/media/v1/libraries/{library_id}/understandings',
12126
+ url: '/registry/v1/repositories/{repository_id}',
10877
12127
  ...options
10878
12128
  });
10879
12129
  /**
10880
- * List jobs
12130
+ * Update repository
10881
12131
  *
10882
- * List batch and generation jobs in a library. Filter by status or by pipeline_run_id (the jobs one automation run started) and continue with next_cursor. Poll a generation Job until terminal; every produced output is already a library asset.
12132
+ * 改库的 display_name 或 description。只送要改的字段,省略的保持原值;name 建库之后不能改,它标识库。一个字段都不送会 400。
10883
12133
  */
10884
- export const mediaListJobs = (options) => (options.client ?? client).get({
12134
+ export const registryRepositoriesUpdate = (options) => (options.client ?? client).patch({
10885
12135
  security: [{
10886
- key: 'media-BearerAuth',
12136
+ key: 'registry-bearerAuth',
10887
12137
  scheme: 'bearer',
10888
12138
  type: 'http'
10889
12139
  }],
10890
- url: '/media/v1/libraries/{library_id}/jobs',
10891
- ...options
12140
+ url: '/registry/v1/repositories/{repository_id}',
12141
+ ...options,
12142
+ headers: {
12143
+ 'Content-Type': 'application/json',
12144
+ ...options.headers
12145
+ }
10892
12146
  });
10893
12147
  /**
10894
- * Cancel job
12148
+ * List packages
10895
12149
  *
10896
- * Cancel a queued or running generation job. Outputs already produced remain in the library; poll or read the returned Job to confirm its status. A video cannot be cancelled once the provider has started generating it: the call answers 409 JOB_INVALID_STATE (details VIDEO_ALREADY_RUNNING), and the task still finishes, is saved to the library and is charged.
12150
+ * 列出一个库里的包,可按种类筛、按名字搜、按最近更新或下载量排序。kind=skill 只看技能,kind=plugin 只看插件,省略则两类都返回。q 在 name、title 和 description 上做子串匹配。sort 默认 updated;downloads 按累计下载量降序,用来找这个库最常用的资源。
10897
12151
  */
10898
- export const mediaCancelJob = (options) => (options.client ?? client).post({
12152
+ export const registryRepositoriesPackagesList = (options) => (options.client ?? client).get({
10899
12153
  security: [{
10900
- key: 'media-BearerAuth',
12154
+ key: 'registry-bearerAuth',
10901
12155
  scheme: 'bearer',
10902
12156
  type: 'http'
10903
12157
  }],
10904
- url: '/media/v1/libraries/{library_id}/jobs/{job_id}/cancel',
12158
+ url: '/registry/v1/repositories/{repository_id}/packages',
10905
12159
  ...options
10906
12160
  });
10907
12161
  /**
10908
- * Get generation capabilities
12162
+ * Publish a package
10909
12163
  *
10910
- * Read what Praxis offers for each kind of generation — image, video and speech — before asking for one, and read a speech model’s voices here before naming one. Every type answers the models available for it, the model it uses when a request names none, and what each model costs per unit; a speech model the platform publishes voices for also carries default_voice and voices there, each voice with an id, a name, a gender, a language and a style — so a request for "a gentle female voice" is answered by matching the style and gender rather than by guessing an identifier. Pass a voice id back verbatim as voice, or omit voice to take default_voice; a voice that is neither one of those nor a voice material of the library is refused with INVALID_PARAMS before any job is created. OpenAI voice names such as alloy and aura are not valid here. The video fields beside the types keep their original meaning (intents, default model, duration and aspect-ratio limits, per-library concurrency). The models come from the platform model catalogue, and an id listed here is accepted verbatim as the model field of that type’s generation request. A video model additionally carries the modes it can be driven in and the durations, aspect ratios and resolutions the catalogue has registered for it — modes, duration_seconds, aspect_ratios and resolutions — so read them before requesting video and choose a mode and a value this model lists; an empty list means the platform has not registered that option yet, and then omit the field rather than assume a value. price.amount is a decimal string with its currency; video models that charge by resolution also carry price.by_resolution, whose amount is then the cheapest tier. A model the catalogue cannot route right now is still listed, with available false, so a caller can show it as temporarily unavailable instead of hiding it. When the catalogue cannot be read the endpoint still answers: every type comes back with an empty models list and its real default_model, and the voices a speech model carries are absent rather than empty, because the voices come from the platform and not from the catalogue. Generation is charged per unit and every output is stored in the library.
12164
+ * 把一个新包发布进这个库,一次调用建立包并上传它的第一个版本。发布内容是 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 发布。
10911
12165
  */
10912
- export const mediaGetGenerationCapabilities = (options) => (options?.client ?? client).get({
12166
+ export const registryRepositoriesPackagesCreate = (options) => (options.client ?? client).post({
12167
+ ...formDataBodySerializer,
10913
12168
  security: [{
10914
- key: 'media-BearerAuth',
12169
+ key: 'registry-bearerAuth',
10915
12170
  scheme: 'bearer',
10916
12171
  type: 'http'
10917
12172
  }],
10918
- url: '/media/v1/generation/capabilities',
10919
- ...options
12173
+ url: '/registry/v1/repositories/{repository_id}/packages',
12174
+ ...options,
12175
+ headers: {
12176
+ 'Content-Type': null,
12177
+ ...options.headers
12178
+ }
10920
12179
  });
10921
12180
  /**
10922
- * List types
12181
+ * Retrieve package
10923
12182
  *
10924
- * Read the node and relation types registered for this organization before writing, so a create names a type the graph accepts. Each entry is one registrant's registration with its owner, version and definitions. Types cannot be created at runtime; they are registered by the owning service at deploy time, so a type missing here is not available to write.
12183
+ * 读一个包的元数据:种类、所属库、当前 latest_version、作者、标签和累计下载量。package_id 来自 packages.list 或 packages.create;另一个组织或不存在都返回 404。软删期间这个包一律 404,恢复后才重新出现。
10925
12184
  */
10926
- export const ontologyListTypes = (options) => (options?.client ?? client).get({
12185
+ export const registryPackagesRetrieve = (options) => (options.client ?? client).get({
10927
12186
  security: [{
10928
- key: 'ontology-bearerAuth',
12187
+ key: 'registry-bearerAuth',
10929
12188
  scheme: 'bearer',
10930
12189
  type: 'http'
10931
12190
  }],
10932
- url: '/ontology/v1/types',
12191
+ url: '/registry/v1/packages/{package_id}',
10933
12192
  ...options
10934
12193
  });
10935
12194
  /**
10936
- * Register type
12195
+ * List versions
10937
12196
  *
10938
- * Register a node or relation type for this organization. Not open yet — this call currently answers 501 NOT_IMPLEMENTED and writes nothing, because a registration is checked and stored by the deploy gate that ships the registering service, not by a runtime call. Until it opens, read the types already in force with praxis.ontology.types.list and create records only of those types.
12197
+ * 列出一个包的所有版本,含已撤回的。撤回的版本仍在列表里(它占着版本号),withdrawn 为 true,并带 withdraw_time。按发布顺序返回。
10939
12198
  */
10940
- export const ontologyRegisterType = (options) => (options.client ?? client).post({
12199
+ export const registryPackagesVersionsList = (options) => (options.client ?? client).get({
10941
12200
  security: [{
10942
- key: 'ontology-bearerAuth',
12201
+ key: 'registry-bearerAuth',
10943
12202
  scheme: 'bearer',
10944
12203
  type: 'http'
10945
12204
  }],
10946
- url: '/ontology/v1/types',
10947
- ...options,
10948
- headers: {
10949
- 'Content-Type': 'application/json',
10950
- ...options.headers
10951
- }
12205
+ url: '/registry/v1/packages/{package_id}/versions',
12206
+ ...options
10952
12207
  });
10953
12208
  /**
10954
- * Retrieve type
12209
+ * Publish a version
10955
12210
  *
10956
- * Read one registered type's definition before writing a record of it, to learn whether it is a node or an edge, which endpoints an edge type admits, and which origins it accepts. The name comes from types.list; a name that is not registered answers ONTOLOGY_TYPE_UNKNOWN, and writes of that type are refused.
12211
+ * 给一个已有的包发新版本。请求体与 packages.create 相同(multipart:version 必填,archive 或 files 给内容),但种类和名字沿用这个包,不再从上传内容重判。version 必须比已发布的最高版本高(撤回的版本也占号,不能复用);比它低或相等返回 FAILED_PRECONDITION。title、description、tags 不填就沿用这个包现在显示的,不会被新版本里 SKILL.md 或 plugin.json 的描述覆盖;要改就在这次请求里给。作者不随新版本改变。
10957
12212
  */
10958
- export const ontologyRetrieveType = (options) => (options.client ?? client).get({
12213
+ export const registryPackagesVersionsCreate = (options) => (options.client ?? client).post({
12214
+ ...formDataBodySerializer,
10959
12215
  security: [{
10960
- key: 'ontology-bearerAuth',
12216
+ key: 'registry-bearerAuth',
10961
12217
  scheme: 'bearer',
10962
12218
  type: 'http'
10963
12219
  }],
10964
- url: '/ontology/v1/types/{name}',
10965
- ...options
12220
+ url: '/registry/v1/packages/{package_id}/versions',
12221
+ ...options,
12222
+ headers: {
12223
+ 'Content-Type': null,
12224
+ ...options.headers
12225
+ }
10966
12226
  });
10967
12227
  /**
10968
- * List nodes
12228
+ * List commits
10969
12229
  *
10970
- * Discover the entities in this organization's graph and obtain node ids for retrieval, updates and relations. Filter by type, by free text over names, aliases, descriptions and facts, or by owner; limit is 1–100 and defaults to 50. Omit cursor for the first page, then copy next_cursor into the next request until it is null. A node whose content belongs to somebody else comes back as a restricted entry carrying only its id, type and name.
12230
+ * 列出一个 git 包的提交历史,最新的在前。ref 不给就是包的默认分支;limit 与 offset 分页,has_more 为 true 表示还有下一页。只读:提交只能通过 git 协议推送(clone 地址在包的 clone_url)。OCI 包没有 git 读接口,返回 404。
10971
12231
  */
10972
- export const ontologyListNodes = (options) => (options?.client ?? client).get({
12232
+ export const registryGitLog = (options) => (options.client ?? client).get({
10973
12233
  security: [{
10974
- key: 'ontology-bearerAuth',
12234
+ key: 'registry-bearerAuth',
10975
12235
  scheme: 'bearer',
10976
12236
  type: 'http'
10977
12237
  }],
10978
- url: '/ontology/v1/nodes',
12238
+ url: '/registry/v1/packages/{package_id}/git/log',
10979
12239
  ...options
10980
12240
  });
10981
12241
  /**
10982
- * Create node
12242
+ * Read a commit
10983
12243
  *
10984
- * Record one entity in the graph, for a system mirroring a record it owns. type must already be registered and ref, when given, must match that type's ref_prefix. Send an Idempotency-Key header; repeating the same key with the same content returns the first result instead of creating a second node. This writes structure only; it does not give any agent a memory.
12244
+ * 按对象 id 读一个提交(完整 sha,不解析缩写)。返回提交信息、作者、提交时间与父提交。仓库里没有这个对象返回 404。
10985
12245
  */
10986
- export const ontologyCreateNode = (options) => (options.client ?? client).post({
12246
+ export const registryGitCommitsRetrieve = (options) => (options.client ?? client).get({
10987
12247
  security: [{
10988
- key: 'ontology-bearerAuth',
12248
+ key: 'registry-bearerAuth',
10989
12249
  scheme: 'bearer',
10990
12250
  type: 'http'
10991
12251
  }],
10992
- url: '/ontology/v1/nodes',
10993
- ...options,
10994
- headers: {
10995
- 'Content-Type': 'application/json',
10996
- ...options.headers
10997
- }
12252
+ url: '/registry/v1/packages/{package_id}/git/commits/{sha}',
12253
+ ...options
10998
12254
  });
10999
12255
  /**
11000
- * Retrieve node
12256
+ * List a tree
11001
12257
  *
11002
- * Read one node's content and, with expand=relations, every relation on and around it. as_of reads the node as it was at that time. A node id from another organization, or one that never existed, answers ONTOLOGY_NODE_NOT_FOUND; a node you may reach but not read returns restricted true with its name only.
12258
+ * 读一个树对象(或一个提交的根树)的条目:名字、类型(blob / tree / commit)、模式、对象 id,以及已知时的大小。只列这一层,不递归。
11003
12259
  */
11004
- export const ontologyRetrieveNode = (options) => (options.client ?? client).get({
12260
+ export const registryGitTreesRetrieve = (options) => (options.client ?? client).get({
11005
12261
  security: [{
11006
- key: 'ontology-bearerAuth',
12262
+ key: 'registry-bearerAuth',
11007
12263
  scheme: 'bearer',
11008
12264
  type: 'http'
11009
12265
  }],
11010
- url: '/ontology/v1/nodes/{node_id}',
12266
+ url: '/registry/v1/packages/{package_id}/git/trees/{sha}',
11011
12267
  ...options
11012
12268
  });
11013
12269
  /**
11014
- * Update node
12270
+ * Download a file from a ref
11015
12271
  *
11016
- * Change a node's name, aliases or description when the mirrored record was renamed, without touching its type or identity. Send only the fields to change; omitted fields keep their current values and an explicitly null description clears it. Repeating the same edit converges on the same node, so this needs no Idempotency-Key.
12272
+ * 按引用读一个文件的原始字节,边读边发(流式),没有大小上限。path 是仓库内相对路径,可以含斜杠;ref 不给就是默认分支。路径不是文件或引用不存在返回 404。
11017
12273
  */
11018
- export const ontologyUpdateNode = (options) => (options.client ?? client).patch({
12274
+ export const registryGitFilesRetrieve = (options) => (options.client ?? client).get({
11019
12275
  security: [{
11020
- key: 'ontology-bearerAuth',
12276
+ key: 'registry-bearerAuth',
11021
12277
  scheme: 'bearer',
11022
12278
  type: 'http'
11023
12279
  }],
11024
- url: '/ontology/v1/nodes/{node_id}',
11025
- ...options,
11026
- headers: {
11027
- 'Content-Type': 'application/json',
11028
- ...options.headers
11029
- }
12280
+ url: '/registry/v1/packages/{package_id}/git/files/{path}',
12281
+ ...options
11030
12282
  });
11031
12283
  /**
11032
- * Retrieve neighborhood
12284
+ * List version contents
11033
12285
  *
11034
- * Load the subgraph around one node instead of the whole graph — the read to use when a screen or an agent needs the context of one entity. Returns the start node, every node within depth hops of it, the relations whose both ends are in that set, and truncated true when the node limit cut the walk short. direction chooses which way relations are followed; as_of and include_invalid read the graph as those parameters do elsewhere. Visibility is exactly nodes.retrieve's — a node you may reach but not read comes back restricted with its name only, and relations touching it are withheld, so this read never reaches further than a node read does. The node id comes from nodes.list, nodes.create or a changeset; an unknown one answers ONTOLOGY_NODE_NOT_FOUND, the same answer nodes.retrieve gives.
12286
+ * 列出一个版本解压后的文件清单(路径和大小),用来在不下载整个包的前提下看它包含什么。路径是相对包根的,例如 SKILL.md 或 plugin/skills/review.md。已撤回的版本仍可读清单。
11035
12287
  */
11036
- export const ontologyNeighborhood = (options) => (options.client ?? client).get({
12288
+ export const registryPackagesVersionsContents = (options) => (options.client ?? client).get({
11037
12289
  security: [{
11038
- key: 'ontology-bearerAuth',
12290
+ key: 'registry-bearerAuth',
11039
12291
  scheme: 'bearer',
11040
12292
  type: 'http'
11041
12293
  }],
11042
- url: '/ontology/v1/nodes/{node_id}/neighborhood',
12294
+ url: '/registry/v1/packages/{package_id}/versions/{version}/contents',
11043
12295
  ...options
11044
12296
  });
11045
12297
  /**
11046
- * Merge node
12298
+ * Download a file
11047
12299
  *
11048
- * Fold a duplicate node into the node that should survive, when two records are discovered to be the same entity. The merged node's relations and aliases move to the survivor and later reads of the duplicate resolve to it. Send an Idempotency-Key header; repeating the same key replays the first result. Reversal is a staff operation, not available here.
12300
+ * 下载一个版本里的单个文件,返回原始字节。path 是 contents 给出的路径,可以含斜杠(例如 plugin/skills/review.md)。用它按文件取内容,装到磁盘上时保留这个相对路径。不计入 downloads。
11049
12301
  */
11050
- export const ontologyMergeNode = (options) => (options.client ?? client).post({
12302
+ export const registryPackagesVersionsFilesRetrieve = (options) => (options.client ?? client).get({
11051
12303
  security: [{
11052
- key: 'ontology-bearerAuth',
12304
+ key: 'registry-bearerAuth',
11053
12305
  scheme: 'bearer',
11054
12306
  type: 'http'
11055
12307
  }],
11056
- url: '/ontology/v1/nodes/{node_id}/merge',
11057
- ...options,
11058
- headers: {
11059
- 'Content-Type': 'application/json',
11060
- ...options.headers
11061
- }
12308
+ url: '/registry/v1/packages/{package_id}/versions/{version}/files/{path}',
12309
+ ...options
11062
12310
  });
11063
12311
  /**
11064
- * List relations
12312
+ * Download version archive
11065
12313
  *
11066
- * Read the facts in the graph and obtain relation ids for retrieval, invalidation or spreading. Filter by endpoint node, by type and by direction; as_of reads the relations as they were then. Invalidated relations are omitted unless include_invalid is true. limit is 1–100 and defaults to 50; follow next_cursor until it is null.
12314
+ * 下载一个版本的完整 zip 归档,用来整包安装或转存。每次调用都计入这个包的 downloads,所以不要为了看内容而反复拉 archive——先读 contents,只取需要的文件用 files 下载。
11067
12315
  */
11068
- export const ontologyListRelations = (options) => (options?.client ?? client).get({
12316
+ export const registryPackagesVersionsArchive = (options) => (options.client ?? client).get({
11069
12317
  security: [{
11070
- key: 'ontology-bearerAuth',
12318
+ key: 'registry-bearerAuth',
11071
12319
  scheme: 'bearer',
11072
12320
  type: 'http'
11073
12321
  }],
11074
- url: '/ontology/v1/relations',
12322
+ url: '/registry/v1/packages/{package_id}/versions/{version}/archive',
11075
12323
  ...options
11076
12324
  });
11077
12325
  /**
11078
- * Create relation
12326
+ * Withdraw a version
11079
12327
  *
11080
- * Record one fact between two existing nodes, for a system mirroring a relationship it owns. type must be registered and must admit these endpoints; fact states the relationship in one sentence. Send an Idempotency-Key header; repeating the same key returns the first result instead of writing a second relation. This writes structure only; it does not give any agent a memory.
12328
+ * 撤回一个版本。撤回后它不再是 latest、不能被新装;已经装好的照常可用。版本号仍被占着,不能再用它发新版本。已经撤回的版本再撤回会返回 FAILED_PRECONDITION。撤回是不可逆的:要重新提供这个版本,用更高的版本号重新发布。
11081
12329
  */
11082
- export const ontologyCreateRelation = (options) => (options.client ?? client).post({
12330
+ export const registryPackagesVersionsWithdraw = (options) => (options.client ?? client).post({
11083
12331
  security: [{
11084
- key: 'ontology-bearerAuth',
12332
+ key: 'registry-bearerAuth',
11085
12333
  scheme: 'bearer',
11086
12334
  type: 'http'
11087
12335
  }],
11088
- url: '/ontology/v1/relations',
11089
- ...options,
11090
- headers: {
11091
- 'Content-Type': 'application/json',
11092
- ...options.headers
11093
- }
12336
+ url: '/registry/v1/packages/{package_id}/versions/{version}:withdraw',
12337
+ ...options
11094
12338
  });
11095
12339
  /**
11096
- * Retrieve relation
12340
+ * List installations
11097
12341
  *
11098
- * Read one relation's fact and both of its clocks — valid_at and invalid_at for when it was true in the world, created_at and expired_at for when it was recorded and retired. An id from another organization, or one that never existed, answers ONTOLOGY_EDGE_NOT_FOUND.
12342
+ * 列出这个包装在哪些智能体和电脑上。每次读取都会和目标那边对账,以目标现在的实际情况为准,所以每条记录的 state 是读取这一刻的结论:installed 表示目标上有它且版本与记录一致;drifted 表示目标上有它但版本不同,此时 version 显示目标上的版本;missing 表示目标上已经没有它(被人在智能体或电脑那边删掉了),记录仍保留,可以用 installations.delete 清掉,或用 installations.update 重新装回;unknown 表示这次问不到目标,不代表没装,稍后重读。withdrawn 表示这条记录的版本已被撤回。一次返回全部记录,没有分页,按创建时间排序。
11099
12343
  */
11100
- export const ontologyRetrieveRelation = (options) => (options.client ?? client).get({
12344
+ export const registryPackagesInstallationsList = (options) => (options.client ?? client).get({
11101
12345
  security: [{
11102
- key: 'ontology-bearerAuth',
12346
+ key: 'registry-bearerAuth',
11103
12347
  scheme: 'bearer',
11104
12348
  type: 'http'
11105
12349
  }],
11106
- url: '/ontology/v1/relations/{relation_id}',
12350
+ url: '/registry/v1/packages/{package_id}/installations',
11107
12351
  ...options
11108
12352
  });
11109
12353
  /**
11110
- * Invalidate relation
12354
+ * Install a package
11111
12355
  *
11112
- * Mark a relation as no longer true from a world time, when the mirrored record changed. The relation is kept — invalid_at moves and the relation still reads at an earlier as_of, so history stays answerable. Send an Idempotency-Key header; repeating the same key replays the first result. There is no delete.
12356
+ * 把一个包装到目标上:技能装到智能体(agent_ids),插件装到电脑(computer_ids),一次最多 50 个目标;目标种类给错会被拒(400),包的种类可从 packages.retrieve 的 kind 得知。技能装的是具体版本,version 省略时装最新版,之后不会自动升级,要换版本用 installations.update。插件只能装库里的最新版本,version 若给了就必须等于最新版,否则 FAILED_PRECONDITION。撤回的版本不能新装。同一目标重复装同一个包不会报错,而是把它移到这个版本。技能被拒的情形:智能体上已有同名的另一个技能(名字冲突),或这个智能体已经有 20 个技能。各目标独立处理:只要有一个成功就返回 201,成功的在 data 里,失败的目标在 errors 里逐个列出 target_id、code 和 message,按消息修正后只对失败的目标重发;全部失败时不返回 201,而是按第一个失败返回错误状态。装到智能体或电脑上要求调用者本人有权限,权限不足会出现在该目标的 errors 里。
11113
12357
  */
11114
- export const ontologyInvalidateRelation = (options) => (options.client ?? client).post({
12358
+ export const registryPackagesInstallationsCreate = (options) => (options.client ?? client).post({
11115
12359
  security: [{
11116
- key: 'ontology-bearerAuth',
12360
+ key: 'registry-bearerAuth',
11117
12361
  scheme: 'bearer',
11118
12362
  type: 'http'
11119
12363
  }],
11120
- url: '/ontology/v1/relations/{relation_id}/invalidate',
12364
+ url: '/registry/v1/packages/{package_id}/installations',
11121
12365
  ...options,
11122
12366
  headers: {
11123
12367
  'Content-Type': 'application/json',
@@ -11125,17 +12369,17 @@ export const ontologyInvalidateRelation = (options) => (options.client ?? client
11125
12369
  }
11126
12370
  });
11127
12371
  /**
11128
- * Apply changeset
12372
+ * Update an installation
11129
12373
  *
11130
- * Apply a batch of node, relation and invalidation operations as one transaction, when a mirror has several records to write together and a partial write would leave the graph inconsistent. Every operation succeeds or none is applied. Send an Idempotency-Key header; the same key with the same content replays the first result, and the same key with different content is ONTOLOGY_CONFLICT.
12374
+ * 把一条安装记录换到另一个版本。技能可以换到任何未撤回的版本(升级或回退),version 省略时换到最新版;插件只能换到库里的最新版本,version 给了也必须等于最新版。撤回的版本不能换过去。对账为 missing 的记录用它可以重新装回去。同名冲突和 20 个技能上限的规则与安装时相同。
11131
12375
  */
11132
- export const ontologyApplyChangeset = (options) => (options.client ?? client).post({
12376
+ export const registryInstallationsUpdate = (options) => (options.client ?? client).post({
11133
12377
  security: [{
11134
- key: 'ontology-bearerAuth',
12378
+ key: 'registry-bearerAuth',
11135
12379
  scheme: 'bearer',
11136
12380
  type: 'http'
11137
12381
  }],
11138
- url: '/ontology/v1/changesets',
12382
+ url: '/registry/v1/installations/{installation_id}:update',
11139
12383
  ...options,
11140
12384
  headers: {
11141
12385
  'Content-Type': 'application/json',
@@ -11143,22 +12387,18 @@ export const ontologyApplyChangeset = (options) => (options.client ?? client).po
11143
12387
  }
11144
12388
  });
11145
12389
  /**
11146
- * Search nodes
12390
+ * Remove an installation
11147
12391
  *
11148
- * Resolve text to the nodes it most likely names, when a mirror holds a name and needs the node id it corresponds to. Results are ranked candidates, not an answer, each reporting whether the match came from the node's name, an alias, its description or a relation's fact. Narrow with types, and cap the result count with limit (1–50, default 20). This reads structure; it is not an agent's recall, which reads the graph from that agent's own viewpoint inside its sessions.
12392
+ * 把包从目标上卸下来,并删掉这条安装记录:技能从智能体的技能列表里移除,插件从电脑上卸载。目标那边已经没有它时也算完成。包本身和它的版本不受影响,之后可以重新安装。记录删除后重发会 404,所以删除前先用 installations.list 确认。
11149
12393
  */
11150
- export const ontologySearch = (options) => (options.client ?? client).post({
12394
+ export const registryInstallationsDelete = (options) => (options.client ?? client).delete({
11151
12395
  security: [{
11152
- key: 'ontology-bearerAuth',
12396
+ key: 'registry-bearerAuth',
11153
12397
  scheme: 'bearer',
11154
12398
  type: 'http'
11155
12399
  }],
11156
- url: '/ontology/v1/search',
11157
- ...options,
11158
- headers: {
11159
- 'Content-Type': 'application/json',
11160
- ...options.headers
11161
- }
12400
+ url: '/registry/v1/installations/{installation_id}',
12401
+ ...options
11162
12402
  });
11163
12403
  /**
11164
12404
  * List sandboxes (v2)
@@ -11201,7 +12441,7 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
11201
12441
  /**
11202
12442
  * Create sandbox (v2)
11203
12443
  *
11204
- * 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.
12444
+ * 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.
11205
12445
  */
11206
12446
  export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
11207
12447
  security: [
@@ -12280,6 +13520,66 @@ export const searchMap = (options) => (options.client ?? client).post({
12280
13520
  ...options.headers
12281
13521
  }
12282
13522
  });
13523
+ /**
13524
+ * List shares
13525
+ *
13526
+ * Find the shares of this organization, newest first, for example every link that exposes one file before you decide which to revoke. Filter by resource_type, resource_id and status; filters combine with AND. Continue with next_page_token as page_token until next_page_token is null. Records never include link.web_url. A credential bound to specific files must pass resource_type and resource_id of a bound file, and an unbound file answers 404.
13527
+ */
13528
+ export const shareListPermissions = (options) => (options?.client ?? client).get({
13529
+ security: [{
13530
+ key: 'share-bearerAuth',
13531
+ scheme: 'bearer',
13532
+ type: 'http'
13533
+ }],
13534
+ url: '/share/v1/permissions',
13535
+ ...options
13536
+ });
13537
+ /**
13538
+ * Create share
13539
+ *
13540
+ * 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.
13541
+ */
13542
+ export const shareCreatePermission = (options) => (options.client ?? client).post({
13543
+ security: [{
13544
+ key: 'share-bearerAuth',
13545
+ scheme: 'bearer',
13546
+ type: 'http'
13547
+ }],
13548
+ url: '/share/v1/permissions',
13549
+ ...options,
13550
+ headers: {
13551
+ 'Content-Type': 'application/json',
13552
+ ...options.headers
13553
+ }
13554
+ });
13555
+ /**
13556
+ * Delete share
13557
+ *
13558
+ * Take a link back so nobody can open it again. This revokes the share, the record stays readable with status revoked, and opening the link answers 410. Repeating the call on a revoked share is harmless and answers 204 again. Content addresses already signed when the link was opened expire on their own within five minutes. Take the id from shares.create or shares.list.
13559
+ */
13560
+ export const shareDeletePermission = (options) => (options.client ?? client).delete({
13561
+ security: [{
13562
+ key: 'share-bearerAuth',
13563
+ scheme: 'bearer',
13564
+ type: 'http'
13565
+ }],
13566
+ url: '/share/v1/permissions/{id}',
13567
+ ...options
13568
+ });
13569
+ /**
13570
+ * Retrieve share
13571
+ *
13572
+ * Read one share to see whether its link is still active, when it expires, and how many times it was opened. Take the id from shares.create or shares.list. The record never includes link.web_url, because the address is shown once at creation. A share that does not exist or belongs to another organization answers 404 PERMISSION_NOT_FOUND.
13573
+ */
13574
+ export const shareRetrievePermission = (options) => (options.client ?? client).get({
13575
+ security: [{
13576
+ key: 'share-bearerAuth',
13577
+ scheme: 'bearer',
13578
+ type: 'http'
13579
+ }],
13580
+ url: '/share/v1/permissions/{id}',
13581
+ ...options
13582
+ });
12283
13583
  /**
12284
13584
  * List the genres Studio can write
12285
13585
  *
@@ -13887,7 +15187,7 @@ export const vaultListSecrets = (options) => (options.client ?? client).get({
13887
15187
  /**
13888
15188
  * Create secret
13889
15189
  *
13890
- * 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.
15190
+ * 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.
13891
15191
  */
13892
15192
  export const vaultCreateSecret = (options) => (options.client ?? client).post({
13893
15193
  security: [{
@@ -13905,7 +15205,7 @@ export const vaultCreateSecret = (options) => (options.client ?? client).post({
13905
15205
  /**
13906
15206
  * Import secrets
13907
15207
  *
13908
- * 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.
15208
+ * 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.
13909
15209
  */
13910
15210
  export const vaultImportSecrets = (options) => (options.client ?? client).post({
13911
15211
  security: [{