@deepraxis/sdk 0.1.1-dev.d2b8440 → 0.1.1-dev.d326820
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.
- package/METHODS.md +270 -20
- package/README.md +3 -3
- package/dist/core/binary-operations.d.ts +3 -0
- package/dist/core/binary-operations.js +14 -0
- package/dist/core/credentials.d.ts +16 -6
- package/dist/core/credentials.js +24 -5
- package/dist/core/transport.js +8 -4
- package/dist/generated/binary-operations.gen.d.ts +3 -0
- package/dist/generated/binary-operations.gen.js +14 -0
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +504 -82
- package/dist/generated/sdk.gen.js +1518 -276
- package/dist/generated/types.gen.d.ts +17120 -5927
- package/dist/helpers/application-publish.js +16 -2
- package/dist/helpers/browser-connect-error.d.ts +28 -0
- package/dist/helpers/browser-connect-error.js +74 -0
- package/dist/helpers/browser-connect.d.ts +2 -0
- package/dist/helpers/browser-connect.js +36 -42
- package/dist/helpers/browser-decisions.d.ts +13 -0
- package/dist/helpers/browser-decisions.js +11 -0
- package/dist/helpers/browser-documentation.d.ts +1 -1
- package/dist/helpers/browser-documentation.js +4 -2
- package/dist/operations.generated.d.ts +1 -0
- package/dist/operations.generated.js +10737 -8278
- package/dist/resources.generated.d.ts +1936 -332
- package/dist/resources.generated.js +161 -12
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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: [{
|
|
@@ -44,7 +44,7 @@ export const sendAgentEvents = (options) => (options.client ?? client).post({
|
|
|
44
44
|
/**
|
|
45
45
|
* Follow an agent live
|
|
46
46
|
*
|
|
47
|
-
* Follow an agent live over Server-Sent Events. For a
|
|
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: [{
|
|
@@ -358,13 +358,11 @@ export const getAgentAppearance = (options) => (options.client ?? client).get({
|
|
|
358
358
|
...options
|
|
359
359
|
});
|
|
360
360
|
/**
|
|
361
|
-
*
|
|
361
|
+
* Retrieve agent phone
|
|
362
362
|
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
* 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.
|
|
366
364
|
*/
|
|
367
|
-
export const
|
|
365
|
+
export const agentsPhoneRetrieve = (options) => (options.client ?? client).get({
|
|
368
366
|
security: [{
|
|
369
367
|
key: 'BearerAuth',
|
|
370
368
|
scheme: 'bearer',
|
|
@@ -374,36 +372,33 @@ export const createCustomerGrantCode = (options) => (options.client ?? client).p
|
|
|
374
372
|
name: 'X-API-Key',
|
|
375
373
|
type: 'apiKey'
|
|
376
374
|
}],
|
|
377
|
-
url: '/agent/v1/agents/{agent_id}/
|
|
378
|
-
...options
|
|
379
|
-
headers: {
|
|
380
|
-
'Content-Type': 'application/json',
|
|
381
|
-
...options.headers
|
|
382
|
-
}
|
|
375
|
+
url: '/agent/v1/agents/{agent_id}/phone',
|
|
376
|
+
...options
|
|
383
377
|
});
|
|
384
378
|
/**
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
* 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
|
|
388
380
|
*
|
|
389
|
-
*
|
|
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.
|
|
390
382
|
*/
|
|
391
|
-
export const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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
|
|
398
395
|
});
|
|
399
396
|
/**
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
* Get a fresh customer access token in the same sign-in, authenticated with the current one.
|
|
397
|
+
* Get agent embed policy
|
|
403
398
|
*
|
|
404
|
-
*
|
|
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.
|
|
405
400
|
*/
|
|
406
|
-
export const
|
|
401
|
+
export const getAgentEmbedPolicy = (options) => (options.client ?? client).get({
|
|
407
402
|
security: [{
|
|
408
403
|
key: 'BearerAuth',
|
|
409
404
|
scheme: 'bearer',
|
|
@@ -413,17 +408,15 @@ export const renewCustomerAccessToken = (options) => (options.client ?? client).
|
|
|
413
408
|
name: 'X-API-Key',
|
|
414
409
|
type: 'apiKey'
|
|
415
410
|
}],
|
|
416
|
-
url: '/agent/v1/agents/{agent_id}/
|
|
411
|
+
url: '/agent/v1/agents/{agent_id}/embed_policy',
|
|
417
412
|
...options
|
|
418
413
|
});
|
|
419
414
|
/**
|
|
420
|
-
*
|
|
415
|
+
* Update agent embed policy
|
|
421
416
|
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
* 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"]}.
|
|
425
418
|
*/
|
|
426
|
-
export const
|
|
419
|
+
export const updateAgentEmbedPolicy = (options) => (options.client ?? client).post({
|
|
427
420
|
security: [{
|
|
428
421
|
key: 'BearerAuth',
|
|
429
422
|
scheme: 'bearer',
|
|
@@ -433,15 +426,19 @@ export const deleteCurrentCustomerAccessToken = (options) => (options.client ??
|
|
|
433
426
|
name: 'X-API-Key',
|
|
434
427
|
type: 'apiKey'
|
|
435
428
|
}],
|
|
436
|
-
url: '/agent/v1/agents/{agent_id}/
|
|
437
|
-
...options
|
|
429
|
+
url: '/agent/v1/agents/{agent_id}/embed_policy',
|
|
430
|
+
...options,
|
|
431
|
+
headers: {
|
|
432
|
+
'Content-Type': 'application/json',
|
|
433
|
+
...options.headers
|
|
434
|
+
}
|
|
438
435
|
});
|
|
439
436
|
/**
|
|
440
437
|
* List Computers
|
|
441
438
|
*
|
|
442
439
|
* List the computers of your organization, archived ones included.
|
|
443
440
|
*
|
|
444
|
-
* 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;
|
|
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.
|
|
445
442
|
*/
|
|
446
443
|
export const computersList = (options) => (options?.client ?? client).get({
|
|
447
444
|
security: [{
|
|
@@ -459,9 +456,9 @@ export const computersList = (options) => (options?.client ?? client).get({
|
|
|
459
456
|
/**
|
|
460
457
|
* Create Computer
|
|
461
458
|
*
|
|
462
|
-
* Create a durable computer: a named machine whose files outlive sessions, for general
|
|
459
|
+
* Create a durable computer: a named machine whose files outlive sessions, for general agents.
|
|
463
460
|
*
|
|
464
|
-
* 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;
|
|
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.
|
|
465
462
|
*/
|
|
466
463
|
export const computersCreate = (options) => (options.client ?? client).post({
|
|
467
464
|
security: [{
|
|
@@ -505,7 +502,7 @@ export const computersDelete = (options) => (options.client ?? client).delete({
|
|
|
505
502
|
*
|
|
506
503
|
* Read one computer's status, storage use and sandbox id.
|
|
507
504
|
*
|
|
508
|
-
* 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;
|
|
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.
|
|
509
506
|
*/
|
|
510
507
|
export const computersRetrieve = (options) => (options.client ?? client).get({
|
|
511
508
|
security: [{
|
|
@@ -525,7 +522,7 @@ export const computersRetrieve = (options) => (options.client ?? client).get({
|
|
|
525
522
|
*
|
|
526
523
|
* Rename a computer.
|
|
527
524
|
*
|
|
528
|
-
* 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;
|
|
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.
|
|
529
526
|
*/
|
|
530
527
|
export const computersUpdate = (options) => (options.client ?? client).post({
|
|
531
528
|
security: [{
|
|
@@ -549,7 +546,7 @@ export const computersUpdate = (options) => (options.client ?? client).post({
|
|
|
549
546
|
*
|
|
550
547
|
* Archive a computer: its files stay readable but new sessions cannot use it.
|
|
551
548
|
*
|
|
552
|
-
* 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;
|
|
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.
|
|
553
550
|
*/
|
|
554
551
|
export const computersArchive = (options) => (options.client ?? client).post({
|
|
555
552
|
security: [{
|
|
@@ -594,7 +591,7 @@ export const computersAttachmentsCreate = (options) => (options.client ?? client
|
|
|
594
591
|
*
|
|
595
592
|
* List the entries of one directory on a computer.
|
|
596
593
|
*
|
|
597
|
-
* 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;
|
|
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.
|
|
598
595
|
*/
|
|
599
596
|
export const computersFilesList = (options) => (options.client ?? client).get({
|
|
600
597
|
security: [{
|
|
@@ -614,7 +611,7 @@ export const computersFilesList = (options) => (options.client ?? client).get({
|
|
|
614
611
|
*
|
|
615
612
|
* Download the bytes of one file on a computer, up to 16 MiB, with single-range support.
|
|
616
613
|
*
|
|
617
|
-
* 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;
|
|
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.
|
|
618
615
|
*/
|
|
619
616
|
export const computersFilesContent = (options) => (options.client ?? client).get({
|
|
620
617
|
security: [{
|
|
@@ -629,6 +626,49 @@ export const computersFilesContent = (options) => (options.client ?? client).get
|
|
|
629
626
|
url: '/agent/v1/computers/{computer_id}/files/content',
|
|
630
627
|
...options
|
|
631
628
|
});
|
|
629
|
+
/**
|
|
630
|
+
* Write computer file content
|
|
631
|
+
*
|
|
632
|
+
* Write the bytes of one existing file on a computer, only if the file is still the version you read.
|
|
633
|
+
*
|
|
634
|
+
* Send the raw bytes as the body (at most 16 MiB) and the version you edited in `If-Match`: the `version` field of the file listing (`<size>-<mtimeMs>`). The file must already exist; the write replaces it whole and keeps its permissions. A request without `If-Match` answers 428 FILE_VERSION_REQUIRED and nothing is written. When the file has changed since that version, the answer is 412 FILE_VERSION_MISMATCH with `error.current_version`, and nothing is written: read the file again, redo the edit and write with the new version. The version is checked against the file's current size and modification time, then the content digest is bound into the write itself, so a change that lands while the bytes are being written is refused instead of overwritten. Paths under /attachments and /skills are read-only (403 READ_ONLY). A successful write answers the new path, size, mtime and version; use that version for the next write.
|
|
635
|
+
*/
|
|
636
|
+
export const updateComputerFileContent = (options) => (options.client ?? client).put({
|
|
637
|
+
bodySerializer: null,
|
|
638
|
+
security: [{
|
|
639
|
+
key: 'BearerAuth',
|
|
640
|
+
scheme: 'bearer',
|
|
641
|
+
type: 'http'
|
|
642
|
+
}, {
|
|
643
|
+
key: 'ApiKeyAuth',
|
|
644
|
+
name: 'X-API-Key',
|
|
645
|
+
type: 'apiKey'
|
|
646
|
+
}],
|
|
647
|
+
url: '/agent/v1/computers/{computer_id}/files/content',
|
|
648
|
+
...options,
|
|
649
|
+
headers: {
|
|
650
|
+
'Content-Type': 'application/octet-stream',
|
|
651
|
+
...options.headers
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
/**
|
|
655
|
+
* Preview a computer file
|
|
656
|
+
*
|
|
657
|
+
* The preview product of one version of one computer file: an image becomes a 1600 px WebP, an Office document a linearized PDF, text and source the first 64 KiB, and PDF, xlsx, epub, GIF, SVG and unknown types their original bytes. Products live in the File service and are keyed by computer, path, size, mtime, variant and format version. A request that pins `v` answers from that registry without stat'ing or waking the computer; without `v` the file is read and the product generated once. A file over the size threshold, or a deployment without the File service, answers `fallback: "content"` so the caller keeps the ordinary content door.
|
|
658
|
+
*/
|
|
659
|
+
export const previewComputerFile = (options) => (options.client ?? client).get({
|
|
660
|
+
security: [{
|
|
661
|
+
key: 'BearerAuth',
|
|
662
|
+
scheme: 'bearer',
|
|
663
|
+
type: 'http'
|
|
664
|
+
}, {
|
|
665
|
+
key: 'ApiKeyAuth',
|
|
666
|
+
name: 'X-API-Key',
|
|
667
|
+
type: 'apiKey'
|
|
668
|
+
}],
|
|
669
|
+
url: '/agent/v1/computers/{computer_id}/files/preview',
|
|
670
|
+
...options
|
|
671
|
+
});
|
|
632
672
|
/**
|
|
633
673
|
* Convert a Computer Document to PDF
|
|
634
674
|
*
|
|
@@ -718,7 +758,7 @@ export const releaseComputerLease = (options) => (options.client ?? client).dele
|
|
|
718
758
|
/**
|
|
719
759
|
* List Toolsets
|
|
720
760
|
*
|
|
721
|
-
* 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
|
|
761
|
+
* Discover tool names, input schemas, read-only status and default permission policies before configuring an agent. The catalog is read-only: enable tools through agents.create or agents.update. agent_toolset_20260401 includes bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message, codemode and skill, plus todo_write and goal_read, which are listed so they can be switched off. Native additions require bash enabled; codemode requires bash (enabling it with bash disabled returns 400; keep bash enabled with permission_policy always_ask to restrict it); send_message also requires agent. To keep only some tools, set default_config.enabled to false and enable the wanted tools in configs; unlisted tools follow default_config. The catalog includes plugin names and versions. Sessions created through /anthropic/v1 expose only the eight official tools.
|
|
722
762
|
*/
|
|
723
763
|
export const listToolsets = (options) => (options?.client ?? client).get({
|
|
724
764
|
security: [{
|
|
@@ -777,6 +817,54 @@ export const forkSession = (options) => (options.client ?? client).post({
|
|
|
777
817
|
...options.headers
|
|
778
818
|
}
|
|
779
819
|
});
|
|
820
|
+
/**
|
|
821
|
+
* Rename Session (Extension)
|
|
822
|
+
*
|
|
823
|
+
* Give a session a short, branch-like name; the main session is always main and cannot be renamed.
|
|
824
|
+
*
|
|
825
|
+
* Available only on /agent/v1. The name is normalized first (surrounding whitespace trimmed, upper case folded to lowercase, runs of whitespace become one hyphen, characters the rule does not admit dropped, and no hyphen left hanging at either end) and then validated: non-empty, at most 32 display columns wide (a Han character counts as two), made only of Han characters, lowercase ASCII letters, digits and hyphens, and never the reserved word main. A name another of the caller's own sessions already holds is not an error: the answer carries a numeric suffix (base-2, base-3, …). Renaming the main session returns 400; a missing session, one that belongs to another caller, or one the caller cannot write returns 404. Returns 200 with the same Session shape as retrieval, name set to the new name; one rename writes a session.renamed event. Example: POST /agent/v1/sessions/sesn_login/name with body {"name":"login-fix"}.
|
|
826
|
+
*/
|
|
827
|
+
export const renameSession = (options) => (options.client ?? client).post({
|
|
828
|
+
security: [{
|
|
829
|
+
key: 'BearerAuth',
|
|
830
|
+
scheme: 'bearer',
|
|
831
|
+
type: 'http'
|
|
832
|
+
}, {
|
|
833
|
+
key: 'ApiKeyAuth',
|
|
834
|
+
name: 'X-API-Key',
|
|
835
|
+
type: 'apiKey'
|
|
836
|
+
}],
|
|
837
|
+
url: '/agent/v1/sessions/{session_id}/name',
|
|
838
|
+
...options,
|
|
839
|
+
headers: {
|
|
840
|
+
'Content-Type': 'application/json',
|
|
841
|
+
...options.headers
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
/**
|
|
845
|
+
* Update session agent version
|
|
846
|
+
*
|
|
847
|
+
* Move one session to a version of its agent
|
|
848
|
+
*
|
|
849
|
+
* 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.
|
|
850
|
+
*/
|
|
851
|
+
export const updateSessionAgentVersion = (options) => (options.client ?? client).post({
|
|
852
|
+
security: [{
|
|
853
|
+
key: 'BearerAuth',
|
|
854
|
+
scheme: 'bearer',
|
|
855
|
+
type: 'http'
|
|
856
|
+
}, {
|
|
857
|
+
key: 'ApiKeyAuth',
|
|
858
|
+
name: 'X-API-Key',
|
|
859
|
+
type: 'apiKey'
|
|
860
|
+
}],
|
|
861
|
+
url: '/agent/v1/sessions/{session_id}/agent_version',
|
|
862
|
+
...options,
|
|
863
|
+
headers: {
|
|
864
|
+
'Content-Type': 'application/json',
|
|
865
|
+
...options.headers
|
|
866
|
+
}
|
|
867
|
+
});
|
|
780
868
|
/**
|
|
781
869
|
* List Session Artifacts (Extension)
|
|
782
870
|
*
|
|
@@ -826,7 +914,7 @@ export const createSessionArtifactContentUrl = (options) => (options.client ?? c
|
|
|
826
914
|
*
|
|
827
915
|
* List the requests a session is waiting on; an end-customer token reads its own session.
|
|
828
916
|
*
|
|
829
|
-
* 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 (
|
|
917
|
+
* Own-face extension. When a session stops at session.status_idle with stop_reason requires_action, read what it waits on here instead of replaying events. Returns { data: Request[] } ordered by create_time, an empty array when nothing is pending, not paginated. Each request has id (the pending tool call id), object (request), kind (always approval, a tool waiting for permission; question is kept for compatibility and is never returned), status (pending), tool_name, input (the same input the agent.tool_use event shows), create_time and expire_time. Answer a request as before: send a user.tool_confirmation event for its id. expire_time is set only for a session with no collaboration mode while the requests-v1 release is on (create_time plus 24 hours; an expired request counts as declined), otherwise null. Answered, expired and superseded requests are not listed, and neither are pending custom tool results (user.custom_tool_result). Whoever may read the session may read its requests; a session that is missing or not yours returns 404.
|
|
830
918
|
*/
|
|
831
919
|
export const listSessionRequests = (options) => (options.client ?? client).get({
|
|
832
920
|
security: [{
|
|
@@ -965,6 +1053,46 @@ export const listSessionCompactions = (options) => (options.client ?? client).ge
|
|
|
965
1053
|
url: '/agent/v1/sessions/{session_id}/compactions',
|
|
966
1054
|
...options
|
|
967
1055
|
});
|
|
1056
|
+
/**
|
|
1057
|
+
* Upload a File (Extension)
|
|
1058
|
+
*
|
|
1059
|
+
* 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"}.
|
|
1060
|
+
*/
|
|
1061
|
+
export const createAgentUpload = (options) => (options.client ?? client).post({
|
|
1062
|
+
security: [{
|
|
1063
|
+
key: 'BearerAuth',
|
|
1064
|
+
scheme: 'bearer',
|
|
1065
|
+
type: 'http'
|
|
1066
|
+
}, {
|
|
1067
|
+
key: 'ApiKeyAuth',
|
|
1068
|
+
name: 'X-API-Key',
|
|
1069
|
+
type: 'apiKey'
|
|
1070
|
+
}],
|
|
1071
|
+
url: '/agent/v1/uploads',
|
|
1072
|
+
...options,
|
|
1073
|
+
headers: {
|
|
1074
|
+
'Content-Type': 'application/json',
|
|
1075
|
+
...options.headers
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
/**
|
|
1079
|
+
* Create Upload Content URL (Extension)
|
|
1080
|
+
*
|
|
1081
|
+
* 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.
|
|
1082
|
+
*/
|
|
1083
|
+
export const createAgentUploadContentUrl = (options) => (options.client ?? client).post({
|
|
1084
|
+
security: [{
|
|
1085
|
+
key: 'BearerAuth',
|
|
1086
|
+
scheme: 'bearer',
|
|
1087
|
+
type: 'http'
|
|
1088
|
+
}, {
|
|
1089
|
+
key: 'ApiKeyAuth',
|
|
1090
|
+
name: 'X-API-Key',
|
|
1091
|
+
type: 'apiKey'
|
|
1092
|
+
}],
|
|
1093
|
+
url: '/agent/v1/uploads/{file_id}/content_url',
|
|
1094
|
+
...options
|
|
1095
|
+
});
|
|
968
1096
|
/**
|
|
969
1097
|
* Generate speech
|
|
970
1098
|
*
|
|
@@ -987,6 +1115,12 @@ export const createAudioSpeech = (options) => (options.client ?? client).post({
|
|
|
987
1115
|
...options.headers
|
|
988
1116
|
}
|
|
989
1117
|
});
|
|
1118
|
+
/**
|
|
1119
|
+
* List current prices
|
|
1120
|
+
*
|
|
1121
|
+
* Read every open price item with the amount in force now, in USD and CNY, for example to show a pricing page or check what a meter costs before using it. No credential: the response is the public price book, not an organization's prices, so customer-specific prices and cost floors are not part of it (the source does not carry them). Each entry names the item id, the product (the id's namespace such as router, sandbox or search), the meter's unit and how many units one amount covers (per is 1000000 for per-million-token meters). A model with one amount has one entry; a price that varies by tier or by dimensions has one entry per tier or cell, told apart by variant: tier carries up_to, cell carries when, and a matrix default is kind default. Only versions already in force are shown, so an announced price never appears before its effective_from. usd and cny are decimal strings of major units copied from the price book; a currency the item does not price is null and must be shown as "—", never as 0. pricing_version and effective_at identify the catalog this body came from, and the ETag is derived from both: send it as If-None-Match to get 304 until either changes. Cache-Control is public, max-age=60, so revalidate rather than keeping a copy longer. Reading is free.
|
|
1122
|
+
*/
|
|
1123
|
+
export const listPublicPrices = (options) => (options?.client ?? client).get({ url: '/billing/v1/prices', ...options });
|
|
990
1124
|
/**
|
|
991
1125
|
* 列出浏览器会话
|
|
992
1126
|
*
|
|
@@ -1320,9 +1454,10 @@ export const browserSeleniumUnsupported = (options) => (options?.client ?? clien
|
|
|
1320
1454
|
/**
|
|
1321
1455
|
* List files
|
|
1322
1456
|
*
|
|
1323
|
-
* List live files owned by your tenant, optionally filtered by purpose or
|
|
1457
|
+
* List live files owned by your tenant, optionally filtered by purpose, session scope_id or up to 100 file ids. Results default to descending creation order with a limit of 10000. Page using after or before with a file ID from the list; these cursors are mutually exclusive. Deleted and expired files are excluded.
|
|
1324
1458
|
*/
|
|
1325
1459
|
export const fileListFiles = (options) => (options?.client ?? client).get({
|
|
1460
|
+
querySerializer: { parameters: { ids: { array: { explode: false } } } },
|
|
1326
1461
|
security: [{
|
|
1327
1462
|
key: 'BearerAuth',
|
|
1328
1463
|
scheme: 'bearer',
|
|
@@ -2477,7 +2612,7 @@ export const listOrganizationUsage = (options) => (options.client ?? client).get
|
|
|
2477
2612
|
/**
|
|
2478
2613
|
* List Organization Usage Events
|
|
2479
2614
|
*
|
|
2480
|
-
* Usage events newest first, one opaque cursor page at a time; a page never duplicates or skips an event. Every item carries its metering lines (meter, display name, consumed quantity and unit, mapped from the billing measurements); the per-line price split (list unit price, pricing unit, billed cost) rides only the single event — fetch /organization/v1/events/{id} for it.
|
|
2615
|
+
* Usage events newest first by occurrence time (occurred_at, when the usage happened), one opaque cursor page at a time; a page never duplicates or skips an event. Every item carries its metering lines (meter, display name, consumed quantity and unit, mapped from the billing measurements); the per-line price split (list unit price, pricing unit, billed cost) rides only the single event — fetch /organization/v1/events/{id} for it. A cursor belongs to the order it was issued under: one obtained before this occurrence-time ordering, or used under the other sort direction, is refused with 400 INVALID_PARAMS instead of being reused — restart the listing.
|
|
2481
2616
|
*
|
|
2482
2617
|
*/
|
|
2483
2618
|
export const listOrganizationEvents = (options) => (options.client ?? client).get({
|
|
@@ -3028,7 +3163,7 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
|
|
|
3028
3163
|
/**
|
|
3029
3164
|
* Hire into a position
|
|
3030
3165
|
*
|
|
3031
|
-
* 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"}.
|
|
3166
|
+
* Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. An agent created moments ago may not be in the organization roster yet (agents enter it asynchronously): that answers 503 ACTOR_SYNCING with a Retry-After header and retryable true, and the same call succeeds after that wait. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
|
|
3032
3167
|
*/
|
|
3033
3168
|
export const hireOrganizationPosition = (options) => (options.client ?? client).post({
|
|
3034
3169
|
security: [{
|
|
@@ -3484,11 +3619,11 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
|
|
|
3484
3619
|
}
|
|
3485
3620
|
});
|
|
3486
3621
|
/**
|
|
3487
|
-
*
|
|
3622
|
+
* List specs
|
|
3488
3623
|
*
|
|
3489
|
-
*
|
|
3624
|
+
* Lists the specs (规定) of the organization, most recently updated first; use it to find which subject already has a spec before reading or revising one. Narrow it with kind. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, an unknown kind, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/specs?kind=job.
|
|
3490
3625
|
*/
|
|
3491
|
-
export const
|
|
3626
|
+
export const listOrganizationSpecs = (options) => (options?.client ?? client).get({
|
|
3492
3627
|
security: [{
|
|
3493
3628
|
key: 'BearerAuth',
|
|
3494
3629
|
scheme: 'bearer',
|
|
@@ -3498,19 +3633,15 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
|
|
|
3498
3633
|
name: 'X-API-Key',
|
|
3499
3634
|
type: 'apiKey'
|
|
3500
3635
|
}],
|
|
3501
|
-
url: '/
|
|
3502
|
-
...options
|
|
3503
|
-
headers: {
|
|
3504
|
-
'Content-Type': 'application/json',
|
|
3505
|
-
...options.headers
|
|
3506
|
-
}
|
|
3636
|
+
url: '/organization/v1/specs',
|
|
3637
|
+
...options
|
|
3507
3638
|
});
|
|
3508
3639
|
/**
|
|
3509
|
-
*
|
|
3640
|
+
* Get a spec
|
|
3510
3641
|
*
|
|
3511
|
-
*
|
|
3642
|
+
* Reads one subject's live spec, or one historical revision with revision; a subject never written answers revision 0 with an empty spec, so a first revise sends expected_revision 0. Read-only. Errors: 400 INVALID_PARAMS for a non-integer revision; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject, or the named SPEC_REVISION_NOT_FOUND, does not exist. Example: GET /organization/v1/specs/job/jpr_123?revision=2.
|
|
3512
3643
|
*/
|
|
3513
|
-
export const
|
|
3644
|
+
export const getOrganizationSpec = (options) => (options.client ?? client).get({
|
|
3514
3645
|
security: [{
|
|
3515
3646
|
key: 'BearerAuth',
|
|
3516
3647
|
scheme: 'bearer',
|
|
@@ -3520,7 +3651,25 @@ export const extendSandbox = (options) => (options.client ?? client).post({
|
|
|
3520
3651
|
name: 'X-API-Key',
|
|
3521
3652
|
type: 'apiKey'
|
|
3522
3653
|
}],
|
|
3523
|
-
url: '/
|
|
3654
|
+
url: '/organization/v1/specs/{kind}/{id}',
|
|
3655
|
+
...options
|
|
3656
|
+
});
|
|
3657
|
+
/**
|
|
3658
|
+
* Revise a spec
|
|
3659
|
+
*
|
|
3660
|
+
* Replaces the whole spec of a subject: expected_revision is the revision you last read (0 when none was written) and each success raises it by one, so a mismatch returns REVISION_CONFLICT and you must read again, merge and retry. The spec body is stored and returned verbatim; its blocks are document, agent, computer, phone, roles, grants, repositories, schedules, browser and remove, and it is validated against the block registry. Requires an organization owner or admin, or the head of the subject's department. Errors: 400 INVALID_PARAMS for a missing spec or expected_revision, a block outside the registry or an unknown body field; 403 PERMISSION_DENIED; 404 when the subject does not exist; 409 REVISION_CONFLICT. Example body: {"expected_revision":0,"spec":{"document":"Deliver reliably."}}.
|
|
3661
|
+
*/
|
|
3662
|
+
export const reviseOrganizationSpec = (options) => (options.client ?? client).put({
|
|
3663
|
+
security: [{
|
|
3664
|
+
key: 'BearerAuth',
|
|
3665
|
+
scheme: 'bearer',
|
|
3666
|
+
type: 'http'
|
|
3667
|
+
}, {
|
|
3668
|
+
key: 'ApiKeyAuth',
|
|
3669
|
+
name: 'X-API-Key',
|
|
3670
|
+
type: 'apiKey'
|
|
3671
|
+
}],
|
|
3672
|
+
url: '/organization/v1/specs/{kind}/{id}',
|
|
3524
3673
|
...options,
|
|
3525
3674
|
headers: {
|
|
3526
3675
|
'Content-Type': 'application/json',
|
|
@@ -3528,11 +3677,11 @@ export const extendSandbox = (options) => (options.client ?? client).post({
|
|
|
3528
3677
|
}
|
|
3529
3678
|
});
|
|
3530
3679
|
/**
|
|
3531
|
-
* List
|
|
3680
|
+
* List spec revisions
|
|
3532
3681
|
*
|
|
3533
|
-
*
|
|
3682
|
+
* Lists every stored revision of one subject's spec, newest first, each with its body, author and creation instant; use it to see what changed over time or to pick a revision to read or diff. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist.
|
|
3534
3683
|
*/
|
|
3535
|
-
export const
|
|
3684
|
+
export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
|
|
3536
3685
|
security: [{
|
|
3537
3686
|
key: 'BearerAuth',
|
|
3538
3687
|
scheme: 'bearer',
|
|
@@ -3542,15 +3691,15 @@ export const listObservedProcesses = (options) => (options.client ?? client).get
|
|
|
3542
3691
|
name: 'X-API-Key',
|
|
3543
3692
|
type: 'apiKey'
|
|
3544
3693
|
}],
|
|
3545
|
-
url: '/
|
|
3694
|
+
url: '/organization/v1/specs/{kind}/{id}/revisions',
|
|
3546
3695
|
...options
|
|
3547
3696
|
});
|
|
3548
3697
|
/**
|
|
3549
|
-
*
|
|
3698
|
+
* Diff two spec revisions
|
|
3550
3699
|
*
|
|
3551
|
-
*
|
|
3700
|
+
* Compares two revisions of one subject's spec and lists the changes between them, each with its path and, for a change, the value before and after; revision 0 is the empty spec, so diffing 0 against 1 shows the first write. Read-only. Errors: 400 INVALID_PARAMS when from or to is missing or not an integer; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist, or SPEC_REVISION_NOT_FOUND when from or to was never written. Example: GET /organization/v1/specs/job/jpr_123/diff?from=1&to=2.
|
|
3552
3701
|
*/
|
|
3553
|
-
export const
|
|
3702
|
+
export const diffOrganizationSpec = (options) => (options.client ?? client).get({
|
|
3554
3703
|
security: [{
|
|
3555
3704
|
key: 'BearerAuth',
|
|
3556
3705
|
scheme: 'bearer',
|
|
@@ -3560,15 +3709,15 @@ export const getObservedProcessOutput = (options) => (options.client ?? client).
|
|
|
3560
3709
|
name: 'X-API-Key',
|
|
3561
3710
|
type: 'apiKey'
|
|
3562
3711
|
}],
|
|
3563
|
-
url: '/
|
|
3712
|
+
url: '/organization/v1/specs/{kind}/{id}/diff',
|
|
3564
3713
|
...options
|
|
3565
3714
|
});
|
|
3566
3715
|
/**
|
|
3567
|
-
*
|
|
3716
|
+
* Read the effective spec
|
|
3568
3717
|
*
|
|
3569
|
-
*
|
|
3718
|
+
* Merges the spec chain of a seat or an actor and returns the one effective configuration: the merged capability blocks, the document of every layer, where each merged value came from, and anything only the merged result shows to be wrong. Give exactly one of actor (every seat the actor holds) or position_id (one seat, held or vacant, a preview before hiring); holder_kind defaults from the seat's holder. Read-only; nothing is changed. Errors: 400 INVALID_PARAMS when neither or both of actor and position_id are given, the actor address is malformed, holder_kind is neither agent nor human, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 POSITION_NOT_FOUND. Example: GET /organization/v1/effective_spec?actor=agent:agent_123.
|
|
3570
3719
|
*/
|
|
3571
|
-
export const
|
|
3720
|
+
export const getOrganizationEffectiveSpec = (options) => (options?.client ?? client).get({
|
|
3572
3721
|
security: [{
|
|
3573
3722
|
key: 'BearerAuth',
|
|
3574
3723
|
scheme: 'bearer',
|
|
@@ -3578,19 +3727,15 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
|
|
|
3578
3727
|
name: 'X-API-Key',
|
|
3579
3728
|
type: 'apiKey'
|
|
3580
3729
|
}],
|
|
3581
|
-
url: '/
|
|
3582
|
-
...options
|
|
3583
|
-
headers: {
|
|
3584
|
-
'Content-Type': 'application/json',
|
|
3585
|
-
...options.headers
|
|
3586
|
-
}
|
|
3730
|
+
url: '/organization/v1/effective_spec',
|
|
3731
|
+
...options
|
|
3587
3732
|
});
|
|
3588
3733
|
/**
|
|
3589
|
-
*
|
|
3734
|
+
* Plan reconciliation
|
|
3590
3735
|
*
|
|
3591
|
-
*
|
|
3736
|
+
* Dry-runs the reconciler for one holder and returns what it would change: an action per block (hold, update, none, pending, blocked) with the value it would write, and the violations only the merged result shows. It changes nothing - no state, no agent and no memory. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/reconcile/plan?actor=agent:agent_123.
|
|
3592
3737
|
*/
|
|
3593
|
-
export const
|
|
3738
|
+
export const planOrganizationReconcile = (options) => (options.client ?? client).get({
|
|
3594
3739
|
security: [{
|
|
3595
3740
|
key: 'BearerAuth',
|
|
3596
3741
|
scheme: 'bearer',
|
|
@@ -3600,89 +3745,433 @@ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
|
|
|
3600
3745
|
name: 'X-API-Key',
|
|
3601
3746
|
type: 'apiKey'
|
|
3602
3747
|
}],
|
|
3603
|
-
url: '/
|
|
3748
|
+
url: '/organization/v1/reconcile/plan',
|
|
3604
3749
|
...options
|
|
3605
3750
|
});
|
|
3606
3751
|
/**
|
|
3607
|
-
*
|
|
3752
|
+
* Read reconcile status
|
|
3608
3753
|
*
|
|
3609
|
-
*
|
|
3754
|
+
* Reads the reconciler's last result for one holder: whether the sweep is paused, the seats and layer revisions of the last applied run, each block's state (ready, pending, failed, waiting_human or paused), the drift between what is applied and what the specs want, and when it last applied. Read-only; it changes nothing. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /organization/v1/reconcile/status?actor=agent:agent_123.
|
|
3610
3755
|
*/
|
|
3611
|
-
export const
|
|
3612
|
-
security: [
|
|
3613
|
-
|
|
3614
|
-
key: 'sandbox-ApiKeyAuth',
|
|
3615
|
-
name: 'X-API-Key',
|
|
3616
|
-
type: 'apiKey'
|
|
3617
|
-
},
|
|
3618
|
-
{
|
|
3619
|
-
key: 'sandbox-AuthProviderBearerAuth',
|
|
3756
|
+
export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
|
|
3757
|
+
security: [{
|
|
3758
|
+
key: 'BearerAuth',
|
|
3620
3759
|
scheme: 'bearer',
|
|
3621
3760
|
type: 'http'
|
|
3622
|
-
},
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
name: 'X-Team-ID',
|
|
3626
|
-
type: 'apiKey'
|
|
3627
|
-
},
|
|
3628
|
-
{ name: 'X-Admin-Token', type: 'apiKey' },
|
|
3629
|
-
{
|
|
3630
|
-
key: 'sandbox-AdminTeamAuth',
|
|
3631
|
-
name: 'X-Team-ID',
|
|
3761
|
+
}, {
|
|
3762
|
+
key: 'ApiKeyAuth',
|
|
3763
|
+
name: 'X-API-Key',
|
|
3632
3764
|
type: 'apiKey'
|
|
3633
|
-
},
|
|
3634
|
-
|
|
3635
|
-
key: 'sandbox-AdminJWTAuth',
|
|
3636
|
-
scheme: 'bearer',
|
|
3637
|
-
type: 'http'
|
|
3638
|
-
}
|
|
3639
|
-
],
|
|
3640
|
-
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
3765
|
+
}],
|
|
3766
|
+
url: '/organization/v1/reconcile/status',
|
|
3641
3767
|
...options
|
|
3642
3768
|
});
|
|
3643
3769
|
/**
|
|
3644
|
-
*
|
|
3770
|
+
* Run reconciliation now
|
|
3645
3771
|
*
|
|
3646
|
-
*
|
|
3772
|
+
* Reconciles one holder now instead of waiting for the sweep: it plans, applies every update and returns the new status. Run plan first to see the changes without applying them. Requires an organization owner or admin. A block that cannot be applied now stays pending, waiting_human or failed, and the returned status says so. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
|
|
3647
3773
|
*/
|
|
3648
|
-
export const
|
|
3649
|
-
security: [
|
|
3650
|
-
|
|
3651
|
-
|
|
3774
|
+
export const runOrganizationReconcile = (options) => (options.client ?? client).post({
|
|
3775
|
+
security: [{
|
|
3776
|
+
key: 'BearerAuth',
|
|
3777
|
+
scheme: 'bearer',
|
|
3778
|
+
type: 'http'
|
|
3779
|
+
}, {
|
|
3780
|
+
key: 'ApiKeyAuth',
|
|
3652
3781
|
name: 'X-API-Key',
|
|
3653
3782
|
type: 'apiKey'
|
|
3654
|
-
},
|
|
3655
|
-
|
|
3656
|
-
|
|
3783
|
+
}],
|
|
3784
|
+
url: '/organization/v1/reconcile/run',
|
|
3785
|
+
...options,
|
|
3786
|
+
headers: {
|
|
3787
|
+
'Content-Type': 'application/json',
|
|
3788
|
+
...options.headers
|
|
3789
|
+
}
|
|
3790
|
+
});
|
|
3791
|
+
/**
|
|
3792
|
+
* Pause reconciliation
|
|
3793
|
+
*
|
|
3794
|
+
* Stops the sweep from reconciling one holder until it is resumed: the holder's blocks keep their state and no further update is applied. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
|
|
3795
|
+
*/
|
|
3796
|
+
export const pauseOrganizationReconcile = (options) => (options.client ?? client).post({
|
|
3797
|
+
security: [{
|
|
3798
|
+
key: 'BearerAuth',
|
|
3657
3799
|
scheme: 'bearer',
|
|
3658
3800
|
type: 'http'
|
|
3659
|
-
},
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3801
|
+
}, {
|
|
3802
|
+
key: 'ApiKeyAuth',
|
|
3803
|
+
name: 'X-API-Key',
|
|
3804
|
+
type: 'apiKey'
|
|
3805
|
+
}],
|
|
3806
|
+
url: '/organization/v1/reconcile/pause',
|
|
3807
|
+
...options,
|
|
3808
|
+
headers: {
|
|
3809
|
+
'Content-Type': 'application/json',
|
|
3810
|
+
...options.headers
|
|
3811
|
+
}
|
|
3812
|
+
});
|
|
3813
|
+
/**
|
|
3814
|
+
* Resume reconciliation
|
|
3815
|
+
*
|
|
3816
|
+
* Restarts the sweep for a paused holder and reconciles it now, returning the new status. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
|
|
3817
|
+
*/
|
|
3818
|
+
export const resumeOrganizationReconcile = (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: '/organization/v1/reconcile/resume',
|
|
3829
|
+
...options,
|
|
3830
|
+
headers: {
|
|
3831
|
+
'Content-Type': 'application/json',
|
|
3832
|
+
...options.headers
|
|
3833
|
+
}
|
|
3834
|
+
});
|
|
3835
|
+
/**
|
|
3836
|
+
* Upgrade to a full sandbox
|
|
3837
|
+
*
|
|
3838
|
+
* Move a light sandbox to a full environment when its capabilities are insufficient. Stops active processes and terminals, migrates files, and preserves the sandbox ID and name. Reconnect with the new envdAccessToken. A failed migration preserves source files but does not restart terminated processes.
|
|
3839
|
+
*/
|
|
3840
|
+
export const upgradeSandbox = (options) => (options.client ?? client).post({
|
|
3841
|
+
security: [{
|
|
3842
|
+
key: 'BearerAuth',
|
|
3843
|
+
scheme: 'bearer',
|
|
3844
|
+
type: 'http'
|
|
3845
|
+
}, {
|
|
3846
|
+
key: 'ApiKeyAuth',
|
|
3847
|
+
name: 'X-API-Key',
|
|
3848
|
+
type: 'apiKey'
|
|
3849
|
+
}],
|
|
3850
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
|
|
3851
|
+
...options,
|
|
3852
|
+
headers: {
|
|
3853
|
+
'Content-Type': 'application/json',
|
|
3854
|
+
...options.headers
|
|
3855
|
+
}
|
|
3856
|
+
});
|
|
3857
|
+
/**
|
|
3858
|
+
* Extend a running sandbox without shortening its deadline
|
|
3859
|
+
*
|
|
3860
|
+
* Extend a running sandbox only when it needs a later expiry; this never resumes a paused sandbox. Timeout is seconds from now, not added to the prior deadline, and must be 900, 1800 or 3600. Returns 409 for paused, expired, or non-extending requests.
|
|
3861
|
+
*/
|
|
3862
|
+
export const extendSandbox = (options) => (options.client ?? client).post({
|
|
3863
|
+
security: [{
|
|
3864
|
+
key: 'BearerAuth',
|
|
3865
|
+
scheme: 'bearer',
|
|
3866
|
+
type: 'http'
|
|
3867
|
+
}, {
|
|
3868
|
+
key: 'ApiKeyAuth',
|
|
3869
|
+
name: 'X-API-Key',
|
|
3870
|
+
type: 'apiKey'
|
|
3871
|
+
}],
|
|
3872
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
|
|
3873
|
+
...options,
|
|
3874
|
+
headers: {
|
|
3875
|
+
'Content-Type': 'application/json',
|
|
3876
|
+
...options.headers
|
|
3877
|
+
}
|
|
3878
|
+
});
|
|
3879
|
+
/**
|
|
3880
|
+
* List live processes and retained observations
|
|
3881
|
+
*
|
|
3882
|
+
* Inspect live processes and retained observations; this does not start a command. Praxis observation, not complete provider history. Only a witnessed exit event establishes exitCode; disconnects and restarts leave gaps and unknown state. Output retains at most 1 MiB/1024 chunks per process and 4 MiB/4096 chunks per instance across 256 observations. Truncation is explicit. Output data is base64; timestamps are Unix milliseconds. Reading never resumes a paused sandbox.
|
|
3883
|
+
*/
|
|
3884
|
+
export const listObservedProcesses = (options) => (options.client ?? client).get({
|
|
3885
|
+
security: [{
|
|
3886
|
+
key: 'BearerAuth',
|
|
3887
|
+
scheme: 'bearer',
|
|
3888
|
+
type: 'http'
|
|
3889
|
+
}, {
|
|
3890
|
+
key: 'ApiKeyAuth',
|
|
3891
|
+
name: 'X-API-Key',
|
|
3892
|
+
type: 'apiKey'
|
|
3893
|
+
}],
|
|
3894
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
|
|
3895
|
+
...options
|
|
3896
|
+
});
|
|
3897
|
+
/**
|
|
3898
|
+
* Read bounded observed process output
|
|
3899
|
+
*
|
|
3900
|
+
* Read retained stdout and stderr chunks for a processID returned by processes.list. Praxis observation, not complete provider history. Only a witnessed exit event establishes exitCode; disconnects and restarts leave gaps and unknown state. Output retains at most 1 MiB/1024 chunks per process and 4 MiB/4096 chunks per instance across 256 observations. Truncation is explicit. Output data is base64; timestamps are Unix milliseconds. Reading never resumes a paused sandbox.
|
|
3901
|
+
*/
|
|
3902
|
+
export const getObservedProcessOutput = (options) => (options.client ?? client).get({
|
|
3903
|
+
security: [{
|
|
3904
|
+
key: 'BearerAuth',
|
|
3905
|
+
scheme: 'bearer',
|
|
3906
|
+
type: 'http'
|
|
3907
|
+
}, {
|
|
3908
|
+
key: 'ApiKeyAuth',
|
|
3909
|
+
name: 'X-API-Key',
|
|
3910
|
+
type: 'apiKey'
|
|
3911
|
+
}],
|
|
3912
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
|
|
3913
|
+
...options
|
|
3914
|
+
});
|
|
3915
|
+
/**
|
|
3916
|
+
* Start a task whose output is pushed off the machine while it runs
|
|
3917
|
+
*
|
|
3918
|
+
* Run a long command whose output you will read back afterwards, including after the sandbox is deleted, instead of holding one connection open. Use this for builds, test runs and batch jobs; use commands.run for a short command whose output you want inline. The machine's resident daemon pushes the task's stdout/stderr to Praxis storage as it is produced, so the log survives the sandbox (seven days) and can be read in ranges with sandboxes.tasks.log; no vendor exec channel is involved. The command and the shipping credential travel to the daemon in its process environment, never in argv, so neither appears in the machine's process list. Only a full sandbox whose daemon advertises log-ship can run a task; any other machine returns PROVIDER_UNSUPPORTED with the reason. Returns 201 with the task id; starting is not waiting — poll the log to follow the task, and the final marker's exitCode for how it ended.
|
|
3919
|
+
*/
|
|
3920
|
+
export const startSandboxTask = (options) => (options.client ?? client).post({
|
|
3921
|
+
security: [{
|
|
3922
|
+
key: 'BearerAuth',
|
|
3923
|
+
scheme: 'bearer',
|
|
3924
|
+
type: 'http'
|
|
3925
|
+
}, {
|
|
3926
|
+
key: 'ApiKeyAuth',
|
|
3927
|
+
name: 'X-API-Key',
|
|
3928
|
+
type: 'apiKey'
|
|
3929
|
+
}],
|
|
3930
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
|
|
3931
|
+
...options,
|
|
3932
|
+
headers: {
|
|
3933
|
+
'Content-Type': 'application/json',
|
|
3934
|
+
...options.headers
|
|
3935
|
+
}
|
|
3936
|
+
});
|
|
3937
|
+
/**
|
|
3938
|
+
* Read a range of a task's pushed output
|
|
3939
|
+
*
|
|
3940
|
+
* Follow a task started with sandboxes.tasks.start, or read it long after its sandbox is gone. This reads Praxis storage and never the machine, so the answer is the same whether the sandbox is running, paused or deleted; the log is kept for seven days. Read in ranges: pass the previous answer's nextOffset as offset to continue, and stop when done is true. done means the final marker exists and the whole stream has been read, and only then do exitCode and size carry the task's outcome. text is UTF-8 decoded by bytes and backs up to a whole character when a cut would split one, so a page never ends mid-character; size, offset and nextOffset all count bytes. Ownership comes from the sandbox's index row while it exists and from the record written when the task started once it does not, so a sandbox id you own keeps answering after the sandbox is deleted. A task that was never started, or one belonging to another organization, returns NOT_FOUND.
|
|
3941
|
+
*/
|
|
3942
|
+
export const getSandboxTaskLog = (options) => (options.client ?? client).get({
|
|
3943
|
+
security: [{
|
|
3944
|
+
key: 'BearerAuth',
|
|
3945
|
+
scheme: 'bearer',
|
|
3946
|
+
type: 'http'
|
|
3947
|
+
}, {
|
|
3948
|
+
key: 'ApiKeyAuth',
|
|
3949
|
+
name: 'X-API-Key',
|
|
3950
|
+
type: 'apiKey'
|
|
3951
|
+
}],
|
|
3952
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
|
|
3953
|
+
...options
|
|
3954
|
+
});
|
|
3955
|
+
/**
|
|
3956
|
+
* Kill sandbox
|
|
3957
|
+
*
|
|
3958
|
+
* Kill a sandbox: stop it and release its resources for good. Use it when you are done with the sandbox; to keep its state for later use pause it instead with pauseSandbox. Success answers 204 with no body, and a killed sandbox answers 404 afterwards.
|
|
3959
|
+
*/
|
|
3960
|
+
export const deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
|
|
3961
|
+
security: [
|
|
3962
|
+
{
|
|
3963
|
+
key: 'sandbox-ApiKeyAuth',
|
|
3964
|
+
name: 'X-API-Key',
|
|
3965
|
+
type: 'apiKey'
|
|
3966
|
+
},
|
|
3967
|
+
{
|
|
3968
|
+
key: 'sandbox-AuthProviderBearerAuth',
|
|
3969
|
+
scheme: 'bearer',
|
|
3970
|
+
type: 'http'
|
|
3971
|
+
},
|
|
3972
|
+
{
|
|
3973
|
+
key: 'sandbox-AuthProviderTeamAuth',
|
|
3974
|
+
name: 'X-Team-ID',
|
|
3975
|
+
type: 'apiKey'
|
|
3976
|
+
},
|
|
3665
3977
|
{ name: 'X-Admin-Token', type: 'apiKey' },
|
|
3666
3978
|
{
|
|
3667
3979
|
key: 'sandbox-AdminTeamAuth',
|
|
3668
3980
|
name: 'X-Team-ID',
|
|
3669
3981
|
type: 'apiKey'
|
|
3670
|
-
},
|
|
3671
|
-
{
|
|
3672
|
-
key: 'sandbox-AdminJWTAuth',
|
|
3982
|
+
},
|
|
3983
|
+
{
|
|
3984
|
+
key: 'sandbox-AdminJWTAuth',
|
|
3985
|
+
scheme: 'bearer',
|
|
3986
|
+
type: 'http'
|
|
3987
|
+
}
|
|
3988
|
+
],
|
|
3989
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
3990
|
+
...options
|
|
3991
|
+
});
|
|
3992
|
+
/**
|
|
3993
|
+
* Sandbox
|
|
3994
|
+
*
|
|
3995
|
+
* Read one sandbox: its state (running or paused), template, resources, start time and expiry (endAt), plus the access token for its data plane when it is running. Use it to poll the state or the remaining lifetime of a sandbox; to find sandboxes use listSandboxes. An unknown id or another team's sandbox answers 404.
|
|
3996
|
+
*/
|
|
3997
|
+
export const getSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).get({
|
|
3998
|
+
security: [
|
|
3999
|
+
{
|
|
4000
|
+
key: 'sandbox-ApiKeyAuth',
|
|
4001
|
+
name: 'X-API-Key',
|
|
4002
|
+
type: 'apiKey'
|
|
4003
|
+
},
|
|
4004
|
+
{
|
|
4005
|
+
key: 'sandbox-AuthProviderBearerAuth',
|
|
4006
|
+
scheme: 'bearer',
|
|
4007
|
+
type: 'http'
|
|
4008
|
+
},
|
|
4009
|
+
{
|
|
4010
|
+
key: 'sandbox-AuthProviderTeamAuth',
|
|
4011
|
+
name: 'X-Team-ID',
|
|
4012
|
+
type: 'apiKey'
|
|
4013
|
+
},
|
|
4014
|
+
{ name: 'X-Admin-Token', type: 'apiKey' },
|
|
4015
|
+
{
|
|
4016
|
+
key: 'sandbox-AdminTeamAuth',
|
|
4017
|
+
name: 'X-Team-ID',
|
|
4018
|
+
type: 'apiKey'
|
|
4019
|
+
},
|
|
4020
|
+
{
|
|
4021
|
+
key: 'sandbox-AdminJWTAuth',
|
|
4022
|
+
scheme: 'bearer',
|
|
4023
|
+
type: 'http'
|
|
4024
|
+
}
|
|
4025
|
+
],
|
|
4026
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
4027
|
+
...options
|
|
4028
|
+
});
|
|
4029
|
+
/**
|
|
4030
|
+
* Rename a sandbox
|
|
4031
|
+
*
|
|
4032
|
+
* Rename your sandbox. Names are trimmed, must contain 1–64 characters after trimming, and must be unique within your team. Only name may be changed. Returns the updated sandbox detail, as GET does. Killed or unavailable sandboxes return 404.
|
|
4033
|
+
*/
|
|
4034
|
+
export const renameSandbox = (options) => (options.client ?? client).patch({
|
|
4035
|
+
security: [{
|
|
4036
|
+
key: 'BearerAuth',
|
|
4037
|
+
scheme: 'bearer',
|
|
4038
|
+
type: 'http'
|
|
4039
|
+
}, {
|
|
4040
|
+
key: 'ApiKeyAuth',
|
|
4041
|
+
name: 'X-API-Key',
|
|
4042
|
+
type: 'apiKey'
|
|
4043
|
+
}],
|
|
4044
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
4045
|
+
...options,
|
|
4046
|
+
headers: {
|
|
4047
|
+
'Content-Type': 'application/json',
|
|
4048
|
+
...options.headers
|
|
4049
|
+
}
|
|
4050
|
+
});
|
|
4051
|
+
/**
|
|
4052
|
+
* Act on a phone sandbox's screen
|
|
4053
|
+
*
|
|
4054
|
+
* See and operate an android sandbox's phone screen: take a screenshot, read the UI hierarchy to get a ref for each node, then tap a node or a screen point, long-press, swipe, scroll, type text, press a key, open or close an app, open a URL, or wait. Use it to drive and automate a mobile app on a phone sandbox created with templateID "android"; those machines have no terminal or file API, so drive the screen with this operation and run shell commands with commands.run. Start with a snapshot to learn what is on screen and to mint the refs the tap-like actions use; a ref names a node in the latest snapshot only, so after a newer snapshot, or after an action that changed the screen, take a fresh snapshot — a stale ref is refused with INVALID_PARAMS. The phone runs one action at a time, so actions on one sandbox are serial: send the next only after the previous call returns. A phone that has just been created may not have connected yet and answers 503 SERVICE_UNAVAILABLE with Retry-After: 2; retry after that delay (measured on develop: the sandbox is created in about 45 s and the phone program connects about 15 s later). Text is entered through the phone's own input, which supports ASCII only, so typing non-ASCII text into a Chinese app is not supported and answers INVALID_PARAMS. A linux sandbox has no screen and answers CAPABILITY_UNSUPPORTED.
|
|
4055
|
+
*
|
|
4056
|
+
* The same path is the caller's action socket: send GET with the standard WebSocket upgrade headers instead of POST and drive many actions over one connection. The server answers {"type":"ready","instanceId":"<id>"} first, then every frame {"id":"<your correlation id>","action":{…}} (an action of the same shape as this operation's body, at most 64 characters of id) is answered by its own id, in submission order, as {"id":"…","result":{…}} or {"id":"…","error":{"code":"…","message":"…","retryable":true}}. At most 8 actions may be in flight on one connection (the next answers RATE_LIMITED), and 10 malformed frames in a row close the connection 1008. Authentication is the caller's own (an organization API key), never the phone's token. Closing the connection ends only that client's view: actions already accepted are answered, and the phone stays connected. Before the handshake, a phone that is still being built or has not connected yet answers 503 DEVICE_NOT_READY with the state it is in and Retry-After: 2.
|
|
4057
|
+
*/
|
|
4058
|
+
export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
|
|
4059
|
+
security: [{
|
|
4060
|
+
key: 'BearerAuth',
|
|
4061
|
+
scheme: 'bearer',
|
|
4062
|
+
type: 'http'
|
|
4063
|
+
}, {
|
|
4064
|
+
key: 'ApiKeyAuth',
|
|
4065
|
+
name: 'X-API-Key',
|
|
4066
|
+
type: 'apiKey'
|
|
4067
|
+
}],
|
|
4068
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/act',
|
|
4069
|
+
...options,
|
|
4070
|
+
headers: {
|
|
4071
|
+
'Content-Type': 'application/json',
|
|
4072
|
+
...options.headers
|
|
4073
|
+
}
|
|
4074
|
+
});
|
|
4075
|
+
/**
|
|
4076
|
+
* Remove a file or directory in the sandbox
|
|
4077
|
+
*
|
|
4078
|
+
* Remove an unneeded file or recursively remove a directory and its contents. This permanently deletes the selected path; read any needed content first. Returns 204 after removal.
|
|
4079
|
+
*/
|
|
4080
|
+
export const removeSandboxFile = (options) => (options.client ?? client).delete({
|
|
4081
|
+
security: [{
|
|
4082
|
+
key: 'BearerAuth',
|
|
4083
|
+
scheme: 'bearer',
|
|
4084
|
+
type: 'http'
|
|
4085
|
+
}, {
|
|
4086
|
+
key: 'ApiKeyAuth',
|
|
4087
|
+
name: 'X-API-Key',
|
|
4088
|
+
type: 'apiKey'
|
|
4089
|
+
}],
|
|
4090
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
|
|
4091
|
+
...options
|
|
4092
|
+
});
|
|
4093
|
+
/**
|
|
4094
|
+
* Read a file in the sandbox
|
|
4095
|
+
*
|
|
4096
|
+
* Read UTF-8 file content when a command needs input or produced a text artifact. Returns a JSON string. Unlike E2B, this endpoint supports text only and rejects output above 1 MiB; binary and streaming reads are unavailable.
|
|
4097
|
+
*/
|
|
4098
|
+
export const readSandboxFile = (options) => (options.client ?? client).get({
|
|
4099
|
+
security: [{
|
|
4100
|
+
key: 'BearerAuth',
|
|
4101
|
+
scheme: 'bearer',
|
|
4102
|
+
type: 'http'
|
|
4103
|
+
}, {
|
|
4104
|
+
key: 'ApiKeyAuth',
|
|
4105
|
+
name: 'X-API-Key',
|
|
4106
|
+
type: 'apiKey'
|
|
4107
|
+
}],
|
|
4108
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
|
|
4109
|
+
...options
|
|
4110
|
+
});
|
|
4111
|
+
/**
|
|
4112
|
+
* Write a file in the sandbox
|
|
4113
|
+
*
|
|
4114
|
+
* Write a file in the sandbox before running a command. Replaces the target content and creates missing parent directories. Unlike E2B, this endpoint accepts one UTF-8 text file per request, at most 1 MiB; binary and batch writes are unavailable. Example body: {"path":"/tmp/hello.txt","data":"hello"}.
|
|
4115
|
+
*/
|
|
4116
|
+
export const writeSandboxFile = (options) => (options.client ?? client).put({
|
|
4117
|
+
security: [{
|
|
4118
|
+
key: 'BearerAuth',
|
|
4119
|
+
scheme: 'bearer',
|
|
4120
|
+
type: 'http'
|
|
4121
|
+
}, {
|
|
4122
|
+
key: 'ApiKeyAuth',
|
|
4123
|
+
name: 'X-API-Key',
|
|
4124
|
+
type: 'apiKey'
|
|
4125
|
+
}],
|
|
4126
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
|
|
4127
|
+
...options,
|
|
4128
|
+
headers: {
|
|
4129
|
+
'Content-Type': 'application/json',
|
|
4130
|
+
...options.headers
|
|
4131
|
+
}
|
|
4132
|
+
});
|
|
4133
|
+
/**
|
|
4134
|
+
* List files in a sandbox directory
|
|
4135
|
+
*
|
|
4136
|
+
* Inspect a directory to find paths to read or remove. Returns immediate children with name, path, type and size. Unlike E2B, recursive depth is unavailable and responses are limited to 1 MiB.
|
|
4137
|
+
*/
|
|
4138
|
+
export const listSandboxFiles = (options) => (options.client ?? client).get({
|
|
4139
|
+
security: [{
|
|
4140
|
+
key: 'BearerAuth',
|
|
4141
|
+
scheme: 'bearer',
|
|
4142
|
+
type: 'http'
|
|
4143
|
+
}, {
|
|
4144
|
+
key: 'ApiKeyAuth',
|
|
4145
|
+
name: 'X-API-Key',
|
|
4146
|
+
type: 'apiKey'
|
|
4147
|
+
}],
|
|
4148
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
|
|
4149
|
+
...options
|
|
4150
|
+
});
|
|
4151
|
+
/**
|
|
4152
|
+
* Create a directory in the sandbox
|
|
4153
|
+
*
|
|
4154
|
+
* Create a directory and missing parent directories before writing files. Returns true when created or false when the path already exists. Supply the path as a query parameter.
|
|
4155
|
+
*/
|
|
4156
|
+
export const makeSandboxDirectory = (options) => (options.client ?? client).post({
|
|
4157
|
+
security: [{
|
|
4158
|
+
key: 'BearerAuth',
|
|
3673
4159
|
scheme: 'bearer',
|
|
3674
4160
|
type: 'http'
|
|
3675
|
-
}
|
|
3676
|
-
|
|
3677
|
-
|
|
4161
|
+
}, {
|
|
4162
|
+
key: 'ApiKeyAuth',
|
|
4163
|
+
name: 'X-API-Key',
|
|
4164
|
+
type: 'apiKey'
|
|
4165
|
+
}],
|
|
4166
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
|
|
3678
4167
|
...options
|
|
3679
4168
|
});
|
|
3680
4169
|
/**
|
|
3681
|
-
*
|
|
4170
|
+
* Run a command in the sandbox
|
|
3682
4171
|
*
|
|
3683
|
-
*
|
|
4172
|
+
* Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–3600000 milliseconds, default 600000, that is 10 minutes; E2B defaults to 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout (timeoutMs 0); output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. On an android sandbox the command runs in the phone's root shell, its stderr is merged into stdout (read stdout and expect stderr to come back empty), and background mode is unavailable. Example body: {"cmd":"echo hi"}.
|
|
3684
4173
|
*/
|
|
3685
|
-
export const
|
|
4174
|
+
export const runSandboxCommand = (options) => (options.client ?? client).post({
|
|
3686
4175
|
security: [{
|
|
3687
4176
|
key: 'BearerAuth',
|
|
3688
4177
|
scheme: 'bearer',
|
|
@@ -3692,7 +4181,7 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
|
|
|
3692
4181
|
name: 'X-API-Key',
|
|
3693
4182
|
type: 'apiKey'
|
|
3694
4183
|
}],
|
|
3695
|
-
url: '/sandbox/v1/sandboxes/{
|
|
4184
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
|
|
3696
4185
|
...options,
|
|
3697
4186
|
headers: {
|
|
3698
4187
|
'Content-Type': 'application/json',
|
|
@@ -3700,11 +4189,11 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
|
|
|
3700
4189
|
}
|
|
3701
4190
|
});
|
|
3702
4191
|
/**
|
|
3703
|
-
*
|
|
4192
|
+
* Start adding a phone of your own
|
|
3704
4193
|
*
|
|
3705
|
-
*
|
|
4194
|
+
* Begin bringing your own device (BYOD): the platform answers an 8-character code, its ten-minute deadline and the QR payload your phone's app scans, and nothing is registered until the owner taps Allow on the phone. Show the QR payload (or the code) in your app; the phone opens GET /sandbox/v1/byod/pairings/{code} — with no credential — to show the organization and the deadline, then posts the claim once. The pairing stores the organization's display name, which the phone shows on its Allow screen, so create the pairing from a session or key that carries one. A code is spent by the first successful claim and cannot be reused; create a new pairing for another device. BYOD devices are separate from sandboxes: they never appear in listSandboxes and have no template, size or expiry. Example: POST /sandbox/v1/byod/pairings with no body returns {code:'K7M4PQRS',expires_at:'2026-11-22T13:10:00.000Z',qr:'praxis://byod/pair?code=K7M4PQRS&api=https%3A%2F%2Fapi.deepraxis.com'}.
|
|
3706
4195
|
*/
|
|
3707
|
-
export const
|
|
4196
|
+
export const createByodPairing = (options) => (options?.client ?? client).post({
|
|
3708
4197
|
security: [{
|
|
3709
4198
|
key: 'BearerAuth',
|
|
3710
4199
|
scheme: 'bearer',
|
|
@@ -3714,15 +4203,15 @@ export const removeSandboxFile = (options) => (options.client ?? client).delete(
|
|
|
3714
4203
|
name: 'X-API-Key',
|
|
3715
4204
|
type: 'apiKey'
|
|
3716
4205
|
}],
|
|
3717
|
-
url: '/sandbox/v1/
|
|
4206
|
+
url: '/sandbox/v1/byod/pairings',
|
|
3718
4207
|
...options
|
|
3719
4208
|
});
|
|
3720
4209
|
/**
|
|
3721
|
-
*
|
|
4210
|
+
* List your organization's own devices
|
|
3722
4211
|
*
|
|
3723
|
-
*
|
|
4212
|
+
* List the devices your organization has paired, oldest first, with each one's platform, name, model, OS version, live online fact and when it was last seen. Use it to find a device id before you act on it, rename it or disconnect it, or to show the BYOD page. A revoked device is not listed, so a device that disappears from this answer was disconnected; there is no paging because an organization's own devices are few. Each row carries capabilities and, for a desktop, the agent_dirs it registered. Example: GET /sandbox/v1/byod/devices returns {data:[{object:'byod_device',id:'byd_0123456789abcdefghijklmno',platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16',online:true,last_seen_at:'2026-11-22T12:58:00.000Z',created_at:'2026-11-22T12:40:00.000Z',capabilities:['display'],agent_dirs:[]}]}.
|
|
3724
4213
|
*/
|
|
3725
|
-
export const
|
|
4214
|
+
export const listByodDevices = (options) => (options?.client ?? client).get({
|
|
3726
4215
|
security: [{
|
|
3727
4216
|
key: 'BearerAuth',
|
|
3728
4217
|
scheme: 'bearer',
|
|
@@ -3732,15 +4221,15 @@ export const readSandboxFile = (options) => (options.client ?? client).get({
|
|
|
3732
4221
|
name: 'X-API-Key',
|
|
3733
4222
|
type: 'apiKey'
|
|
3734
4223
|
}],
|
|
3735
|
-
url: '/sandbox/v1/
|
|
4224
|
+
url: '/sandbox/v1/byod/devices',
|
|
3736
4225
|
...options
|
|
3737
4226
|
});
|
|
3738
4227
|
/**
|
|
3739
|
-
*
|
|
4228
|
+
* Read one of your organization's devices
|
|
3740
4229
|
*
|
|
3741
|
-
*
|
|
4230
|
+
* Read one BYOD device: the same fields listByodDevices returns, for a single device. Use it to poll whether a device is online before acting on it, or to refresh one row of the BYOD page after a rename. An unknown id and another organization's device both answer 404, so the answer never reveals that a foreign device exists. Example: GET /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno.
|
|
3742
4231
|
*/
|
|
3743
|
-
export const
|
|
4232
|
+
export const getByodDevice = (options) => (options.client ?? client).get({
|
|
3744
4233
|
security: [{
|
|
3745
4234
|
key: 'BearerAuth',
|
|
3746
4235
|
scheme: 'bearer',
|
|
@@ -3750,7 +4239,25 @@ export const writeSandboxFile = (options) => (options.client ?? client).put({
|
|
|
3750
4239
|
name: 'X-API-Key',
|
|
3751
4240
|
type: 'apiKey'
|
|
3752
4241
|
}],
|
|
3753
|
-
url: '/sandbox/v1/
|
|
4242
|
+
url: '/sandbox/v1/byod/devices/{deviceID}',
|
|
4243
|
+
...options
|
|
4244
|
+
});
|
|
4245
|
+
/**
|
|
4246
|
+
* Rename one of your organization's devices
|
|
4247
|
+
*
|
|
4248
|
+
* Change a device's display name, and nothing else: pairing, credential, platform and connection are untouched. Use it to give a shared phone a name your team recognises. The body takes exactly one field, name, 1 to 64 characters after trimming; a missing, extra or wrongly typed field answers INVALID_PARAMS. An unknown id and another organization's device both answer 404. Example: PATCH /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno with {name:'Shelf phone'} returns the updated device.
|
|
4249
|
+
*/
|
|
4250
|
+
export const updateByodDevice = (options) => (options.client ?? client).patch({
|
|
4251
|
+
security: [{
|
|
4252
|
+
key: 'BearerAuth',
|
|
4253
|
+
scheme: 'bearer',
|
|
4254
|
+
type: 'http'
|
|
4255
|
+
}, {
|
|
4256
|
+
key: 'ApiKeyAuth',
|
|
4257
|
+
name: 'X-API-Key',
|
|
4258
|
+
type: 'apiKey'
|
|
4259
|
+
}],
|
|
4260
|
+
url: '/sandbox/v1/byod/devices/{deviceID}',
|
|
3754
4261
|
...options,
|
|
3755
4262
|
headers: {
|
|
3756
4263
|
'Content-Type': 'application/json',
|
|
@@ -3758,11 +4265,11 @@ export const writeSandboxFile = (options) => (options.client ?? client).put({
|
|
|
3758
4265
|
}
|
|
3759
4266
|
});
|
|
3760
4267
|
/**
|
|
3761
|
-
*
|
|
4268
|
+
* Disconnect a device and revoke its credential
|
|
3762
4269
|
*
|
|
3763
|
-
*
|
|
4270
|
+
* Disconnect a paired device: the device's credential is revoked, its control connection is closed, and it stops appearing in listByodDevices. Use it when the phone is lost, lent or no longer wanted; the same disconnect is offered as one tap on the device itself. The operation is idempotent — disconnecting an already-disconnected device answers the same 200 — so a retry after a lost response is safe. The device is untouched: nothing is erased on the phone, and it can be paired again with a new pairing. Because a revoked device is not listed, a later listByodDevices no longer shows it. An unknown id and another organization's device both answer 404. Example: POST /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno/disconnect returns {id:'byd_0123456789abcdefghijklmno',object:'byod_device',disconnected:true}.
|
|
3764
4271
|
*/
|
|
3765
|
-
export const
|
|
4272
|
+
export const disconnectByodDevice = (options) => (options.client ?? client).post({
|
|
3766
4273
|
security: [{
|
|
3767
4274
|
key: 'BearerAuth',
|
|
3768
4275
|
scheme: 'bearer',
|
|
@@ -3772,15 +4279,15 @@ export const listSandboxFiles = (options) => (options.client ?? client).get({
|
|
|
3772
4279
|
name: 'X-API-Key',
|
|
3773
4280
|
type: 'apiKey'
|
|
3774
4281
|
}],
|
|
3775
|
-
url: '/sandbox/v1/
|
|
4282
|
+
url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
|
|
3776
4283
|
...options
|
|
3777
4284
|
});
|
|
3778
4285
|
/**
|
|
3779
|
-
*
|
|
4286
|
+
* Read a pairing for the phone's Allow screen
|
|
3780
4287
|
*
|
|
3781
|
-
*
|
|
4288
|
+
* The phone's own read, called by the app that scanned the QR code or the code was typed into: it answers the organization's display name and the code's deadline, which the owner sees before tapping Allow. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and do not call it from server code. An unknown, spent or expired code answers 404, with nothing said about which of the three it is; that also covers a code another organization created. The read is a preview only: it registers nothing, and the claim is what spends the code. Example: GET /sandbox/v1/byod/pairings/K7M4PQRS returns {organization_name:'烟火测试团队',expires_at:'2026-11-22T13:10:00.000Z'}.
|
|
3782
4289
|
*/
|
|
3783
|
-
export const
|
|
4290
|
+
export const getByodPairing = (options) => (options.client ?? client).get({
|
|
3784
4291
|
security: [{
|
|
3785
4292
|
key: 'BearerAuth',
|
|
3786
4293
|
scheme: 'bearer',
|
|
@@ -3790,15 +4297,15 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
|
|
|
3790
4297
|
name: 'X-API-Key',
|
|
3791
4298
|
type: 'apiKey'
|
|
3792
4299
|
}],
|
|
3793
|
-
url: '/sandbox/v1/
|
|
4300
|
+
url: '/sandbox/v1/byod/pairings/{code}',
|
|
3794
4301
|
...options
|
|
3795
4302
|
});
|
|
3796
4303
|
/**
|
|
3797
|
-
*
|
|
4304
|
+
* Claim a pairing and register the phone
|
|
3798
4305
|
*
|
|
3799
|
-
*
|
|
4306
|
+
* The phone's own final step after the owner taps Allow: it registers the device and answers the device id, a one-time credential and the control socket url the app dials. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and never call it from server code. The claim is single use: the first successful call spends the code and a second call answers 404, as does an unknown or expired code, so the app must store the credential the moment it arrives because it is never shown again. Connect to socket_url with Authorization: Bearer <credential>; the socket speaks the phone channel (hello, ping/pong, act, result/error) and the device's one connection is replaced if the app reconnects. Example: POST /sandbox/v1/byod/pairings/K7M4PQRS/claim with {platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16'} returns {device_id:'byd_0123456789abcdefghijklmno',credential:'…',socket_url:'wss://49982-byd0123456789abcdefghijklmno.sandbox-develop.praxisusercontent.com/'}.
|
|
3800
4307
|
*/
|
|
3801
|
-
export const
|
|
4308
|
+
export const claimByodPairing = (options) => (options.client ?? client).post({
|
|
3802
4309
|
security: [{
|
|
3803
4310
|
key: 'BearerAuth',
|
|
3804
4311
|
scheme: 'bearer',
|
|
@@ -3808,7 +4315,7 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
|
|
|
3808
4315
|
name: 'X-API-Key',
|
|
3809
4316
|
type: 'apiKey'
|
|
3810
4317
|
}],
|
|
3811
|
-
url: '/sandbox/v1/
|
|
4318
|
+
url: '/sandbox/v1/byod/pairings/{code}/claim',
|
|
3812
4319
|
...options,
|
|
3813
4320
|
headers: {
|
|
3814
4321
|
'Content-Type': 'application/json',
|
|
@@ -3836,7 +4343,7 @@ export const sessionsDelete = (options) => (options.client ?? client).delete({
|
|
|
3836
4343
|
/**
|
|
3837
4344
|
* Get session
|
|
3838
4345
|
*
|
|
3839
|
-
* 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
|
|
4346
|
+
* 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.
|
|
3840
4347
|
*/
|
|
3841
4348
|
export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
3842
4349
|
security: [{
|
|
@@ -3876,7 +4383,7 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
|
3876
4383
|
/**
|
|
3877
4384
|
* List agents
|
|
3878
4385
|
*
|
|
3879
|
-
* 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
|
|
4386
|
+
* 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.
|
|
3880
4387
|
*/
|
|
3881
4388
|
export const agentsList = (options) => (options?.client ?? client).get({
|
|
3882
4389
|
security: [{
|
|
@@ -3894,7 +4401,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
|
|
|
3894
4401
|
/**
|
|
3895
4402
|
* Create agent
|
|
3896
4403
|
*
|
|
3897
|
-
* 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
|
|
4404
|
+
* Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. Omit kind to create a service agent (Managed Agents behaviour: a fresh environment per session). Pass kind: "general" for an employee-style agent with its own computer, created with it; size and template come from the agent's computers configuration. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. A general or assume agent created without computer_id gets a new computer registered in the same request, named after the agent; a service agent with computer_id returns 400. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. phone gives the agent one phone, in one of two mutually exclusive forms: {sku, name?, archive: {exclude}} is a cloud Android device the platform builds on demand from that Sandbox SKU, and {byod, name?} is your organization's own device, named by a byd_… id it already owns (Brought Your Own Device), which the platform drives but never builds. A body naming both sku and byod returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. Only a general or assume agent may have a phone: a service agent with phone returns 400. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
|
|
3898
4405
|
*/
|
|
3899
4406
|
export const agentsCreate = (options) => (options.client ?? client).post({
|
|
3900
4407
|
security: [{
|
|
@@ -3934,7 +4441,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
|
|
|
3934
4441
|
/**
|
|
3935
4442
|
* Update agent
|
|
3936
4443
|
*
|
|
3937
|
-
* 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.
|
|
4444
|
+
* 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.
|
|
3938
4445
|
*/
|
|
3939
4446
|
export const agentsUpdate = (options) => (options.client ?? client).post({
|
|
3940
4447
|
security: [{
|
|
@@ -4010,7 +4517,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
4010
4517
|
/**
|
|
4011
4518
|
* Create session
|
|
4012
4519
|
*
|
|
4013
|
-
* 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 (
|
|
4520
|
+
* 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.
|
|
4014
4521
|
*/
|
|
4015
4522
|
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
4016
4523
|
security: [{
|
|
@@ -4050,7 +4557,7 @@ export const sessionsArchive = (options) => (options.client ?? client).post({
|
|
|
4050
4557
|
/**
|
|
4051
4558
|
* List session events
|
|
4052
4559
|
*
|
|
4053
|
-
* 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
|
|
4560
|
+
* 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.
|
|
4054
4561
|
*/
|
|
4055
4562
|
export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
4056
4563
|
security: [{
|
|
@@ -4068,7 +4575,7 @@ export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
|
4068
4575
|
/**
|
|
4069
4576
|
* Send session events
|
|
4070
4577
|
*
|
|
4071
|
-
* 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
|
|
4578
|
+
* 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.
|
|
4072
4579
|
*/
|
|
4073
4580
|
export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
4074
4581
|
security: [{
|
|
@@ -4090,7 +4597,7 @@ export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
|
4090
4597
|
/**
|
|
4091
4598
|
* Stream session events
|
|
4092
4599
|
*
|
|
4093
|
-
* 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
|
|
4600
|
+
* 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.
|
|
4094
4601
|
*/
|
|
4095
4602
|
export const sessionsEventsStream = (options) => (options.client ?? client).sse.get({
|
|
4096
4603
|
security: [{
|
|
@@ -4390,7 +4897,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
|
|
|
4390
4897
|
/**
|
|
4391
4898
|
* Create deployment
|
|
4392
4899
|
*
|
|
4393
|
-
* 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
|
|
4900
|
+
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400. Example, a weekly cron deployment on the agent's computer: {"agent":"agent_123","name":"weekly report","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Write the weekly report."}]}],"target":{"type":"computer"},"schedule":{"type":"cron","expression":"0 9 * * 1","timezone":"America/Los_Angeles"}}.
|
|
4394
4901
|
*/
|
|
4395
4902
|
export const deploymentsCreate = (options) => (options.client ?? client).post({
|
|
4396
4903
|
security: [{
|
|
@@ -4870,7 +5377,7 @@ export const applicationListVersions = (options) => (options.client ?? client).g
|
|
|
4870
5377
|
/**
|
|
4871
5378
|
* Create version
|
|
4872
5379
|
*
|
|
4873
|
-
* 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.
|
|
5380
|
+
* 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.
|
|
4874
5381
|
*/
|
|
4875
5382
|
export const applicationCreateVersion = (options) => (options.client ?? client).post({
|
|
4876
5383
|
security: [{
|
|
@@ -5036,7 +5543,7 @@ export const applicationListGrants = (options) => (options.client ?? client).get
|
|
|
5036
5543
|
/**
|
|
5037
5544
|
* Create grant
|
|
5038
5545
|
*
|
|
5039
|
-
* Record access to an organization-owned database
|
|
5546
|
+
* Record access to an organization-owned database, knowledge base, file, media library, workflow, script, agent or another Worker, to models (id *, read only), or to a whole service (search, browser, ticket, crm, canvas, cut, studio, ontology, workspace: id *, read_write; feedback: read). The types are the ones a service agent can bind. The retired files type is refused; grant one file by its file-… id. Once a Worker has any grant, its platform calls reach only what its grants name; an agent grant at read_write is what lets it issue that agent's customer grant codes. Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
|
|
5040
5547
|
*/
|
|
5041
5548
|
export const applicationCreateGrant = (options) => (options.client ?? client).post({
|
|
5042
5549
|
security: [{
|
|
@@ -5624,7 +6131,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
|
|
|
5624
6131
|
/**
|
|
5625
6132
|
* Create a workflow
|
|
5626
6133
|
*
|
|
5627
|
-
* Workflow syntax reference: https://deepraxis.com/
|
|
6134
|
+
* Workflow syntax reference: https://docs.deepraxis.com/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 5 min (run-sandbox 6 h), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. To pause for a person, call praxis/approval (it opens a human task; the step output is the decision); agents answer with praxis.automation.humanTasks.respond on behalf of their user. Guide: /developers/automation/guides/approvals Guide: /developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
|
|
5628
6135
|
*/
|
|
5629
6136
|
export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
|
|
5630
6137
|
security: [{
|
|
@@ -5664,7 +6171,7 @@ export const automationWorkflowsGet = (options) => (options.client ?? client).ge
|
|
|
5664
6171
|
/**
|
|
5665
6172
|
* Update a workflow draft
|
|
5666
6173
|
*
|
|
5667
|
-
* Update description, labels or draft with the current draft revision in If-Match, taken from draft.revision in the get-workflow response. Even metadata-only updates create a new draft revision. A mismatch returns 412 PRECONDITION_FAILED; read the draft again, merge and retry. The draft is not validated here, so check it with validate (kind=workflow) before publishing. Error details are in errors[]. See the workflow syntax reference at https://deepraxis.com/
|
|
6174
|
+
* Update description, labels or draft with the current draft revision in If-Match, taken from draft.revision in the get-workflow response. Even metadata-only updates create a new draft revision. A mismatch returns 412 PRECONDITION_FAILED; read the draft again, merge and retry. The draft is not validated here, so check it with validate (kind=workflow) before publishing. Error details are in errors[]. See the workflow syntax reference at https://docs.deepraxis.com/developers/automation/reference/workflow-syntax.
|
|
5668
6175
|
*/
|
|
5669
6176
|
export const automationWorkflowsPatch = (options) => (options.client ?? client).patch({
|
|
5670
6177
|
security: [{
|
|
@@ -5868,7 +6375,7 @@ export const automationWorkflowsSetDistTag = (options) => (options.client ?? cli
|
|
|
5868
6375
|
/**
|
|
5869
6376
|
* Validate a definition
|
|
5870
6377
|
*
|
|
5871
|
-
* Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation. For kind=workflow the YAML needs document (dsl, namespace, name, version) and do; each problem is one entry in errors[] (pointer, detail, hint), so read the first one. A listen outside the supported subset (to.all, inside a fork) and emit are not reported here and fail with DEFINITION_INVALID only when a run is created. Workflow syntax reference: https://deepraxis.com/
|
|
6378
|
+
* Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation. For kind=workflow the YAML needs document (dsl, namespace, name, version) and do; each problem is one entry in errors[] (pointer, detail, hint), so read the first one. A listen outside the supported subset (to.all, inside a fork) and emit are not reported here and fail with DEFINITION_INVALID only when a run is created. Workflow syntax reference: https://docs.deepraxis.com/developers/automation/reference/workflow-syntax.
|
|
5872
6379
|
*/
|
|
5873
6380
|
export const automationValidateValidate = (options) => (options.client ?? client).post({
|
|
5874
6381
|
security: [{
|
|
@@ -6775,53 +7282,231 @@ export const canvasListNodes = (options) => (options.client ?? client).get({
|
|
|
6775
7282
|
...options
|
|
6776
7283
|
});
|
|
6777
7284
|
/**
|
|
6778
|
-
* Render canvas nodes
|
|
7285
|
+
* Render canvas nodes
|
|
7286
|
+
*
|
|
7287
|
+
* Render 1–4 nodes to inspect the visual result of a design edit. Use ids from retrieve, execute.created or execute.screenshots; scale defaults to 1 and accepts 0.25–4, and png is the only supported format. Unlike Figma, images contains inline data:image/png;base64,... URLs, not hosted image URLs; a null entry means no image is available for that id. Use nodes.list for editable node content instead of pixels.
|
|
7288
|
+
*/
|
|
7289
|
+
export const canvasListImages = (options) => (options.client ?? client).get({
|
|
7290
|
+
security: [{
|
|
7291
|
+
key: 'canvas-bearerAuth',
|
|
7292
|
+
scheme: 'bearer',
|
|
7293
|
+
type: 'http'
|
|
7294
|
+
}],
|
|
7295
|
+
url: '/canvas/v1/canvases/{canvas_id}/images',
|
|
7296
|
+
...options
|
|
7297
|
+
});
|
|
7298
|
+
/**
|
|
7299
|
+
* Execute canvas script
|
|
7300
|
+
*
|
|
7301
|
+
* Draw or edit a canvas atomically with a synchronous Pencil execute script. First create a canvas with praxis.canvas.canvases.create and use its id as canvas_id; inspect an existing canvas with retrieve before modifying it. Send exactly one of script (new source) or edit_id (a failed script to patch using edits). Unlike Figma REST, :execute writes design content; nodes use Pencil .pen schema 2.21 (frame/group/rectangle/ellipse/polygon/path/text/icon/ref/note), not Figma node fields.
|
|
7302
|
+
*
|
|
7303
|
+
* The root variable is document. Synchronous functions are Insert / Copy / Update / Replace / Move / Delete / SetVariables / Get / GetVariables / FindEmptySpace / Print / TakeScreenshot; globals persist for the next call. A first frame needs only this body.script:
|
|
7304
|
+
*
|
|
7305
|
+
* ```js
|
|
7306
|
+
* const f = Insert(document, { type: "frame", name: "Hero", width: 1200, layout: "vertical", padding: 48, fill: "#FFFFFF" }); Insert(f, { type: "text", content: "Hello", fontSize: 32, fill: "#111111" }); Print(f)
|
|
7307
|
+
* ```
|
|
7308
|
+
*
|
|
7309
|
+
* Insert/Copy return the new node id; read the copy with Get(id) — copied descendants get new ids, so change them through Copy's third argument `descendants` keyed by the source node ids. To copy a page and change its title in the same script:
|
|
7310
|
+
*
|
|
7311
|
+
* ```js canvas-example="copy-page"
|
|
7312
|
+
* const page = Insert(document, {type:"frame",name:"Original",width:320,height:160,layout:"vertical",padding:16});
|
|
7313
|
+
* const title = Insert(page, {type:"text",name:"Title",content:"Original",fontSize:24});
|
|
7314
|
+
* const copy = Copy(page, document, {name:"Copy",x:360,descendants:{[title]:{content:"Updated"}}});
|
|
7315
|
+
* Print(copy); Print(Get(copy).children[0].content);
|
|
7316
|
+
* ```
|
|
7317
|
+
*
|
|
7318
|
+
* Use viewer_url to watch the result in Console. TakeScreenshot records node ids in screenshots; call images.list with those ids to fetch PNG data URLs. See the [Canvas execute reference](https://deepraxis.com/en/docs/api/native/canvas/execute) for request fields and results, and the [Canvas node reference](https://deepraxis.com/en/docs/developers/canvas/nodes) for node content.
|
|
7319
|
+
*
|
|
7320
|
+
* A successful write increments version by one. Optionally set expected_version to the version from retrieve or nodes.list; on 409 REVISION_CONFLICT read again, merge your intent and retry with the current version. Every script failure rolls back all writes. On 400 SCRIPT_ERROR, SCRIPT_LIMIT or OPS_REJECTED, use error.details.edit_id plus edits to repair and rerun the stored source without resending the entire script; details may include line, column and rejection. On 400 EDIT_EXPIRED the saved script is older than ten minutes: submit a corrected new script. On 429 CANVAS_BUSY, more than four calls are queued for this canvas: wait for pending calls before retrying.
|
|
7321
|
+
*
|
|
7322
|
+
* Execution errors include error.details.prints containing output printed before failure, with the same string-array shape and output limit as successful prints; rolled-back writes still create no version.
|
|
7323
|
+
*
|
|
7324
|
+
*/
|
|
7325
|
+
export const canvasExecute = (options) => (options.client ?? client).post({
|
|
7326
|
+
security: [{
|
|
7327
|
+
key: 'canvas-bearerAuth',
|
|
7328
|
+
scheme: 'bearer',
|
|
7329
|
+
type: 'http'
|
|
7330
|
+
}],
|
|
7331
|
+
url: '/canvas/v1/canvases/{canvas_id}:execute',
|
|
7332
|
+
...options,
|
|
7333
|
+
headers: {
|
|
7334
|
+
'Content-Type': 'application/json',
|
|
7335
|
+
...options.headers
|
|
7336
|
+
}
|
|
7337
|
+
});
|
|
7338
|
+
/**
|
|
7339
|
+
* List collections
|
|
7340
|
+
*
|
|
7341
|
+
* Find collections and ids for filtering or moving canvases. All organization collections are returned in name order in one response; next_cursor is always null. canvas_count excludes deleted canvases. total_count counts all live canvases, rather than collections, and uncategorized_count counts live canvases without a collection. Use canvases.list with collection_id to read a collection or none to read uncategorized canvases.
|
|
7342
|
+
*/
|
|
7343
|
+
export const canvasListCollections = (options) => (options?.client ?? client).get({
|
|
7344
|
+
security: [{
|
|
7345
|
+
key: 'BearerAuth',
|
|
7346
|
+
scheme: 'bearer',
|
|
7347
|
+
type: 'http'
|
|
7348
|
+
}, {
|
|
7349
|
+
key: 'ApiKeyAuth',
|
|
7350
|
+
name: 'X-API-Key',
|
|
7351
|
+
type: 'apiKey'
|
|
7352
|
+
}],
|
|
7353
|
+
url: '/canvas/v1/collections',
|
|
7354
|
+
...options
|
|
7355
|
+
});
|
|
7356
|
+
/**
|
|
7357
|
+
* Create collection
|
|
7358
|
+
*
|
|
7359
|
+
* Organize canvases by creating a one-level collection in your organization. Send a name of 1–100 characters after trimming; duplicate names are allowed. Each call creates a new collection, initially containing no canvases. Use canvases.update with its id as collection_id to move existing canvases into it. Collections cannot be nested and an organization can have at most 200.
|
|
7360
|
+
*/
|
|
7361
|
+
export const canvasCreateCollection = (options) => (options.client ?? client).post({
|
|
7362
|
+
security: [{
|
|
7363
|
+
key: 'BearerAuth',
|
|
7364
|
+
scheme: 'bearer',
|
|
7365
|
+
type: 'http'
|
|
7366
|
+
}, {
|
|
7367
|
+
key: 'ApiKeyAuth',
|
|
7368
|
+
name: 'X-API-Key',
|
|
7369
|
+
type: 'apiKey'
|
|
7370
|
+
}],
|
|
7371
|
+
url: '/canvas/v1/collections',
|
|
7372
|
+
...options,
|
|
7373
|
+
headers: {
|
|
7374
|
+
'Content-Type': 'application/json',
|
|
7375
|
+
...options.headers
|
|
7376
|
+
}
|
|
7377
|
+
});
|
|
7378
|
+
/**
|
|
7379
|
+
* Delete collection
|
|
7380
|
+
*
|
|
7381
|
+
* Remove a collection using an id from collections.list. All its canvases are preserved and become uncategorized, with collection_id set to null; read them using canvases.list with collection_id=none. The removed collection cannot be retrieved again, and repeating deletion returns COLLECTION_NOT_FOUND.
|
|
7382
|
+
*/
|
|
7383
|
+
export const canvasDeleteCollection = (options) => (options.client ?? client).delete({
|
|
7384
|
+
security: [{
|
|
7385
|
+
key: 'BearerAuth',
|
|
7386
|
+
scheme: 'bearer',
|
|
7387
|
+
type: 'http'
|
|
7388
|
+
}, {
|
|
7389
|
+
key: 'ApiKeyAuth',
|
|
7390
|
+
name: 'X-API-Key',
|
|
7391
|
+
type: 'apiKey'
|
|
7392
|
+
}],
|
|
7393
|
+
url: '/canvas/v1/collections/{collection_id}',
|
|
7394
|
+
...options
|
|
7395
|
+
});
|
|
7396
|
+
/**
|
|
7397
|
+
* Retrieve collection
|
|
7398
|
+
*
|
|
7399
|
+
* Inspect one collection and its current live canvas count using an id from collections.list or collections.create. The collection must belong to the API key organization. To read its canvases, pass the same id as collection_id to canvases.list; this response contains collection metadata only.
|
|
7400
|
+
*/
|
|
7401
|
+
export const canvasRetrieveCollection = (options) => (options.client ?? client).get({
|
|
7402
|
+
security: [{
|
|
7403
|
+
key: 'BearerAuth',
|
|
7404
|
+
scheme: 'bearer',
|
|
7405
|
+
type: 'http'
|
|
7406
|
+
}, {
|
|
7407
|
+
key: 'ApiKeyAuth',
|
|
7408
|
+
name: 'X-API-Key',
|
|
7409
|
+
type: 'apiKey'
|
|
7410
|
+
}],
|
|
7411
|
+
url: '/canvas/v1/collections/{collection_id}',
|
|
7412
|
+
...options
|
|
7413
|
+
});
|
|
7414
|
+
/**
|
|
7415
|
+
* Rename collection
|
|
7416
|
+
*
|
|
7417
|
+
* Change the display name of a collection from collections.list without changing its id or canvas assignments. Names contain 1–100 characters after trimming and may match another collection name. This operation does not move canvases; use canvases.update with collection_id for that.
|
|
7418
|
+
*/
|
|
7419
|
+
export const canvasUpdateCollection = (options) => (options.client ?? client).patch({
|
|
7420
|
+
security: [{
|
|
7421
|
+
key: 'BearerAuth',
|
|
7422
|
+
scheme: 'bearer',
|
|
7423
|
+
type: 'http'
|
|
7424
|
+
}, {
|
|
7425
|
+
key: 'ApiKeyAuth',
|
|
7426
|
+
name: 'X-API-Key',
|
|
7427
|
+
type: 'apiKey'
|
|
7428
|
+
}],
|
|
7429
|
+
url: '/canvas/v1/collections/{collection_id}',
|
|
7430
|
+
...options,
|
|
7431
|
+
headers: {
|
|
7432
|
+
'Content-Type': 'application/json',
|
|
7433
|
+
...options.headers
|
|
7434
|
+
}
|
|
7435
|
+
});
|
|
7436
|
+
/**
|
|
7437
|
+
* List canvas versions
|
|
7438
|
+
*
|
|
7439
|
+
* Inspect retained edits before restoring a canvas or reading historical nodes and images. Supply a canvas_id from canvases.list or create. Results include successful execute, import and restore commits since history was enabled, newest first. limit is 1–100 and defaults to 30; pass next_cursor as cursor until it is null. All versions from the last 30 days are retained unless the 256 MiB history budget requires pruning; the newest 100 versions are always retained regardless of age or size. earliest_restorable_version is the oldest readable and restorable version, including the state immediately before the first retained commit; null means no history has been recorded. Listing does not change the canvas.
|
|
7440
|
+
*/
|
|
7441
|
+
export const canvasListVersions = (options) => (options.client ?? client).get({
|
|
7442
|
+
security: [{
|
|
7443
|
+
key: 'BearerAuth',
|
|
7444
|
+
scheme: 'bearer',
|
|
7445
|
+
type: 'http'
|
|
7446
|
+
}, {
|
|
7447
|
+
key: 'ApiKeyAuth',
|
|
7448
|
+
name: 'X-API-Key',
|
|
7449
|
+
type: 'apiKey'
|
|
7450
|
+
}],
|
|
7451
|
+
url: '/canvas/v1/canvases/{canvas_id}/versions',
|
|
7452
|
+
...options
|
|
7453
|
+
});
|
|
7454
|
+
/**
|
|
7455
|
+
* Restore canvas version
|
|
7456
|
+
*
|
|
7457
|
+
* Recover a canvas after an unwanted edit by restoring a retained version from versions.list or its earliest_restorable_version. This replaces current nodes, variables and themes with the target state and creates one new version; history remains available, so restoring can itself be undone with another restore. Restoring the current version succeeds without creating a version. Optionally guard the write with expected_version from retrieve or nodes.list; if it is stale, inspect current state and retry with the new value. Repeating an unguarded request after another edit can create another restore version. Versions from before history was enabled or outside retention cannot be recovered. Connected viewers resync after a successful restore.
|
|
7458
|
+
*/
|
|
7459
|
+
export const canvasRestoreCanvas = (options) => (options.client ?? client).post({
|
|
7460
|
+
security: [{
|
|
7461
|
+
key: 'BearerAuth',
|
|
7462
|
+
scheme: 'bearer',
|
|
7463
|
+
type: 'http'
|
|
7464
|
+
}, {
|
|
7465
|
+
key: 'ApiKeyAuth',
|
|
7466
|
+
name: 'X-API-Key',
|
|
7467
|
+
type: 'apiKey'
|
|
7468
|
+
}],
|
|
7469
|
+
url: '/canvas/v1/canvases/{canvas_id}:restore',
|
|
7470
|
+
...options,
|
|
7471
|
+
headers: {
|
|
7472
|
+
'Content-Type': 'application/json',
|
|
7473
|
+
...options.headers
|
|
7474
|
+
}
|
|
7475
|
+
});
|
|
7476
|
+
/**
|
|
7477
|
+
* List contents
|
|
6779
7478
|
*
|
|
6780
|
-
*
|
|
7479
|
+
* 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.
|
|
6781
7480
|
*/
|
|
6782
|
-
export const
|
|
7481
|
+
export const contentListContents = (options) => (options?.client ?? client).get({
|
|
6783
7482
|
security: [{
|
|
6784
|
-
key: '
|
|
7483
|
+
key: 'BearerAuth',
|
|
6785
7484
|
scheme: 'bearer',
|
|
6786
7485
|
type: 'http'
|
|
7486
|
+
}, {
|
|
7487
|
+
key: 'ApiKeyAuth',
|
|
7488
|
+
name: 'X-API-Key',
|
|
7489
|
+
type: 'apiKey'
|
|
6787
7490
|
}],
|
|
6788
|
-
url: '/
|
|
7491
|
+
url: '/content/v1/contents',
|
|
6789
7492
|
...options
|
|
6790
7493
|
});
|
|
6791
7494
|
/**
|
|
6792
|
-
*
|
|
6793
|
-
*
|
|
6794
|
-
* Draw or edit a canvas atomically with a synchronous Pencil execute script. First create a canvas with praxis.canvas.canvases.create and use its id as canvas_id; inspect an existing canvas with retrieve before modifying it. Send exactly one of script (new source) or edit_id (a failed script to patch using edits). Unlike Figma REST, :execute writes design content; nodes use Pencil .pen schema 2.21 (frame/group/rectangle/ellipse/polygon/path/text/icon/ref/note), not Figma node fields.
|
|
6795
|
-
*
|
|
6796
|
-
* The root variable is document. Synchronous functions are Insert / Copy / Update / Replace / Move / Delete / SetVariables / Get / GetVariables / FindEmptySpace / Print / TakeScreenshot; globals persist for the next call. A first frame needs only this body.script:
|
|
6797
|
-
*
|
|
6798
|
-
* ```js
|
|
6799
|
-
* const f = Insert(document, { type: "frame", name: "Hero", width: 1200, layout: "vertical", padding: 48, fill: "#FFFFFF" }); Insert(f, { type: "text", content: "Hello", fontSize: 32, fill: "#111111" }); Print(f)
|
|
6800
|
-
* ```
|
|
6801
|
-
*
|
|
6802
|
-
* Insert/Copy return the new node id; read the copy with Get(id) — copied descendants get new ids, so change them through Copy's third argument `descendants` keyed by the source node ids. To copy a page and change its title in the same script:
|
|
6803
|
-
*
|
|
6804
|
-
* ```js canvas-example="copy-page"
|
|
6805
|
-
* const page = Insert(document, {type:"frame",name:"Original",width:320,height:160,layout:"vertical",padding:16});
|
|
6806
|
-
* const title = Insert(page, {type:"text",name:"Title",content:"Original",fontSize:24});
|
|
6807
|
-
* const copy = Copy(page, document, {name:"Copy",x:360,descendants:{[title]:{content:"Updated"}}});
|
|
6808
|
-
* Print(copy); Print(Get(copy).children[0].content);
|
|
6809
|
-
* ```
|
|
6810
|
-
*
|
|
6811
|
-
* Use viewer_url to watch the result in Console. TakeScreenshot records node ids in screenshots; call images.list with those ids to fetch PNG data URLs. See the [Canvas execute reference](https://deepraxis.com/en/docs/api/native/canvas/execute) for request fields and results, and the [Canvas node reference](https://deepraxis.com/en/docs/developers/canvas/nodes) for node content.
|
|
6812
|
-
*
|
|
6813
|
-
* A successful write increments version by one. Optionally set expected_version to the version from retrieve or nodes.list; on 409 REVISION_CONFLICT read again, merge your intent and retry with the current version. Every script failure rolls back all writes. On 400 SCRIPT_ERROR, SCRIPT_LIMIT or OPS_REJECTED, use error.details.edit_id plus edits to repair and rerun the stored source without resending the entire script; details may include line, column and rejection. On 400 EDIT_EXPIRED the saved script is older than ten minutes: submit a corrected new script. On 429 CANVAS_BUSY, more than four calls are queued for this canvas: wait for pending calls before retrying.
|
|
6814
|
-
*
|
|
6815
|
-
* Execution errors include error.details.prints containing output printed before failure, with the same string-array shape and output limit as successful prints; rolled-back writes still create no version.
|
|
7495
|
+
* Create a content
|
|
6816
7496
|
*
|
|
7497
|
+
* 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.
|
|
6817
7498
|
*/
|
|
6818
|
-
export const
|
|
7499
|
+
export const contentCreateContent = (options) => (options.client ?? client).post({
|
|
6819
7500
|
security: [{
|
|
6820
|
-
key: '
|
|
7501
|
+
key: 'BearerAuth',
|
|
6821
7502
|
scheme: 'bearer',
|
|
6822
7503
|
type: 'http'
|
|
7504
|
+
}, {
|
|
7505
|
+
key: 'ApiKeyAuth',
|
|
7506
|
+
name: 'X-API-Key',
|
|
7507
|
+
type: 'apiKey'
|
|
6823
7508
|
}],
|
|
6824
|
-
url: '/
|
|
7509
|
+
url: '/content/v1/contents',
|
|
6825
7510
|
...options,
|
|
6826
7511
|
headers: {
|
|
6827
7512
|
'Content-Type': 'application/json',
|
|
@@ -6829,11 +7514,11 @@ export const canvasExecute = (options) => (options.client ?? client).post({
|
|
|
6829
7514
|
}
|
|
6830
7515
|
});
|
|
6831
7516
|
/**
|
|
6832
|
-
*
|
|
7517
|
+
* Get a content
|
|
6833
7518
|
*
|
|
6834
|
-
*
|
|
7519
|
+
* 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.
|
|
6835
7520
|
*/
|
|
6836
|
-
export const
|
|
7521
|
+
export const contentGetContent = (options) => (options.client ?? client).get({
|
|
6837
7522
|
security: [{
|
|
6838
7523
|
key: 'BearerAuth',
|
|
6839
7524
|
scheme: 'bearer',
|
|
@@ -6843,15 +7528,15 @@ export const canvasListCollections = (options) => (options?.client ?? client).ge
|
|
|
6843
7528
|
name: 'X-API-Key',
|
|
6844
7529
|
type: 'apiKey'
|
|
6845
7530
|
}],
|
|
6846
|
-
url: '/
|
|
7531
|
+
url: '/content/v1/contents/{content_id}',
|
|
6847
7532
|
...options
|
|
6848
7533
|
});
|
|
6849
7534
|
/**
|
|
6850
|
-
*
|
|
7535
|
+
* Update a content
|
|
6851
7536
|
*
|
|
6852
|
-
*
|
|
7537
|
+
* 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.
|
|
6853
7538
|
*/
|
|
6854
|
-
export const
|
|
7539
|
+
export const contentUpdateContent = (options) => (options.client ?? client).patch({
|
|
6855
7540
|
security: [{
|
|
6856
7541
|
key: 'BearerAuth',
|
|
6857
7542
|
scheme: 'bearer',
|
|
@@ -6861,7 +7546,7 @@ export const canvasCreateCollection = (options) => (options.client ?? client).po
|
|
|
6861
7546
|
name: 'X-API-Key',
|
|
6862
7547
|
type: 'apiKey'
|
|
6863
7548
|
}],
|
|
6864
|
-
url: '/
|
|
7549
|
+
url: '/content/v1/contents/{content_id}',
|
|
6865
7550
|
...options,
|
|
6866
7551
|
headers: {
|
|
6867
7552
|
'Content-Type': 'application/json',
|
|
@@ -6869,11 +7554,11 @@ export const canvasCreateCollection = (options) => (options.client ?? client).po
|
|
|
6869
7554
|
}
|
|
6870
7555
|
});
|
|
6871
7556
|
/**
|
|
6872
|
-
*
|
|
7557
|
+
* Publish a content
|
|
6873
7558
|
*
|
|
6874
|
-
*
|
|
7559
|
+
* 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.
|
|
6875
7560
|
*/
|
|
6876
|
-
export const
|
|
7561
|
+
export const contentPublishContent = (options) => (options.client ?? client).post({
|
|
6877
7562
|
security: [{
|
|
6878
7563
|
key: 'BearerAuth',
|
|
6879
7564
|
scheme: 'bearer',
|
|
@@ -6883,15 +7568,19 @@ export const canvasDeleteCollection = (options) => (options.client ?? client).de
|
|
|
6883
7568
|
name: 'X-API-Key',
|
|
6884
7569
|
type: 'apiKey'
|
|
6885
7570
|
}],
|
|
6886
|
-
url: '/
|
|
6887
|
-
...options
|
|
7571
|
+
url: '/content/v1/contents/{content_id}/publish',
|
|
7572
|
+
...options,
|
|
7573
|
+
headers: {
|
|
7574
|
+
'Content-Type': 'application/json',
|
|
7575
|
+
...options.headers
|
|
7576
|
+
}
|
|
6888
7577
|
});
|
|
6889
7578
|
/**
|
|
6890
|
-
*
|
|
7579
|
+
* Unpublish a content
|
|
6891
7580
|
*
|
|
6892
|
-
*
|
|
7581
|
+
* 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.
|
|
6893
7582
|
*/
|
|
6894
|
-
export const
|
|
7583
|
+
export const contentUnpublishContent = (options) => (options.client ?? client).post({
|
|
6895
7584
|
security: [{
|
|
6896
7585
|
key: 'BearerAuth',
|
|
6897
7586
|
scheme: 'bearer',
|
|
@@ -6901,15 +7590,15 @@ export const canvasRetrieveCollection = (options) => (options.client ?? client).
|
|
|
6901
7590
|
name: 'X-API-Key',
|
|
6902
7591
|
type: 'apiKey'
|
|
6903
7592
|
}],
|
|
6904
|
-
url: '/
|
|
7593
|
+
url: '/content/v1/contents/{content_id}/unpublish',
|
|
6905
7594
|
...options
|
|
6906
7595
|
});
|
|
6907
7596
|
/**
|
|
6908
|
-
*
|
|
7597
|
+
* Archive a content
|
|
6909
7598
|
*
|
|
6910
|
-
*
|
|
7599
|
+
* 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.
|
|
6911
7600
|
*/
|
|
6912
|
-
export const
|
|
7601
|
+
export const contentArchiveContent = (options) => (options.client ?? client).post({
|
|
6913
7602
|
security: [{
|
|
6914
7603
|
key: 'BearerAuth',
|
|
6915
7604
|
scheme: 'bearer',
|
|
@@ -6919,19 +7608,15 @@ export const canvasUpdateCollection = (options) => (options.client ?? client).pa
|
|
|
6919
7608
|
name: 'X-API-Key',
|
|
6920
7609
|
type: 'apiKey'
|
|
6921
7610
|
}],
|
|
6922
|
-
url: '/
|
|
6923
|
-
...options
|
|
6924
|
-
headers: {
|
|
6925
|
-
'Content-Type': 'application/json',
|
|
6926
|
-
...options.headers
|
|
6927
|
-
}
|
|
7611
|
+
url: '/content/v1/contents/{content_id}/archive',
|
|
7612
|
+
...options
|
|
6928
7613
|
});
|
|
6929
7614
|
/**
|
|
6930
|
-
* List
|
|
7615
|
+
* List versions
|
|
6931
7616
|
*
|
|
6932
|
-
*
|
|
7617
|
+
* 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.
|
|
6933
7618
|
*/
|
|
6934
|
-
export const
|
|
7619
|
+
export const contentListVersions = (options) => (options.client ?? client).get({
|
|
6935
7620
|
security: [{
|
|
6936
7621
|
key: 'BearerAuth',
|
|
6937
7622
|
scheme: 'bearer',
|
|
@@ -6941,15 +7626,15 @@ export const canvasListVersions = (options) => (options.client ?? client).get({
|
|
|
6941
7626
|
name: 'X-API-Key',
|
|
6942
7627
|
type: 'apiKey'
|
|
6943
7628
|
}],
|
|
6944
|
-
url: '/
|
|
7629
|
+
url: '/content/v1/contents/{content_id}/versions',
|
|
6945
7630
|
...options
|
|
6946
7631
|
});
|
|
6947
7632
|
/**
|
|
6948
|
-
*
|
|
7633
|
+
* Get a version
|
|
6949
7634
|
*
|
|
6950
|
-
*
|
|
7635
|
+
* 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.
|
|
6951
7636
|
*/
|
|
6952
|
-
export const
|
|
7637
|
+
export const contentGetVersion = (options) => (options.client ?? client).get({
|
|
6953
7638
|
security: [{
|
|
6954
7639
|
key: 'BearerAuth',
|
|
6955
7640
|
scheme: 'bearer',
|
|
@@ -6959,7 +7644,16 @@ export const canvasRestoreCanvas = (options) => (options.client ?? client).post(
|
|
|
6959
7644
|
name: 'X-API-Key',
|
|
6960
7645
|
type: 'apiKey'
|
|
6961
7646
|
}],
|
|
6962
|
-
url: '/
|
|
7647
|
+
url: '/content/v1/contents/{content_id}/versions/{version}',
|
|
7648
|
+
...options
|
|
7649
|
+
});
|
|
7650
|
+
/**
|
|
7651
|
+
* Open a playback session
|
|
7652
|
+
*
|
|
7653
|
+
* 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.
|
|
7654
|
+
*/
|
|
7655
|
+
export const contentCreatePlaybackSession = (options) => (options.client ?? client).post({
|
|
7656
|
+
url: '/content/v1/playback/sessions',
|
|
6963
7657
|
...options,
|
|
6964
7658
|
headers: {
|
|
6965
7659
|
'Content-Type': 'application/json',
|
|
@@ -7549,13 +8243,248 @@ export const crmLayoutsUpdate = (options) => (options.client ?? client).put({
|
|
|
7549
8243
|
scheme: 'bearer',
|
|
7550
8244
|
type: 'http'
|
|
7551
8245
|
}],
|
|
7552
|
-
url: '/crm/v1/layouts/{objectType}',
|
|
8246
|
+
url: '/crm/v1/layouts/{objectType}',
|
|
8247
|
+
...options,
|
|
8248
|
+
headers: {
|
|
8249
|
+
'Content-Type': 'application/json',
|
|
8250
|
+
...options.headers
|
|
8251
|
+
}
|
|
8252
|
+
});
|
|
8253
|
+
/**
|
|
8254
|
+
* Create a grant code
|
|
8255
|
+
*
|
|
8256
|
+
* 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.
|
|
8257
|
+
*/
|
|
8258
|
+
export const customerCreateGrantCode = (options) => (options.client ?? client).post({
|
|
8259
|
+
security: [{
|
|
8260
|
+
key: 'BearerAuth',
|
|
8261
|
+
scheme: 'bearer',
|
|
8262
|
+
type: 'http'
|
|
8263
|
+
}, {
|
|
8264
|
+
key: 'ApiKeyAuth',
|
|
8265
|
+
name: 'X-API-Key',
|
|
8266
|
+
type: 'apiKey'
|
|
8267
|
+
}],
|
|
8268
|
+
url: '/customer/v1/grant_codes',
|
|
8269
|
+
...options,
|
|
8270
|
+
headers: {
|
|
8271
|
+
'Content-Type': 'application/json',
|
|
8272
|
+
...options.headers
|
|
8273
|
+
}
|
|
8274
|
+
});
|
|
8275
|
+
/**
|
|
8276
|
+
* Exchange a grant code or publishable key
|
|
8277
|
+
*
|
|
8278
|
+
* 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.
|
|
8279
|
+
*/
|
|
8280
|
+
export const customerCreateAccessToken = (options) => (options.client ?? client).post({
|
|
8281
|
+
url: '/customer/v1/access_tokens',
|
|
8282
|
+
...options,
|
|
8283
|
+
headers: {
|
|
8284
|
+
'Content-Type': 'application/json',
|
|
8285
|
+
...options.headers
|
|
8286
|
+
}
|
|
8287
|
+
});
|
|
8288
|
+
/**
|
|
8289
|
+
* Renew an access token
|
|
8290
|
+
*
|
|
8291
|
+
* 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.
|
|
8292
|
+
*/
|
|
8293
|
+
export const customerRenewAccessToken = (options) => (options?.client ?? client).post({ url: '/customer/v1/access_tokens/renew', ...options });
|
|
8294
|
+
/**
|
|
8295
|
+
* Sign out the current token
|
|
8296
|
+
*
|
|
8297
|
+
* 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.
|
|
8298
|
+
*/
|
|
8299
|
+
export const customerRevokeCurrentTokens = (options) => (options?.client ?? client).delete({ url: '/customer/v1/access_tokens/current', ...options });
|
|
8300
|
+
/**
|
|
8301
|
+
* List end users
|
|
8302
|
+
*
|
|
8303
|
+
* 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.
|
|
8304
|
+
*/
|
|
8305
|
+
export const customerListCustomers = (options) => (options?.client ?? client).get({
|
|
8306
|
+
security: [{
|
|
8307
|
+
key: 'BearerAuth',
|
|
8308
|
+
scheme: 'bearer',
|
|
8309
|
+
type: 'http'
|
|
8310
|
+
}, {
|
|
8311
|
+
key: 'ApiKeyAuth',
|
|
8312
|
+
name: 'X-API-Key',
|
|
8313
|
+
type: 'apiKey'
|
|
8314
|
+
}],
|
|
8315
|
+
url: '/customer/v1/customers',
|
|
8316
|
+
...options
|
|
8317
|
+
});
|
|
8318
|
+
/**
|
|
8319
|
+
* Delete an end user
|
|
8320
|
+
*
|
|
8321
|
+
* 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.
|
|
8322
|
+
*/
|
|
8323
|
+
export const customerDeleteCustomer = (options) => (options.client ?? client).delete({
|
|
8324
|
+
security: [{
|
|
8325
|
+
key: 'BearerAuth',
|
|
8326
|
+
scheme: 'bearer',
|
|
8327
|
+
type: 'http'
|
|
8328
|
+
}, {
|
|
8329
|
+
key: 'ApiKeyAuth',
|
|
8330
|
+
name: 'X-API-Key',
|
|
8331
|
+
type: 'apiKey'
|
|
8332
|
+
}],
|
|
8333
|
+
url: '/customer/v1/customers/{customer_id}',
|
|
8334
|
+
...options
|
|
8335
|
+
});
|
|
8336
|
+
/**
|
|
8337
|
+
* Get an end user
|
|
8338
|
+
*
|
|
8339
|
+
* 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.
|
|
8340
|
+
*/
|
|
8341
|
+
export const customerGetCustomer = (options) => (options.client ?? client).get({
|
|
8342
|
+
security: [{
|
|
8343
|
+
key: 'BearerAuth',
|
|
8344
|
+
scheme: 'bearer',
|
|
8345
|
+
type: 'http'
|
|
8346
|
+
}, {
|
|
8347
|
+
key: 'ApiKeyAuth',
|
|
8348
|
+
name: 'X-API-Key',
|
|
8349
|
+
type: 'apiKey'
|
|
8350
|
+
}],
|
|
8351
|
+
url: '/customer/v1/customers/{customer_id}',
|
|
8352
|
+
...options
|
|
8353
|
+
});
|
|
8354
|
+
/**
|
|
8355
|
+
* Read end-user usage
|
|
8356
|
+
*
|
|
8357
|
+
* 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.
|
|
8358
|
+
*/
|
|
8359
|
+
export const customerGetUsage = (options) => (options.client ?? client).get({
|
|
8360
|
+
security: [{
|
|
8361
|
+
key: 'BearerAuth',
|
|
8362
|
+
scheme: 'bearer',
|
|
8363
|
+
type: 'http'
|
|
8364
|
+
}, {
|
|
8365
|
+
key: 'ApiKeyAuth',
|
|
8366
|
+
name: 'X-API-Key',
|
|
8367
|
+
type: 'apiKey'
|
|
8368
|
+
}],
|
|
8369
|
+
url: '/customer/v1/customers/{customer_id}/usage',
|
|
8370
|
+
...options
|
|
8371
|
+
});
|
|
8372
|
+
/**
|
|
8373
|
+
* Block an end user
|
|
8374
|
+
*
|
|
8375
|
+
* 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.
|
|
8376
|
+
*/
|
|
8377
|
+
export const customerBlockCustomer = (options) => (options.client ?? client).post({
|
|
8378
|
+
security: [{
|
|
8379
|
+
key: 'BearerAuth',
|
|
8380
|
+
scheme: 'bearer',
|
|
8381
|
+
type: 'http'
|
|
8382
|
+
}, {
|
|
8383
|
+
key: 'ApiKeyAuth',
|
|
8384
|
+
name: 'X-API-Key',
|
|
8385
|
+
type: 'apiKey'
|
|
8386
|
+
}],
|
|
8387
|
+
url: '/customer/v1/customers/{customer_id}/block',
|
|
8388
|
+
...options,
|
|
8389
|
+
headers: {
|
|
8390
|
+
'Content-Type': 'application/json',
|
|
8391
|
+
...options.headers
|
|
8392
|
+
}
|
|
8393
|
+
});
|
|
8394
|
+
/**
|
|
8395
|
+
* Unblock an end user
|
|
8396
|
+
*
|
|
8397
|
+
* 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.
|
|
8398
|
+
*/
|
|
8399
|
+
export const customerUnblockCustomer = (options) => (options.client ?? client).post({
|
|
8400
|
+
security: [{
|
|
8401
|
+
key: 'BearerAuth',
|
|
8402
|
+
scheme: 'bearer',
|
|
8403
|
+
type: 'http'
|
|
8404
|
+
}, {
|
|
8405
|
+
key: 'ApiKeyAuth',
|
|
8406
|
+
name: 'X-API-Key',
|
|
8407
|
+
type: 'apiKey'
|
|
8408
|
+
}],
|
|
8409
|
+
url: '/customer/v1/customers/{customer_id}/unblock',
|
|
8410
|
+
...options
|
|
8411
|
+
});
|
|
8412
|
+
/**
|
|
8413
|
+
* Revoke every token of an end user
|
|
8414
|
+
*
|
|
8415
|
+
* 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.
|
|
8416
|
+
*/
|
|
8417
|
+
export const customerRevokeTokens = (options) => (options.client ?? client).post({
|
|
8418
|
+
security: [{
|
|
8419
|
+
key: 'BearerAuth',
|
|
8420
|
+
scheme: 'bearer',
|
|
8421
|
+
type: 'http'
|
|
8422
|
+
}, {
|
|
8423
|
+
key: 'ApiKeyAuth',
|
|
8424
|
+
name: 'X-API-Key',
|
|
8425
|
+
type: 'apiKey'
|
|
8426
|
+
}],
|
|
8427
|
+
url: '/customer/v1/customers/{customer_id}/revoke_tokens',
|
|
8428
|
+
...options
|
|
8429
|
+
});
|
|
8430
|
+
/**
|
|
8431
|
+
* List publishable keys
|
|
8432
|
+
*
|
|
8433
|
+
* 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.
|
|
8434
|
+
*/
|
|
8435
|
+
export const customerListPublishableKeys = (options) => (options?.client ?? client).get({
|
|
8436
|
+
security: [{
|
|
8437
|
+
key: 'BearerAuth',
|
|
8438
|
+
scheme: 'bearer',
|
|
8439
|
+
type: 'http'
|
|
8440
|
+
}, {
|
|
8441
|
+
key: 'ApiKeyAuth',
|
|
8442
|
+
name: 'X-API-Key',
|
|
8443
|
+
type: 'apiKey'
|
|
8444
|
+
}],
|
|
8445
|
+
url: '/customer/v1/publishable_keys',
|
|
8446
|
+
...options
|
|
8447
|
+
});
|
|
8448
|
+
/**
|
|
8449
|
+
* Create a publishable key
|
|
8450
|
+
*
|
|
8451
|
+
* 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.
|
|
8452
|
+
*/
|
|
8453
|
+
export const customerCreatePublishableKey = (options) => (options.client ?? client).post({
|
|
8454
|
+
security: [{
|
|
8455
|
+
key: 'BearerAuth',
|
|
8456
|
+
scheme: 'bearer',
|
|
8457
|
+
type: 'http'
|
|
8458
|
+
}, {
|
|
8459
|
+
key: 'ApiKeyAuth',
|
|
8460
|
+
name: 'X-API-Key',
|
|
8461
|
+
type: 'apiKey'
|
|
8462
|
+
}],
|
|
8463
|
+
url: '/customer/v1/publishable_keys',
|
|
7553
8464
|
...options,
|
|
7554
8465
|
headers: {
|
|
7555
8466
|
'Content-Type': 'application/json',
|
|
7556
8467
|
...options.headers
|
|
7557
8468
|
}
|
|
7558
8469
|
});
|
|
8470
|
+
/**
|
|
8471
|
+
* Delete a publishable key
|
|
8472
|
+
*
|
|
8473
|
+
* 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.
|
|
8474
|
+
*/
|
|
8475
|
+
export const customerDeletePublishableKey = (options) => (options.client ?? client).delete({
|
|
8476
|
+
security: [{
|
|
8477
|
+
key: 'BearerAuth',
|
|
8478
|
+
scheme: 'bearer',
|
|
8479
|
+
type: 'http'
|
|
8480
|
+
}, {
|
|
8481
|
+
key: 'ApiKeyAuth',
|
|
8482
|
+
name: 'X-API-Key',
|
|
8483
|
+
type: 'apiKey'
|
|
8484
|
+
}],
|
|
8485
|
+
url: '/customer/v1/publishable_keys/{key_id}',
|
|
8486
|
+
...options
|
|
8487
|
+
});
|
|
7559
8488
|
/**
|
|
7560
8489
|
* List projects
|
|
7561
8490
|
*
|
|
@@ -7689,7 +8618,7 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
|
7689
8618
|
* codemode.describe("praxis.cut.script") // names, one page at a time
|
|
7690
8619
|
* ```
|
|
7691
8620
|
*
|
|
7692
|
-
* Published at https://docs.deepraxis.com/
|
|
8621
|
+
* Published at https://docs.deepraxis.com/developers/cut/script-reference with one anchor per entry. Names below omit the `praxis.cut.<kind>.` prefix.
|
|
7693
8622
|
*
|
|
7694
8623
|
* #### Script functions (script)
|
|
7695
8624
|
*
|
|
@@ -7758,8 +8687,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
|
7758
8687
|
* - `transform` — Position, scale, rotation, opacity, crop, blur.
|
|
7759
8688
|
* - `fit` — contain, cover, fill or none.
|
|
7760
8689
|
* - `blend` — Layer blend mode; null clears.
|
|
7761
|
-
* - `style` — Text styling: font,
|
|
7762
|
-
* - `style.
|
|
8690
|
+
* - `style` — Text styling in Shotstack's rich shape: font, gradient, stroke, shadow, box, border, align, per-word animation.
|
|
8691
|
+
* - `style.align.vertical` — top, middle or bottom; omit it, never null.
|
|
7763
8692
|
* - `playback` — Rate, direction, audio policy, or freeze.
|
|
7764
8693
|
* - `volumeDb` — Audio level in dB; 0 is source level.
|
|
7765
8694
|
* - `gain` — Keyframed audio level in dB.
|
|
@@ -7780,6 +8709,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
|
7780
8709
|
* - `JOIN_CONFLICT` — A join is invalid or blocks this edit.
|
|
7781
8710
|
* - `INVALID_TRANSITION` — Bad transition kind, parameter or length.
|
|
7782
8711
|
* - `INVALID_STYLE` — A style value is out of range.
|
|
8712
|
+
* - `UNSUPPORTED_STYLE_FIELD` — A Shotstack style field this platform cannot render yet.
|
|
8713
|
+
* - `STYLE_LEGACY_FIELDS` — A style written in the old flat shape; it still works.
|
|
7783
8714
|
* - `INVALID_MASK` — A mask definition is malformed.
|
|
7784
8715
|
* - `MASK_IN_USE` — The edit would break a live mask.
|
|
7785
8716
|
* - `TOO_MANY_MASKS` — At most 16 masks per project.
|
|
@@ -8792,7 +9723,7 @@ export const devopsTestExecutionsGet = (options) => (options.client ?? client).g
|
|
|
8792
9723
|
/**
|
|
8793
9724
|
* Upload an external test report
|
|
8794
9725
|
*
|
|
8795
|
-
* Record the results of a run executed outside Praxis by uploading a CTRF or JUnit report. Nothing has to exist first: a first upload from CI creates the run it reports on (executor external) and catalogues the cases the report names, so there is no setup call before the first result. When the report already belongs to a run, pass ref and the upload joins it; the run's counts and verdict are recomputed from the report. Uploading the same reportId again is idempotent and counts once, so a retry after a timeout is safe — and a reported case is catalogued once, however many reports carry it. The report's bytes are kept as a file (the file field of the answer) rather than in the results database, so the original document stays retrievable. Send purpose feedback instead when the report is your own local run rather than evidence: the document is stored as an organization-private file and nothing else happens — no run is created or joined, no case state changes and the merge gate never reads it — so a developer's machine can publish what it ran without any commit being credited as tested.
|
|
9726
|
+
* Record the results of a run executed outside Praxis by uploading a CTRF or JUnit report. Nothing has to exist first: a first upload from CI creates the run it reports on (executor external) and catalogues the cases the report names, so there is no setup call before the first result. When the report already belongs to a run, pass ref and the upload joins it; the run's counts and verdict are recomputed from the report. Uploading the same reportId again is idempotent and counts once, so a retry after a timeout is safe — and a reported case is catalogued once, however many reports carry it. The report's bytes are kept as a file (the file field of the answer) rather than in the results database, so the original document stays retrievable. Send purpose feedback instead when the report is your own local run rather than evidence: the document is stored as an organization-private file and nothing else happens — no run is created or joined, no case state changes and the merge gate never reads it — so a developer's machine can publish what it ran without any commit being credited as tested. With purpose evidence the report is also filed as test evidence, package by package: DevOps recomputes each package's input hash from ref.commit (so the commit must already be pushed; an unreadable commit records the run but no evidence), and writes passed or failed only for a package whose every case at the gate's sizes the report carries — a report of a few files leaves that package without evidence. Pass ref.branch and ref.pullRequest so the run says where it came from; devops.projects.retrieveTestPlan at the commit then shows what the gate will read.
|
|
8796
9727
|
*/
|
|
8797
9728
|
export const devopsTestReportsUpload = (options) => (options.client ?? client).post({
|
|
8798
9729
|
security: [{
|
|
@@ -8807,10 +9738,24 @@ export const devopsTestReportsUpload = (options) => (options.client ?? client).p
|
|
|
8807
9738
|
...options.headers
|
|
8808
9739
|
}
|
|
8809
9740
|
});
|
|
9741
|
+
/**
|
|
9742
|
+
* Retrieve the merge gate's test plan at a commit
|
|
9743
|
+
*
|
|
9744
|
+
* Ask what the merge gate would require at one commit before running anything: the packages the base...commit diff affects, each package's input hash at that commit's own tree, and whether evidence already answers it. The answer also carries cases: every feature scenario of the affected packages at the gate's sizes, each with required (whether this diff can affect it, chosen by the files the scenario was recorded running), the reason, the deps hash it is judged at and its own evidence. A merge needs evidence only for the required cases; run `praxis devops test <package> --record-impact` to record coverage and results. Read a package as passed when a recorded run covered every case the package has at the gate's sizes and they passed, failed when the newest evidence at its input hash failed, and missing when no run has a row for that (package, input hash). Use it before running tests — run `praxis devops test <package>` for each missing or failed package on a clean, pushed commit and the run files the evidence itself — or to explain a gate verdict, because it is the same required set and the same (package, input hash) lookup the gate itself decides on. The call is read-only: it starts no run, runs no case and writes nothing. The commit must already be pushed, since the hashes are recomputed from the tree GitHub holds; a commit whose tree cannot be read answers COMMIT_NOT_FOUND instead of an empty plan. A selection of nothing means every changed path belongs to no test package, which is a pass and not a failure.
|
|
9745
|
+
*/
|
|
9746
|
+
export const devopsTestPlanGet = (options) => (options.client ?? client).get({
|
|
9747
|
+
security: [{
|
|
9748
|
+
key: 'devops-bearerAuth',
|
|
9749
|
+
scheme: 'bearer',
|
|
9750
|
+
type: 'http'
|
|
9751
|
+
}],
|
|
9752
|
+
url: '/devops/v1/projects/{project}/test-plan',
|
|
9753
|
+
...options
|
|
9754
|
+
});
|
|
8810
9755
|
/**
|
|
8811
9756
|
* List projects
|
|
8812
9757
|
*
|
|
8813
|
-
* List the delivery projects this organization has, newest first, with each project's repository binding and settings. Call this first when you do not already hold a project id: every other operation in this domain is addressed by one. A project from another organization is never listed, so an empty page means this organization has none rather than that they are hidden. The order is by creation time descending; follow nextPageToken until it is empty to see them all.
|
|
9758
|
+
* List the delivery projects this organization has, newest first, with each project's repository binding and settings. Call this first when you do not already hold a project id: every other operation in this domain is addressed by one. A project from another organization is never listed, so an empty page means this organization has none rather than that they are hidden. The order is by creation time descending; follow nextPageToken until it is empty to see them all. The page always carries visibleProjects: how many projects the caller's own organization has in total, deleted ones excluded. Those are the projects visible to the credential's organization — the count filters by organization_id and is not a permission check — so an empty items array reads as "this organization has none yet" instead of leaving you to guess whether the read was lost or the credential points at another organization. It is the organization's total across all pages, not this page's length.
|
|
8814
9759
|
*/
|
|
8815
9760
|
export const devopsProjectsList = (options) => (options?.client ?? client).get({
|
|
8816
9761
|
security: [{
|
|
@@ -8821,6 +9766,42 @@ export const devopsProjectsList = (options) => (options?.client ?? client).get({
|
|
|
8821
9766
|
url: '/devops/v1/projects',
|
|
8822
9767
|
...options
|
|
8823
9768
|
});
|
|
9769
|
+
/**
|
|
9770
|
+
* Create a project
|
|
9771
|
+
*
|
|
9772
|
+
* Create a delivery project and its two default environments (develop, production). The code lives in one of two places. Our own Git: pass provider platform and package, the id (pkg_...) of a git package in your organization's registry (the registry domain lists packages and creates git libraries); there is no install flow and no connection, the project records the provider, the package and the package's default branch, and from then on pull requests, the merge gate, changes and cloud workspaces use that package and DevOps merges a pull request itself. A package backs at most one project (REPOSITORY_ALREADY_BOUND) and a package that is not a git package of your organization is INVALID_ARGUMENT. If the package has no default branch yet, which is usual for a library imported from elsewhere, pass initialRef, an existing branch such as import: the default branch is created at its head while the project is created, and no change can be opened before it exists. If the default branch already exists the call is refused with DEFAULT_BRANCH_EXISTS, and a missing initialRef branch with REF_NOT_FOUND; neither leaves a project behind. For a package whose project already exists, use devops.projects.initializeDefaultBranch instead. GitHub (the default): pass the connection of a completed GitHub App install and the repository (owner/name) it can see; leave both out to create a project with no repository yet. A name must be kebab-case and unused in the organization (PROJECT_NAME_TAKEN).
|
|
9773
|
+
*/
|
|
9774
|
+
export const devopsProjectsCreate = (options) => (options.client ?? client).post({
|
|
9775
|
+
security: [{
|
|
9776
|
+
key: 'devops-bearerAuth',
|
|
9777
|
+
scheme: 'bearer',
|
|
9778
|
+
type: 'http'
|
|
9779
|
+
}],
|
|
9780
|
+
url: '/devops/v1/projects',
|
|
9781
|
+
...options,
|
|
9782
|
+
headers: {
|
|
9783
|
+
'Content-Type': 'application/json',
|
|
9784
|
+
...options.headers
|
|
9785
|
+
}
|
|
9786
|
+
});
|
|
9787
|
+
/**
|
|
9788
|
+
* Create a project's default branch
|
|
9789
|
+
*
|
|
9790
|
+
* Create the default branch of a project on our own Git, once. A git package imported from elsewhere can hold branches and no default branch, and every change is cut from the default branch, so until it exists no change can be opened. The default branch is protected and only DevOps holds the credential that may write it, so this call is the one way to create it: it points the default branch at the head of the existing branch named in from (for example import). It only creates: a default branch that already exists is refused with DEFAULT_BRANCH_EXISTS and is never moved, a from that is not a branch of the repository is REF_NOT_FOUND, and a GitHub project is INVALID_ARGUMENT because GitHub's branches are GitHub's. The push reaches the project like any other push to its default branch. Read the project first (devops.projects.retrieve) for the package's default branch name.
|
|
9791
|
+
*/
|
|
9792
|
+
export const devopsProjectsInitializeDefaultBranch = (options) => (options.client ?? client).post({
|
|
9793
|
+
security: [{
|
|
9794
|
+
key: 'devops-bearerAuth',
|
|
9795
|
+
scheme: 'bearer',
|
|
9796
|
+
type: 'http'
|
|
9797
|
+
}],
|
|
9798
|
+
url: '/devops/v1/projects/{id}/default-branch:initialize',
|
|
9799
|
+
...options,
|
|
9800
|
+
headers: {
|
|
9801
|
+
'Content-Type': 'application/json',
|
|
9802
|
+
...options.headers
|
|
9803
|
+
}
|
|
9804
|
+
});
|
|
8824
9805
|
/**
|
|
8825
9806
|
* Retrieve a project
|
|
8826
9807
|
*
|
|
@@ -8920,7 +9901,7 @@ export const devopsReleasesAbandon = (options) => (options.client ?? client).pos
|
|
|
8920
9901
|
/**
|
|
8921
9902
|
* Create a promotion
|
|
8922
9903
|
*
|
|
8923
|
-
* Promote a release into one environment: this is the operation that actually schedules a deployment. Name the release and the environment; path is regular for an ordinary promotion, targeted to deploy only the targets you list, patch to carry a patch release, and rollback to return the environment to an earlier release. A regular promotion promotes EVERY target the release changed in that environment and refuses a targets list (to promote a subset use path targeted, so a narrowing is never silently ignored). A targeted promotion requires targets: each item is a target id from the target list or the workspace path the console shows (services/devops), and the call resolves the path to the id. A target the release does not carry is refused with the targets the release does deploy; so is a target this environment never runs. Naming a target also deploys the targets it depends on, which come first and are reported in plan.addedDependencies. The targets that changed but were not named are listed in plan.skipped with reason not_requested, so a reader sees what the promotion left behind. Callees upgrade first by default: naming a target brings the targets it depends on, because a caller cannot run on a callee it did not deploy. To leave one of those callees behind, pass withoutCallees, a list of { target, reason } on a targeted promotion. Each entry names a callee the named targets depend on — by target id or workspace path, as in targets — and carries a required, non-empty reason, because an exception nobody can justify afterwards is indistinguishable from a mistake. An excluded callee is subtracted rather than deferred: it is not deployed, and a target that entered the plan only through it leaves the plan too, so nothing is deployed that would have needed it. The exclusion is visible in the plan (plan.skipped with reason callee_excluded, carrying the reason in message) and on the promotion (withoutCallees), and a retry repeats it. Excluding a target you named is refused (take it out of targets instead), as is excluding a target the named ones do not depend on; a regular promotion refuses withoutCallees the same way it refuses targets. A targeted promotion's success verifies only the targets it deployed, not the whole release, so the upstream gate still requires the untouched targets before a later environment may take them. The service reads the environment's promotion order and refuses when an upstream environment has not verified this release yet, unless a bypass carries the authorization for that gate. An environment takes one promotion at a time, so a create while another is running is queued behind it rather than refused; only a regular promotion supersedes waiting regular ones, and a targeted promotion neither overtakes another ride nor is overtaken. Set validateOnly to read the plan and its refusals — layers, skipped targets, pending migrations, missing configuration keys — without scheduling anything, which is the safe way to find out what a promotion will do; the same plan is on the promotion this call answers and on `praxis api devops promotion get`, which reads it again with the promotion's progress as the rollout advances. patch and rollback are not creatable here yet and are refused with NOT_IMPLEMENTED. The answer is the promotion: the plan it will execute is in its plan field (layers, skipped, refusals, pending migrations) and its progress is in state; `praxis api devops promotion get <id>` shows both again at any time. With an environment that requires approval the promotion waits in awaiting_approval until `praxis api devops promotion approve`.
|
|
9904
|
+
* Promote a release into one environment: this is the operation that actually schedules a deployment. Name the release and the environment; path is regular for an ordinary promotion, targeted to deploy only the targets you list, patch to carry a patch release, and rollback to return the environment to an earlier release. A regular promotion promotes EVERY target the release changed in that environment and refuses a targets list (to promote a subset use path targeted, so a narrowing is never silently ignored). A targeted promotion requires targets: each item is a target id from the target list or the workspace path the console shows (services/devops), and the call resolves the path to the id. A target the release does not carry is refused with the targets the release does deploy; so is a target this environment never runs. Naming a target also deploys the targets it depends on, which come first and are reported in plan.addedDependencies. The targets that changed but were not named are listed in plan.skipped with reason not_requested, so a reader sees what the promotion left behind. Callees upgrade first by default: naming a target brings the targets it depends on, because a caller cannot run on a callee it did not deploy. To skip that on purpose, pass dependencies skip, a forced express that deploys only the named targets and records that it did so (see dependencies). To leave one of those callees behind, pass withoutCallees, a list of { target, reason } on a targeted promotion. Each entry names a callee the named targets depend on — by target id or workspace path, as in targets — and carries a required, non-empty reason, because an exception nobody can justify afterwards is indistinguishable from a mistake. An excluded callee is subtracted rather than deferred: it is not deployed, and a target that entered the plan only through it leaves the plan too, so nothing is deployed that would have needed it. The exclusion is visible in the plan (plan.skipped with reason callee_excluded, carrying the reason in message) and on the promotion (withoutCallees), and a retry repeats it. Excluding a target you named is refused (take it out of targets instead), as is excluding a target the named ones do not depend on; a regular promotion refuses withoutCallees the same way it refuses targets. A targeted promotion's success verifies only the targets it deployed, not the whole release, so the upstream gate still requires the untouched targets before a later environment may take them. The service reads the environment's promotion order and refuses when an upstream environment has not verified this release yet, unless a bypass carries the authorization for that gate. An environment takes one promotion at a time, so a create while another is running is queued behind it rather than refused; only a regular promotion supersedes waiting regular ones, and a targeted promotion neither overtakes another ride nor is overtaken. Set validateOnly to read the plan and its refusals — layers, skipped targets, pending migrations, missing configuration keys — without scheduling anything, which is the safe way to find out what a promotion will do; the same plan is on the promotion this call answers and on `praxis api devops promotion get`, which reads it again with the promotion's progress as the rollout advances. patch and rollback are not creatable here yet and are refused with NOT_IMPLEMENTED. The answer is the promotion: the plan it will execute is in its plan field (layers, skipped, refusals, pending migrations) and its progress is in state; `praxis api devops promotion get <id>` shows both again at any time. With an environment that requires approval the promotion waits in awaiting_approval until `praxis api devops promotion approve`.
|
|
8924
9905
|
*/
|
|
8925
9906
|
export const devopsPromotionsCreate = (options) => (options.client ?? client).post({
|
|
8926
9907
|
security: [{
|
|
@@ -9002,7 +9983,7 @@ export const devopsPromotionsCancel = (options) => (options.client ?? client).po
|
|
|
9002
9983
|
/**
|
|
9003
9984
|
* Retry a promotion
|
|
9004
9985
|
*
|
|
9005
|
-
* Continue a promotion that stopped part-way
|
|
9986
|
+
* 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.
|
|
9006
9987
|
*/
|
|
9007
9988
|
export const devopsPromotionsRetry = (options) => (options.client ?? client).post({
|
|
9008
9989
|
security: [{
|
|
@@ -9031,6 +10012,20 @@ export const devopsPromotionsConclude = (options) => (options.client ?? client).
|
|
|
9031
10012
|
...options.headers
|
|
9032
10013
|
}
|
|
9033
10014
|
});
|
|
10015
|
+
/**
|
|
10016
|
+
* Get the checkout credential of a running promotion
|
|
10017
|
+
*
|
|
10018
|
+
* Issue the credential the deploy machine fetches a platform-Git project's code with. The caller is the deploy machine itself, during a run: its `devops/prepare` step sends the API key it already holds and receives the clone URL of the project's repository plus a pull-only credential for exactly that one repository. The credential lives 15 minutes and is issued again on every request, so it never sits in the run's stored input or log, and a leaked copy is useless almost at once. A run that needs the code later, such as an engine checkout after a long install, asks again. It answers only while the promotion is deploying (a rollback is a promotion and deploys too) or halted; a promotion that is queued, waiting for approval, observing or finished is refused with PROMOTION_NOT_RUNNING, because no machine should be fetching code for it. A project whose code is on GitHub is refused with SOURCE_NOT_PLATFORM: its checkout uses the GitHub App token, not this. The key must belong to the promotion's organization, the same check as reading the promotion with `praxis api devops promotion get <id>`. People do not need this call: to read a platform project's code use the code browser calls instead.
|
|
10019
|
+
*/
|
|
10020
|
+
export const devopsPromotionsCheckoutCredential = (options) => (options.client ?? client).post({
|
|
10021
|
+
security: [{
|
|
10022
|
+
key: 'devops-bearerAuth',
|
|
10023
|
+
scheme: 'bearer',
|
|
10024
|
+
type: 'http'
|
|
10025
|
+
}],
|
|
10026
|
+
url: '/devops/v1/promotions/{id}:checkoutCredential',
|
|
10027
|
+
...options
|
|
10028
|
+
});
|
|
9034
10029
|
/**
|
|
9035
10030
|
* List a promotion's rollouts
|
|
9036
10031
|
*
|
|
@@ -9500,7 +10495,7 @@ export const devopsChangesGet = (options) => (options.client ?? client).get({
|
|
|
9500
10495
|
/**
|
|
9501
10496
|
* Abandon a change
|
|
9502
10497
|
*
|
|
9503
|
-
* 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).
|
|
10498
|
+
* 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.
|
|
9504
10499
|
*/
|
|
9505
10500
|
export const devopsChangesAbandon = (options) => (options.client ?? client).post({
|
|
9506
10501
|
security: [{
|
|
@@ -9533,6 +10528,38 @@ export const devopsChangesMarkLastSlice = (options) => (options.client ?? client
|
|
|
9533
10528
|
...options.headers
|
|
9534
10529
|
}
|
|
9535
10530
|
});
|
|
10531
|
+
/**
|
|
10532
|
+
* Open a change's pull request
|
|
10533
|
+
*
|
|
10534
|
+
* 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.
|
|
10535
|
+
*/
|
|
10536
|
+
export const devopsChangesOpenPullRequest = (options) => (options.client ?? client).post({
|
|
10537
|
+
security: [{
|
|
10538
|
+
key: 'devops-bearerAuth',
|
|
10539
|
+
scheme: 'bearer',
|
|
10540
|
+
type: 'http'
|
|
10541
|
+
}],
|
|
10542
|
+
url: '/devops/v1/changes/{id}:openPullRequest',
|
|
10543
|
+
...options,
|
|
10544
|
+
headers: {
|
|
10545
|
+
'Content-Type': 'application/json',
|
|
10546
|
+
...options.headers
|
|
10547
|
+
}
|
|
10548
|
+
});
|
|
10549
|
+
/**
|
|
10550
|
+
* Get a change workspace's read-only git credential
|
|
10551
|
+
*
|
|
10552
|
+
* 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).
|
|
10553
|
+
*/
|
|
10554
|
+
export const devopsChangesGitCredential = (options) => (options.client ?? client).post({
|
|
10555
|
+
security: [{
|
|
10556
|
+
key: 'devops-bearerAuth',
|
|
10557
|
+
scheme: 'bearer',
|
|
10558
|
+
type: 'http'
|
|
10559
|
+
}],
|
|
10560
|
+
url: '/devops/v1/changes/{id}:gitCredential',
|
|
10561
|
+
...options
|
|
10562
|
+
});
|
|
9536
10563
|
/**
|
|
9537
10564
|
* List a project's pull requests
|
|
9538
10565
|
*
|
|
@@ -9550,7 +10577,7 @@ export const devopsPullRequestsList = (options) => (options.client ?? client).ge
|
|
|
9550
10577
|
/**
|
|
9551
10578
|
* Retrieve a pull request
|
|
9552
10579
|
*
|
|
9553
|
-
* Read one pull request in full: its state, its head and base, its changed paths, the exposure its description declares, and — the part this call exists for — its gate. The gate is a list of named checks (the declaration, the flag duties, the affected tests, and the one judgement only a person makes), each with a result and, when it failed or is pending, the sentence saying what is missing; the gate's own state is passed only when no check failed and none is still pending. Read the gate here before merging or before recording a verdict, and read it again after a rerun: the checks are facts about the current head, and a new head starts a new gate. Add expand=runs to also get the
|
|
10580
|
+
* Read one pull request in full: its state, its head and base, its changed paths, the exposure its description declares, and — the part this call exists for — its gate. The gate is a list of named checks (the declaration, the flag duties, the affected tests, and the one judgement only a person makes), each with a result and, when it failed or is pending, the sentence saying what is missing; the tests check is never pending, because DevOps runs no tests for a pull request: it is passed, or failed naming the missing or failed cases and the command `praxis devops test <package> --record-impact` the author runs on the pushed head; the gate's own state is passed only when no check failed and none is still pending. Read the gate here before merging or before recording a verdict, and read it again after a rerun: the checks are facts about the current head, and a new head starts a new gate. Add expand=runs to also get the test runs reported at the head commit (uploaded by the author, never started by DevOps), newest first.
|
|
9554
10581
|
*/
|
|
9555
10582
|
export const devopsPullRequestsGet = (options) => (options.client ?? client).get({
|
|
9556
10583
|
security: [{
|
|
@@ -9564,7 +10591,7 @@ export const devopsPullRequestsGet = (options) => (options.client ?? client).get
|
|
|
9564
10591
|
/**
|
|
9565
10592
|
* Decide a pull request's merge gate again
|
|
9566
10593
|
*
|
|
9567
|
-
* Decide the merge gate again at the pull request's current head and report the result on GitHub as the "Praxis DevOps / gate" check run. Use it when a fact the gate reads has changed without a new push — a
|
|
10594
|
+
* Decide the merge gate again at the pull request's current head and report the result on GitHub as the "Praxis DevOps / gate" check run. Use it when a fact the gate reads has changed without a new push — a flag was registered, or a check that had no evidence now has some (test evidence uploaded for the head already decides the gate again by itself) — so nobody has to push an empty commit to make the check move. The answer is the pull request with the gate it now reaches. A head whose earlier gate already had a verdict and comes back pending opens a NEW check run, because GitHub will not reopen a completed one; while the same head is still deciding, the run it already owns is updated in place. Nothing else on the pull request changes, and repeating the call is safe: the same facts decide the same gate.
|
|
9568
10595
|
*/
|
|
9569
10596
|
export const devopsPullRequestsRerunGate = (options) => (options.client ?? client).post({
|
|
9570
10597
|
security: [{
|
|
@@ -9578,7 +10605,7 @@ export const devopsPullRequestsRerunGate = (options) => (options.client ?? clien
|
|
|
9578
10605
|
/**
|
|
9579
10606
|
* Merge a pull request through its gate
|
|
9580
10607
|
*
|
|
9581
|
-
* Land a pull request by having DevOps call GitHub, so the merge goes through the platform's own merge gate instead of around it. The gate is the permission: while the gate is pending or failed the merge is refused with GATE_NOT_PASSED, and a pull request that is already merged or closed is refused with PULL_REQUEST_NOT_OPEN. Only the commit the gate decided on may land — that commit is sent to GitHub as the merge sha, so a head that moved underneath is refused with HEAD_MOVED rather than merged untested — and GitHub's own refusal, such as a conflict, comes back as MERGE_REFUSED carrying its words. method picks the merge shape
|
|
10608
|
+
* Land a pull request by having DevOps call GitHub, so the merge goes through the platform's own merge gate instead of around it. The gate is the permission: while the gate is pending or failed the merge is refused with GATE_NOT_PASSED, and a pull request that is already merged or closed is refused with PULL_REQUEST_NOT_OPEN. Only the commit the gate decided on may land — that commit is sent to GitHub as the merge sha, so a head that moved underneath is refused with HEAD_MOVED rather than merged untested — and GitHub's own refusal, such as a conflict, comes back as MERGE_REFUSED carrying its words. method picks the merge shape; on GitHub it defaults to rebase. A project on our own Git (provider platform) merges by squash only: no method means squash, and rebase or merge is refused with INVALID_ARGUMENT naming squash. queue true does not merge now: it puts the pull request into its (project, base) merge queue, where the commit that eventually lands is one GitHub built from the current base and a test run proved. Send requestId to make a retry safe — a retry that reaches a pull request DevOps itself already merged answers that merge without calling GitHub again; it does not make the merge wait. Merging something already merged by somebody else stays a refusal rather than a replay.
|
|
9582
10609
|
*/
|
|
9583
10610
|
export const devopsPullRequestsMerge = (options) => (options.client ?? client).post({
|
|
9584
10611
|
security: [{
|
|
@@ -9594,9 +10621,9 @@ export const devopsPullRequestsMerge = (options) => (options.client ?? client).p
|
|
|
9594
10621
|
}
|
|
9595
10622
|
});
|
|
9596
10623
|
/**
|
|
9597
|
-
* Record a
|
|
10624
|
+
* Record a review verdict on a pull request
|
|
9598
10625
|
*
|
|
9599
|
-
*
|
|
10626
|
+
* Record a reviewer's verdict on a pull request, after the fact (Sean 2026-11-24). The merge gate no longer waits for it: exposure-judged is decided by machine from the declaration for every kind of exposure, so a pull request merges without any verdict. This call is the review record — send result passed or failed with reason saying in a sentence a reviewer can act on why. It is stored on the pull request as review and announced with the event devops.pullRequest.reviewed. A failed verdict on an already merged pull request is a finding for follow-up (the event says finding true): the merge stands, nothing is un-merged, and a rollback or a fix is asked for on the ticket. headSha must be the pull request's head, and a verdict for another commit is refused with INVALID_ARGUMENT. List the merged pull requests nobody reviewed with pullRequests.list reviewed=false.
|
|
9600
10627
|
*/
|
|
9601
10628
|
export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? client).post({
|
|
9602
10629
|
security: [{
|
|
@@ -9611,6 +10638,42 @@ export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? c
|
|
|
9611
10638
|
...options.headers
|
|
9612
10639
|
}
|
|
9613
10640
|
});
|
|
10641
|
+
/**
|
|
10642
|
+
* Close a pull request without merging it
|
|
10643
|
+
*
|
|
10644
|
+
* 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.
|
|
10645
|
+
*/
|
|
10646
|
+
export const devopsPullRequestsClose = (options) => (options.client ?? client).post({
|
|
10647
|
+
security: [{
|
|
10648
|
+
key: 'devops-bearerAuth',
|
|
10649
|
+
scheme: 'bearer',
|
|
10650
|
+
type: 'http'
|
|
10651
|
+
}],
|
|
10652
|
+
url: '/devops/v1/pull-requests/{id}:close',
|
|
10653
|
+
...options,
|
|
10654
|
+
headers: {
|
|
10655
|
+
'Content-Type': 'application/json',
|
|
10656
|
+
...options.headers
|
|
10657
|
+
}
|
|
10658
|
+
});
|
|
10659
|
+
/**
|
|
10660
|
+
* Review a pull request on our own Git
|
|
10661
|
+
*
|
|
10662
|
+
* Give your verdict on a pull request whose project keeps its code on the platform's own Git, where there is no GitHub to hold reviews. The reviewer is you — the user or agent the credential names, never a name in the body — and the platform stores your verdict on the pull request's reviewers under your id, so an ownership rule that lists principal ids reads it. Send approved to approve, changes_requested to hold it with changes you want, or commented to say something without a verdict. A second review from you replaces your first, and the gate is decided again so a rule that reads reviews sees it at once. Only an open pull request is reviewed: a merged or closed one is refused with PULL_REQUEST_NOT_OPEN. A project connected to GitHub is refused with INVALID_ARGUMENT, because its reviews belong to GitHub and the platform projects them from there, so a verdict is never recorded in two places that can disagree.
|
|
10663
|
+
*/
|
|
10664
|
+
export const devopsPullRequestsReviewsCreate = (options) => (options.client ?? client).post({
|
|
10665
|
+
security: [{
|
|
10666
|
+
key: 'devops-bearerAuth',
|
|
10667
|
+
scheme: 'bearer',
|
|
10668
|
+
type: 'http'
|
|
10669
|
+
}],
|
|
10670
|
+
url: '/devops/v1/pull-requests/{id}/reviews',
|
|
10671
|
+
...options,
|
|
10672
|
+
headers: {
|
|
10673
|
+
'Content-Type': 'application/json',
|
|
10674
|
+
...options.headers
|
|
10675
|
+
}
|
|
10676
|
+
});
|
|
9614
10677
|
/**
|
|
9615
10678
|
* List connections
|
|
9616
10679
|
*
|
|
@@ -9756,7 +10819,7 @@ export const devopsTestRunsRetryFailed = (options) => (options.client ?? client)
|
|
|
9756
10819
|
/**
|
|
9757
10820
|
* List a project's stage workspaces
|
|
9758
10821
|
*
|
|
9759
|
-
* List the project's three stage workspaces — development, integration and
|
|
10822
|
+
* List the project's three stage workspaces — development, integration and release — in that order. Each row says how a machine of that stage is built and how long it lives; it is configuration, not a machine, so listing never opens one. A project whose rows do not exist yet gets all three materialized on this call with the defaults (size medium, prebuild on, idle timeout 30 minutes, retention 7 days), and a later call reads those same rows back rather than replacing them. Read one stage with the workspace retrieve; the machines actually running are units.
|
|
9760
10823
|
*/
|
|
9761
10824
|
export const devopsWorkspacesList = (options) => (options.client ?? client).get({
|
|
9762
10825
|
security: [{
|
|
@@ -9831,6 +10894,20 @@ export const devopsUnitsCreate = (options) => (options.client ?? client).post({
|
|
|
9831
10894
|
...options.headers
|
|
9832
10895
|
}
|
|
9833
10896
|
});
|
|
10897
|
+
/**
|
|
10898
|
+
* List a project's cleanup ledger
|
|
10899
|
+
*
|
|
10900
|
+
* List what the daily cleanup job removed or archived for the project, newest decision first: merged branches deleted when their pull request merged, stopped units deleted after the project's window, test evidence past its age, and prebuilds beyond the kept versions. Each row names the kind of thing, which one, whether it was archived (the record stays, the heavy content goes) or deleted, the reason and when it was decided and done; error is set while the last attempt failed and the job will try again. The ledger is read-only: the job is its only writer, and a project changes what is kept through settings.retention on devops.projects.update. A project with no row has had nothing cleaned.
|
|
10901
|
+
*/
|
|
10902
|
+
export const devopsCleanupsList = (options) => (options.client ?? client).get({
|
|
10903
|
+
security: [{
|
|
10904
|
+
key: 'devops-bearerAuth',
|
|
10905
|
+
scheme: 'bearer',
|
|
10906
|
+
type: 'http'
|
|
10907
|
+
}],
|
|
10908
|
+
url: '/devops/v1/projects/{project}/cleanups',
|
|
10909
|
+
...options
|
|
10910
|
+
});
|
|
9834
10911
|
/**
|
|
9835
10912
|
* Delete a unit
|
|
9836
10913
|
*
|
|
@@ -10702,7 +11779,7 @@ export const mediaBatchAssets = (options) => (options.client ?? client).post({
|
|
|
10702
11779
|
/**
|
|
10703
11780
|
* Get job
|
|
10704
11781
|
*
|
|
10705
|
-
* Read
|
|
11782
|
+
* 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.
|
|
10706
11783
|
*/
|
|
10707
11784
|
export const mediaGetJob = (options) => (options.client ?? client).get({
|
|
10708
11785
|
security: [{
|
|
@@ -10794,7 +11871,7 @@ export const mediaGetAssetLineage = (options) => (options.client ?? client).get(
|
|
|
10794
11871
|
/**
|
|
10795
11872
|
* Generate image
|
|
10796
11873
|
*
|
|
10797
|
-
* Generate
|
|
11874
|
+
* 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.
|
|
10798
11875
|
*/
|
|
10799
11876
|
export const mediaGenerateImage = (options) => (options.client ?? client).post({
|
|
10800
11877
|
security: [{
|
|
@@ -10812,7 +11889,7 @@ export const mediaGenerateImage = (options) => (options.client ?? client).post({
|
|
|
10812
11889
|
/**
|
|
10813
11890
|
* Generate video
|
|
10814
11891
|
*
|
|
10815
|
-
* Generate
|
|
11892
|
+
* 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.
|
|
10816
11893
|
*/
|
|
10817
11894
|
export const mediaGenerateVideo = (options) => (options.client ?? client).post({
|
|
10818
11895
|
security: [{
|
|
@@ -10830,7 +11907,7 @@ export const mediaGenerateVideo = (options) => (options.client ?? client).post({
|
|
|
10830
11907
|
/**
|
|
10831
11908
|
* Edit asset
|
|
10832
11909
|
*
|
|
10833
|
-
*
|
|
11910
|
+
* 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.
|
|
10834
11911
|
*/
|
|
10835
11912
|
export const mediaEditAsset = (options) => (options.client ?? client).post({
|
|
10836
11913
|
security: [{
|
|
@@ -10848,7 +11925,7 @@ export const mediaEditAsset = (options) => (options.client ?? client).post({
|
|
|
10848
11925
|
/**
|
|
10849
11926
|
* Create speech
|
|
10850
11927
|
*
|
|
10851
|
-
* 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.
|
|
11928
|
+
* 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.
|
|
10852
11929
|
*/
|
|
10853
11930
|
export const mediaCreateSpeech = (options) => (options.client ?? client).post({
|
|
10854
11931
|
security: [{
|
|
@@ -10944,7 +12021,7 @@ export const mediaListUnderstandingsByLibrary = (options) => (options.client ??
|
|
|
10944
12021
|
/**
|
|
10945
12022
|
* List jobs
|
|
10946
12023
|
*
|
|
10947
|
-
* List batch and generation jobs
|
|
12024
|
+
* 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.
|
|
10948
12025
|
*/
|
|
10949
12026
|
export const mediaListJobs = (options) => (options.client ?? client).get({
|
|
10950
12027
|
security: [{
|
|
@@ -10958,7 +12035,7 @@ export const mediaListJobs = (options) => (options.client ?? client).get({
|
|
|
10958
12035
|
/**
|
|
10959
12036
|
* Cancel job
|
|
10960
12037
|
*
|
|
10961
|
-
*
|
|
12038
|
+
* 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.
|
|
10962
12039
|
*/
|
|
10963
12040
|
export const mediaCancelJob = (options) => (options.client ?? client).post({
|
|
10964
12041
|
security: [{
|
|
@@ -11033,6 +12110,42 @@ export const mediaRequestHlsRenditions = (options) => (options.client ?? client)
|
|
|
11033
12110
|
...options.headers
|
|
11034
12111
|
}
|
|
11035
12112
|
});
|
|
12113
|
+
/**
|
|
12114
|
+
* Create voice
|
|
12115
|
+
*
|
|
12116
|
+
* 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.
|
|
12117
|
+
*/
|
|
12118
|
+
export const mediaCreateVoice = (options) => (options.client ?? client).post({
|
|
12119
|
+
security: [{
|
|
12120
|
+
key: 'media-BearerAuth',
|
|
12121
|
+
scheme: 'bearer',
|
|
12122
|
+
type: 'http'
|
|
12123
|
+
}],
|
|
12124
|
+
url: '/media/v1/libraries/{library_id}/voices',
|
|
12125
|
+
...options,
|
|
12126
|
+
headers: {
|
|
12127
|
+
'Content-Type': 'application/json',
|
|
12128
|
+
...options.headers
|
|
12129
|
+
}
|
|
12130
|
+
});
|
|
12131
|
+
/**
|
|
12132
|
+
* Design a voice
|
|
12133
|
+
*
|
|
12134
|
+
* 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.
|
|
12135
|
+
*/
|
|
12136
|
+
export const mediaDesignVoice = (options) => (options.client ?? client).post({
|
|
12137
|
+
security: [{
|
|
12138
|
+
key: 'media-BearerAuth',
|
|
12139
|
+
scheme: 'bearer',
|
|
12140
|
+
type: 'http'
|
|
12141
|
+
}],
|
|
12142
|
+
url: '/media/v1/libraries/{library_id}/voices/designs',
|
|
12143
|
+
...options,
|
|
12144
|
+
headers: {
|
|
12145
|
+
'Content-Type': 'application/json',
|
|
12146
|
+
...options.headers
|
|
12147
|
+
}
|
|
12148
|
+
});
|
|
11036
12149
|
/**
|
|
11037
12150
|
* List types
|
|
11038
12151
|
*
|
|
@@ -11292,7 +12405,7 @@ export const registryRepositoriesList = (options) => (options?.client ?? client)
|
|
|
11292
12405
|
/**
|
|
11293
12406
|
* Create repository
|
|
11294
12407
|
*
|
|
11295
|
-
* 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。
|
|
12408
|
+
* 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。format 默认 oci,库里放技能和插件;要放 git 仓库就传 format=git,建库后 format 不能改。git 库需要这个组织已开放 git 功能,否则返回 409。
|
|
11296
12409
|
*/
|
|
11297
12410
|
export const registryRepositoriesCreate = (options) => (options.client ?? client).post({
|
|
11298
12411
|
security: [{
|
|
@@ -11368,12 +12481,11 @@ export const registryRepositoriesPackagesList = (options) => (options.client ??
|
|
|
11368
12481
|
...options
|
|
11369
12482
|
});
|
|
11370
12483
|
/**
|
|
11371
|
-
*
|
|
12484
|
+
* Create a package
|
|
11372
12485
|
*
|
|
11373
|
-
*
|
|
12486
|
+
* 在一个库里建新包,按库的 format 走两条路。git 库(format=git):Content-Type 用 application/json,请求体 {name, format:"git", default_branch?, description?, import?},建一个空的 git 仓库,或者用 import.url(公开 https 仓库)从现有仓库导入;成功返回的包带 clone_url、default_branch 和 protected_refs(默认只保护默认分支),接着调用 packages.git-credential 取推拉凭据;组织未开放 git 功能返回 409,往 oci 库里用 JSON 建包也是 409。oci 库(技能和插件):把一个新包发布进这个库,一次调用建立包并上传它的第一个版本,Content-Type 用 multipart/form-data。发布内容是 multipart:version 必填,archive 给一个 zip,或者 files 给一组文件(每个文件的 filename 是相对上传根的路径,例如 pdf/SKILL.md)。单个顶层目录会被剥掉。种类按根上有什么判:有 SKILL.md 就是 skill,有 .claude-plugin/plugin.json 就是 plugin;两者都没有、或都有,会被拒。名字从 SKILL.md 或 plugin.json 里读,不从路径或 query 猜。限额:上传 ≤25 MiB,解压后 ≤50 MiB,≤1000 个文件。版本必须是 semver 且严格递增;第一个版本可以是任意合法 semver,之后每个新版本都要比已发布的最高版本高。把已有智能体的技能搬过来时,先用 GET /agent/v1/skills/{id}/versions/{v}/content 导出 zip,再在这里作为 archive 发布。
|
|
11374
12487
|
*/
|
|
11375
12488
|
export const registryRepositoriesPackagesCreate = (options) => (options.client ?? client).post({
|
|
11376
|
-
...formDataBodySerializer,
|
|
11377
12489
|
security: [{
|
|
11378
12490
|
key: 'registry-bearerAuth',
|
|
11379
12491
|
scheme: 'bearer',
|
|
@@ -11382,14 +12494,14 @@ export const registryRepositoriesPackagesCreate = (options) => (options.client ?
|
|
|
11382
12494
|
url: '/registry/v1/repositories/{repository_id}/packages',
|
|
11383
12495
|
...options,
|
|
11384
12496
|
headers: {
|
|
11385
|
-
'Content-Type':
|
|
12497
|
+
'Content-Type': 'application/json',
|
|
11386
12498
|
...options.headers
|
|
11387
12499
|
}
|
|
11388
12500
|
});
|
|
11389
12501
|
/**
|
|
11390
12502
|
* Retrieve package
|
|
11391
12503
|
*
|
|
11392
|
-
* 读一个包的元数据:种类、所属库、当前 latest_version、作者、标签和累计下载量。package_id 来自 packages.list 或 packages.create;另一个组织或不存在都返回 404
|
|
12504
|
+
* 读一个包的元数据:种类、所属库、当前 latest_version、作者、标签和累计下载量。package_id 来自 packages.list 或 packages.create;另一个组织或不存在都返回 404。软删期间这个包一律 404,恢复后才重新出现。
|
|
11393
12505
|
*/
|
|
11394
12506
|
export const registryPackagesRetrieve = (options) => (options.client ?? client).get({
|
|
11395
12507
|
security: [{
|
|
@@ -11433,6 +12545,136 @@ export const registryPackagesVersionsCreate = (options) => (options.client ?? cl
|
|
|
11433
12545
|
...options.headers
|
|
11434
12546
|
}
|
|
11435
12547
|
});
|
|
12548
|
+
/**
|
|
12549
|
+
* Create a git credential
|
|
12550
|
+
*
|
|
12551
|
+
* 给一个 git 包换一个短期的 git 凭据,用来 git clone / git push。access 选 pull(只读,用来克隆和拉取)或 push(推分支,同时可以克隆和拉取)。push-protected(更新受保护分支)暂不发放,请推到别的分支再合并,请求它返回 400。ttl_seconds 是有效秒数,1-3600,默认 3600;到期后重新调用本接口,不要缓存过期的凭据。返回的 password 是敏感信息,只出现这一次,不要写进日志或提交。用法:git clone https://x-access-token:$PASSWORD@host/git/组织/库/包.git,或把 url 里的地址配上 http.extraHeader。组织未开放 git 功能返回 409;另一个组织的包、已被删除的包和 oci 包都返回 404。同一个 package_id 可以多次取,每次是一个新凭据,互不影响。
|
|
12552
|
+
*/
|
|
12553
|
+
export const registryPackagesGitCredentialCreate = (options) => (options.client ?? client).post({
|
|
12554
|
+
security: [{
|
|
12555
|
+
key: 'registry-bearerAuth',
|
|
12556
|
+
scheme: 'bearer',
|
|
12557
|
+
type: 'http'
|
|
12558
|
+
}],
|
|
12559
|
+
url: '/registry/v1/packages/{package_id}/git-credential',
|
|
12560
|
+
...options,
|
|
12561
|
+
headers: {
|
|
12562
|
+
'Content-Type': 'application/json',
|
|
12563
|
+
...options.headers
|
|
12564
|
+
}
|
|
12565
|
+
});
|
|
12566
|
+
/**
|
|
12567
|
+
* List commits
|
|
12568
|
+
*
|
|
12569
|
+
* 列出一个 git 包的提交历史,最新的在前。ref 不给就是包的默认分支;limit 与 offset 分页,has_more 为 true 表示还有下一页。只读:提交只能通过 git 协议推送(clone 地址在包的 clone_url)。OCI 包没有 git 读接口,返回 404。
|
|
12570
|
+
*/
|
|
12571
|
+
export const registryGitLog = (options) => (options.client ?? client).get({
|
|
12572
|
+
security: [{
|
|
12573
|
+
key: 'registry-bearerAuth',
|
|
12574
|
+
scheme: 'bearer',
|
|
12575
|
+
type: 'http'
|
|
12576
|
+
}],
|
|
12577
|
+
url: '/registry/v1/packages/{package_id}/git/log',
|
|
12578
|
+
...options
|
|
12579
|
+
});
|
|
12580
|
+
/**
|
|
12581
|
+
* Read a commit
|
|
12582
|
+
*
|
|
12583
|
+
* 按对象 id 读一个提交(完整 sha,不解析缩写)。返回提交信息、作者、提交时间与父提交;changed_files=true 时再返回它相对第一个父提交改了哪些文件(根提交的全部文件算新增),文件列表被上限截断时 changed_files_truncated 为 true。仓库里没有这个对象返回 404。
|
|
12584
|
+
*/
|
|
12585
|
+
export const registryGitCommitsRetrieve = (options) => (options.client ?? client).get({
|
|
12586
|
+
security: [{
|
|
12587
|
+
key: 'registry-bearerAuth',
|
|
12588
|
+
scheme: 'bearer',
|
|
12589
|
+
type: 'http'
|
|
12590
|
+
}],
|
|
12591
|
+
url: '/registry/v1/packages/{package_id}/git/commits/{sha}',
|
|
12592
|
+
...options
|
|
12593
|
+
});
|
|
12594
|
+
/**
|
|
12595
|
+
* List a tree
|
|
12596
|
+
*
|
|
12597
|
+
* 读一个树对象(或一个提交的根树)的条目:名字、类型(blob / tree / commit)、模式、对象 id,以及已知时的大小。只列这一层,不递归。
|
|
12598
|
+
*/
|
|
12599
|
+
export const registryGitTreesRetrieve = (options) => (options.client ?? client).get({
|
|
12600
|
+
security: [{
|
|
12601
|
+
key: 'registry-bearerAuth',
|
|
12602
|
+
scheme: 'bearer',
|
|
12603
|
+
type: 'http'
|
|
12604
|
+
}],
|
|
12605
|
+
url: '/registry/v1/packages/{package_id}/git/trees/{sha}',
|
|
12606
|
+
...options
|
|
12607
|
+
});
|
|
12608
|
+
/**
|
|
12609
|
+
* List branches and tags
|
|
12610
|
+
*
|
|
12611
|
+
* 列出一个 git 包的分支和标签,按名字排序;prefix 只取 refs/heads/(分支)或 refs/tags/(标签),不给就两者都列。page 从 1 起,size 1 到 500,默认 100;has_more 为 true 表示还有下一页。带注解的标签返回它指向的提交 id,不是标签对象的 id。想把一个名字换成提交 id 用 git/resolve,不要自己在这个列表里找。只读;OCI 包返回 404。
|
|
12612
|
+
*/
|
|
12613
|
+
export const registryGitRefs = (options) => (options.client ?? client).get({
|
|
12614
|
+
security: [{
|
|
12615
|
+
key: 'registry-bearerAuth',
|
|
12616
|
+
scheme: 'bearer',
|
|
12617
|
+
type: 'http'
|
|
12618
|
+
}],
|
|
12619
|
+
url: '/registry/v1/packages/{package_id}/git/refs',
|
|
12620
|
+
...options
|
|
12621
|
+
});
|
|
12622
|
+
/**
|
|
12623
|
+
* Resolve a ref
|
|
12624
|
+
*
|
|
12625
|
+
* 把一个引用换成它指向的提交 id:ref 可以是分支名、标签名、refs/… 全名、HEAD 或完整对象 id(40 或 64 位十六进制,缩写不解析)。名字既是标签又是分支时取标签。完整对象 id 只在仓库里真有这个提交时才返回。仓库没有这个引用或提交返回 404(GIT_OBJECT_NOT_FOUND),不会返回空值。要比较两个引用用 git/compare。
|
|
12626
|
+
*/
|
|
12627
|
+
export const registryGitResolve = (options) => (options.client ?? client).get({
|
|
12628
|
+
security: [{
|
|
12629
|
+
key: 'registry-bearerAuth',
|
|
12630
|
+
scheme: 'bearer',
|
|
12631
|
+
type: 'http'
|
|
12632
|
+
}],
|
|
12633
|
+
url: '/registry/v1/packages/{package_id}/git/resolve',
|
|
12634
|
+
...options
|
|
12635
|
+
});
|
|
12636
|
+
/**
|
|
12637
|
+
* Compare two refs
|
|
12638
|
+
*
|
|
12639
|
+
* 比较 base 与 head(引用名或完整对象 id):status 是 identical、ahead(head 在 base 之上有新提交)、behind(head 已包含在 base 里)或 diverged(两边各有提交);merge_base 是找到的最近共同祖先;files 是 head 相对 merge_base 改了哪些文件(added、modified、removed、renamed,renamed 带 previous_path),commits 是 head 比 base 多出的提交,最新的在前。Artifacts 无法低成本回答祖先关系,所以这里只沿两边的第一父链各走最多 300 个提交,并在有界读取下比对树:找不到共同祖先时返回 diverged、merge_base 为 null;files 被上限(3000 个文件、1000 次树读取)截断时 truncated 为 true;commits 被截断、或合并提交藏起了被合并分支上的提交时 commits_truncated 为 true。truncated 或 commits_truncated 为 true 时不要把列表当作完整结果。引用不存在返回 404。只读。
|
|
12640
|
+
*/
|
|
12641
|
+
export const registryGitCompare = (options) => (options.client ?? client).get({
|
|
12642
|
+
security: [{
|
|
12643
|
+
key: 'registry-bearerAuth',
|
|
12644
|
+
scheme: 'bearer',
|
|
12645
|
+
type: 'http'
|
|
12646
|
+
}],
|
|
12647
|
+
url: '/registry/v1/packages/{package_id}/git/compare',
|
|
12648
|
+
...options
|
|
12649
|
+
});
|
|
12650
|
+
/**
|
|
12651
|
+
* List a tree recursively
|
|
12652
|
+
*
|
|
12653
|
+
* 读一个提交(或树对象)下的全部条目,递归,每个条目用相对根的完整路径命名,目录和子模块也是条目(子模块不展开)。适合要拿到整个仓库文件清单的场景(例如 DevOps 的构建判断);只想看一个目录用 git/trees/{sha}。相同的子树只读一次。条目上限 20000、树读取上限 1000 次,撞到上限时 truncated 为 true、entries 只是前一部分,不要当作全部。sha 通常来自 git/resolve。仓库里没有这个对象返回 404。只读。
|
|
12654
|
+
*/
|
|
12655
|
+
export const registryGitTreesRecursive = (options) => (options.client ?? client).get({
|
|
12656
|
+
security: [{
|
|
12657
|
+
key: 'registry-bearerAuth',
|
|
12658
|
+
scheme: 'bearer',
|
|
12659
|
+
type: 'http'
|
|
12660
|
+
}],
|
|
12661
|
+
url: '/registry/v1/packages/{package_id}/git/trees/{sha}/recursive',
|
|
12662
|
+
...options
|
|
12663
|
+
});
|
|
12664
|
+
/**
|
|
12665
|
+
* Download a file from a ref
|
|
12666
|
+
*
|
|
12667
|
+
* 按引用读一个文件的原始字节,边读边发(流式),没有大小上限。path 是仓库内相对路径,可以含斜杠;ref 不给就是默认分支。路径不是文件或引用不存在返回 404。
|
|
12668
|
+
*/
|
|
12669
|
+
export const registryGitFilesRetrieve = (options) => (options.client ?? client).get({
|
|
12670
|
+
security: [{
|
|
12671
|
+
key: 'registry-bearerAuth',
|
|
12672
|
+
scheme: 'bearer',
|
|
12673
|
+
type: 'http'
|
|
12674
|
+
}],
|
|
12675
|
+
url: '/registry/v1/packages/{package_id}/git/files/{path}',
|
|
12676
|
+
...options
|
|
12677
|
+
});
|
|
11436
12678
|
/**
|
|
11437
12679
|
* List version contents
|
|
11438
12680
|
*
|
|
@@ -11594,7 +12836,7 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
|
|
|
11594
12836
|
/**
|
|
11595
12837
|
* Create sandbox (v2)
|
|
11596
12838
|
*
|
|
11597
|
-
* 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.
|
|
12839
|
+
* 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.
|
|
11598
12840
|
*/
|
|
11599
12841
|
export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
|
|
11600
12842
|
security: [
|
|
@@ -12690,7 +13932,7 @@ export const shareListPermissions = (options) => (options?.client ?? client).get
|
|
|
12690
13932
|
/**
|
|
12691
13933
|
* Create share
|
|
12692
13934
|
*
|
|
12693
|
-
* Make one
|
|
13935
|
+
* 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.
|
|
12694
13936
|
*/
|
|
12695
13937
|
export const shareCreatePermission = (options) => (options.client ?? client).post({
|
|
12696
13938
|
security: [{
|
|
@@ -14340,7 +15582,7 @@ export const vaultListSecrets = (options) => (options.client ?? client).get({
|
|
|
14340
15582
|
/**
|
|
14341
15583
|
* Create secret
|
|
14342
15584
|
*
|
|
14343
|
-
* Store a manually supplied token in an active vault.
|
|
15585
|
+
* 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.
|
|
14344
15586
|
*/
|
|
14345
15587
|
export const vaultCreateSecret = (options) => (options.client ?? client).post({
|
|
14346
15588
|
security: [{
|
|
@@ -14358,7 +15600,7 @@ export const vaultCreateSecret = (options) => (options.client ?? client).post({
|
|
|
14358
15600
|
/**
|
|
14359
15601
|
* Import secrets
|
|
14360
15602
|
*
|
|
14361
|
-
* 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
|
|
15603
|
+
* 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.
|
|
14362
15604
|
*/
|
|
14363
15605
|
export const vaultImportSecrets = (options) => (options.client ?? client).post({
|
|
14364
15606
|
security: [{
|
|
@@ -14482,7 +15724,7 @@ export const vaultListTemplates = (options) => (options?.client ?? client).get({
|
|
|
14482
15724
|
/**
|
|
14483
15725
|
* Create authorization
|
|
14484
15726
|
*
|
|
14485
|
-
* Connect an OAuth service to an active vault using either an OAuth template or a resource URL. Unlike Anthropic mcp_oauth credential creation, this flow obtains tokens through user consent rather than accepting an auth token bundle; compatible mcp_oauth creation and updates return 501. Open connect_url, then poll praxis.vault.authorizations.retrieve until completed, failed or expired; only completed supplies the resulting secret_id.
|
|
15727
|
+
* Connect an OAuth service to an active vault using either an OAuth template or a resource URL. Unlike Anthropic mcp_oauth credential creation, this flow obtains tokens through user consent rather than accepting an auth token bundle; compatible mcp_oauth creation and updates return 501. Open connect_url, then poll praxis.vault.authorizations.retrieve until completed, failed or expired; only completed supplies the resulting secret_id. The resulting oauth secret serves vault-backed MCP authentication — an Agent session or deployment whose vault_ids include this vault sends it to the MCP server whose URL equals this authorization's resource URL (normalized), and the platform refreshes the token once when that server answers 401.
|
|
14486
15728
|
*/
|
|
14487
15729
|
export const vaultCreateAuthorization = (options) => (options.client ?? client).post({
|
|
14488
15730
|
security: [{
|