@deepraxis/sdk 0.1.0-dev.ea77ce8 → 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.
@@ -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
  *
@@ -45,6 +63,176 @@ export const setRunFeedback = (options) => (options.client ?? client).post({
45
63
  ...options.headers
46
64
  }
47
65
  });
66
+ /**
67
+ * List End Users
68
+ *
69
+ * List users who have sessions or token issuance history on a service agent.
70
+ *
71
+ * Ordered by last_active_at and external_user_id descending. q is a case-sensitive literal prefix, including underscores. limit is 1–100, default 20. Reuse next_page with the same organization, agent, q and limit. Preemptively blocked users without history do not appear. End-user credentials and inaccessible or personal agents return 404.
72
+ */
73
+ export const listEndUsers = (options) => (options.client ?? client).get({
74
+ security: [{
75
+ key: 'BearerAuth',
76
+ scheme: 'bearer',
77
+ type: 'http'
78
+ }, {
79
+ key: 'ApiKeyAuth',
80
+ name: 'X-API-Key',
81
+ type: 'apiKey'
82
+ }],
83
+ url: '/agent/v1/agents/{agent_id}/end_users',
84
+ ...options
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
+ });
106
+ /**
107
+ * Get End User
108
+ *
109
+ * Inspect one end user and their twenty most recently updated sessions.
110
+ *
111
+ * Use external_user_id from listing or your host application. Users without session or issuance history return 404, including preemptively blocked users. End-user credentials and inaccessible or personal agents return 404.
112
+ */
113
+ export const getEndUser = (options) => (options.client ?? client).get({
114
+ security: [{
115
+ key: 'BearerAuth',
116
+ scheme: 'bearer',
117
+ type: 'http'
118
+ }, {
119
+ key: 'ApiKeyAuth',
120
+ name: 'X-API-Key',
121
+ type: 'apiKey'
122
+ }],
123
+ url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}',
124
+ ...options
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
+ });
146
+ /**
147
+ * Revoke End User Tokens
148
+ *
149
+ * Revoke all issued tokens for an end user and terminate their open embed streams.
150
+ *
151
+ * Revokes credentials before marking grants revoked. Upstream failure returns 502 without changing grant revocation timestamps. Returns the count of newly revoked grants; a repeat without new grants returns zero. Does not block future issuance. End-user credentials and inaccessible or personal agents return 404.
152
+ */
153
+ export const revokeEndUserTokens = (options) => (options.client ?? client).post({
154
+ security: [{
155
+ key: 'BearerAuth',
156
+ scheme: 'bearer',
157
+ type: 'http'
158
+ }, {
159
+ key: 'ApiKeyAuth',
160
+ name: 'X-API-Key',
161
+ type: 'apiKey'
162
+ }],
163
+ url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/revoke_tokens',
164
+ ...options
165
+ });
166
+ /**
167
+ * Block End User
168
+ *
169
+ * Block token issuance and session creation, then revoke existing tokens for an end user.
170
+ *
171
+ * May block a user before any history exists; timestamps are then null and counts and cost are zero. Requires an embed policy, otherwise returns 409 with setup guidance. Deduplicates the policy blocklist and retains its 1000-user maximum. If revocation returns 502, the user remains blocked; retry to finish revocation. Repeats keep the user blocked and revoke any remaining grants. End-user credentials and inaccessible or personal agents return 404.
172
+ */
173
+ export const blockEndUser = (options) => (options.client ?? client).post({
174
+ security: [{
175
+ key: 'BearerAuth',
176
+ scheme: 'bearer',
177
+ type: 'http'
178
+ }, {
179
+ key: 'ApiKeyAuth',
180
+ name: 'X-API-Key',
181
+ type: 'apiKey'
182
+ }],
183
+ url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/block',
184
+ ...options
185
+ });
186
+ /**
187
+ * Unblock End User
188
+ *
189
+ * Allow an end user to receive new tokens and create new sessions again.
190
+ *
191
+ * Removes the user from the blocklist; previously revoked tokens stay revoked. Idempotent. Requires an embed policy, otherwise returns 409 with setup guidance. Returns null timestamps and zero counts and cost when no session or issuance history exists. End-user credentials and inaccessible or personal agents return 404.
192
+ */
193
+ export const unblockEndUser = (options) => (options.client ?? client).post({
194
+ security: [{
195
+ key: 'BearerAuth',
196
+ scheme: 'bearer',
197
+ type: 'http'
198
+ }, {
199
+ key: 'ApiKeyAuth',
200
+ name: 'X-API-Key',
201
+ type: 'apiKey'
202
+ }],
203
+ url: '/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock',
204
+ ...options
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
+ });
48
236
  /**
49
237
  * List Embed Tokens
50
238
  *
@@ -70,7 +258,7 @@ export const listEmbedTokens = (options) => (options?.client ?? client).get({
70
258
  *
71
259
  * Issue a short-lived credential on your backend for an end user of a service agent.
72
260
  *
73
- * 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. The hosted field is not supported.
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.
74
262
  */
75
263
  export const createEmbedToken = (options) => (options.client ?? client).post({
76
264
  security: [{
@@ -307,7 +495,9 @@ export const computersFilesContent = (options) => (options.client ?? client).get
307
495
  *
308
496
  * Resume the computer and issue a sandbox connection.
309
497
  *
310
- * 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.
311
501
  */
312
502
  export const connectComputer = (options) => (options.client ?? client).post({
313
503
  security: [{
@@ -320,6 +510,50 @@ export const connectComputer = (options) => (options.client ?? client).post({
320
510
  type: 'apiKey'
321
511
  }],
322
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}',
323
557
  ...options
324
558
  });
325
559
  /**
@@ -508,6 +742,20 @@ export const listSessionCompactions = (options) => (options.client ?? client).ge
508
742
  url: '/agent/v1/sessions/{session_id}/compactions',
509
743
  ...options
510
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
+ });
511
759
  /**
512
760
  * Generate speech
513
761
  *
@@ -1562,6 +1810,24 @@ export const countResponseInputTokens = (options) => (options.client ?? client).
1562
1810
  ...options.headers
1563
1811
  }
1564
1812
  });
1813
+ /**
1814
+ * List your organization's feedback
1815
+ *
1816
+ * Feedback submitted by your organization, newest first, with phase and unread state. Filter by phase and search titles and message text (case-insensitive). Page with next_page. Requires a valid API key, Console session, or machine token of the organization.
1817
+ */
1818
+ export const listOrganizationFeedback = (options) => (options?.client ?? client).get({
1819
+ security: [{
1820
+ key: 'BearerAuth',
1821
+ scheme: 'bearer',
1822
+ type: 'http'
1823
+ }, {
1824
+ key: 'ApiKeyAuth',
1825
+ name: 'X-API-Key',
1826
+ type: 'apiKey'
1827
+ }],
1828
+ url: '/organization/v1/feedback',
1829
+ ...options
1830
+ });
1565
1831
  /**
1566
1832
  * Report a problem with the Praxis platform
1567
1833
  *
@@ -1584,6 +1850,82 @@ export const createOrganizationFeedback = (options) => (options.client ?? client
1584
1850
  ...options.headers
1585
1851
  }
1586
1852
  });
1853
+ /**
1854
+ * Count your organization's feedback by phase
1855
+ *
1856
+ * How many of your organization's feedback are in each phase, for status tabs. Counts never include another organization's feedback.
1857
+ */
1858
+ export const getOrganizationFeedbackCounts = (options) => (options?.client ?? client).get({
1859
+ security: [{
1860
+ key: 'BearerAuth',
1861
+ scheme: 'bearer',
1862
+ type: 'http'
1863
+ }, {
1864
+ key: 'ApiKeyAuth',
1865
+ name: 'X-API-Key',
1866
+ type: 'apiKey'
1867
+ }],
1868
+ url: '/organization/v1/feedback/counts',
1869
+ ...options
1870
+ });
1871
+ /**
1872
+ * Get one of your organization's feedback
1873
+ *
1874
+ * Read one feedback submitted by your organization with its current phase and first-response timing. Another organization's feedback answers 404 FEEDBACK_NOT_FOUND exactly like a missing one.
1875
+ */
1876
+ export const getOrganizationFeedback = (options) => (options.client ?? client).get({
1877
+ security: [{
1878
+ key: 'BearerAuth',
1879
+ scheme: 'bearer',
1880
+ type: 'http'
1881
+ }, {
1882
+ key: 'ApiKeyAuth',
1883
+ name: 'X-API-Key',
1884
+ type: 'apiKey'
1885
+ }],
1886
+ url: '/organization/v1/feedback/{id}',
1887
+ ...options
1888
+ });
1889
+ /**
1890
+ * List the messages of a feedback
1891
+ *
1892
+ * The conversation of one feedback in time order: your messages, support replies and system events. Internal support notes are never returned. Page with next_page.
1893
+ */
1894
+ export const listOrganizationFeedbackMessages = (options) => (options.client ?? client).get({
1895
+ security: [{
1896
+ key: 'BearerAuth',
1897
+ scheme: 'bearer',
1898
+ type: 'http'
1899
+ }, {
1900
+ key: 'ApiKeyAuth',
1901
+ name: 'X-API-Key',
1902
+ type: 'apiKey'
1903
+ }],
1904
+ url: '/organization/v1/feedback/{id}/messages',
1905
+ ...options
1906
+ });
1907
+ /**
1908
+ * Reply on a feedback
1909
+ *
1910
+ * Add your message to a feedback conversation, for example to answer a question from support. A reply while the phase is awaiting_customer moves it to in_progress and notifies support.
1911
+ */
1912
+ export const createOrganizationFeedbackMessage = (options) => (options.client ?? client).post({
1913
+ security: [{
1914
+ key: 'BearerAuth',
1915
+ scheme: 'bearer',
1916
+ type: 'http'
1917
+ }, {
1918
+ key: 'ApiKeyAuth',
1919
+ name: 'X-API-Key',
1920
+ type: 'apiKey'
1921
+ }],
1922
+ url: '/organization/v1/feedback/{id}/messages',
1923
+ ...options,
1924
+ headers: {
1925
+ 'Content-Type': 'application/json',
1926
+ ...options.headers
1927
+ }
1928
+ });
1587
1929
  /**
1588
1930
  * List Organization Costs
1589
1931
  *
@@ -1971,6 +2313,64 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
1971
2313
  ...options.headers
1972
2314
  }
1973
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
+ });
1974
2374
  /**
1975
2375
  * List agents
1976
2376
  *
@@ -1992,7 +2392,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
1992
2392
  /**
1993
2393
  * Create agent
1994
2394
  *
1995
- * 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 and custom tool entries 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"}]}.
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"}]}.
1996
2396
  */
1997
2397
  export const agentsCreate = (options) => (options.client ?? client).post({
1998
2398
  security: [{
@@ -2032,7 +2432,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
2032
2432
  /**
2033
2433
  * Update agent
2034
2434
  *
2035
- * 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 and custom tools return 400; use the native skill tool for available runtime skills.
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.
2036
2436
  */
2037
2437
  export const agentsUpdate = (options) => (options.client ?? client).post({
2038
2438
  security: [{
@@ -2108,7 +2508,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
2108
2508
  /**
2109
2509
  * Create session
2110
2510
  *
2111
- * Create a session: one conversation with an agent, running on a machine. Pass agent as an agent id (latest version) or {id, version, type:"agent"}. Unlike Anthropic Managed Agents, omit environment_id to get a light machine, unless computer_id (explicit, or the agent's default) selects a Computer; pass environment_id for a sandbox recipe. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Inline agent overrides are not supported. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Omitted budget defaults to USD 20; null removes the limit, and a limit object uses a positive integer string of USD cents. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.
2511
+ * Create a session: one conversation with an agent, running on a machine. Pass agent as an agent id (latest version) or {id, version, type:"agent"}. Unlike Anthropic Managed Agents, omit environment_id to get a light machine, unless computer_id (explicit, or the agent's default) selects a Computer; pass environment_id for a sandbox recipe. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Inline agent overrides are not supported. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Omitted budget defaults to USD 20; null removes the limit, and a limit object uses a positive integer string of USD cents. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.
2112
2512
  */
2113
2513
  export const sessionsCreate = (options) => (options.client ?? client).post({
2114
2514
  security: [{
@@ -2127,46 +2527,6 @@ export const sessionsCreate = (options) => (options.client ?? client).post({
2127
2527
  ...options.headers
2128
2528
  }
2129
2529
  });
2130
- /**
2131
- * Get session
2132
- *
2133
- * 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.
2134
- */
2135
- export const sessionsRetrieve = (options) => (options.client ?? client).get({
2136
- security: [{
2137
- key: 'BearerAuth',
2138
- scheme: 'bearer',
2139
- type: 'http'
2140
- }, {
2141
- key: 'ApiKeyAuth',
2142
- name: 'X-API-Key',
2143
- type: 'apiKey'
2144
- }],
2145
- url: '/agent/v1/sessions/{session_id}',
2146
- ...options
2147
- });
2148
- /**
2149
- * Update session
2150
- *
2151
- * 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.
2152
- */
2153
- export const sessionsUpdate = (options) => (options.client ?? client).post({
2154
- security: [{
2155
- key: 'BearerAuth',
2156
- scheme: 'bearer',
2157
- type: 'http'
2158
- }, {
2159
- key: 'ApiKeyAuth',
2160
- name: 'X-API-Key',
2161
- type: 'apiKey'
2162
- }],
2163
- url: '/agent/v1/sessions/{session_id}',
2164
- ...options,
2165
- headers: {
2166
- 'Content-Type': 'application/json',
2167
- ...options.headers
2168
- }
2169
- });
2170
2530
  /**
2171
2531
  * Archive session
2172
2532
  *
@@ -2188,7 +2548,7 @@ export const sessionsArchive = (options) => (options.client ?? client).post({
2188
2548
  /**
2189
2549
  * List session events
2190
2550
  *
2191
- * 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.
2192
2552
  */
2193
2553
  export const sessionsEventsList = (options) => (options.client ?? client).get({
2194
2554
  security: [{
@@ -2206,7 +2566,7 @@ export const sessionsEventsList = (options) => (options.client ?? client).get({
2206
2566
  /**
2207
2567
  * Send session events
2208
2568
  *
2209
- * 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.
2210
2570
  */
2211
2571
  export const sessionsEventsSend = (options) => (options.client ?? client).post({
2212
2572
  security: [{
@@ -2851,6 +3211,20 @@ export const applicationCreateVersion = (options) => (options.client ?? client).
2851
3211
  ...options.headers
2852
3212
  }
2853
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
+ });
2854
3228
  /**
2855
3229
  * Get version
2856
3230
  *
@@ -4534,7 +4908,7 @@ export const databaseListTables = (options) => (options.client ?? client).get({
4534
4908
  /**
4535
4909
  * Create table
4536
4910
  *
4537
- * 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.
4538
4912
  */
4539
4913
  export const databaseCreateTable = (options) => (options.client ?? client).post({
4540
4914
  security: [{
@@ -4598,7 +4972,7 @@ export const databaseUpdateTable = (options) => (options.client ?? client).patch
4598
4972
  /**
4599
4973
  * Add field
4600
4974
  *
4601
- * 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. Scalar fields are indexed by default, while 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.
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.
4602
4976
  */
4603
4977
  export const databaseAddField = (options) => (options.client ?? client).post({
4604
4978
  security: [{
@@ -4676,7 +5050,7 @@ export const databaseDelete = (options) => (options.client ?? client).delete({
4676
5050
  /**
4677
5051
  * Select rows
4678
5052
  *
4679
- * 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. Praxis SDK/codemode methods return the body only; a page length is not a total unless you know all matches fit in that page.
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.
4680
5054
  */
4681
5055
  export const databaseSelect = (options) => (options.client ?? client).get({
4682
5056
  security: [{
@@ -4690,7 +5064,7 @@ export const databaseSelect = (options) => (options.client ?? client).get({
4690
5064
  /**
4691
5065
  * Count rows
4692
5066
  *
4693
- * 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. Praxis SDK/codemode methods return only the empty body, not the Content-Range response header; use an HTTP client when you need that header.
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.
4694
5068
  */
4695
5069
  export const databaseHead = (options) => (options.client ?? client).head({
4696
5070
  security: [{
@@ -4724,7 +5098,7 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
4724
5098
  *
4725
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.
4726
5100
  * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
4727
- * 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.
4728
5102
  */
4729
5103
  export const databaseInsert = (options) => (options.client ?? client).post({
4730
5104
  security: [{