@deepraxis/sdk 0.1.0-dev.d939e0f → 0.1.0-dev.ed6ad1b
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 +46 -1
- package/dist/core/client.d.ts +5 -1
- package/dist/core/client.js +3 -0
- package/dist/core/transport.d.ts +5 -0
- package/dist/core/transport.js +6 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +98 -24
- package/dist/generated/sdk.gen.js +231 -51
- package/dist/generated/types.gen.d.ts +4055 -1817
- package/dist/helpers/application-publish.d.ts +24 -4
- package/dist/helpers/application-publish.js +53 -3
- package/dist/helpers/database-count.d.ts +17 -0
- package/dist/helpers/database-count.js +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/operations.generated.d.ts +222 -21
- package/dist/operations.generated.js +275 -22
- package/dist/resources.generated.d.ts +472 -1
- package/dist/resources.generated.js +24 -0
- package/package.json +1 -1
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { formDataBodySerializer } from './client/index.js';
|
|
3
3
|
import { client } from './client.gen.js';
|
|
4
|
+
/**
|
|
5
|
+
* Unarchive Agent
|
|
6
|
+
*
|
|
7
|
+
* Restore an archived agent without creating a configuration version. Already active agents are unchanged. Missing or inaccessible agents return 404. Use the returned agent id to create new sessions.
|
|
8
|
+
*/
|
|
9
|
+
export const unarchiveAgent = (options) => (options.client ?? client).post({
|
|
10
|
+
security: [{
|
|
11
|
+
key: 'BearerAuth',
|
|
12
|
+
scheme: 'bearer',
|
|
13
|
+
type: 'http'
|
|
14
|
+
}, {
|
|
15
|
+
key: 'ApiKeyAuth',
|
|
16
|
+
name: 'X-API-Key',
|
|
17
|
+
type: 'apiKey'
|
|
18
|
+
}],
|
|
19
|
+
url: '/agent/v1/agents/{agent_id}/unarchive',
|
|
20
|
+
...options
|
|
21
|
+
});
|
|
4
22
|
/**
|
|
5
23
|
* Delete Run Feedback
|
|
6
24
|
*
|
|
@@ -65,6 +83,26 @@ export const listEndUsers = (options) => (options.client ?? client).get({
|
|
|
65
83
|
url: '/agent/v1/agents/{agent_id}/end_users',
|
|
66
84
|
...options
|
|
67
85
|
});
|
|
86
|
+
/**
|
|
87
|
+
* Delete end-user data
|
|
88
|
+
*
|
|
89
|
+
* Delete a host application's end-user data from one service agent after explicit confirmation.
|
|
90
|
+
*
|
|
91
|
+
* 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.
|
|
92
|
+
*/
|
|
93
|
+
export const deleteEndUser = (options) => (options.client ?? client).delete({
|
|
94
|
+
security: [{
|
|
95
|
+
key: 'BearerAuth',
|
|
96
|
+
scheme: 'bearer',
|
|
97
|
+
type: 'http'
|
|
98
|
+
}, {
|
|
99
|
+
key: 'ApiKeyAuth',
|
|
100
|
+
name: 'X-API-Key',
|
|
101
|
+
type: 'apiKey'
|
|
102
|
+
}],
|
|
103
|
+
url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}',
|
|
104
|
+
...options
|
|
105
|
+
});
|
|
68
106
|
/**
|
|
69
107
|
* Get End User
|
|
70
108
|
*
|
|
@@ -85,6 +123,26 @@ export const getEndUser = (options) => (options.client ?? client).get({
|
|
|
85
123
|
url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}',
|
|
86
124
|
...options
|
|
87
125
|
});
|
|
126
|
+
/**
|
|
127
|
+
* Get end-user deletion
|
|
128
|
+
*
|
|
129
|
+
* Poll the latest deletion task for an end user, including after the user data has been removed.
|
|
130
|
+
*
|
|
131
|
+
* 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.
|
|
132
|
+
*/
|
|
133
|
+
export const getEndUserDeletion = (options) => (options.client ?? client).get({
|
|
134
|
+
security: [{
|
|
135
|
+
key: 'BearerAuth',
|
|
136
|
+
scheme: 'bearer',
|
|
137
|
+
type: 'http'
|
|
138
|
+
}, {
|
|
139
|
+
key: 'ApiKeyAuth',
|
|
140
|
+
name: 'X-API-Key',
|
|
141
|
+
type: 'apiKey'
|
|
142
|
+
}],
|
|
143
|
+
url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/deletion',
|
|
144
|
+
...options
|
|
145
|
+
});
|
|
88
146
|
/**
|
|
89
147
|
* Revoke End User Tokens
|
|
90
148
|
*
|
|
@@ -145,6 +203,36 @@ export const unblockEndUser = (options) => (options.client ?? client).post({
|
|
|
145
203
|
url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock',
|
|
146
204
|
...options
|
|
147
205
|
});
|
|
206
|
+
/**
|
|
207
|
+
* Exchange Hosted Code
|
|
208
|
+
*
|
|
209
|
+
* Redeem a single-use hosted link credential for an end-user token.
|
|
210
|
+
*
|
|
211
|
+
* 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>"}.
|
|
212
|
+
*/
|
|
213
|
+
export const exchangeEmbedCode = (options) => (options.client ?? client).post({
|
|
214
|
+
url: '/agent/v1/embed/exchange',
|
|
215
|
+
...options,
|
|
216
|
+
headers: {
|
|
217
|
+
'Content-Type': 'application/json',
|
|
218
|
+
...options.headers
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
/**
|
|
222
|
+
* Issue anonymous visitor token
|
|
223
|
+
*
|
|
224
|
+
* Obtain a short-lived embedding token for a visitor without an account using the agent owner's publishable key.
|
|
225
|
+
*
|
|
226
|
+
* 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"}.
|
|
227
|
+
*/
|
|
228
|
+
export const createAnonymousEmbedToken = (options) => (options.client ?? client).post({
|
|
229
|
+
url: '/agent/v1/embed_tokens/anonymous',
|
|
230
|
+
...options,
|
|
231
|
+
headers: {
|
|
232
|
+
'Content-Type': 'application/json',
|
|
233
|
+
...options.headers
|
|
234
|
+
}
|
|
235
|
+
});
|
|
148
236
|
/**
|
|
149
237
|
* List Embed Tokens
|
|
150
238
|
*
|
|
@@ -170,7 +258,7 @@ export const listEmbedTokens = (options) => (options?.client ?? client).get({
|
|
|
170
258
|
*
|
|
171
259
|
* Issue a short-lived credential on your backend for an end user of a service agent.
|
|
172
260
|
*
|
|
173
|
-
* 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.
|
|
261
|
+
* 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.
|
|
174
262
|
*/
|
|
175
263
|
export const createEmbedToken = (options) => (options.client ?? client).post({
|
|
176
264
|
security: [{
|
|
@@ -407,7 +495,9 @@ export const computersFilesContent = (options) => (options.client ?? client).get
|
|
|
407
495
|
*
|
|
408
496
|
* Resume the computer and issue a sandbox connection.
|
|
409
497
|
*
|
|
410
|
-
* Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.
|
|
498
|
+
* Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id, plus the machine tier the computer is on now (light or heavy) and the lease that keeps it there (lease_id, lease_expires_at; lease_id is null when no lease exists). Keep the lease while the connection stays open: renew it about every 20 seconds (POST .../leases/{lease_id}/renew) and release it on close (DELETE .../leases/{lease_id}). An unrenewed lease simply expires, and the full machine is reclaimed only after that. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.
|
|
499
|
+
*
|
|
500
|
+
* Connect to a computer with a caller-held lease. Omit the body or send {} to request light: the lightweight shell, or the heavy instance while it is running. Send {"need":"heavy"} to request full Linux for interactive programs; files are synchronized before the heavy connection is returned with tier heavy. Renew the lease while using the connection and release it with DELETE when finished.
|
|
411
501
|
*/
|
|
412
502
|
export const connectComputer = (options) => (options.client ?? client).post({
|
|
413
503
|
security: [{
|
|
@@ -420,6 +510,50 @@ export const connectComputer = (options) => (options.client ?? client).post({
|
|
|
420
510
|
type: 'apiKey'
|
|
421
511
|
}],
|
|
422
512
|
url: '/agent/v1/computers/{computer_id}/connect',
|
|
513
|
+
...options,
|
|
514
|
+
headers: {
|
|
515
|
+
'Content-Type': 'application/json',
|
|
516
|
+
...options.headers
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
/**
|
|
520
|
+
* Renew computer lease
|
|
521
|
+
*
|
|
522
|
+
* Extend the lease a connection holds so the full machine stays in service while the connection is open.
|
|
523
|
+
*
|
|
524
|
+
* Own-face extension. A lease that is no longer valid (released, expired, or the computer moved to another machine) returns 409 LEASE_STALE; call connect again for a new connection and lease. Foreign or absent computers return 404.
|
|
525
|
+
*/
|
|
526
|
+
export const renewComputerLease = (options) => (options.client ?? client).post({
|
|
527
|
+
security: [{
|
|
528
|
+
key: 'BearerAuth',
|
|
529
|
+
scheme: 'bearer',
|
|
530
|
+
type: 'http'
|
|
531
|
+
}, {
|
|
532
|
+
key: 'ApiKeyAuth',
|
|
533
|
+
name: 'X-API-Key',
|
|
534
|
+
type: 'apiKey'
|
|
535
|
+
}],
|
|
536
|
+
url: '/agent/v1/computers/{computer_id}/leases/{lease_id}/renew',
|
|
537
|
+
...options
|
|
538
|
+
});
|
|
539
|
+
/**
|
|
540
|
+
* Release computer lease
|
|
541
|
+
*
|
|
542
|
+
* Give the lease back when a connection closes so the full machine can be reclaimed without waiting for it to expire.
|
|
543
|
+
*
|
|
544
|
+
* Own-face extension. Idempotent: an unknown or already released lease succeeds as well. Foreign or absent computers return 404.
|
|
545
|
+
*/
|
|
546
|
+
export const releaseComputerLease = (options) => (options.client ?? client).delete({
|
|
547
|
+
security: [{
|
|
548
|
+
key: 'BearerAuth',
|
|
549
|
+
scheme: 'bearer',
|
|
550
|
+
type: 'http'
|
|
551
|
+
}, {
|
|
552
|
+
key: 'ApiKeyAuth',
|
|
553
|
+
name: 'X-API-Key',
|
|
554
|
+
type: 'apiKey'
|
|
555
|
+
}],
|
|
556
|
+
url: '/agent/v1/computers/{computer_id}/leases/{lease_id}',
|
|
423
557
|
...options
|
|
424
558
|
});
|
|
425
559
|
/**
|
|
@@ -608,6 +742,20 @@ export const listSessionCompactions = (options) => (options.client ?? client).ge
|
|
|
608
742
|
url: '/agent/v1/sessions/{session_id}/compactions',
|
|
609
743
|
...options
|
|
610
744
|
});
|
|
745
|
+
/**
|
|
746
|
+
* Read chat appearance
|
|
747
|
+
*
|
|
748
|
+
* 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.
|
|
749
|
+
*/
|
|
750
|
+
export const getEmbedAppearance = (options) => (options?.client ?? client).get({
|
|
751
|
+
security: [{
|
|
752
|
+
key: 'BearerAuth',
|
|
753
|
+
scheme: 'bearer',
|
|
754
|
+
type: 'http'
|
|
755
|
+
}, { name: 'Praxis-Publishable-Key', type: 'apiKey' }],
|
|
756
|
+
url: '/agent/v1/embed/appearance',
|
|
757
|
+
...options
|
|
758
|
+
});
|
|
611
759
|
/**
|
|
612
760
|
* Generate speech
|
|
613
761
|
*
|
|
@@ -2165,6 +2313,64 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
|
|
|
2165
2313
|
...options.headers
|
|
2166
2314
|
}
|
|
2167
2315
|
});
|
|
2316
|
+
/**
|
|
2317
|
+
* Delete session
|
|
2318
|
+
*
|
|
2319
|
+
* Delete an idle or terminated session and its event history after saving a deletion snapshot. Supply the session id from creation or listing. Running sessions return 409 INVALID_STATE: interrupt first or wait until idle or terminated. Afterwards retrieval and event listing return 404 and lists omit the session. Example: DELETE /agent/v1/sessions/sesn_example.
|
|
2320
|
+
*/
|
|
2321
|
+
export const sessionsDelete = (options) => (options.client ?? client).delete({
|
|
2322
|
+
security: [{
|
|
2323
|
+
key: 'BearerAuth',
|
|
2324
|
+
scheme: 'bearer',
|
|
2325
|
+
type: 'http'
|
|
2326
|
+
}, {
|
|
2327
|
+
key: 'ApiKeyAuth',
|
|
2328
|
+
name: 'X-API-Key',
|
|
2329
|
+
type: 'apiKey'
|
|
2330
|
+
}],
|
|
2331
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
2332
|
+
...options
|
|
2333
|
+
});
|
|
2334
|
+
/**
|
|
2335
|
+
* Get session
|
|
2336
|
+
*
|
|
2337
|
+
* Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on a light machine; no environment lookup or provisioning is needed for a codemode calculation.
|
|
2338
|
+
*/
|
|
2339
|
+
export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
2340
|
+
security: [{
|
|
2341
|
+
key: 'BearerAuth',
|
|
2342
|
+
scheme: 'bearer',
|
|
2343
|
+
type: 'http'
|
|
2344
|
+
}, {
|
|
2345
|
+
key: 'ApiKeyAuth',
|
|
2346
|
+
name: 'X-API-Key',
|
|
2347
|
+
type: 'apiKey'
|
|
2348
|
+
}],
|
|
2349
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
2350
|
+
...options
|
|
2351
|
+
});
|
|
2352
|
+
/**
|
|
2353
|
+
* Update session
|
|
2354
|
+
*
|
|
2355
|
+
* Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
|
|
2356
|
+
*/
|
|
2357
|
+
export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
2358
|
+
security: [{
|
|
2359
|
+
key: 'BearerAuth',
|
|
2360
|
+
scheme: 'bearer',
|
|
2361
|
+
type: 'http'
|
|
2362
|
+
}, {
|
|
2363
|
+
key: 'ApiKeyAuth',
|
|
2364
|
+
name: 'X-API-Key',
|
|
2365
|
+
type: 'apiKey'
|
|
2366
|
+
}],
|
|
2367
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
2368
|
+
...options,
|
|
2369
|
+
headers: {
|
|
2370
|
+
'Content-Type': 'application/json',
|
|
2371
|
+
...options.headers
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2168
2374
|
/**
|
|
2169
2375
|
* List agents
|
|
2170
2376
|
*
|
|
@@ -2186,7 +2392,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
|
|
|
2186
2392
|
/**
|
|
2187
2393
|
* Create agent
|
|
2188
2394
|
*
|
|
2189
|
-
* 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
|
|
2395
|
+
* 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"}]}.
|
|
2190
2396
|
*/
|
|
2191
2397
|
export const agentsCreate = (options) => (options.client ?? client).post({
|
|
2192
2398
|
security: [{
|
|
@@ -2226,7 +2432,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
|
|
|
2226
2432
|
/**
|
|
2227
2433
|
* Update agent
|
|
2228
2434
|
*
|
|
2229
|
-
* Update an agent. Send the current version in the body for optimistic concurrency: a stale version returns 409, and an update that changes nothing keeps the version number. Any real change saves a new version; existing sessions keep the version they were created with. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. Unlike Anthropic Managed Agents, nonempty skills attachments
|
|
2435
|
+
* Update an agent. Send the current version in the body for optimistic concurrency: a stale version returns 409, and an update that changes nothing keeps the version number. Any real change saves a new version; existing sessions keep the version they were created with. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. Unlike Anthropic Managed Agents, nonempty skills attachments return 400; use the native skill tool for available runtime skills.
|
|
2230
2436
|
*/
|
|
2231
2437
|
export const agentsUpdate = (options) => (options.client ?? client).post({
|
|
2232
2438
|
security: [{
|
|
@@ -2321,46 +2527,6 @@ export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
|
2321
2527
|
...options.headers
|
|
2322
2528
|
}
|
|
2323
2529
|
});
|
|
2324
|
-
/**
|
|
2325
|
-
* Get session
|
|
2326
|
-
*
|
|
2327
|
-
* Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on a light machine; no environment lookup or provisioning is needed for a codemode calculation.
|
|
2328
|
-
*/
|
|
2329
|
-
export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
2330
|
-
security: [{
|
|
2331
|
-
key: 'BearerAuth',
|
|
2332
|
-
scheme: 'bearer',
|
|
2333
|
-
type: 'http'
|
|
2334
|
-
}, {
|
|
2335
|
-
key: 'ApiKeyAuth',
|
|
2336
|
-
name: 'X-API-Key',
|
|
2337
|
-
type: 'apiKey'
|
|
2338
|
-
}],
|
|
2339
|
-
url: '/agent/v1/sessions/{session_id}',
|
|
2340
|
-
...options
|
|
2341
|
-
});
|
|
2342
|
-
/**
|
|
2343
|
-
* Update session
|
|
2344
|
-
*
|
|
2345
|
-
* Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
|
|
2346
|
-
*/
|
|
2347
|
-
export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
2348
|
-
security: [{
|
|
2349
|
-
key: 'BearerAuth',
|
|
2350
|
-
scheme: 'bearer',
|
|
2351
|
-
type: 'http'
|
|
2352
|
-
}, {
|
|
2353
|
-
key: 'ApiKeyAuth',
|
|
2354
|
-
name: 'X-API-Key',
|
|
2355
|
-
type: 'apiKey'
|
|
2356
|
-
}],
|
|
2357
|
-
url: '/agent/v1/sessions/{session_id}',
|
|
2358
|
-
...options,
|
|
2359
|
-
headers: {
|
|
2360
|
-
'Content-Type': 'application/json',
|
|
2361
|
-
...options.headers
|
|
2362
|
-
}
|
|
2363
|
-
});
|
|
2364
2530
|
/**
|
|
2365
2531
|
* Archive session
|
|
2366
2532
|
*
|
|
@@ -2382,7 +2548,7 @@ export const sessionsArchive = (options) => (options.client ?? client).post({
|
|
|
2382
2548
|
/**
|
|
2383
2549
|
* List session events
|
|
2384
2550
|
*
|
|
2385
|
-
* Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval (session.status_idle with stop_reason requires_action lists their event_ids), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter.
|
|
2551
|
+
* Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter.
|
|
2386
2552
|
*/
|
|
2387
2553
|
export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
2388
2554
|
security: [{
|
|
@@ -2400,7 +2566,7 @@ export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
|
2400
2566
|
/**
|
|
2401
2567
|
* Send session events
|
|
2402
2568
|
*
|
|
2403
|
-
* Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects.
|
|
2569
|
+
* Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409.
|
|
2404
2570
|
*/
|
|
2405
2571
|
export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
2406
2572
|
security: [{
|
|
@@ -3045,6 +3211,20 @@ export const applicationCreateVersion = (options) => (options.client ?? client).
|
|
|
3045
3211
|
...options.headers
|
|
3046
3212
|
}
|
|
3047
3213
|
});
|
|
3214
|
+
/**
|
|
3215
|
+
* Get version asset manifest
|
|
3216
|
+
*
|
|
3217
|
+
* Read the retained asset paths, content hashes and byte sizes of a version for publication planning. This read creates no session or version. A version without assets returns an empty manifest; unavailable artifacts and foreign resources return 404.
|
|
3218
|
+
*/
|
|
3219
|
+
export const applicationGetVersionAssetManifest = (options) => (options.client ?? client).get({
|
|
3220
|
+
security: [{
|
|
3221
|
+
key: 'application-bearerAuth',
|
|
3222
|
+
scheme: 'bearer',
|
|
3223
|
+
type: 'http'
|
|
3224
|
+
}],
|
|
3225
|
+
url: '/application/v1/workers/{worker_id}/versions/{version_id}/assets/manifest',
|
|
3226
|
+
...options
|
|
3227
|
+
});
|
|
3048
3228
|
/**
|
|
3049
3229
|
* Get version
|
|
3050
3230
|
*
|
|
@@ -4728,7 +4908,7 @@ export const databaseListTables = (options) => (options.client ?? client).get({
|
|
|
4728
4908
|
/**
|
|
4729
4909
|
* Create table
|
|
4730
4910
|
*
|
|
4731
|
-
* Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
|
|
4911
|
+
* Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
|
|
4732
4912
|
*/
|
|
4733
4913
|
export const databaseCreateTable = (options) => (options.client ?? client).post({
|
|
4734
4914
|
security: [{
|
|
@@ -4792,7 +4972,7 @@ export const databaseUpdateTable = (options) => (options.client ?? client).patch
|
|
|
4792
4972
|
/**
|
|
4793
4973
|
* Add field
|
|
4794
4974
|
*
|
|
4795
|
-
* Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row.
|
|
4975
|
+
* Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
|
|
4796
4976
|
*/
|
|
4797
4977
|
export const databaseAddField = (options) => (options.client ?? client).post({
|
|
4798
4978
|
security: [{
|
|
@@ -4870,7 +5050,7 @@ export const databaseDelete = (options) => (options.client ?? client).delete({
|
|
|
4870
5050
|
/**
|
|
4871
5051
|
* Select rows
|
|
4872
5052
|
*
|
|
4873
|
-
* Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property.
|
|
5053
|
+
* Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
|
|
4874
5054
|
*/
|
|
4875
5055
|
export const databaseSelect = (options) => (options.client ?? client).get({
|
|
4876
5056
|
security: [{
|
|
@@ -4884,7 +5064,7 @@ export const databaseSelect = (options) => (options.client ?? client).get({
|
|
|
4884
5064
|
/**
|
|
4885
5065
|
* Count rows
|
|
4886
5066
|
*
|
|
4887
|
-
* Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode.
|
|
5067
|
+
* Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
|
|
4888
5068
|
*/
|
|
4889
5069
|
export const databaseHead = (options) => (options.client ?? client).head({
|
|
4890
5070
|
security: [{
|
|
@@ -4918,7 +5098,7 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
|
|
|
4918
5098
|
*
|
|
4919
5099
|
* Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
|
|
4920
5100
|
* Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
|
|
4921
|
-
* The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
|
|
5101
|
+
* The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
|
|
4922
5102
|
*/
|
|
4923
5103
|
export const databaseInsert = (options) => (options.client ?? client).post({
|
|
4924
5104
|
security: [{
|