@deepraxis/sdk 0.1.1-dev.d25d171 → 0.1.1-dev.ea219e1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/METHODS.md +35 -47
- package/README.md +1 -1
- package/dist/automation.d.ts +7 -0
- package/dist/core/client.d.ts +5 -1
- package/dist/core/client.js +10 -0
- package/dist/core/transport.js +1 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +99 -95
- package/dist/generated/sdk.gen.js +190 -163
- package/dist/generated/types.gen.d.ts +2807 -2238
- package/dist/helpers/application-build.d.ts +10 -0
- package/dist/helpers/application-build.js +98 -0
- package/dist/helpers/application-publish.d.ts +8 -0
- package/dist/helpers/application-publish.js +26 -9
- package/dist/helpers/browser-connect.d.ts +78 -0
- package/dist/helpers/browser-connect.js +161 -0
- package/dist/helpers/browser-decisions.d.ts +44 -0
- package/dist/helpers/browser-decisions.js +84 -0
- package/dist/helpers/browser-documentation.d.ts +2 -0
- package/dist/helpers/browser-documentation.js +47 -0
- package/dist/helpers/file-upload.d.ts +2 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/operations.generated.d.ts +345 -298
- package/dist/operations.generated.js +412 -333
- package/dist/resources.generated.d.ts +230 -367
- package/dist/resources.generated.js +19 -25
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { client } from './client.gen.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Apply Agent Version
|
|
6
6
|
*
|
|
7
|
-
* Apply a version from agents.versions.list
|
|
7
|
+
* Apply a saved version from agents.versions.list for new sessions and newly issued tokens, without creating a version. Existing sessions and tokens retain their version. The response contains the effective configuration with version equal to active_version and latest_version naming the newest saved version. Missing versions return 404; archived agents return 409. For example, POST /agent/v1/agents/{agent_id}/versions/2/apply with no body.
|
|
8
8
|
*/
|
|
9
9
|
export const applyAgentVersion = (options) => (options.client ?? client).post({
|
|
10
10
|
security: [{
|
|
@@ -82,13 +82,13 @@ export const setRunFeedback = (options) => (options.client ?? client).post({
|
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
/**
|
|
85
|
-
* List
|
|
85
|
+
* List customers
|
|
86
86
|
*
|
|
87
|
-
* List
|
|
87
|
+
* List the customers of a service agent, identified and anonymous, most recently seen first.
|
|
88
88
|
*
|
|
89
|
-
*
|
|
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
|
|
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}/
|
|
101
|
+
url: '/agent/v1/agents/{agent_id}/customers',
|
|
102
102
|
...options
|
|
103
103
|
});
|
|
104
104
|
/**
|
|
105
|
-
* Delete
|
|
105
|
+
* Delete customer data
|
|
106
106
|
*
|
|
107
|
-
* Delete a
|
|
107
|
+
* Delete a customer's data from one service agent after explicit confirmation.
|
|
108
108
|
*
|
|
109
|
-
* Develop only. Set confirm to the exact
|
|
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
|
|
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}/
|
|
121
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}',
|
|
122
122
|
...options
|
|
123
123
|
});
|
|
124
124
|
/**
|
|
125
|
-
* Get
|
|
125
|
+
* Get customer
|
|
126
126
|
*
|
|
127
|
-
*
|
|
127
|
+
* Retrieve one customer of a service agent with its twenty most recently updated sessions.
|
|
128
128
|
*
|
|
129
|
-
* Use
|
|
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
|
|
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}/
|
|
141
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}',
|
|
142
142
|
...options
|
|
143
143
|
});
|
|
144
144
|
/**
|
|
145
|
-
* Get
|
|
145
|
+
* Get customer deletion
|
|
146
146
|
*
|
|
147
|
-
* Poll the latest deletion task
|
|
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
|
|
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
|
|
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}/
|
|
161
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/deletion',
|
|
162
162
|
...options
|
|
163
163
|
});
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
165
|
+
* Block customer
|
|
166
166
|
*
|
|
167
|
-
*
|
|
167
|
+
* Block a customer and end every sign-in it has on this agent.
|
|
168
168
|
*
|
|
169
|
-
*
|
|
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
|
|
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}/
|
|
181
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/block',
|
|
182
182
|
...options
|
|
183
183
|
});
|
|
184
184
|
/**
|
|
185
|
-
*
|
|
185
|
+
* Unblock customer
|
|
186
186
|
*
|
|
187
|
-
*
|
|
187
|
+
* Allow a blocked customer to sign in and start sessions again.
|
|
188
188
|
*
|
|
189
|
-
*
|
|
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
|
|
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}/
|
|
201
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/unblock',
|
|
202
202
|
...options
|
|
203
203
|
});
|
|
204
204
|
/**
|
|
205
|
-
*
|
|
205
|
+
* Revoke customer tokens
|
|
206
206
|
*
|
|
207
|
-
*
|
|
207
|
+
* Sign a customer out everywhere without blocking it.
|
|
208
208
|
*
|
|
209
|
-
*
|
|
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
|
|
211
|
+
export const revokeCustomerTokens = (options) => (options.client ?? client).post({
|
|
212
212
|
security: [{
|
|
213
213
|
key: 'BearerAuth',
|
|
214
214
|
scheme: 'bearer',
|
|
@@ -218,7 +218,27 @@ 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}/
|
|
221
|
+
url: '/agent/v1/agents/{agent_id}/customers/{customer_id}/revoke_tokens',
|
|
222
|
+
...options
|
|
223
|
+
});
|
|
224
|
+
/**
|
|
225
|
+
* Get agent appearance
|
|
226
|
+
*
|
|
227
|
+
* Read the saved chat appearance of a service agent.
|
|
228
|
+
*
|
|
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
|
+
*/
|
|
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',
|
|
222
242
|
...options
|
|
223
243
|
});
|
|
224
244
|
/**
|
|
@@ -300,100 +320,6 @@ export const deleteCurrentCustomerAccessToken = (options) => (options.client ??
|
|
|
300
320
|
url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/current',
|
|
301
321
|
...options
|
|
302
322
|
});
|
|
303
|
-
/**
|
|
304
|
-
* Exchange Hosted Code
|
|
305
|
-
*
|
|
306
|
-
* Redeem a single-use hosted link credential for an end-user token.
|
|
307
|
-
*
|
|
308
|
-
* 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>"}.
|
|
309
|
-
*/
|
|
310
|
-
export const exchangeEmbedCode = (options) => (options.client ?? client).post({
|
|
311
|
-
url: '/agent/v1/embed/exchange',
|
|
312
|
-
...options,
|
|
313
|
-
headers: {
|
|
314
|
-
'Content-Type': 'application/json',
|
|
315
|
-
...options.headers
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
/**
|
|
319
|
-
* Issue anonymous visitor token
|
|
320
|
-
*
|
|
321
|
-
* Obtain a short-lived embedding token for a visitor without an account using the agent owner's publishable key.
|
|
322
|
-
*
|
|
323
|
-
* 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"}.
|
|
324
|
-
*/
|
|
325
|
-
export const createAnonymousEmbedToken = (options) => (options.client ?? client).post({
|
|
326
|
-
url: '/agent/v1/embed_tokens/anonymous',
|
|
327
|
-
...options,
|
|
328
|
-
headers: {
|
|
329
|
-
'Content-Type': 'application/json',
|
|
330
|
-
...options.headers
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
/**
|
|
334
|
-
* List Embed Tokens
|
|
335
|
-
*
|
|
336
|
-
* List embed token issuance records in your organization.
|
|
337
|
-
*
|
|
338
|
-
* 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.
|
|
339
|
-
*/
|
|
340
|
-
export const listEmbedTokens = (options) => (options?.client ?? client).get({
|
|
341
|
-
security: [{
|
|
342
|
-
key: 'BearerAuth',
|
|
343
|
-
scheme: 'bearer',
|
|
344
|
-
type: 'http'
|
|
345
|
-
}, {
|
|
346
|
-
key: 'ApiKeyAuth',
|
|
347
|
-
name: 'X-API-Key',
|
|
348
|
-
type: 'apiKey'
|
|
349
|
-
}],
|
|
350
|
-
url: '/agent/v1/embed_tokens',
|
|
351
|
-
...options
|
|
352
|
-
});
|
|
353
|
-
/**
|
|
354
|
-
* Create Embed Token
|
|
355
|
-
*
|
|
356
|
-
* Issue a short-lived credential on your backend for an end user of a service agent.
|
|
357
|
-
*
|
|
358
|
-
* 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.
|
|
359
|
-
*/
|
|
360
|
-
export const createEmbedToken = (options) => (options.client ?? client).post({
|
|
361
|
-
security: [{
|
|
362
|
-
key: 'BearerAuth',
|
|
363
|
-
scheme: 'bearer',
|
|
364
|
-
type: 'http'
|
|
365
|
-
}, {
|
|
366
|
-
key: 'ApiKeyAuth',
|
|
367
|
-
name: 'X-API-Key',
|
|
368
|
-
type: 'apiKey'
|
|
369
|
-
}],
|
|
370
|
-
url: '/agent/v1/embed_tokens',
|
|
371
|
-
...options,
|
|
372
|
-
headers: {
|
|
373
|
-
'Content-Type': 'application/json',
|
|
374
|
-
...options.headers
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
/**
|
|
378
|
-
* Revoke Embed Token
|
|
379
|
-
*
|
|
380
|
-
* Revoke an embed token and close its open event streams.
|
|
381
|
-
*
|
|
382
|
-
* 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.
|
|
383
|
-
*/
|
|
384
|
-
export const revokeEmbedToken = (options) => (options.client ?? client).post({
|
|
385
|
-
security: [{
|
|
386
|
-
key: 'BearerAuth',
|
|
387
|
-
scheme: 'bearer',
|
|
388
|
-
type: 'http'
|
|
389
|
-
}, {
|
|
390
|
-
key: 'ApiKeyAuth',
|
|
391
|
-
name: 'X-API-Key',
|
|
392
|
-
type: 'apiKey'
|
|
393
|
-
}],
|
|
394
|
-
url: '/agent/v1/embed_tokens/{id}/revoke',
|
|
395
|
-
...options
|
|
396
|
-
});
|
|
397
323
|
/**
|
|
398
324
|
* List Computers
|
|
399
325
|
*
|
|
@@ -417,7 +343,7 @@ export const computersList = (options) => (options?.client ?? client).get({
|
|
|
417
343
|
/**
|
|
418
344
|
* Create Computer
|
|
419
345
|
*
|
|
420
|
-
* Create a durable computer: a named machine whose files outlive sessions, for personal agents.
|
|
346
|
+
* Create a durable computer: a named machine whose files outlive sessions, for general and personal agents.
|
|
421
347
|
*
|
|
422
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.
|
|
423
349
|
*/
|
|
@@ -780,7 +706,7 @@ export const stopSessionBackgroundTask = (options) => (options.client ?? client)
|
|
|
780
706
|
*
|
|
781
707
|
* Request session context compaction and retrieve an operation receipt.
|
|
782
708
|
*
|
|
783
|
-
* Available only on /agent/v1. The body may be omitted or {}. Optional instructions must be a string and is forwarded unchanged. Idempotency-Key is forwarded unchanged; a UUID is generated when absent. Returns { type: session_compaction, id, status, reason? }, where id is the operation ID. queued/running return 202; skipped/succeeded/failed return 200. Non-string instructions return 400 invalid_request_error. Missing or inaccessible managed sessions return 404 not_found_error.
|
|
709
|
+
* Available only on /agent/v1. The body may be omitted or {}. Optional instructions must be a string and is forwarded unchanged. Idempotency-Key is forwarded unchanged; a UUID is generated when absent. Returns { type: session_compaction, id, status, reason? }, where id is the operation ID. queued/running return 202; skipped/succeeded/failed/cancelled return 200. Non-string instructions return 400 invalid_request_error. Missing or inaccessible managed sessions return 404 not_found_error.
|
|
784
710
|
*/
|
|
785
711
|
export const compactSession = (options) => (options.client ?? client).post({
|
|
786
712
|
security: [{
|
|
@@ -824,7 +750,7 @@ export const getSessionCompaction = (options) => (options.client ?? client).get(
|
|
|
824
750
|
*
|
|
825
751
|
* Read session compaction history and summaries.
|
|
826
752
|
*
|
|
827
|
-
* Available only on /agent/v1. Returns { data: [...] }. Each entry contains type, id, event_id, trigger, status, model, compacted_message_count, input_tokens_before, input_tokens_after, summary, error and created_at, as recorded by the service. Missing or inaccessible managed sessions return 404 not_found_error.
|
|
753
|
+
* Available only on /agent/v1. Returns { data: [...], active }. active is the queued or running compaction ({ type: session_compaction, id, status, trigger: manual|auto|idle }), or null when none; manual work takes precedence. Each data entry contains type, id, event_id, trigger, status, model, compacted_message_count, input_tokens_before, input_tokens_after, summary, error and created_at, as recorded by the service. Missing or inaccessible managed sessions return 404 not_found_error.
|
|
828
754
|
*/
|
|
829
755
|
export const listSessionCompactions = (options) => (options.client ?? client).get({
|
|
830
756
|
security: [{
|
|
@@ -839,20 +765,6 @@ export const listSessionCompactions = (options) => (options.client ?? client).ge
|
|
|
839
765
|
url: '/agent/v1/sessions/{session_id}/compactions',
|
|
840
766
|
...options
|
|
841
767
|
});
|
|
842
|
-
/**
|
|
843
|
-
* Read chat appearance
|
|
844
|
-
*
|
|
845
|
-
* 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.
|
|
846
|
-
*/
|
|
847
|
-
export const getEmbedAppearance = (options) => (options?.client ?? client).get({
|
|
848
|
-
security: [{
|
|
849
|
-
key: 'BearerAuth',
|
|
850
|
-
scheme: 'bearer',
|
|
851
|
-
type: 'http'
|
|
852
|
-
}, { name: 'Praxis-Publishable-Key', type: 'apiKey' }],
|
|
853
|
-
url: '/agent/v1/embed/appearance',
|
|
854
|
-
...options
|
|
855
|
-
});
|
|
856
768
|
/**
|
|
857
769
|
* Generate speech
|
|
858
770
|
*
|
|
@@ -1180,7 +1092,7 @@ export const fileListFiles = (options) => (options?.client ?? client).get({
|
|
|
1180
1092
|
/**
|
|
1181
1093
|
* Upload file
|
|
1182
1094
|
*
|
|
1183
|
-
* Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 100000000 bytes, and only user_data
|
|
1095
|
+
* Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 100000000 bytes, and only user_data and vision purposes are accepted. Send file bytes as a multipart file part, not a filename or file ID; in the SDK use a File or Blob, for example new File(["Return within 23 days."], "policy.txt", { type: "text/plain" }). Content determines the MIME type. Supported uploads include PDF, DOCX/XLSX/PPTX, PNG/JPEG/GIF/WebP, MP3/WAV/FLAC/OGG/M4A, MP4/WebM, and UTF-8 JSON/NDJSON/CSV/Markdown/plain text; empty, unsupported, oversized files and unsupported purposes return 400. Use Uploads for larger files. The purpose vision accepts only PNG, JPEG, GIF and WebP, while conversation images require user_data. The returned ID belongs to your tenant; upload alone does not ingest the file into Knowledge. Knowledge attachment has a lower limit of 100000000 bytes. Optionally set expires_after[anchor]=created_at with expires_after[seconds] (3600–7776000). Without expiry, the file persists until deleted.
|
|
1184
1096
|
*/
|
|
1185
1097
|
export const fileCreateFile = (options) => (options.client ?? client).post({
|
|
1186
1098
|
...formDataBodySerializer,
|
|
@@ -1257,7 +1169,7 @@ export const fileRetrieveFileContent = (options) => (options.client ?? client).g
|
|
|
1257
1169
|
/**
|
|
1258
1170
|
* Create an upload
|
|
1259
1171
|
*
|
|
1260
|
-
* Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data
|
|
1172
|
+
* Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data and vision purposes. Add parts of at most 64000000 bytes and complete within one hour. Optional part_size enables fixed-size, retryable parts. expires_after applies to the resulting file (3600–7776000 seconds on this own face); without it the file persists until deleted.
|
|
1261
1173
|
*/
|
|
1262
1174
|
export const fileCreateUpload = (options) => (options.client ?? client).post({
|
|
1263
1175
|
security: [{
|
|
@@ -1357,6 +1269,18 @@ export const metaMethodsSearch = (options) => (options?.client ?? client).get({
|
|
|
1357
1269
|
*
|
|
1358
1270
|
*/
|
|
1359
1271
|
export const metaMethodsRetrieve = (options) => (options.client ?? client).get({ url: '/meta/v1/methods/{name}', ...options });
|
|
1272
|
+
/**
|
|
1273
|
+
* Read documentation Markdown
|
|
1274
|
+
*
|
|
1275
|
+
* Read a platform guide or reference before implementing an unfamiliar capability. Public; no API key required. Take path from praxis.meta.docs.search, or use developers/automation/guides/write-workflow. Append #heading-id to path to read only that section, including its subsections. Encode the hash as %23 over HTTP; SDK callers pass it in the path string. lang defaults to zh; en selects the English page. Unknown pages or anchors return DOC_NOT_FOUND; search again for a valid path.
|
|
1276
|
+
*/
|
|
1277
|
+
export const metaDocsRetrieve = (options) => (options.client ?? client).get({ url: '/meta/v1/docs/{path}', ...options });
|
|
1278
|
+
/**
|
|
1279
|
+
* Search platform documentation
|
|
1280
|
+
*
|
|
1281
|
+
* Find guides and references by keyword before reading them with praxis.meta.docs.retrieve. Public; no API key required. Matches documentation titles, headings and page text without case sensitivity; all query words must occur. q is required; limit defaults to 20 and accepts 1–50. lang defaults to zh or use en for English. Returns paths, page titles, canonical URLs and short matching snippets; no matches returns an empty array.
|
|
1282
|
+
*/
|
|
1283
|
+
export const metaDocsSearch = (options) => (options.client ?? client).get({ url: '/meta/v1/docs/search', ...options });
|
|
1360
1284
|
/**
|
|
1361
1285
|
* List Models
|
|
1362
1286
|
*
|
|
@@ -2540,7 +2464,7 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
|
2540
2464
|
/**
|
|
2541
2465
|
* List agents
|
|
2542
2466
|
*
|
|
2543
|
-
* List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=personal for durable-computer agents or kind=service for per-session environments. Pass next_page from the response as page to read the next page; a null next_page means the end.
|
|
2467
|
+
* List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general or kind=personal for durable-computer agents or kind=service for per-session environments. Pass next_page from the response as page to read the next page; a null next_page means the end.
|
|
2544
2468
|
*/
|
|
2545
2469
|
export const agentsList = (options) => (options?.client ?? client).get({
|
|
2546
2470
|
security: [{
|
|
@@ -2580,7 +2504,7 @@ export const agentsCreate = (options) => (options.client ?? client).post({
|
|
|
2580
2504
|
/**
|
|
2581
2505
|
* Get agent
|
|
2582
2506
|
*
|
|
2583
|
-
* Read
|
|
2507
|
+
* Read the agent configuration currently effective for new sessions. By default, version equals active_version and latest_version identifies the newest saved version, including an unapplied save. Use latest_version for optimistic concurrency when updating. Pass version as a positive integer to read that saved version; version=active is equivalent to omission. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so tools can be sent back unchanged to agents.update. Use agents.versions.list to enumerate saved versions.
|
|
2584
2508
|
*/
|
|
2585
2509
|
export const agentsRetrieve = (options) => (options.client ?? client).get({
|
|
2586
2510
|
security: [{
|
|
@@ -2598,7 +2522,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
|
|
|
2598
2522
|
/**
|
|
2599
2523
|
* Update agent
|
|
2600
2524
|
*
|
|
2601
|
-
*
|
|
2525
|
+
* Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400.
|
|
2602
2526
|
*/
|
|
2603
2527
|
export const agentsUpdate = (options) => (options.client ?? client).post({
|
|
2604
2528
|
security: [{
|
|
@@ -2638,7 +2562,7 @@ export const agentsArchive = (options) => (options.client ?? client).post({
|
|
|
2638
2562
|
/**
|
|
2639
2563
|
* List agent versions
|
|
2640
2564
|
*
|
|
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
|
|
2565
|
+
* List the saved versions of one agent in ascending version number, oldest first, in pages of at most 100 (default 20). Each item is the full agent definition at that saved version, so you can compare configurations. active is true only for the item new sessions use. active_version on every item is the same agent-level currently effective version; it is not that item's version. Use agents.retrieve with version to read a single saved version; agent_id comes from agents.list or agents.create. Pass next_page as page to continue.
|
|
2642
2566
|
*/
|
|
2643
2567
|
export const agentsVersionsList = (options) => (options.client ?? client).get({
|
|
2644
2568
|
security: [{
|
|
@@ -2674,7 +2598,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
2674
2598
|
/**
|
|
2675
2599
|
* Create session
|
|
2676
2600
|
*
|
|
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
|
|
2601
|
+
* Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.
|
|
2678
2602
|
*/
|
|
2679
2603
|
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
2680
2604
|
security: [{
|
|
@@ -3054,7 +2978,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
|
|
|
3054
2978
|
/**
|
|
3055
2979
|
* Create deployment
|
|
3056
2980
|
*
|
|
3057
|
-
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for personal agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.
|
|
2981
|
+
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general and personal agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.
|
|
3058
2982
|
*/
|
|
3059
2983
|
export const deploymentsCreate = (options) => (options.client ?? client).post({
|
|
3060
2984
|
security: [{
|
|
@@ -3782,7 +3706,7 @@ export const applicationUploadAssets = (options) => (options.client ?? client).p
|
|
|
3782
3706
|
/**
|
|
3783
3707
|
* List actions
|
|
3784
3708
|
*
|
|
3785
|
-
* Discover callable Actions and their ns/name references without executing them. Combine each returned namespace and name as ns/name; Action calls use the current revision and do not accept @version or @tag. Filter by name or description; results include seven-day statistics and revision summaries without implementation source. Archived actions are excluded by default.
|
|
3709
|
+
* Discover callable Actions and their ns/name references without executing them. Combine each returned namespace and name as ns/name; Action calls use the current revision and do not accept @version or @tag. Filter by name or description; results include seven-day statistics and revision summaries without implementation source. Archived actions are excluded by default. List items carry no input contract: get the action and read current_revision.input_schema. Call it with call("ns/name", input) in a script or call: ns/name with with: in a workflow.
|
|
3786
3710
|
*/
|
|
3787
3711
|
export const automationActionsList = (options) => (options?.client ?? client).get({
|
|
3788
3712
|
querySerializer: { parameters: {
|
|
@@ -3827,7 +3751,7 @@ export const automationActionsCreate = (options) => (options.client ?? client).p
|
|
|
3827
3751
|
/**
|
|
3828
3752
|
* Get an Action with its current input and output JSON Schemas
|
|
3829
3753
|
*
|
|
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.
|
|
3754
|
+
* 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) or in a workflow step with call: ocr and with:. Input that breaks the contract returns INPUT_INVALID, with the fields in errors[]. The response ETag is the current revision ID for conditional updates.
|
|
3831
3755
|
*/
|
|
3832
3756
|
export const automationActionsGet = (options) => (options.client ?? client).get({
|
|
3833
3757
|
security: [{
|
|
@@ -4025,7 +3949,7 @@ export const automationScriptsList = (options) => (options?.client ?? client).ge
|
|
|
4025
3949
|
/**
|
|
4026
3950
|
* Create a script
|
|
4027
3951
|
*
|
|
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.
|
|
3952
|
+
* 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. The return value is limited to 1 MiB: write large results to a file with call("write-file", ...) and return the file ID. A call error carries errors[] (pointer, detail, hint); String(e) is only the summary. 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.
|
|
4029
3953
|
*/
|
|
4030
3954
|
export const automationScriptsCreate = (options) => (options.client ?? client).post({
|
|
4031
3955
|
security: [{
|
|
@@ -4288,7 +4212,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
|
|
|
4288
4212
|
/**
|
|
4289
4213
|
* Create a workflow
|
|
4290
4214
|
*
|
|
4291
|
-
* Save a YAML workflow as an editable draft
|
|
4215
|
+
* Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 30 s (run-sandbox 10 min), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
|
|
4292
4216
|
*/
|
|
4293
4217
|
export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
|
|
4294
4218
|
security: [{
|
|
@@ -4328,7 +4252,7 @@ export const automationWorkflowsGet = (options) => (options.client ?? client).ge
|
|
|
4328
4252
|
/**
|
|
4329
4253
|
* Update a workflow draft
|
|
4330
4254
|
*
|
|
4331
|
-
* Update description, labels or draft with the current draft revision in If-Match. Even metadata-only updates create a new draft revision.
|
|
4255
|
+
* Update description, labels or draft with the current draft revision in If-Match, taken from draft.revision in the get-workflow response. Even metadata-only updates create a new draft revision. A mismatch returns 412 PRECONDITION_FAILED; read the draft again, merge and retry. The draft is not validated here, so check it with validate (kind=workflow) before publishing. Error details are in errors[]. See the workflow syntax reference at https://deepraxis.com/docs/developers/automation/reference/workflow-syntax.
|
|
4332
4256
|
*/
|
|
4333
4257
|
export const automationWorkflowsPatch = (options) => (options.client ?? client).patch({
|
|
4334
4258
|
security: [{
|
|
@@ -4412,7 +4336,7 @@ export const automationWorkflowsVersions = (options) => (options.client ?? clien
|
|
|
4412
4336
|
/**
|
|
4413
4337
|
* Publish a workflow version
|
|
4414
4338
|
*
|
|
4415
|
-
* Publish a saved definition from its draft or an ad hoc run as a reusable version for named runs or triggers, validating the definition and locking dependencies. To test unpublished code, use praxis.automation.runs.create with source and language instead. Use draft.revision from create or retrieve as expected_draft_revision. The draft must match expected_draft_revision; an ad hoc run requires from_run and expected_source_sha256. The same version and contents return the existing version; different contents return VERSION_EXISTS, prereleases require an explicit tag (not latest, URL-safe characters only, not a version or range; violations return TAG_REQUIRED or TAG_INVALID with the complete rules in hint), and invalid definitions return DEFINITION_INVALID. Stable releases automatically advance latest only above the highest existing stable version; workflows becoming latest synchronize their declared schedule. String and object run.workflow/run.script references share version resolution and dependency locking. Publishing removes +build metadata from the version number.
|
|
4339
|
+
* Publish a saved definition from its draft or an ad hoc run as a reusable version for named runs or triggers, validating the definition and locking dependencies. To test unpublished code, use praxis.automation.runs.create with source and language instead. Use draft.revision from create or retrieve as expected_draft_revision. The draft must match expected_draft_revision; an ad hoc run requires from_run and expected_source_sha256. The same version and contents return the existing version; different contents return VERSION_EXISTS, prereleases require an explicit tag (not latest, URL-safe characters only, not a version or range; violations return TAG_REQUIRED or TAG_INVALID with the complete rules in hint), and invalid definitions return DEFINITION_INVALID. Stable releases automatically advance latest only above the highest existing stable version; workflows becoming latest synchronize their declared schedule. String and object run.workflow/run.script references share version resolution and dependency locking. Publishing removes +build metadata from the version number. For a workflow, document namespace, name and version must equal the publish target, otherwise DEFINITION_IDENTITY_MISMATCH; where a DEFINITION_INVALID failure sits is listed in errors[] (pointer, detail, hint).
|
|
4416
4340
|
*/
|
|
4417
4341
|
export const automationWorkflowsPublish = (options) => (options.client ?? client).post({
|
|
4418
4342
|
security: [{
|
|
@@ -4532,7 +4456,7 @@ export const automationWorkflowsSetDistTag = (options) => (options.client ?? cli
|
|
|
4532
4456
|
/**
|
|
4533
4457
|
* Validate a definition
|
|
4534
4458
|
*
|
|
4535
|
-
* Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation.
|
|
4459
|
+
* Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation. For kind=workflow the YAML needs document (dsl, namespace, name, version) and do; each problem is one entry in errors[] (pointer, detail, hint), so read the first one. A listen outside the supported subset (to.all, inside a fork) and emit are not reported here and fail with DEFINITION_INVALID only when a run is created. Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax.
|
|
4536
4460
|
*/
|
|
4537
4461
|
export const automationValidateValidate = (options) => (options.client ?? client).post({
|
|
4538
4462
|
security: [{
|
|
@@ -4620,7 +4544,7 @@ export const automationRunsList = (options) => (options?.client ?? client).get({
|
|
|
4620
4544
|
/**
|
|
4621
4545
|
* Run a published target or execute draft source
|
|
4622
4546
|
*
|
|
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
|
|
4547
|
+
* 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 30 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. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). 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.
|
|
4624
4548
|
*/
|
|
4625
4549
|
export const automationRunsCreate = (options) => (options.client ?? client).post({
|
|
4626
4550
|
security: [{
|
|
@@ -5123,6 +5047,109 @@ export const automationHooksReceive = (options) => (options.client ?? client).po
|
|
|
5123
5047
|
...options.headers
|
|
5124
5048
|
}
|
|
5125
5049
|
});
|
|
5050
|
+
/**
|
|
5051
|
+
* List human tasks
|
|
5052
|
+
*
|
|
5053
|
+
* List the human tasks that praxis/approval workflow steps opened, newest first. By default it returns only open tasks assigned to the caller: their approval inbox. scope=all lists every task of the organization, and status and run_id narrow the list. Use a returned id with retrieve for details and respond to decide. Read-only: listing never changes a task.
|
|
5054
|
+
*/
|
|
5055
|
+
export const automationHumanTasksList = (options) => (options?.client ?? client).get({
|
|
5056
|
+
querySerializer: { parameters: { status: { array: { explode: false } } } },
|
|
5057
|
+
security: [{
|
|
5058
|
+
key: 'BearerAuth',
|
|
5059
|
+
scheme: 'bearer',
|
|
5060
|
+
type: 'http'
|
|
5061
|
+
}, {
|
|
5062
|
+
key: 'ApiKeyAuth',
|
|
5063
|
+
name: 'X-API-Key',
|
|
5064
|
+
type: 'apiKey'
|
|
5065
|
+
}],
|
|
5066
|
+
url: '/automation/v1/human-tasks',
|
|
5067
|
+
...options
|
|
5068
|
+
});
|
|
5069
|
+
/**
|
|
5070
|
+
* Retrieve a human task
|
|
5071
|
+
*
|
|
5072
|
+
* Read one human task - title, Markdown body, context, actions, form, assignees, mode, due time, responses and outcome - so an assignee can choose an action and fill the form. Read-only; the Console approval page /automation/tasks/{id} reads the same resource.
|
|
5073
|
+
*/
|
|
5074
|
+
export const automationHumanTasksGet = (options) => (options.client ?? client).get({
|
|
5075
|
+
security: [{
|
|
5076
|
+
key: 'BearerAuth',
|
|
5077
|
+
scheme: 'bearer',
|
|
5078
|
+
type: 'http'
|
|
5079
|
+
}, {
|
|
5080
|
+
key: 'ApiKeyAuth',
|
|
5081
|
+
name: 'X-API-Key',
|
|
5082
|
+
type: 'apiKey'
|
|
5083
|
+
}],
|
|
5084
|
+
url: '/automation/v1/human-tasks/{id}',
|
|
5085
|
+
...options
|
|
5086
|
+
});
|
|
5087
|
+
/**
|
|
5088
|
+
* Respond to a human task
|
|
5089
|
+
*
|
|
5090
|
+
* Submit an action (action_id), form values (values) and a comment as the calling user. Depending on the task's mode the response either decides it (status becomes completed, outcome is set, and the waiting workflow resumes with outcome as the step output) or is recorded while other assignees are awaited. When two assignees respond at once, exactly one decides and the other gets TASK_CLOSED. An agent may respond only if the workflow set allow_agent_decision. Send an Idempotency-Key to retry safely.
|
|
5091
|
+
*/
|
|
5092
|
+
export const automationHumanTasksRespond = (options) => (options.client ?? client).post({
|
|
5093
|
+
security: [{
|
|
5094
|
+
key: 'BearerAuth',
|
|
5095
|
+
scheme: 'bearer',
|
|
5096
|
+
type: 'http'
|
|
5097
|
+
}, {
|
|
5098
|
+
key: 'ApiKeyAuth',
|
|
5099
|
+
name: 'X-API-Key',
|
|
5100
|
+
type: 'apiKey'
|
|
5101
|
+
}],
|
|
5102
|
+
url: '/automation/v1/human-tasks/{id}/respond',
|
|
5103
|
+
...options,
|
|
5104
|
+
headers: {
|
|
5105
|
+
'Content-Type': 'application/json',
|
|
5106
|
+
...options.headers
|
|
5107
|
+
}
|
|
5108
|
+
});
|
|
5109
|
+
/**
|
|
5110
|
+
* Cancel a human task
|
|
5111
|
+
*
|
|
5112
|
+
* Cancel an open human task; only the person who started the run or an organization API key may cancel. The task becomes cancelled and the waiting workflow step raises a runtime error with code HUMAN_TASK_CANCELLED, which try/catch can catch. Open tasks are cancelled automatically when their run ends, so this call is not needed then.
|
|
5113
|
+
*/
|
|
5114
|
+
export const automationHumanTasksCancel = (options) => (options.client ?? client).post({
|
|
5115
|
+
security: [{
|
|
5116
|
+
key: 'BearerAuth',
|
|
5117
|
+
scheme: 'bearer',
|
|
5118
|
+
type: 'http'
|
|
5119
|
+
}, {
|
|
5120
|
+
key: 'ApiKeyAuth',
|
|
5121
|
+
name: 'X-API-Key',
|
|
5122
|
+
type: 'apiKey'
|
|
5123
|
+
}],
|
|
5124
|
+
url: '/automation/v1/human-tasks/{id}/cancel',
|
|
5125
|
+
...options,
|
|
5126
|
+
headers: {
|
|
5127
|
+
'Content-Type': 'application/json',
|
|
5128
|
+
...options.headers
|
|
5129
|
+
}
|
|
5130
|
+
});
|
|
5131
|
+
/**
|
|
5132
|
+
* Delegate a human task
|
|
5133
|
+
*
|
|
5134
|
+
* An assignee who has not responded hands their place to another user (to_user), replacing their entry in assignees.users in place, so sequential order is kept. The new user cannot already be an assignee, nor the initiator unless self-approval is allowed. The task must still be open.
|
|
5135
|
+
*/
|
|
5136
|
+
export const automationHumanTasksDelegate = (options) => (options.client ?? client).post({
|
|
5137
|
+
security: [{
|
|
5138
|
+
key: 'BearerAuth',
|
|
5139
|
+
scheme: 'bearer',
|
|
5140
|
+
type: 'http'
|
|
5141
|
+
}, {
|
|
5142
|
+
key: 'ApiKeyAuth',
|
|
5143
|
+
name: 'X-API-Key',
|
|
5144
|
+
type: 'apiKey'
|
|
5145
|
+
}],
|
|
5146
|
+
url: '/automation/v1/human-tasks/{id}/delegate',
|
|
5147
|
+
...options,
|
|
5148
|
+
headers: {
|
|
5149
|
+
'Content-Type': 'application/json',
|
|
5150
|
+
...options.headers
|
|
5151
|
+
}
|
|
5152
|
+
});
|
|
5126
5153
|
/**
|
|
5127
5154
|
* List databases
|
|
5128
5155
|
*
|