@deepraxis/sdk 0.1.1-dev.201f323 → 0.1.1-dev.218780d
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 +10 -19
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +39 -43
- package/dist/generated/sdk.gen.js +69 -68
- package/dist/generated/types.gen.d.ts +6112 -3256
- package/dist/operations.generated.js +196 -180
- package/dist/resources.generated.d.ts +1080 -271
- package/dist/resources.generated.js +6 -12
- package/package.json +1 -1
|
@@ -358,13 +358,11 @@ export const getAgentAppearance = (options) => (options.client ?? client).get({
|
|
|
358
358
|
...options
|
|
359
359
|
});
|
|
360
360
|
/**
|
|
361
|
-
*
|
|
361
|
+
* Get agent embed policy
|
|
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 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.
|
|
366
364
|
*/
|
|
367
|
-
export const
|
|
365
|
+
export const getAgentEmbedPolicy = (options) => (options.client ?? client).get({
|
|
368
366
|
security: [{
|
|
369
367
|
key: 'BearerAuth',
|
|
370
368
|
scheme: 'bearer',
|
|
@@ -374,56 +372,15 @@ 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
|
-
}
|
|
383
|
-
});
|
|
384
|
-
/**
|
|
385
|
-
* Create customer access token
|
|
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.
|
|
388
|
-
*
|
|
389
|
-
* No Authorization header is required: the grant code or the publishable key is the credential. Agent Kit calls this from the browser, so send the page Origin. With grant_code, the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, used, expired and other-agent codes all return the same 401 GRANT_CODE_INVALID. The sign-in starts now and lasts the code's max_session_seconds. Unlike Shopify, a visitor without an account gets a token too: send publishable_key instead and a new anonymous customer (anon_…) is created, bound to the request Origin, for 7 days. The access token lasts at most two hours and never outlives the sign-in; renew it with access_tokens/renew before expires_at. Both forms share the per-IP minute limit of anonymous issuance (default 20). Example body: {"grant_code":"cgc_…"}.
|
|
390
|
-
*/
|
|
391
|
-
export const createCustomerAccessToken = (options) => (options.client ?? client).post({
|
|
392
|
-
url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens',
|
|
393
|
-
...options,
|
|
394
|
-
headers: {
|
|
395
|
-
'Content-Type': 'application/json',
|
|
396
|
-
...options.headers
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
/**
|
|
400
|
-
* Renew customer access token
|
|
401
|
-
*
|
|
402
|
-
* Get a fresh customer access token in the same sign-in, authenticated with the current one.
|
|
403
|
-
*
|
|
404
|
-
* Send the current customer access token as the Bearer credential, with no body, a few minutes before expires_at. The new token keeps the version, budget, context, metadata and origin binding of the sign-in and lasts at most two hours, never past session_expires_at. Unlike Shopify, renewal does not revoke the presented token: it stays valid until its own expiry, so a reply that is streaming on it is not cut off. When less than 60 seconds of the sign-in remain, renewal returns 401 CUSTOMER_SESSION_EXPIRED; sign the customer in again with a new grant code from your backend. A token that was logged out or merged returns 401 ACCESS_TOKEN_REVOKED.
|
|
405
|
-
*/
|
|
406
|
-
export const renewCustomerAccessToken = (options) => (options.client ?? client).post({
|
|
407
|
-
security: [{
|
|
408
|
-
key: 'BearerAuth',
|
|
409
|
-
scheme: 'bearer',
|
|
410
|
-
type: 'http'
|
|
411
|
-
}, {
|
|
412
|
-
key: 'ApiKeyAuth',
|
|
413
|
-
name: 'X-API-Key',
|
|
414
|
-
type: 'apiKey'
|
|
415
|
-
}],
|
|
416
|
-
url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/renew',
|
|
375
|
+
url: '/agent/v1/agents/{agent_id}/embed_policy',
|
|
417
376
|
...options
|
|
418
377
|
});
|
|
419
378
|
/**
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
* Log the customer out by revoking the sign-in of the presented access token and every token issued in it.
|
|
379
|
+
* Update agent embed policy
|
|
423
380
|
*
|
|
424
|
-
*
|
|
381
|
+
* Change some of a service agent's embed settings. Only the fields you send change: everything you leave out, including the budgets and the token lifetime set in the console, is kept exactly as it was. Send allowed_origins so the pages that load the agent are allowed — an application's URL origin must be in the list before the application can embed the agent, or its Kit chat answers ORIGIN_NOT_ALLOWED. Send allow_localhost while developing on http://localhost, and uploads to open, close or bound file attachments for the embedded end user. 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
382
|
*/
|
|
426
|
-
export const
|
|
383
|
+
export const updateAgentEmbedPolicy = (options) => (options.client ?? client).post({
|
|
427
384
|
security: [{
|
|
428
385
|
key: 'BearerAuth',
|
|
429
386
|
scheme: 'bearer',
|
|
@@ -433,8 +390,12 @@ export const deleteCurrentCustomerAccessToken = (options) => (options.client ??
|
|
|
433
390
|
name: 'X-API-Key',
|
|
434
391
|
type: 'apiKey'
|
|
435
392
|
}],
|
|
436
|
-
url: '/agent/v1/agents/{agent_id}/
|
|
437
|
-
...options
|
|
393
|
+
url: '/agent/v1/agents/{agent_id}/embed_policy',
|
|
394
|
+
...options,
|
|
395
|
+
headers: {
|
|
396
|
+
'Content-Type': 'application/json',
|
|
397
|
+
...options.headers
|
|
398
|
+
}
|
|
438
399
|
});
|
|
439
400
|
/**
|
|
440
401
|
* List Computers
|
|
@@ -777,6 +738,30 @@ export const forkSession = (options) => (options.client ?? client).post({
|
|
|
777
738
|
...options.headers
|
|
778
739
|
}
|
|
779
740
|
});
|
|
741
|
+
/**
|
|
742
|
+
* Update session agent version
|
|
743
|
+
*
|
|
744
|
+
* Move one session to a version of its agent
|
|
745
|
+
*
|
|
746
|
+
* 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.
|
|
747
|
+
*/
|
|
748
|
+
export const updateSessionAgentVersion = (options) => (options.client ?? client).post({
|
|
749
|
+
security: [{
|
|
750
|
+
key: 'BearerAuth',
|
|
751
|
+
scheme: 'bearer',
|
|
752
|
+
type: 'http'
|
|
753
|
+
}, {
|
|
754
|
+
key: 'ApiKeyAuth',
|
|
755
|
+
name: 'X-API-Key',
|
|
756
|
+
type: 'apiKey'
|
|
757
|
+
}],
|
|
758
|
+
url: '/agent/v1/sessions/{session_id}/agent_version',
|
|
759
|
+
...options,
|
|
760
|
+
headers: {
|
|
761
|
+
'Content-Type': 'application/json',
|
|
762
|
+
...options.headers
|
|
763
|
+
}
|
|
764
|
+
});
|
|
780
765
|
/**
|
|
781
766
|
* List Session Artifacts (Extension)
|
|
782
767
|
*
|
|
@@ -3068,7 +3053,7 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
|
|
|
3068
3053
|
/**
|
|
3069
3054
|
* Hire into a position
|
|
3070
3055
|
*
|
|
3071
|
-
* 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"}.
|
|
3056
|
+
* 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"}.
|
|
3072
3057
|
*/
|
|
3073
3058
|
export const hireOrganizationPosition = (options) => (options.client ?? client).post({
|
|
3074
3059
|
security: [{
|
|
@@ -3876,7 +3861,7 @@ export const sessionsDelete = (options) => (options.client ?? client).delete({
|
|
|
3876
3861
|
/**
|
|
3877
3862
|
* Get session
|
|
3878
3863
|
*
|
|
3879
|
-
* 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
|
|
3864
|
+
* 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.
|
|
3880
3865
|
*/
|
|
3881
3866
|
export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
3882
3867
|
security: [{
|
|
@@ -3934,7 +3919,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
|
|
|
3934
3919
|
/**
|
|
3935
3920
|
* Create agent
|
|
3936
3921
|
*
|
|
3937
|
-
* Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; omit computer_id to register a new computer named after the agent without starting an instance, or provide an existing computer_id; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
|
|
3922
|
+
* Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; omit computer_id to register a new computer named after the agent without starting an instance, or provide an existing computer_id; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
|
|
3938
3923
|
*/
|
|
3939
3924
|
export const agentsCreate = (options) => (options.client ?? client).post({
|
|
3940
3925
|
security: [{
|
|
@@ -4050,7 +4035,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
4050
4035
|
/**
|
|
4051
4036
|
* Create session
|
|
4052
4037
|
*
|
|
4053
|
-
* 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 (
|
|
4038
|
+
* 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.
|
|
4054
4039
|
*/
|
|
4055
4040
|
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
4056
4041
|
security: [{
|
|
@@ -7786,7 +7771,7 @@ export const crmLayoutsUpdate = (options) => (options.client ?? client).put({
|
|
|
7786
7771
|
/**
|
|
7787
7772
|
* Create a grant code
|
|
7788
7773
|
*
|
|
7789
|
-
* 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. 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.
|
|
7774
|
+
* 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.
|
|
7790
7775
|
*/
|
|
7791
7776
|
export const customerCreateGrantCode = (options) => (options.client ?? client).post({
|
|
7792
7777
|
security: [{
|
|
@@ -8220,8 +8205,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
|
8220
8205
|
* - `transform` — Position, scale, rotation, opacity, crop, blur.
|
|
8221
8206
|
* - `fit` — contain, cover, fill or none.
|
|
8222
8207
|
* - `blend` — Layer blend mode; null clears.
|
|
8223
|
-
* - `style` — Text styling: font,
|
|
8224
|
-
* - `style.
|
|
8208
|
+
* - `style` — Text styling in Shotstack's rich shape: font, gradient, stroke, shadow, box, border, align, per-word animation.
|
|
8209
|
+
* - `style.align.vertical` — top, middle or bottom; omit it, never null.
|
|
8225
8210
|
* - `playback` — Rate, direction, audio policy, or freeze.
|
|
8226
8211
|
* - `volumeDb` — Audio level in dB; 0 is source level.
|
|
8227
8212
|
* - `gain` — Keyframed audio level in dB.
|
|
@@ -8242,6 +8227,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
|
8242
8227
|
* - `JOIN_CONFLICT` — A join is invalid or blocks this edit.
|
|
8243
8228
|
* - `INVALID_TRANSITION` — Bad transition kind, parameter or length.
|
|
8244
8229
|
* - `INVALID_STYLE` — A style value is out of range.
|
|
8230
|
+
* - `UNSUPPORTED_STYLE_FIELD` — A Shotstack style field this platform cannot render yet.
|
|
8231
|
+
* - `STYLE_LEGACY_FIELDS` — A style written in the old flat shape; it still works.
|
|
8245
8232
|
* - `INVALID_MASK` — A mask definition is malformed.
|
|
8246
8233
|
* - `MASK_IN_USE` — The edit would break a live mask.
|
|
8247
8234
|
* - `TOO_MANY_MASKS` — At most 16 masks per project.
|
|
@@ -10012,7 +9999,7 @@ export const devopsChangesMarkLastSlice = (options) => (options.client ?? client
|
|
|
10012
9999
|
/**
|
|
10013
10000
|
* Open a change's pull request
|
|
10014
10001
|
*
|
|
10015
|
-
* 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. The pull request then appears on the change and runs its merge gate as usual. The id is the branch name and
|
|
10002
|
+
* 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.
|
|
10016
10003
|
*/
|
|
10017
10004
|
export const devopsChangesOpenPullRequest = (options) => (options.client ?? client).post({
|
|
10018
10005
|
security: [{
|
|
@@ -10027,6 +10014,20 @@ export const devopsChangesOpenPullRequest = (options) => (options.client ?? clie
|
|
|
10027
10014
|
...options.headers
|
|
10028
10015
|
}
|
|
10029
10016
|
});
|
|
10017
|
+
/**
|
|
10018
|
+
* Get a change workspace's read-only git credential
|
|
10019
|
+
*
|
|
10020
|
+
* 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).
|
|
10021
|
+
*/
|
|
10022
|
+
export const devopsChangesGitCredential = (options) => (options.client ?? client).post({
|
|
10023
|
+
security: [{
|
|
10024
|
+
key: 'devops-bearerAuth',
|
|
10025
|
+
scheme: 'bearer',
|
|
10026
|
+
type: 'http'
|
|
10027
|
+
}],
|
|
10028
|
+
url: '/devops/v1/changes/{id}:gitCredential',
|
|
10029
|
+
...options
|
|
10030
|
+
});
|
|
10030
10031
|
/**
|
|
10031
10032
|
* List a project's pull requests
|
|
10032
10033
|
*
|
|
@@ -11196,7 +11197,7 @@ export const mediaBatchAssets = (options) => (options.client ?? client).post({
|
|
|
11196
11197
|
/**
|
|
11197
11198
|
* Get job
|
|
11198
11199
|
*
|
|
11199
|
-
* Read
|
|
11200
|
+
* 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.
|
|
11200
11201
|
*/
|
|
11201
11202
|
export const mediaGetJob = (options) => (options.client ?? client).get({
|
|
11202
11203
|
security: [{
|
|
@@ -11288,7 +11289,7 @@ export const mediaGetAssetLineage = (options) => (options.client ?? client).get(
|
|
|
11288
11289
|
/**
|
|
11289
11290
|
* Generate image
|
|
11290
11291
|
*
|
|
11291
|
-
* Generate
|
|
11292
|
+
* 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.
|
|
11292
11293
|
*/
|
|
11293
11294
|
export const mediaGenerateImage = (options) => (options.client ?? client).post({
|
|
11294
11295
|
security: [{
|
|
@@ -11306,7 +11307,7 @@ export const mediaGenerateImage = (options) => (options.client ?? client).post({
|
|
|
11306
11307
|
/**
|
|
11307
11308
|
* Generate video
|
|
11308
11309
|
*
|
|
11309
|
-
* Generate
|
|
11310
|
+
* 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.
|
|
11310
11311
|
*/
|
|
11311
11312
|
export const mediaGenerateVideo = (options) => (options.client ?? client).post({
|
|
11312
11313
|
security: [{
|
|
@@ -11324,7 +11325,7 @@ export const mediaGenerateVideo = (options) => (options.client ?? client).post({
|
|
|
11324
11325
|
/**
|
|
11325
11326
|
* Edit asset
|
|
11326
11327
|
*
|
|
11327
|
-
*
|
|
11328
|
+
* 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, 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) and remove_background; on a recording or a video’s audio, enhance_voice; and to_video, frame and resynthesize on the material each takes. Any other type answers OPERATION_NOT_SUPPORTED, and an edit that does not fit the source’s material answers REFERENCE_TYPE_MISMATCH. Video and audio edits take their model from the platform catalogue (override with operation.model); an edit whose catalogue is empty answers OPERATION_NOT_SUPPORTED, 尚未上架. remove_background on a video makes a portrait matte: output mask is a small black-and-white video to use as a Cut track mask (the choice for compositing), output alpha (the default) a transparent ProRes 4444 file of about 870 MB per 15 s of 1080p, for when the transparent file itself is the deliverable; pick model from types.matting.models of the generation capabilities. output and model on an image source answer INVALID_PARAMS. The new asset records the source in derived_from; assets.lineage reads the whole edit chain. Charges are at the model API prices (video and audio edits per second of input) and appear in the Job’s usage; repeating the same edit of the same source answers the asset already made instead of paying again. The response is 202 with a queued Job whose source_asset_id is the edited asset; poll GET /media/v1/libraries/{library_id}/jobs/{job_id}, give the output’s viewer_url to the person and tell them usage.
|
|
11328
11329
|
*/
|
|
11329
11330
|
export const mediaEditAsset = (options) => (options.client ?? client).post({
|
|
11330
11331
|
security: [{
|
|
@@ -11438,7 +11439,7 @@ export const mediaListUnderstandingsByLibrary = (options) => (options.client ??
|
|
|
11438
11439
|
/**
|
|
11439
11440
|
* List jobs
|
|
11440
11441
|
*
|
|
11441
|
-
* List batch and generation jobs
|
|
11442
|
+
* 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.
|
|
11442
11443
|
*/
|
|
11443
11444
|
export const mediaListJobs = (options) => (options.client ?? client).get({
|
|
11444
11445
|
security: [{
|
|
@@ -11452,7 +11453,7 @@ export const mediaListJobs = (options) => (options.client ?? client).get({
|
|
|
11452
11453
|
/**
|
|
11453
11454
|
* Cancel job
|
|
11454
11455
|
*
|
|
11455
|
-
*
|
|
11456
|
+
* 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.
|
|
11456
11457
|
*/
|
|
11457
11458
|
export const mediaCancelJob = (options) => (options.client ?? client).post({
|
|
11458
11459
|
security: [{
|
|
@@ -12088,7 +12089,7 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
|
|
|
12088
12089
|
/**
|
|
12089
12090
|
* Create sandbox (v2)
|
|
12090
12091
|
*
|
|
12091
|
-
* 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.
|
|
12092
|
+
* 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.
|
|
12092
12093
|
*/
|
|
12093
12094
|
export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
|
|
12094
12095
|
security: [
|
|
@@ -13184,7 +13185,7 @@ export const shareListPermissions = (options) => (options?.client ?? client).get
|
|
|
13184
13185
|
/**
|
|
13185
13186
|
* Create share
|
|
13186
13187
|
*
|
|
13187
|
-
* Make one
|
|
13188
|
+
* 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.
|
|
13188
13189
|
*/
|
|
13189
13190
|
export const shareCreatePermission = (options) => (options.client ?? client).post({
|
|
13190
13191
|
security: [{
|