@deepraxis/sdk 0.1.0-dev.723d9cb → 0.1.0-dev.7ec6f84

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.
@@ -1,6 +1,24 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  import { formDataBodySerializer } from './client/index.js';
3
3
  import { client } from './client.gen.js';
4
+ /**
5
+ * Apply Agent Version
6
+ *
7
+ * Apply a version from agents.versions.list by its version number. This idempotent operation changes active_version without creating a version; existing sessions and tokens keep their version. The response is the latest saved agent with its current active_version. Missing versions return 404 Agent version not found; archived agents return 409 Agent is archived. For example, POST /agent/v1/agents/{agent_id}/versions/2/apply with no body.
8
+ */
9
+ export const applyAgentVersion = (options) => (options.client ?? client).post({
10
+ security: [{
11
+ key: 'BearerAuth',
12
+ scheme: 'bearer',
13
+ type: 'http'
14
+ }, {
15
+ key: 'ApiKeyAuth',
16
+ name: 'X-API-Key',
17
+ type: 'apiKey'
18
+ }],
19
+ url: '/agent/v1/agents/{agent_id}/versions/{version}/apply',
20
+ ...options
21
+ });
4
22
  /**
5
23
  * Unarchive Agent
6
24
  *
@@ -203,6 +221,85 @@ export const unblockEndUser = (options) => (options.client ?? client).post({
203
221
  url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock',
204
222
  ...options
205
223
  });
224
+ /**
225
+ * Create customer grant code
226
+ *
227
+ * Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.
228
+ *
229
+ * 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_cents, 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"}.
230
+ */
231
+ export const createCustomerGrantCode = (options) => (options.client ?? client).post({
232
+ security: [{
233
+ key: 'BearerAuth',
234
+ scheme: 'bearer',
235
+ type: 'http'
236
+ }, {
237
+ key: 'ApiKeyAuth',
238
+ name: 'X-API-Key',
239
+ type: 'apiKey'
240
+ }],
241
+ url: '/agent/v1/agents/{agent_id}/customers/auth/grant_codes',
242
+ ...options,
243
+ headers: {
244
+ 'Content-Type': 'application/json',
245
+ ...options.headers
246
+ }
247
+ });
248
+ /**
249
+ * Create customer access token
250
+ *
251
+ * 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.
252
+ *
253
+ * 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_…"}.
254
+ */
255
+ export const createCustomerAccessToken = (options) => (options.client ?? client).post({
256
+ url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens',
257
+ ...options,
258
+ headers: {
259
+ 'Content-Type': 'application/json',
260
+ ...options.headers
261
+ }
262
+ });
263
+ /**
264
+ * Renew customer access token
265
+ *
266
+ * Get a fresh customer access token in the same sign-in, authenticated with the current one.
267
+ *
268
+ * 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.
269
+ */
270
+ export const renewCustomerAccessToken = (options) => (options.client ?? client).post({
271
+ security: [{
272
+ key: 'BearerAuth',
273
+ scheme: 'bearer',
274
+ type: 'http'
275
+ }, {
276
+ key: 'ApiKeyAuth',
277
+ name: 'X-API-Key',
278
+ type: 'apiKey'
279
+ }],
280
+ url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/renew',
281
+ ...options
282
+ });
283
+ /**
284
+ * Log out customer
285
+ *
286
+ * Log the customer out by revoking the sign-in of the presented access token and every token issued in it.
287
+ *
288
+ * 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.
289
+ */
290
+ export const deleteCurrentCustomerAccessToken = (options) => (options.client ?? client).delete({
291
+ security: [{
292
+ key: 'BearerAuth',
293
+ scheme: 'bearer',
294
+ type: 'http'
295
+ }, {
296
+ key: 'ApiKeyAuth',
297
+ name: 'X-API-Key',
298
+ type: 'apiKey'
299
+ }],
300
+ url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/current',
301
+ ...options
302
+ });
206
303
  /**
207
304
  * Exchange Hosted Code
208
305
  *
@@ -298,9 +395,9 @@ export const revokeEmbedToken = (options) => (options.client ?? client).post({
298
395
  ...options
299
396
  });
300
397
  /**
301
- * ComputersList
398
+ * List Computers
302
399
  *
303
- * Tenant-owned durable computer resource.
400
+ * List the computers of your organization, archived ones included.
304
401
  *
305
402
  * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
306
403
  */
@@ -318,9 +415,9 @@ export const computersList = (options) => (options?.client ?? client).get({
318
415
  ...options
319
416
  });
320
417
  /**
321
- * ComputersCreate
418
+ * Create Computer
322
419
  *
323
- * Tenant-owned durable computer resource.
420
+ * Create a durable computer: a named machine whose files outlive sessions, for personal agents.
324
421
  *
325
422
  * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
326
423
  */
@@ -362,9 +459,9 @@ export const computersDelete = (options) => (options.client ?? client).delete({
362
459
  ...options
363
460
  });
364
461
  /**
365
- * ComputersRetrieve
462
+ * Get Computer
366
463
  *
367
- * Tenant-owned durable computer resource.
464
+ * Read one computer's status, storage use and sandbox id.
368
465
  *
369
466
  * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
370
467
  */
@@ -382,9 +479,9 @@ export const computersRetrieve = (options) => (options.client ?? client).get({
382
479
  ...options
383
480
  });
384
481
  /**
385
- * ComputersUpdate
482
+ * Update Computer
386
483
  *
387
- * Tenant-owned durable computer resource.
484
+ * Rename a computer.
388
485
  *
389
486
  * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
390
487
  */
@@ -406,9 +503,9 @@ export const computersUpdate = (options) => (options.client ?? client).post({
406
503
  }
407
504
  });
408
505
  /**
409
- * ComputersArchive
506
+ * Archive Computer
410
507
  *
411
- * Tenant-owned durable computer resource.
508
+ * Archive a computer: its files stay readable but new sessions cannot use it.
412
509
  *
413
510
  * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
414
511
  */
@@ -451,9 +548,9 @@ export const computersAttachmentsCreate = (options) => (options.client ?? client
451
548
  }
452
549
  });
453
550
  /**
454
- * ComputersFilesList
551
+ * List Computer Files
455
552
  *
456
- * Tenant-owned durable computer resource.
553
+ * List the entries of one directory on a computer.
457
554
  *
458
555
  * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
459
556
  */
@@ -471,9 +568,9 @@ export const computersFilesList = (options) => (options.client ?? client).get({
471
568
  ...options
472
569
  });
473
570
  /**
474
- * ComputersFilesContent
571
+ * Get Computer File Content
475
572
  *
476
- * Tenant-owned durable computer resource.
573
+ * Download the bytes of one file on a computer, up to 16 MiB, with single-range support.
477
574
  *
478
575
  * Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
479
576
  */
@@ -2461,7 +2558,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
2461
2558
  /**
2462
2559
  * Create agent
2463
2560
  *
2464
- * 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. Unlike Anthropic Managed Agents, nonempty skills attachments return 400; the native skill tool is separate from the skills field. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}.
2561
+ * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}.
2465
2562
  */
2466
2563
  export const agentsCreate = (options) => (options.client ?? client).post({
2467
2564
  security: [{
@@ -2483,7 +2580,7 @@ export const agentsCreate = (options) => (options.client ?? client).post({
2483
2580
  /**
2484
2581
  * Get agent
2485
2582
  *
2486
- * Read one agent by id, at its latest version or, with version, at a specific earlier version. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so it can be sent back unchanged to agents.update. Use agents.versions.list to enumerate versions.
2583
+ * Read one agent by id. The top level is the latest saved version, the editable head whose version you send back for optimistic concurrency; after a save with apply false it differs from active_version, and new sessions use active_version, which you read with version=active. With version, read a specific saved version. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so it can be sent back unchanged to agents.update. Use agents.versions.list to enumerate versions.
2487
2584
  */
2488
2585
  export const agentsRetrieve = (options) => (options.client ?? client).get({
2489
2586
  security: [{
@@ -2501,7 +2598,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
2501
2598
  /**
2502
2599
  * Update agent
2503
2600
  *
2504
- * Update an agent. Send the current version in the body for optimistic concurrency: a stale version returns 409, and an update that changes nothing keeps the version number. Any real change saves a new version; existing sessions keep the version they were created with. 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. Unlike Anthropic Managed Agents, nonempty skills attachments return 400; use the native skill tool for available runtime skills.
2601
+ * Update an agent. Send the current version in the body for optimistic concurrency: a stale version returns 409, and an update that changes nothing keeps the version number. Any real change saves a new version. apply defaults to true and moves active_version to the new version, or to the latest when configuration is unchanged; apply false saves without applying. version_note optionally records up to 280 characters on a newly created version; null means no note, and a note sent when the request changes nothing else returns 400 because a note is stored only with a new 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.
2505
2602
  */
2506
2603
  export const agentsUpdate = (options) => (options.client ?? client).post({
2507
2604
  security: [{
@@ -2541,7 +2638,7 @@ export const agentsArchive = (options) => (options.client ?? client).post({
2541
2638
  /**
2542
2639
  * List agent versions
2543
2640
  *
2544
- * List the saved versions of one agent, in pages of at most 100 (default 20). Each item is the full agent definition at that version, so you can compare what changed between versions. Use agents.retrieve with version to read a single one; agent_id comes from agents.list or agents.create.
2641
+ * List the saved versions of one agent, in pages of at most 100 (default 20). Each item is the full agent definition at that version, so you can compare what changed between versions. active is true only for the item that new sessions use; active_version on each item is the agent-level value, kept for compatibility. Use agents.retrieve with version to read a single one; agent_id comes from agents.list or agents.create.
2545
2642
  */
2546
2643
  export const agentsVersionsList = (options) => (options.client ?? client).get({
2547
2644
  security: [{
@@ -2559,7 +2656,7 @@ export const agentsVersionsList = (options) => (options.client ?? client).get({
2559
2656
  /**
2560
2657
  * List sessions
2561
2658
  *
2562
- * List sessions of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Unlike Anthropic Managed Agents, only limit, page, agent_id and deployment_id are honored; the other filters declared here (agent_version, created_at ranges, memory_store_id, include_archived, order, statuses) are not supported and return 400. Use the returned id with sessions.retrieve or sessions.events.list; pass next_page as page for the next page.
2659
+ * List sessions of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Archived sessions are hidden unless include_archived is true. Unlike Anthropic Managed Agents, only limit, page, agent_id, deployment_id and include_archived are honored; the other filters declared here (agent_version, created_at ranges, memory_store_id, order, statuses) are not supported and return 400. Use the returned id with sessions.retrieve or sessions.events.list; pass next_page as page for the next page.
2563
2660
  */
2564
2661
  export const sessionsList = (options) => (options?.client ?? client).get({
2565
2662
  security: [{
@@ -2577,7 +2674,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
2577
2674
  /**
2578
2675
  * Create session
2579
2676
  *
2580
- * Create a session: one conversation with an agent. Pass agent as an agent id (latest version) or {id, version, type:"agent"}. Unlike Anthropic Managed Agents, omit environment_id to get a light machine, unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, omission returns environment_id=light; 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. Inline agent overrides are not supported. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Omitted budget defaults to USD 20; null removes the limit, and a limit object uses a positive integer string of USD cents. 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.
2677
+ * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive integer string of US cents ("2000" is USD 20.00); omitted budget defaults to "2000" 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.
2581
2678
  */
2582
2679
  export const sessionsCreate = (options) => (options.client ?? client).post({
2583
2680
  security: [{
@@ -2783,7 +2880,7 @@ export const environmentsRetrieve = (options) => (options.client ?? client).get(
2783
2880
  /**
2784
2881
  * Update environment
2785
2882
  *
2786
- * Update the configuration of a tenant-owned cloud environment. Built-in environments are read-only. Package installation and limited networking are applied when a session's sandbox is created. Omitted fields keep their value.
2883
+ * Update the configuration of a tenant-owned cloud environment. Built-in environments are read-only. Package installation and limited networking are applied when a session's sandbox is created. Omitted fields keep their value. A changed config.template must name an available sandbox template, otherwise 400 lists the available ones.
2787
2884
  */
2788
2885
  export const environmentsUpdate = (options) => (options.client ?? client).post({
2789
2886
  security: [{
@@ -2805,7 +2902,7 @@ export const environmentsUpdate = (options) => (options.client ?? client).post({
2805
2902
  /**
2806
2903
  * Archive environment
2807
2904
  *
2808
- * Soft-archive a tenant-owned cloud environment so it can no longer be used to create new sessions. Built-in environments are read-only and cannot be archived.
2905
+ * Soft-archive a tenant-owned cloud environment so it can no longer be used to create new sessions. Built-in environments are read-only and cannot be archived. An environment that the active version of a non-archived agent uses as environment_id returns 409 RESOURCE_IN_USE naming the agents; point them at another environment first.
2809
2906
  */
2810
2907
  export const environmentsArchive = (options) => (options.client ?? client).post({
2811
2908
  security: [{
@@ -2841,7 +2938,7 @@ export const environmentsList = (options) => (options?.client ?? client).get({
2841
2938
  /**
2842
2939
  * Create environment
2843
2940
  *
2844
- * Create a tenant-owned cloud environment: a sandbox recipe (packages to install and networking policy) that sessions can select through environment_id. Package installation happens when the session's sandbox is created; a failed install terminates that session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. Limited networking is applied at sandbox creation. Unlike Anthropic Managed Agents, self_hosted environments, scope and cross-session package caching are not supported.
2941
+ * Create a tenant-owned cloud environment: a sandbox recipe (packages to install and networking policy) that sessions can select through environment_id. Package installation happens when the session's sandbox is created; a failed install terminates that session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. Limited networking is applied at sandbox creation. Unlike Anthropic Managed Agents, self_hosted environments, scope and cross-session package caching are not supported. config.template must name an available sandbox template, otherwise 400 lists the available ones.
2845
2942
  */
2846
2943
  export const environmentsCreate = (options) => (options.client ?? client).post({
2847
2944
  security: [{
@@ -3124,6 +3221,178 @@ export const deploymentsRun = (options) => (options.client ?? client).post({
3124
3221
  url: '/agent/v1/deployments/{deployment_id}/run',
3125
3222
  ...options
3126
3223
  });
3224
+ /**
3225
+ * List skills
3226
+ *
3227
+ * List the skills uploaded to your organization, newest first, in pages of at most 100 (default 20). Use it to find a skill id before reading, versioning or deleting it. Only source=custom has content; source=anthropic returns an empty list. Pass next_page from the response as page to read the next page; a null next_page means the end.
3228
+ */
3229
+ export const skillsList = (options) => (options?.client ?? client).get({
3230
+ security: [{
3231
+ key: 'BearerAuth',
3232
+ scheme: 'bearer',
3233
+ type: 'http'
3234
+ }, {
3235
+ key: 'ApiKeyAuth',
3236
+ name: 'X-API-Key',
3237
+ type: 'apiKey'
3238
+ }],
3239
+ url: '/agent/v1/skills',
3240
+ ...options
3241
+ });
3242
+ /**
3243
+ * Create skill
3244
+ *
3245
+ * Upload a skill: a directory that contains SKILL.md, which the agent reads when it needs the skill. Send multipart/form-data with one files part per file, each file name being its path under one top-level directory (pdf/SKILL.md, pdf/scripts/run.py), and an optional display_name. SKILL.md frontmatter needs a description; name defaults to the directory name and must be one folder name (1-255 characters, no "/", backslash or NUL, not "." or ".."), otherwise the upload returns 400 stating the allowed form. Limits: 8 MB in total, at most 200 files, no .. segments, absolute paths or empty names; a violation returns 400 naming the path or field. The upload creates the skill and its first version, and versions are immutable. Attach the skill to an agent with `skills` on the agent.
3246
+ */
3247
+ export const skillsCreate = (options) => (options.client ?? client).post({
3248
+ ...formDataBodySerializer,
3249
+ security: [{
3250
+ key: 'BearerAuth',
3251
+ scheme: 'bearer',
3252
+ type: 'http'
3253
+ }, {
3254
+ key: 'ApiKeyAuth',
3255
+ name: 'X-API-Key',
3256
+ type: 'apiKey'
3257
+ }],
3258
+ url: '/agent/v1/skills',
3259
+ ...options,
3260
+ headers: {
3261
+ 'Content-Type': null,
3262
+ ...options.headers
3263
+ }
3264
+ });
3265
+ /**
3266
+ * Delete skill
3267
+ *
3268
+ * Delete a skill together with all of its versions. A skill that is still attached to an agent returns 409 RESOURCE_IN_USE naming up to 10 agent ids (the active or latest version of a non-archived agent counts); remove it from those agents first. Returns {id, type: skill_deleted}. skill_id comes from skills.create or skills.list.
3269
+ */
3270
+ export const skillsDelete = (options) => (options.client ?? client).delete({
3271
+ security: [{
3272
+ key: 'BearerAuth',
3273
+ scheme: 'bearer',
3274
+ type: 'http'
3275
+ }, {
3276
+ key: 'ApiKeyAuth',
3277
+ name: 'X-API-Key',
3278
+ type: 'apiKey'
3279
+ }],
3280
+ url: '/agent/v1/skills/{skill_id}',
3281
+ ...options
3282
+ });
3283
+ /**
3284
+ * Get skill
3285
+ *
3286
+ * Read one skill by id: its display_name, source and latest_version_id. skill_id comes from skills.create or skills.list. A skill of another organization, or a deleted one, returns 404 Skill not found.
3287
+ */
3288
+ export const skillsRetrieve = (options) => (options.client ?? client).get({
3289
+ security: [{
3290
+ key: 'BearerAuth',
3291
+ scheme: 'bearer',
3292
+ type: 'http'
3293
+ }, {
3294
+ key: 'ApiKeyAuth',
3295
+ name: 'X-API-Key',
3296
+ type: 'apiKey'
3297
+ }],
3298
+ url: '/agent/v1/skills/{skill_id}',
3299
+ ...options
3300
+ });
3301
+ /**
3302
+ * List skill versions
3303
+ *
3304
+ * List the live versions of one skill, newest first, in pages of at most 100 (default 20). Each item carries the name and description read from the SKILL.md of that version. Pass next_page from the response as page to read the next page; a null next_page means the end.
3305
+ */
3306
+ export const skillsVersionsList = (options) => (options.client ?? client).get({
3307
+ security: [{
3308
+ key: 'BearerAuth',
3309
+ scheme: 'bearer',
3310
+ type: 'http'
3311
+ }, {
3312
+ key: 'ApiKeyAuth',
3313
+ name: 'X-API-Key',
3314
+ type: 'apiKey'
3315
+ }],
3316
+ url: '/agent/v1/skills/{skill_id}/versions',
3317
+ ...options
3318
+ });
3319
+ /**
3320
+ * Create skill version
3321
+ *
3322
+ * Upload a new version of a skill with the same multipart/form-data shape and limits as skills.create (8 MB, 200 files, one top-level directory containing SKILL.md). The SKILL.md name must equal the name of the skill; a different name returns 400. The new version becomes latest_version_id of the skill, and earlier versions stay unchanged because versions are immutable. Attach it to an agent with `skills` on the agent.
3323
+ */
3324
+ export const skillsVersionsCreate = (options) => (options.client ?? client).post({
3325
+ ...formDataBodySerializer,
3326
+ security: [{
3327
+ key: 'BearerAuth',
3328
+ scheme: 'bearer',
3329
+ type: 'http'
3330
+ }, {
3331
+ key: 'ApiKeyAuth',
3332
+ name: 'X-API-Key',
3333
+ type: 'apiKey'
3334
+ }],
3335
+ url: '/agent/v1/skills/{skill_id}/versions',
3336
+ ...options,
3337
+ headers: {
3338
+ 'Content-Type': null,
3339
+ ...options.headers
3340
+ }
3341
+ });
3342
+ /**
3343
+ * Delete skill version
3344
+ *
3345
+ * Soft-delete one version of a skill so it can no longer be read or downloaded; latest_version_id of the skill falls back to the newest remaining version. Returns {id, type: skill_version_deleted}. A skill keeps at least one version: deleting the last remaining version returns 409 SKILL_LAST_VERSION (delete the skill instead), so latest_version_id is never null. A version that a non-archived agent pins returns 409 RESOURCE_IN_USE naming the agents.
3346
+ */
3347
+ export const skillsVersionsDelete = (options) => (options.client ?? client).delete({
3348
+ security: [{
3349
+ key: 'BearerAuth',
3350
+ scheme: 'bearer',
3351
+ type: 'http'
3352
+ }, {
3353
+ key: 'ApiKeyAuth',
3354
+ name: 'X-API-Key',
3355
+ type: 'apiKey'
3356
+ }],
3357
+ url: '/agent/v1/skills/{skill_id}/versions/{version}',
3358
+ ...options
3359
+ });
3360
+ /**
3361
+ * Get skill version
3362
+ *
3363
+ * Read one version of a skill: its name, description and created_at as read from SKILL.md. version is the id returned by skills.versions.create or skills.versions.list. A deleted or unknown version returns 404 Skill version not found.
3364
+ */
3365
+ export const skillsVersionsRetrieve = (options) => (options.client ?? client).get({
3366
+ security: [{
3367
+ key: 'BearerAuth',
3368
+ scheme: 'bearer',
3369
+ type: 'http'
3370
+ }, {
3371
+ key: 'ApiKeyAuth',
3372
+ name: 'X-API-Key',
3373
+ type: 'apiKey'
3374
+ }],
3375
+ url: '/agent/v1/skills/{skill_id}/versions/{version}',
3376
+ ...options
3377
+ });
3378
+ /**
3379
+ * Download skill version
3380
+ *
3381
+ * Download the content of one version as a zip archive (application/zip): the uploaded directory with its top-level folder and every file. version is the id returned by skills.versions.create or skills.versions.list; a deleted version returns 404.
3382
+ */
3383
+ export const skillsVersionsDownload = (options) => (options.client ?? client).get({
3384
+ security: [{
3385
+ key: 'BearerAuth',
3386
+ scheme: 'bearer',
3387
+ type: 'http'
3388
+ }, {
3389
+ key: 'ApiKeyAuth',
3390
+ name: 'X-API-Key',
3391
+ type: 'apiKey'
3392
+ }],
3393
+ url: '/agent/v1/skills/{skill_id}/versions/{version}/content',
3394
+ ...options
3395
+ });
3127
3396
  /**
3128
3397
  * Get account subdomain
3129
3398
  *
@@ -3556,9 +3825,9 @@ export const automationActionsCreate = (options) => (options.client ?? client).p
3556
3825
  }
3557
3826
  });
3558
3827
  /**
3559
- * Get an action
3828
+ * Get an Action with its current input and output JSON Schemas
3560
3829
  *
3561
- * Read the action and its full current implementation. The response ETag is the current revision ID for conditional updates.
3830
+ * Read the Action and its full current implementation, with input and output JSON Schemas at current_revision.input_schema and current_revision.output_schema. To read a built-in Action, use ns=praxis and name=<bare name>, for example name=ocr; invoke it in a script with call("ocr", input). The response ETag is the current revision ID for conditional updates.
3562
3831
  */
3563
3832
  export const automationActionsGet = (options) => (options.client ?? client).get({
3564
3833
  security: [{
@@ -3756,7 +4025,7 @@ export const automationScriptsList = (options) => (options?.client ?? client).ge
3756
4025
  /**
3757
4026
  * Create a script
3758
4027
  *
3759
- * Save a TypeScript script as an editable draft for later reuse; this does not publish or start a run. Choose your own namespace without registering it first; praxis is read-only. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. The draft is a source string with a default-exported function, for example `export default async (input: {name: string}) => ({greeting: "Hello, " + input.name});`. To test it, pass that source and language=ts to praxis.automation.runs.create without publishing. To publish later, use the returned draft.revision as expected_draft_revision.
4028
+ * Save a TypeScript script as an editable draft for later reuse; this does not publish or start a run. 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. The draft is a source string with a default-exported function, for example `export default async (input: {name: string}) => ({greeting: "Hello, " + input.name});`. Scripts provide praxis, call, invoke, console and codemode as module-scope bindings, not on globalThis, with no import needed: praxis.<domain>.<resource>.<method>(...) calls a platform API, call("ocr", input) calls a built-in Action, and invoke("namespace/name", input) starts a child run. Action IDs are strings (bare names for built-ins, namespace/name for your own Actions); praxis.ocr(...) does not exist. To test it, pass that source and language=ts to praxis.automation.runs.create without publishing. To publish later, use the returned draft.revision as expected_draft_revision.
3760
4029
  */
3761
4030
  export const automationScriptsCreate = (options) => (options.client ?? client).post({
3762
4031
  security: [{
@@ -3796,7 +4065,7 @@ export const automationScriptsGet = (options) => (options.client ?? client).get(
3796
4065
  /**
3797
4066
  * Update a script draft
3798
4067
  *
3799
- * Update description, labels or draft with the current draft revision in If-Match. Even metadata-only updates create a new draft revision.
4068
+ * Update description, labels or draft with the current draft revision in If-Match. Even metadata-only updates create a new draft revision. Scripts provide praxis, call, invoke, console and codemode as module-scope bindings, not on globalThis, with no import needed: praxis.<domain>.<resource>.<method>(...) calls a platform API, call("ocr", input) calls a built-in Action, and invoke("namespace/name", input) starts a child run. Action IDs are strings (bare names for built-ins, namespace/name for your own Actions); praxis.ocr(...) does not exist.
3800
4069
  */
3801
4070
  export const automationScriptsPatch = (options) => (options.client ?? client).patch({
3802
4071
  security: [{
@@ -4019,7 +4288,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
4019
4288
  /**
4020
4289
  * Create a workflow
4021
4290
  *
4022
- * Save a YAML workflow as an editable draft without publishing or starting a run. Choose your own namespace without registering it first; praxis is read-only. To test the draft, send its source and language=yaml to praxis.automation.runs.create. 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.
4291
+ * Save a YAML workflow as an editable draft without publishing or starting a run. Choose your own namespace without registering it first; praxis is reserved for built-in Actions. To test the draft, send its source and language=yaml to praxis.automation.runs.create. 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.
4023
4292
  */
4024
4293
  export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
4025
4294
  security: [{
@@ -4349,9 +4618,9 @@ export const automationRunsList = (options) => (options?.client ?? client).get({
4349
4618
  ...options
4350
4619
  });
4351
4620
  /**
4352
- * Create a run
4621
+ * Run a published target or execute draft source
4353
4622
  *
4354
- * Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. New non-deterministic run IDs contain 78 characters (run_ + 10-character base36 millisecond timestamp + 64-character hexadecimal DO ID), compared with 46 for legacy random IDs. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed. Minimal body: {"source":"export default async () => ({ok: true});","language":"ts","wait":10}.
4623
+ * Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 30 s (run-sandbox after 10 min); scripts have a 5 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 7 days. Each run can start at most 100 child runs, with at most 20 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.
4355
4624
  */
4356
4625
  export const automationRunsCreate = (options) => (options.client ?? client).post({
4357
4626
  security: [{