@deepraxis/sdk 0.1.0 → 0.1.1-dev.1538445

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.
@@ -82,13 +82,13 @@ export const setRunFeedback = (options) => (options.client ?? client).post({
82
82
  }
83
83
  });
84
84
  /**
85
- * List End Users
85
+ * List customers
86
86
  *
87
- * List users who have sessions or token issuance history on a service agent.
87
+ * List the customers of a service agent, identified and anonymous, most recently seen first.
88
88
  *
89
- * Ordered by last_active_at and external_user_id descending. q is a case-sensitive literal prefix, including underscores. limit is 1–100, default 20. Reuse next_page with the same organization, agent, q and limit. Preemptively blocked users without history do not appear. End-user credentials and inaccessible or personal agents return 404.
89
+ * Call this from your backend with your API key, or from the console. Customers follow Shopify Admin customers (list, retrieve, block, sign-out and data deletion of the people who use your storefront), so that experience applies. The list includes customers who signed in but have not started a session yet, and customers recorded under your own ids by embed tokens before customer sign-in existed; an id first seen that way is identified unless it starts with anon_. Unlike Shopify, a customer can be anonymous: a visitor admitted with the publishable key gets an anon_ id, and when it later signs in with anonymous_access_token it is merged: merged_into names the identified customer, and its sessions count toward that customer. Filter with q (a case-sensitive customer id prefix), type (identified or anonymous) and blocked (true or false). limit is 1 to 100, default 20; reuse next_page with the same filters and limit. A customer access token gets 404. Example: GET /agent/v1/agents/agent_example/customers?type=identified&blocked=false&limit=50.
90
90
  */
91
- export const listEndUsers = (options) => (options.client ?? client).get({
91
+ export const listCustomers = (options) => (options.client ?? client).get({
92
92
  security: [{
93
93
  key: 'BearerAuth',
94
94
  scheme: 'bearer',
@@ -98,17 +98,17 @@ export const listEndUsers = (options) => (options.client ?? client).get({
98
98
  name: 'X-API-Key',
99
99
  type: 'apiKey'
100
100
  }],
101
- url: '/agent/v1/agents/{agent_id}/end_users',
101
+ url: '/agent/v1/agents/{agent_id}/customers',
102
102
  ...options
103
103
  });
104
104
  /**
105
- * Delete end-user data
105
+ * Delete customer data
106
106
  *
107
- * Delete a host application's end-user data from one service agent after explicit confirmation.
107
+ * Delete a customer's data from one service agent after explicit confirmation.
108
108
  *
109
- * Develop only. Set confirm to the exact external_user_id; missing or mismatched confirmation returns 400. Returns 202 with a pending task id, not completion. Poll the deletion endpoint. Concurrent requests reuse the unfinished task; retry DELETE after failure to resume it. Tokens are revoked and the user is blocked before a seven-day recovery snapshot is verified. Sessions including child sessions, conversation data, grants and feedback are then removed. A pre-existing block remains; a temporary block is removed on success. Attachment metadata is recorded and File attachments are retained. No charge is introduced by this operation. Example: DELETE /agent/v1/agents/agent_example/end_users/customer_123?confirm=customer_123.
109
+ * Develop only. Set confirm to the exact customer id; a missing or different confirm returns 400 naming the value to send. Returns 202 with a pending task id; poll the deletion endpoint. Concurrent requests reuse the unfinished task; retry DELETE after failure to resume it. Tokens are revoked and the customer is blocked before a seven-day recovery snapshot is verified; sessions including child sessions, conversation data, grants and feedback are then removed. A block that existed before stays; a temporary block is removed on success. File attachments are retained. Example: DELETE /agent/v1/agents/agent_example/customers/cus_8f2a91?confirm=cus_8f2a91.
110
110
  */
111
- export const deleteEndUser = (options) => (options.client ?? client).delete({
111
+ export const deleteCustomer = (options) => (options.client ?? client).delete({
112
112
  security: [{
113
113
  key: 'BearerAuth',
114
114
  scheme: 'bearer',
@@ -118,17 +118,17 @@ export const deleteEndUser = (options) => (options.client ?? client).delete({
118
118
  name: 'X-API-Key',
119
119
  type: 'apiKey'
120
120
  }],
121
- url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}',
121
+ url: '/agent/v1/agents/{agent_id}/customers/{customer_id}',
122
122
  ...options
123
123
  });
124
124
  /**
125
- * Get End User
125
+ * Get customer
126
126
  *
127
- * Inspect one end user and their twenty most recently updated sessions.
127
+ * Retrieve one customer of a service agent with its twenty most recently updated sessions.
128
128
  *
129
- * Use external_user_id from listing or your host application. Users without session or issuance history return 404, including preemptively blocked users. End-user credentials and inaccessible or personal agents return 404.
129
+ * Use the customer id from the list or your own customer_id. An unknown customer returns 404 CUSTOMER_NOT_FOUND, and so does a customer access token. Unlike Shopify, an identified customer's session_count, cost and recent_sessions include the sessions of anonymous customers merged into it; the merged anonymous customer still shows its own sessions and its merged_into.
130
130
  */
131
- export const getEndUser = (options) => (options.client ?? client).get({
131
+ export const getCustomer = (options) => (options.client ?? client).get({
132
132
  security: [{
133
133
  key: 'BearerAuth',
134
134
  scheme: 'bearer',
@@ -138,17 +138,17 @@ export const getEndUser = (options) => (options.client ?? client).get({
138
138
  name: 'X-API-Key',
139
139
  type: 'apiKey'
140
140
  }],
141
- url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}',
141
+ url: '/agent/v1/agents/{agent_id}/customers/{customer_id}',
142
142
  ...options
143
143
  });
144
144
  /**
145
- * Get end-user deletion
145
+ * Get customer deletion
146
146
  *
147
- * Poll the latest deletion task for an end user, including after the user data has been removed.
147
+ * Poll the latest deletion task of a customer, including after its data has been removed.
148
148
  *
149
- * Use the same agent_id and external_user_id as the confirmed DELETE. Status is pending, snapshotting, deleting, done or failed. Counts are empty until a verified snapshot exists. A failed task remains blocked and resumes when DELETE is retried with matching confirmation. snapshot_key is an operator recovery reference retained for seven days, not a public download URL. End-user credentials, inaccessible or personal agents, and missing tasks return 404. This read does not create a task or charge usage.
149
+ * Use the same agent_id and customer id as the confirmed DELETE. Status is pending, snapshotting, deleting, done or failed. Counts are empty until a verified snapshot exists. snapshot_key is an operator recovery reference retained for seven days, not a download URL. A customer access token and a missing task return 404.
150
150
  */
151
- export const getEndUserDeletion = (options) => (options.client ?? client).get({
151
+ export const getCustomerDeletion = (options) => (options.client ?? client).get({
152
152
  security: [{
153
153
  key: 'BearerAuth',
154
154
  scheme: 'bearer',
@@ -158,17 +158,17 @@ export const getEndUserDeletion = (options) => (options.client ?? client).get({
158
158
  name: 'X-API-Key',
159
159
  type: 'apiKey'
160
160
  }],
161
- url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/deletion',
161
+ url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/deletion',
162
162
  ...options
163
163
  });
164
164
  /**
165
- * Revoke End User Tokens
165
+ * Block customer
166
166
  *
167
- * Revoke all issued tokens for an end user and terminate their open embed streams.
167
+ * Block a customer and end every sign-in it has on this agent.
168
168
  *
169
- * Revokes credentials before marking grants revoked. Upstream failure returns 502 without changing grant revocation timestamps. Returns the count of newly revoked grants; a repeat without new grants returns zero. Does not block future issuance. End-user credentials and inaccessible or personal agents return 404.
169
+ * Blocks the customer, then ends every live sign-in the way logout does: each access token is revoked and its open event streams close. From then on grant_codes, access_tokens, renew and new sessions for this customer return CUSTOMER_BLOCKED until you unblock it. Idempotent: a repeat keeps the first block time and revokes whatever is still live. If credential revocation fails the request returns 502 and the customer stays blocked; retry to finish. An unknown customer returns 404 CUSTOMER_NOT_FOUND.
170
170
  */
171
- export const revokeEndUserTokens = (options) => (options.client ?? client).post({
171
+ export const blockCustomer = (options) => (options.client ?? client).post({
172
172
  security: [{
173
173
  key: 'BearerAuth',
174
174
  scheme: 'bearer',
@@ -178,17 +178,17 @@ export const revokeEndUserTokens = (options) => (options.client ?? client).post(
178
178
  name: 'X-API-Key',
179
179
  type: 'apiKey'
180
180
  }],
181
- url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/revoke_tokens',
181
+ url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/block',
182
182
  ...options
183
183
  });
184
184
  /**
185
- * Block End User
185
+ * Unblock customer
186
186
  *
187
- * Block token issuance and session creation, then revoke existing tokens for an end user.
187
+ * Allow a blocked customer to sign in and start sessions again.
188
188
  *
189
- * May block a user before any history exists; timestamps are then null and counts and cost are zero. Requires an embed policy, otherwise returns 409 with setup guidance. Deduplicates the policy blocklist and retains its 1000-user maximum. If revocation returns 502, the user remains blocked; retry to finish revocation. Repeats keep the user blocked and revoke any remaining grants. End-user credentials and inaccessible or personal agents return 404.
189
+ * Idempotent. Access tokens revoked while the customer was blocked stay revoked; sign the customer in again with a new grant code. An unknown customer returns 404 CUSTOMER_NOT_FOUND.
190
190
  */
191
- export const blockEndUser = (options) => (options.client ?? client).post({
191
+ export const unblockCustomer = (options) => (options.client ?? client).post({
192
192
  security: [{
193
193
  key: 'BearerAuth',
194
194
  scheme: 'bearer',
@@ -198,17 +198,17 @@ export const blockEndUser = (options) => (options.client ?? client).post({
198
198
  name: 'X-API-Key',
199
199
  type: 'apiKey'
200
200
  }],
201
- url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/block',
201
+ url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/unblock',
202
202
  ...options
203
203
  });
204
204
  /**
205
- * Unblock End User
205
+ * Revoke customer tokens
206
206
  *
207
- * Allow an end user to receive new tokens and create new sessions again.
207
+ * Sign a customer out everywhere without blocking it.
208
208
  *
209
- * Removes the user from the blocklist; previously revoked tokens stay revoked. Idempotent. Requires an embed policy, otherwise returns 409 with setup guidance. Returns null timestamps and zero counts and cost when no session or issuance history exists. End-user credentials and inaccessible or personal agents return 404.
209
+ * Ends every live sign-in of the customer, revoking each access token and closing its open event streams; the customer can sign in again right away. Returns the number of access tokens this request revoked; a repeat returns 0. Credential revocation failure returns 502; retry to finish. An unknown customer returns 404 CUSTOMER_NOT_FOUND.
210
210
  */
211
- export const unblockEndUser = (options) => (options.client ?? client).post({
211
+ export const revokeCustomerTokens = (options) => (options.client ?? client).post({
212
212
  security: [{
213
213
  key: 'BearerAuth',
214
214
  scheme: 'bearer',
@@ -218,18 +218,47 @@ export const unblockEndUser = (options) => (options.client ?? client).post({
218
218
  name: 'X-API-Key',
219
219
  type: 'apiKey'
220
220
  }],
221
- url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock',
221
+ url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/revoke_tokens',
222
222
  ...options
223
223
  });
224
224
  /**
225
- * Exchange Hosted Code
225
+ * Get agent appearance
226
226
  *
227
- * Redeem a single-use hosted link credential for an end-user token.
227
+ * Read the saved chat appearance of a service agent.
228
228
  *
229
- * Read code from the c fragment parameter of hosted_url returned by embed token creation with hosted true, then remove the fragment before exchanging. No Authorization header is required; the code authenticates this request. The code expires after 60 seconds and is consumed atomically on exchange, so concurrent attempts have only one winner. Expired, used and unknown codes return the same 404 body. Keep the token in memory and return to the host website for a fresh link when it expires; exchange cannot refresh it. Requests are IP limited per minute using the anonymous entrypoint budget (default 20). Example body is {"code":"<code from hosted_url>"}.
229
+ * Agent Kit calls this from the page with a customer access token of this agent; your API key and console members can read it too. A token of another agent returns 404. The body is the same as the embed appearance read; a missing appearance returns the agent's own name and avatar only. Responses are private and cacheable for 60 seconds.
230
230
  */
231
- export const exchangeEmbedCode = (options) => (options.client ?? client).post({
232
- url: '/agent/v1/embed/exchange',
231
+ export const getAgentAppearance = (options) => (options.client ?? client).get({
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}/appearance',
242
+ ...options
243
+ });
244
+ /**
245
+ * Create customer grant code
246
+ *
247
+ * 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.
248
+ *
249
+ * 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"}.
250
+ */
251
+ export const createCustomerGrantCode = (options) => (options.client ?? client).post({
252
+ security: [{
253
+ key: 'BearerAuth',
254
+ scheme: 'bearer',
255
+ type: 'http'
256
+ }, {
257
+ key: 'ApiKeyAuth',
258
+ name: 'X-API-Key',
259
+ type: 'apiKey'
260
+ }],
261
+ url: '/agent/v1/agents/{agent_id}/customers/auth/grant_codes',
233
262
  ...options,
234
263
  headers: {
235
264
  'Content-Type': 'application/json',
@@ -237,14 +266,14 @@ export const exchangeEmbedCode = (options) => (options.client ?? client).post({
237
266
  }
238
267
  });
239
268
  /**
240
- * Issue anonymous visitor token
269
+ * Create customer access token
241
270
  *
242
- * Obtain a short-lived embedding token for a visitor without an account using the agent owner's publishable key.
271
+ * 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.
243
272
  *
244
- * No Authorization header is required. Send the browser Origin allowed by the agent policy. Save a returned visitor_secret and reuse it for refreshes; only new visitors receive one. Unknown secrets create new visitors, and extra fields including visitor_id return 400. Issuance uses the key creator's organization membership, the key session budget and the smaller of the policy TTL maximum and 3600 seconds. IP requests are limited per minute (default 20); UTC daily session and spending caps are checked across the key's primary sessions created that day. Token issuance itself does not create a session or charge usage; subsequent sessions bill the host organization. Example body: {"publishable_key":"pk_praxis_example"}.
273
+ * 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_…"}.
245
274
  */
246
- export const createAnonymousEmbedToken = (options) => (options.client ?? client).post({
247
- url: '/agent/v1/embed_tokens/anonymous',
275
+ export const createCustomerAccessToken = (options) => (options.client ?? client).post({
276
+ url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens',
248
277
  ...options,
249
278
  headers: {
250
279
  'Content-Type': 'application/json',
@@ -252,13 +281,13 @@ export const createAnonymousEmbedToken = (options) => (options.client ?? client)
252
281
  }
253
282
  });
254
283
  /**
255
- * List Embed Tokens
284
+ * Renew customer access token
256
285
  *
257
- * List embed token issuance records in your organization.
286
+ * Get a fresh customer access token in the same sign-in, authenticated with the current one.
258
287
  *
259
- * Includes expired and revoked grants; returns neither token nor token_id. Sorts by created_at, then grant id, both descending. agent_id accepts agent_ or agt_; external_user_id matches exactly. limit is 1–100 (default 20). Reuse next_page as page with the same filters and organization; a mismatch returns 400. End-user credentials return 404.
288
+ * 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.
260
289
  */
261
- export const listEmbedTokens = (options) => (options?.client ?? client).get({
290
+ export const renewCustomerAccessToken = (options) => (options.client ?? client).post({
262
291
  security: [{
263
292
  key: 'BearerAuth',
264
293
  scheme: 'bearer',
@@ -268,41 +297,17 @@ export const listEmbedTokens = (options) => (options?.client ?? client).get({
268
297
  name: 'X-API-Key',
269
298
  type: 'apiKey'
270
299
  }],
271
- url: '/agent/v1/embed_tokens',
300
+ url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/renew',
272
301
  ...options
273
302
  });
274
303
  /**
275
- * Create Embed Token
276
- *
277
- * Issue a short-lived credential on your backend for an end user of a service agent.
278
- *
279
- * Requires an active service agent in your organization with an embed policy. Pins the requested version or the latest version and snapshots the policy environment, vaults and resources; metadata comes from the request. Blocked users cannot receive tokens. Keep your API key on the backend and pass only the returned token to the frontend. Every call creates a new grant; issuance is not idempotent. Set hosted to true to also receive hosted_url; redirect the user there within 60 seconds. The agent must have an identity_number. The URL fragment contains a single-use exchange credential, not the token. Omit hosted or set false for ordinary token issuance.
280
- */
281
- export const createEmbedToken = (options) => (options.client ?? client).post({
282
- security: [{
283
- key: 'BearerAuth',
284
- scheme: 'bearer',
285
- type: 'http'
286
- }, {
287
- key: 'ApiKeyAuth',
288
- name: 'X-API-Key',
289
- type: 'apiKey'
290
- }],
291
- url: '/agent/v1/embed_tokens',
292
- ...options,
293
- headers: {
294
- 'Content-Type': 'application/json',
295
- ...options.headers
296
- }
297
- });
298
- /**
299
- * Revoke Embed Token
304
+ * Log out customer
300
305
  *
301
- * Revoke an embed token and close its open event streams.
306
+ * Log the customer out by revoking the sign-in of the presented access token and every token issued in it.
302
307
  *
303
- * Use an id from issuance or listing. Revokes the credential before setting revoked_at; upstream failure leaves it unset. Streams receive session.error (EMBED_TOKEN_REVOKED), then close immediately; other credentials are unaffected. Idempotent; repeats return the original revoked record without another revocation or audit. Missing or foreign grants and end-user credentials return 404.
308
+ * 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.
304
309
  */
305
- export const revokeEmbedToken = (options) => (options.client ?? client).post({
310
+ export const deleteCurrentCustomerAccessToken = (options) => (options.client ?? client).delete({
306
311
  security: [{
307
312
  key: 'BearerAuth',
308
313
  scheme: 'bearer',
@@ -312,13 +317,13 @@ export const revokeEmbedToken = (options) => (options.client ?? client).post({
312
317
  name: 'X-API-Key',
313
318
  type: 'apiKey'
314
319
  }],
315
- url: '/agent/v1/embed_tokens/{id}/revoke',
320
+ url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/current',
316
321
  ...options
317
322
  });
318
323
  /**
319
- * ComputersList
324
+ * List Computers
320
325
  *
321
- * Tenant-owned durable computer resource.
326
+ * List the computers of your organization, archived ones included.
322
327
  *
323
328
  * 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.
324
329
  */
@@ -336,9 +341,9 @@ export const computersList = (options) => (options?.client ?? client).get({
336
341
  ...options
337
342
  });
338
343
  /**
339
- * ComputersCreate
344
+ * Create Computer
340
345
  *
341
- * Tenant-owned durable computer resource.
346
+ * Create a durable computer: a named machine whose files outlive sessions, for personal agents.
342
347
  *
343
348
  * 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.
344
349
  */
@@ -380,9 +385,9 @@ export const computersDelete = (options) => (options.client ?? client).delete({
380
385
  ...options
381
386
  });
382
387
  /**
383
- * ComputersRetrieve
388
+ * Get Computer
384
389
  *
385
- * Tenant-owned durable computer resource.
390
+ * Read one computer's status, storage use and sandbox id.
386
391
  *
387
392
  * 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.
388
393
  */
@@ -400,9 +405,9 @@ export const computersRetrieve = (options) => (options.client ?? client).get({
400
405
  ...options
401
406
  });
402
407
  /**
403
- * ComputersUpdate
408
+ * Update Computer
404
409
  *
405
- * Tenant-owned durable computer resource.
410
+ * Rename a computer.
406
411
  *
407
412
  * 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.
408
413
  */
@@ -424,9 +429,9 @@ export const computersUpdate = (options) => (options.client ?? client).post({
424
429
  }
425
430
  });
426
431
  /**
427
- * ComputersArchive
432
+ * Archive Computer
428
433
  *
429
- * Tenant-owned durable computer resource.
434
+ * Archive a computer: its files stay readable but new sessions cannot use it.
430
435
  *
431
436
  * 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.
432
437
  */
@@ -469,9 +474,9 @@ export const computersAttachmentsCreate = (options) => (options.client ?? client
469
474
  }
470
475
  });
471
476
  /**
472
- * ComputersFilesList
477
+ * List Computer Files
473
478
  *
474
- * Tenant-owned durable computer resource.
479
+ * List the entries of one directory on a computer.
475
480
  *
476
481
  * 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.
477
482
  */
@@ -489,9 +494,9 @@ export const computersFilesList = (options) => (options.client ?? client).get({
489
494
  ...options
490
495
  });
491
496
  /**
492
- * ComputersFilesContent
497
+ * Get Computer File Content
493
498
  *
494
- * Tenant-owned durable computer resource.
499
+ * Download the bytes of one file on a computer, up to 16 MiB, with single-range support.
495
500
  *
496
501
  * 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.
497
502
  */
@@ -760,20 +765,6 @@ export const listSessionCompactions = (options) => (options.client ?? client).ge
760
765
  url: '/agent/v1/sessions/{session_id}/compactions',
761
766
  ...options
762
767
  });
763
- /**
764
- * Read chat appearance
765
- *
766
- * Load saved appearance for an iframe or Hosted chat page. Supply an end-user embed token as Bearer authorization, or a console-issued publishable key in Praxis-Publishable-Key before anonymous token issuance. The credential selects the agent; identity_number and agent_id query parameters are rejected with 400. Missing appearance returns an empty object. Kit option names retain camelCase. Responses are private and cacheable for 60 seconds. Component hosts configure Kit in their own code instead.
767
- */
768
- export const getEmbedAppearance = (options) => (options?.client ?? client).get({
769
- security: [{
770
- key: 'BearerAuth',
771
- scheme: 'bearer',
772
- type: 'http'
773
- }, { name: 'Praxis-Publishable-Key', type: 'apiKey' }],
774
- url: '/agent/v1/embed/appearance',
775
- ...options
776
- });
777
768
  /**
778
769
  * Generate speech
779
770
  *
@@ -2479,7 +2470,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
2479
2470
  /**
2480
2471
  * Create agent
2481
2472
  *
2482
- * 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"}]}.
2473
+ * 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"}]}.
2483
2474
  */
2484
2475
  export const agentsCreate = (options) => (options.client ?? client).post({
2485
2476
  security: [{
@@ -2501,7 +2492,7 @@ export const agentsCreate = (options) => (options.client ?? client).post({
2501
2492
  /**
2502
2493
  * Get agent
2503
2494
  *
2504
- * 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.
2495
+ * 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.
2505
2496
  */
2506
2497
  export const agentsRetrieve = (options) => (options.client ?? client).get({
2507
2498
  security: [{
@@ -2519,7 +2510,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
2519
2510
  /**
2520
2511
  * Update agent
2521
2512
  *
2522
- * 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. 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. Unlike Anthropic Managed Agents, nonempty skills attachments return 400; use the native skill tool for available runtime skills.
2513
+ * 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.
2523
2514
  */
2524
2515
  export const agentsUpdate = (options) => (options.client ?? client).post({
2525
2516
  security: [{
@@ -2559,7 +2550,7 @@ export const agentsArchive = (options) => (options.client ?? client).post({
2559
2550
  /**
2560
2551
  * List agent versions
2561
2552
  *
2562
- * 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.
2553
+ * 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.
2563
2554
  */
2564
2555
  export const agentsVersionsList = (options) => (options.client ?? client).get({
2565
2556
  security: [{
@@ -2577,7 +2568,7 @@ export const agentsVersionsList = (options) => (options.client ?? client).get({
2577
2568
  /**
2578
2569
  * List sessions
2579
2570
  *
2580
- * 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.
2571
+ * 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.
2581
2572
  */
2582
2573
  export const sessionsList = (options) => (options?.client ?? client).get({
2583
2574
  security: [{
@@ -2595,7 +2586,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
2595
2586
  /**
2596
2587
  * Create session
2597
2588
  *
2598
- * Create a session: one conversation with an agent. Pass agent as an agent id (active_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.
2589
+ * 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.
2599
2590
  */
2600
2591
  export const sessionsCreate = (options) => (options.client ?? client).post({
2601
2592
  security: [{
@@ -2801,7 +2792,7 @@ export const environmentsRetrieve = (options) => (options.client ?? client).get(
2801
2792
  /**
2802
2793
  * Update environment
2803
2794
  *
2804
- * 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.
2795
+ * 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.
2805
2796
  */
2806
2797
  export const environmentsUpdate = (options) => (options.client ?? client).post({
2807
2798
  security: [{
@@ -2823,7 +2814,7 @@ export const environmentsUpdate = (options) => (options.client ?? client).post({
2823
2814
  /**
2824
2815
  * Archive environment
2825
2816
  *
2826
- * 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.
2817
+ * 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.
2827
2818
  */
2828
2819
  export const environmentsArchive = (options) => (options.client ?? client).post({
2829
2820
  security: [{
@@ -2859,7 +2850,7 @@ export const environmentsList = (options) => (options?.client ?? client).get({
2859
2850
  /**
2860
2851
  * Create environment
2861
2852
  *
2862
- * 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.
2853
+ * 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.
2863
2854
  */
2864
2855
  export const environmentsCreate = (options) => (options.client ?? client).post({
2865
2856
  security: [{
@@ -3163,7 +3154,7 @@ export const skillsList = (options) => (options?.client ?? client).get({
3163
3154
  /**
3164
3155
  * Create skill
3165
3156
  *
3166
- * 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. 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.
3157
+ * 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.
3167
3158
  */
3168
3159
  export const skillsCreate = (options) => (options.client ?? client).post({
3169
3160
  ...formDataBodySerializer,
@@ -3186,7 +3177,7 @@ export const skillsCreate = (options) => (options.client ?? client).post({
3186
3177
  /**
3187
3178
  * Delete skill
3188
3179
  *
3189
- * Delete a skill that has no live versions. A skill that still has versions returns 409 Delete all versions first; remove each with skills.versions.delete, then call this. Returns {id, type: skill_deleted}. skill_id comes from skills.create or skills.list.
3180
+ * 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.
3190
3181
  */
3191
3182
  export const skillsDelete = (options) => (options.client ?? client).delete({
3192
3183
  security: [{
@@ -3263,7 +3254,7 @@ export const skillsVersionsCreate = (options) => (options.client ?? client).post
3263
3254
  /**
3264
3255
  * Delete skill version
3265
3256
  *
3266
- * 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 can be deleted only after all of its versions are deleted.
3257
+ * 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.
3267
3258
  */
3268
3259
  export const skillsVersionsDelete = (options) => (options.client ?? client).delete({
3269
3260
  security: [{