@deepraxis/sdk 0.1.1-dev.27bb19e → 0.1.1-dev.2cf37ec

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.
@@ -1235,6 +1235,72 @@ export const fileCancelUpload = (options) => (options.client ?? client).post({
1235
1235
  url: '/file/v1/uploads/{upload_id}/cancel',
1236
1236
  ...options
1237
1237
  });
1238
+ /**
1239
+ * Create a one-time upload URL
1240
+ *
1241
+ * Upload a local file of up to 2 GiB from a coding agent without sending bytes through the model. Provide basename, exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes), PUT each chunk to its numbered parts[].url in any order, then POST complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid, wrong-action or cross-organization URLs return 404. URL lifetime defaults to 900 seconds for single PUT or 3600 for multipart, at most 604800; all multipart URLs share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {"filename":"photo.png","bytes":2048,"content_type":"image/png"}.
1242
+ */
1243
+ export const fileCreateSignedUpload = (options) => (options.client ?? client).post({
1244
+ security: [{
1245
+ key: 'BearerAuth',
1246
+ scheme: 'bearer',
1247
+ type: 'http'
1248
+ }, {
1249
+ key: 'ApiKeyAuth',
1250
+ name: 'X-API-Key',
1251
+ type: 'apiKey'
1252
+ }],
1253
+ url: '/file/v1/uploads/signed',
1254
+ ...options,
1255
+ headers: {
1256
+ 'Content-Type': 'application/json',
1257
+ ...options.headers
1258
+ }
1259
+ });
1260
+ /**
1261
+ * Create a download URL
1262
+ *
1263
+ * Download a file's bytes to a local disk from a coding agent without sending them through the model. Use file_id from file creation or listing, then run curl -fsSL -o <filename> '<url>' locally with the returned URL; GET needs no Authorization header. The link is reusable until expiry and supports a single byte Range (for example Range: bytes=0-9 returns 206). Revoke it with files.contentLinks.revoke, passing the token after /c/ in the URL. Expired, revoked, invalid or cross-organization URLs return 404. Lifetime defaults to 3600 seconds and is at most 604800 seconds. Issuance requires the same credential and file-read access as files.retrieveContent; a processing file returns 409 FILE_NOT_READY, so poll files.retrieve until active before retrying. A missing, expired or other-organization file returns 404. Each issuance creates a new link. OpenAI Files has no signed download URL; this follows S3 presigned GET semantics. Example body: {"ttl_seconds":3600}.
1264
+ */
1265
+ export const fileCreateContentUrl = (options) => (options.client ?? client).post({
1266
+ security: [{
1267
+ key: 'BearerAuth',
1268
+ scheme: 'bearer',
1269
+ type: 'http'
1270
+ }, {
1271
+ key: 'ApiKeyAuth',
1272
+ name: 'X-API-Key',
1273
+ type: 'apiKey'
1274
+ }],
1275
+ url: '/file/v1/files/{file_id}/content_url',
1276
+ ...options,
1277
+ headers: {
1278
+ 'Content-Type': 'application/json',
1279
+ ...options.headers
1280
+ }
1281
+ });
1282
+ /**
1283
+ * Revoke a file content link
1284
+ *
1285
+ * Stop a previously issued content link from reading a file. Obtain the link with files.contentUrl.create. Use file_id from file creation or listing and the token path component from a content URL (/c/<token>), not the complete URL. The caller must own the file and have write access; a read-only binding is refused. Revocation propagates through the capability deny list within 30 seconds; the file and other links remain available. Only current IAM capability tokens can be revoked; legacy content links expire at the migration deadline. Example body: {"token":"<token from /c/>"}.
1286
+ */
1287
+ export const fileRevokeContentLink = (options) => (options.client ?? client).post({
1288
+ security: [{
1289
+ key: 'BearerAuth',
1290
+ scheme: 'bearer',
1291
+ type: 'http'
1292
+ }, {
1293
+ key: 'ApiKeyAuth',
1294
+ name: 'X-API-Key',
1295
+ type: 'apiKey'
1296
+ }],
1297
+ url: '/file/v1/files/{file_id}/content_links:revoke',
1298
+ ...options,
1299
+ headers: {
1300
+ 'Content-Type': 'application/json',
1301
+ ...options.headers
1302
+ }
1303
+ });
1238
1304
  /**
1239
1305
  * Health Check
1240
1306
  *
@@ -1389,6 +1455,28 @@ export const remixVideo = (options) => (options.client ?? client).post({
1389
1455
  url: '/model/v1/videos/{video_id}/remix',
1390
1456
  ...options
1391
1457
  });
1458
+ /**
1459
+ * Ask structured decision questions
1460
+ *
1461
+ * Ask typed questions about a state and get calibrated probabilities instead of generated text. Same request and response as TypeSafe System One. Use model ids from model.models.list declaring typesafe.systemone. Send one or more noul, choice or score questions; answers use the same question ids. Input tokens are charged at the catalog input price; output tokens are free. usage.cost and X-Praxis-Cost-Usd expose the same customer charge in USD. box questions and assets are unsupported and return 400: images are not supported. Unknown top-level fields pass unchanged to the native upstream.
1462
+ */
1463
+ export const createSystemone = (options) => (options.client ?? client).post({
1464
+ security: [{
1465
+ key: 'BearerAuth',
1466
+ scheme: 'bearer',
1467
+ type: 'http'
1468
+ }, {
1469
+ key: 'ApiKeyAuth',
1470
+ name: 'X-API-Key',
1471
+ type: 'apiKey'
1472
+ }],
1473
+ url: '/model/v1/systemone',
1474
+ ...options,
1475
+ headers: {
1476
+ 'Content-Type': 'application/json',
1477
+ ...options.headers
1478
+ }
1479
+ });
1392
1480
  /**
1393
1481
  * Transcribe audio
1394
1482
  *
@@ -2384,7 +2472,7 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
2384
2472
  /**
2385
2473
  * Run a command in the sandbox
2386
2474
  *
2387
- * Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–60000 milliseconds, default 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout; output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. Example body: {"cmd":"echo hi"}.
2475
+ * Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–3600000 milliseconds, default 600000, that is 10 minutes; E2B defaults to 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout (timeoutMs 0); output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. Example body: {"cmd":"echo hi"}.
2388
2476
  */
2389
2477
  export const runSandboxCommand = (options) => (options.client ?? client).post({
2390
2478
  security: [{
@@ -2464,7 +2552,7 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
2464
2552
  /**
2465
2553
  * List agents
2466
2554
  *
2467
- * List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general or kind=personal for durable-computer agents or kind=service for per-session environments. Pass next_page from the response as page to read the next page; a null next_page means the end.
2555
+ * List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general or kind=personal for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.
2468
2556
  */
2469
2557
  export const agentsList = (options) => (options?.client ?? client).get({
2470
2558
  security: [{
@@ -2482,7 +2570,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
2482
2570
  /**
2483
2571
  * Create agent
2484
2572
  *
2485
- * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}.
2573
+ * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; omit computer_id to register a new computer named after the agent without starting an instance, or provide an existing computer_id; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
2486
2574
  */
2487
2575
  export const agentsCreate = (options) => (options.client ?? client).post({
2488
2576
  security: [{
@@ -2522,7 +2610,7 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
2522
2610
  /**
2523
2611
  * Update agent
2524
2612
  *
2525
- * Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400.
2613
+ * Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Assume agents reject model, models, subagent_model, subagents and multiagent on every update; other fields follow the general agent rules, with vault_ids also accepted.
2526
2614
  */
2527
2615
  export const agentsUpdate = (options) => (options.client ?? client).post({
2528
2616
  security: [{
@@ -2598,7 +2686,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
2598
2686
  /**
2599
2687
  * Create session
2600
2688
  *
2601
- * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.
2689
+ * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.
2602
2690
  */
2603
2691
  export const sessionsCreate = (options) => (options.client ?? client).post({
2604
2692
  security: [{
@@ -3624,7 +3712,7 @@ export const applicationListGrants = (options) => (options.client ?? client).get
3624
3712
  /**
3625
3713
  * Create grant
3626
3714
  *
3627
- * Let this Worker's platform token access one of your databases, folders or knowledge bases.
3715
+ * Record access to an organization-owned database or knowledge base, all organization files (files, id *), or models (models, id *, read only). Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
3628
3716
  */
3629
3717
  export const applicationCreateGrant = (options) => (options.client ?? client).post({
3630
3718
  security: [{
@@ -3769,7 +3857,7 @@ export const automationActionsGet = (options) => (options.client ?? client).get(
3769
3857
  /**
3770
3858
  * Update an action
3771
3859
  *
3772
- * Update after checking compatibility against the current and five recent revisions. Widening inputs and narrowing outputs are compatible, including length, item count, property count, type (integer/number), and multipleOf (the new input factor divides the old one; the reverse holds for outputs). dry_run=true returns only CompatResult and may omit If-Match; a supplied header is still checked, and * matches any existing representation. Normal updates require If-Match and return ActionDef with ETag; previews return no ETag. Omitted optional fields retain their existing values only for description and labels; when constructing a new revision, errors defaults to [], omitted annotations keys to false, timeout_ms to 30000, and message to null. Incompatible normal updates return 422 SCHEMA_INCOMPATIBLE with issues; unchanged contents retain the existing revision.
3860
+ * Update after checking compatibility against the current and five recent revisions. Widening inputs and narrowing outputs are compatible, including length, item count, property count, type (integer/number), and multipleOf (the new input factor divides the old one; the reverse holds for outputs). dry_run=true returns only CompatResult and may omit If-Match; a supplied header is still checked, and * matches any existing representation. Normal updates require If-Match and return ActionDef with ETag; previews return no ETag. Omitted optional fields retain their existing values only for description and labels; when constructing a new revision, errors defaults to [], omitted annotations keys to false, timeout_ms to 300000, and message to null. Incompatible normal updates return 422 SCHEMA_INCOMPATIBLE with issues; unchanged contents retain the existing revision.
3773
3861
  */
3774
3862
  export const automationActionsUpdate = (options) => (options.client ?? client).put({
3775
3863
  security: [{
@@ -4212,7 +4300,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
4212
4300
  /**
4213
4301
  * Create a workflow
4214
4302
  *
4215
- * Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 30 s (run-sandbox 10 min), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
4303
+ * Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 5 min (run-sandbox 6 h), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. To pause for a person, call praxis/approval (it opens a human task; the step output is the decision); agents answer with praxis.automation.humanTasks.respond on behalf of their user. Guide: /docs/developers/automation/guides/approvals Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
4216
4304
  */
4217
4305
  export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
4218
4306
  security: [{
@@ -4544,7 +4632,7 @@ export const automationRunsList = (options) => (options?.client ?? client).get({
4544
4632
  /**
4545
4633
  * Run a published target or execute draft source
4546
4634
  *
4547
- * Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 30 s (run-sandbox after 10 min); scripts have a 5 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 30 days. Each run can start at most 100 child runs, with at most 20 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.
4635
+ * Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 5 min (run-sandbox after 6 h); scripts have a 30 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 30 days. Each run can start at most 1,000 child runs, with at most 100 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.
4548
4636
  */
4549
4637
  export const automationRunsCreate = (options) => (options.client ?? client).post({
4550
4638
  security: [{
@@ -5151,31 +5239,57 @@ export const automationHumanTasksDelegate = (options) => (options.client ?? clie
5151
5239
  }
5152
5240
  });
5153
5241
  /**
5154
- * List databases
5242
+ * List script vault bindings
5155
5243
  *
5156
- * Find databases owned by your tenant and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
5244
+ * Inspect the whole vaults attached to a saved script, including archived definitions, without reading secret values. Obtain ns and name from automation.scripts.list. Bindings belong to the definition rather than a published version. When vault or secret metadata cannot be read, the binding remains visible with secrets: [] and secrets_unavailable: true.
5157
5245
  */
5158
- export const databaseListDatabases = (options) => (options?.client ?? client).get({
5246
+ export const automationScriptsVaultsList = (options) => (options.client ?? client).get({
5159
5247
  security: [{
5160
- key: 'database-bearerAuth',
5248
+ key: 'BearerAuth',
5161
5249
  scheme: 'bearer',
5162
5250
  type: 'http'
5251
+ }, {
5252
+ key: 'ApiKeyAuth',
5253
+ name: 'X-API-Key',
5254
+ type: 'apiKey'
5163
5255
  }],
5164
- url: '/database/v1/databases',
5256
+ url: '/automation/v1/scripts/{ns}/{name}/vaults',
5165
5257
  ...options
5166
5258
  });
5167
5259
  /**
5168
- * Create database
5260
+ * Delete a script vault binding
5169
5261
  *
5170
- * Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
5262
+ * Remove the vault assignment from this saved script without deleting the vault or its secrets. Obtain aliases from automation.scripts.vaults.list. Repeating deletion of an absent alias on an existing definition succeeds. Bindings also disappear when the definition is permanently deleted, while archival retains them.
5171
5263
  */
5172
- export const databaseCreateDatabase = (options) => (options.client ?? client).post({
5264
+ export const automationScriptsVaultsDelete = (options) => (options.client ?? client).delete({
5173
5265
  security: [{
5174
- key: 'database-bearerAuth',
5266
+ key: 'BearerAuth',
5175
5267
  scheme: 'bearer',
5176
5268
  type: 'http'
5269
+ }, {
5270
+ key: 'ApiKeyAuth',
5271
+ name: 'X-API-Key',
5272
+ type: 'apiKey'
5177
5273
  }],
5178
- url: '/database/v1/databases',
5274
+ url: '/automation/v1/scripts/{ns}/{name}/vaults/{alias}',
5275
+ ...options
5276
+ });
5277
+ /**
5278
+ * Set a script vault binding
5279
+ *
5280
+ * Attach an entire active vault in your organization to a saved script, or replace the vault at an existing alias. Obtain the vault ID or display name from praxis.vault.vaults.list; ambiguous names require an ID. Bindings are independent of published versions and survive archival. The same vault cannot be assigned to two aliases on one definition. Repeating the same assignment is idempotent. Example body: {"vault":"Production"}.
5281
+ */
5282
+ export const automationScriptsVaultsSet = (options) => (options.client ?? client).put({
5283
+ security: [{
5284
+ key: 'BearerAuth',
5285
+ scheme: 'bearer',
5286
+ type: 'http'
5287
+ }, {
5288
+ key: 'ApiKeyAuth',
5289
+ name: 'X-API-Key',
5290
+ type: 'apiKey'
5291
+ }],
5292
+ url: '/automation/v1/scripts/{ns}/{name}/vaults/{alias}',
5179
5293
  ...options,
5180
5294
  headers: {
5181
5295
  'Content-Type': 'application/json',
@@ -5183,45 +5297,57 @@ export const databaseCreateDatabase = (options) => (options.client ?? client).po
5183
5297
  }
5184
5298
  });
5185
5299
  /**
5186
- * Delete database
5300
+ * List workflow vault bindings
5187
5301
  *
5188
- * Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
5302
+ * Inspect the whole vaults attached to a saved workflow, including archived definitions, without reading secret values. Obtain ns and name from automation.workflows.list. Bindings belong to the definition rather than a published version. When vault or secret metadata cannot be read, the binding remains visible with secrets: [] and secrets_unavailable: true.
5189
5303
  */
5190
- export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
5304
+ export const automationWorkflowsVaultsList = (options) => (options.client ?? client).get({
5191
5305
  security: [{
5192
- key: 'database-bearerAuth',
5306
+ key: 'BearerAuth',
5193
5307
  scheme: 'bearer',
5194
5308
  type: 'http'
5309
+ }, {
5310
+ key: 'ApiKeyAuth',
5311
+ name: 'X-API-Key',
5312
+ type: 'apiKey'
5195
5313
  }],
5196
- url: '/database/v1/databases/{database_id}',
5314
+ url: '/automation/v1/workflows/{ns}/{name}/vaults',
5197
5315
  ...options
5198
5316
  });
5199
5317
  /**
5200
- * Get database
5318
+ * Delete a workflow vault binding
5201
5319
  *
5202
- * Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id returns 404 DATABASE_NOT_FOUND.
5320
+ * Remove the vault assignment from this saved workflow without deleting the vault or its secrets. Obtain aliases from automation.workflows.vaults.list. Repeating deletion of an absent alias on an existing definition succeeds. Bindings also disappear when the definition is permanently deleted, while archival retains them.
5203
5321
  */
5204
- export const databaseGetDatabase = (options) => (options.client ?? client).get({
5322
+ export const automationWorkflowsVaultsDelete = (options) => (options.client ?? client).delete({
5205
5323
  security: [{
5206
- key: 'database-bearerAuth',
5324
+ key: 'BearerAuth',
5207
5325
  scheme: 'bearer',
5208
5326
  type: 'http'
5327
+ }, {
5328
+ key: 'ApiKeyAuth',
5329
+ name: 'X-API-Key',
5330
+ type: 'apiKey'
5209
5331
  }],
5210
- url: '/database/v1/databases/{database_id}',
5332
+ url: '/automation/v1/workflows/{ns}/{name}/vaults/{alias}',
5211
5333
  ...options
5212
5334
  });
5213
5335
  /**
5214
- * Update database
5336
+ * Set a workflow vault binding
5215
5337
  *
5216
- * Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreDatabase.
5338
+ * Attach an entire active vault in your organization to a saved workflow, or replace the vault at an existing alias. Obtain the vault ID or display name from praxis.vault.vaults.list; ambiguous names require an ID. Bindings are independent of published versions and survive archival. The same vault cannot be assigned to two aliases on one definition. Repeating the same assignment is idempotent. Example body: {"vault":"Production"}.
5217
5339
  */
5218
- export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
5340
+ export const automationWorkflowsVaultsSet = (options) => (options.client ?? client).put({
5219
5341
  security: [{
5220
- key: 'database-bearerAuth',
5342
+ key: 'BearerAuth',
5221
5343
  scheme: 'bearer',
5222
5344
  type: 'http'
5345
+ }, {
5346
+ key: 'ApiKeyAuth',
5347
+ name: 'X-API-Key',
5348
+ type: 'apiKey'
5223
5349
  }],
5224
- url: '/database/v1/databases/{database_id}',
5350
+ url: '/automation/v1/workflows/{ns}/{name}/vaults/{alias}',
5225
5351
  ...options,
5226
5352
  headers: {
5227
5353
  'Content-Type': 'application/json',
@@ -5229,123 +5355,149 @@ export const databaseUpdateDatabase = (options) => (options.client ?? client).pa
5229
5355
  }
5230
5356
  });
5231
5357
  /**
5232
- * Restore database
5358
+ * List canvases
5233
5359
  *
5234
- * Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
5360
+ * Discover canvases in the API key's organization and obtain ids for retrieval or editing. Results are ordered by updated_at from newest to oldest. limit is 1–100 and defaults to 50; omit cursor for the first page, then copy next_cursor into the next request until it is null. Deleted canvases are unavailable.
5235
5361
  */
5236
- export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
5362
+ export const canvasListCanvases = (options) => (options?.client ?? client).get({
5237
5363
  security: [{
5238
- key: 'database-bearerAuth',
5364
+ key: 'canvas-bearerAuth',
5239
5365
  scheme: 'bearer',
5240
5366
  type: 'http'
5241
5367
  }],
5242
- url: '/database/v1/databases/{database_id}/restore',
5368
+ url: '/canvas/v1/canvases',
5243
5369
  ...options
5244
5370
  });
5245
5371
  /**
5246
- * Permanently purge database
5372
+ * Create canvas
5247
5373
  *
5248
- * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
5374
+ * Create a blank design canvas in the API key's organization before drawing with praxis.canvas.canvases.execute. Send an optional name of at most 200 characters; omitting name uses Untitled. Each successful call creates a new canvas and returns its id and viewer_url with HTTP 201; save the id for subsequent reads, edits and deletion.
5249
5375
  */
5250
- export const databasePurgeDatabase = (options) => (options.client ?? client).post({
5376
+ export const canvasCreateCanvas = (options) => (options?.client ?? client).post({
5251
5377
  security: [{
5252
- key: 'database-bearerAuth',
5378
+ key: 'canvas-bearerAuth',
5253
5379
  scheme: 'bearer',
5254
5380
  type: 'http'
5255
5381
  }],
5256
- url: '/database/v1/databases/{database_id}/purge',
5257
- ...options
5382
+ url: '/canvas/v1/canvases',
5383
+ ...options,
5384
+ headers: {
5385
+ 'Content-Type': 'application/json',
5386
+ ...options?.headers
5387
+ }
5258
5388
  });
5259
5389
  /**
5260
- * List tables
5390
+ * Delete canvas
5261
5391
  *
5262
- * Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseGetTable instead when you also need row_count for one table.
5392
+ * Permanently delete a canvas and its design content when it is no longer needed. Obtain canvas_id from create or list and confirm the target before calling; deletion cannot be undone. HTTP 200 confirms deletion with deleted=true. Subsequent access returns CANVAS_NOT_FOUND, as it does for a missing canvas or one outside the API key's organization.
5263
5393
  */
5264
- export const databaseListTables = (options) => (options.client ?? client).get({
5394
+ export const canvasDeleteCanvas = (options) => (options.client ?? client).delete({
5265
5395
  security: [{
5266
- key: 'database-bearerAuth',
5396
+ key: 'canvas-bearerAuth',
5267
5397
  scheme: 'bearer',
5268
5398
  type: 'http'
5269
5399
  }],
5270
- url: '/database/v1/databases/{database_id}/tables',
5400
+ url: '/canvas/v1/canvases/{canvas_id}',
5271
5401
  ...options
5272
5402
  });
5273
5403
  /**
5274
- * Create table
5404
+ * Retrieve canvas
5275
5405
  *
5276
- * 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.
5406
+ * Inspect the current canvas before editing, like Pencil get_app_state. The response adds top-level node summaries in canvas order and reusable component ids to the canvas metadata. Use these ids in nodes.list, images.list or an execute script; use the returned version as expected_version to detect concurrent edits. Read full node content with nodes.list rather than guessing fields from these summaries.
5277
5407
  */
5278
- export const databaseCreateTable = (options) => (options.client ?? client).post({
5408
+ export const canvasRetrieveCanvas = (options) => (options.client ?? client).get({
5279
5409
  security: [{
5280
- key: 'database-bearerAuth',
5410
+ key: 'canvas-bearerAuth',
5281
5411
  scheme: 'bearer',
5282
5412
  type: 'http'
5283
5413
  }],
5284
- url: '/database/v1/databases/{database_id}/tables',
5285
- ...options,
5286
- headers: {
5287
- 'Content-Type': 'application/json',
5288
- ...options.headers
5289
- }
5414
+ url: '/canvas/v1/canvases/{canvas_id}',
5415
+ ...options
5290
5416
  });
5291
5417
  /**
5292
- * Delete table
5418
+ * Update canvas
5293
5419
  *
5294
- * Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
5420
+ * Rename a canvas or move it to a collection without editing its design content. Use a canvas id from canvases.list and a collection id from collections.list. Send collection_id=null to make it uncategorized; omit either field to preserve its current value. A canvas belongs to at most one collection. The destination must belong to your organization. Renaming keeps the canvas version unchanged.
5295
5421
  */
5296
- export const databaseDeleteTable = (options) => (options.client ?? client).delete({
5422
+ export const canvasUpdateCanvas = (options) => (options.client ?? client).patch({
5297
5423
  security: [{
5298
- key: 'database-bearerAuth',
5424
+ key: 'BearerAuth',
5299
5425
  scheme: 'bearer',
5300
5426
  type: 'http'
5427
+ }, {
5428
+ key: 'ApiKeyAuth',
5429
+ name: 'X-API-Key',
5430
+ type: 'apiKey'
5301
5431
  }],
5302
- url: '/database/v1/databases/{database_id}/tables/{table}',
5303
- ...options
5432
+ url: '/canvas/v1/canvases/{canvas_id}',
5433
+ ...options,
5434
+ headers: {
5435
+ 'Content-Type': 'application/json',
5436
+ ...options.headers
5437
+ }
5304
5438
  });
5305
5439
  /**
5306
- * Get table
5440
+ * Read canvas nodes
5307
5441
  *
5308
- * Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
5442
+ * Read node documents for inspection before changing individual nodes. Supply 1–100 comma-separated node ids from retrieve or execute, or instance paths such as a/b. depth is an integer at least 0; omit it for complete subtrees. Each requested id maps to a document wrapper or null if absent. Unlike Figma, document contains a Pencil .pen 2.21 node, not a Figma node. For top-level summaries use canvases.retrieve; for pixels use images.list.
5309
5443
  */
5310
- export const databaseGetTable = (options) => (options.client ?? client).get({
5444
+ export const canvasListNodes = (options) => (options.client ?? client).get({
5311
5445
  security: [{
5312
- key: 'database-bearerAuth',
5446
+ key: 'canvas-bearerAuth',
5313
5447
  scheme: 'bearer',
5314
5448
  type: 'http'
5315
5449
  }],
5316
- url: '/database/v1/databases/{database_id}/tables/{table}',
5450
+ url: '/canvas/v1/canvases/{canvas_id}/nodes',
5317
5451
  ...options
5318
5452
  });
5319
5453
  /**
5320
- * Update table
5454
+ * Render canvas nodes
5321
5455
  *
5322
- * Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseAddField, databaseUpdateField and databaseDeleteField.
5456
+ * Render 1–4 nodes to inspect the visual result of a design edit. Use ids from retrieve, execute.created or execute.screenshots; scale defaults to 1 and accepts 0.25–4, and png is the only supported format. Unlike Figma, images contains inline data:image/png;base64,... URLs, not hosted image URLs; a null entry means no image is available for that id. Use nodes.list for editable node content instead of pixels.
5323
5457
  */
5324
- export const databaseUpdateTable = (options) => (options.client ?? client).patch({
5458
+ export const canvasListImages = (options) => (options.client ?? client).get({
5325
5459
  security: [{
5326
- key: 'database-bearerAuth',
5460
+ key: 'canvas-bearerAuth',
5327
5461
  scheme: 'bearer',
5328
5462
  type: 'http'
5329
5463
  }],
5330
- url: '/database/v1/databases/{database_id}/tables/{table}',
5331
- ...options,
5332
- headers: {
5333
- 'Content-Type': 'application/json',
5334
- ...options.headers
5335
- }
5464
+ url: '/canvas/v1/canvases/{canvas_id}/images',
5465
+ ...options
5336
5466
  });
5337
5467
  /**
5338
- * Add field
5468
+ * Execute canvas script
5469
+ *
5470
+ * Draw or edit a canvas atomically with a synchronous Pencil execute script. First create a canvas with praxis.canvas.canvases.create and use its id as canvas_id; inspect an existing canvas with retrieve before modifying it. Send exactly one of script (new source) or edit_id (a failed script to patch using edits). Unlike Figma REST, :execute writes design content; nodes use Pencil .pen schema 2.21 (frame/group/rectangle/ellipse/polygon/path/text/icon/ref/note), not Figma node fields.
5471
+ *
5472
+ * The root variable is document. Synchronous functions are Insert / Copy / Update / Replace / Move / Delete / SetVariables / Get / GetVariables / FindEmptySpace / Print / TakeScreenshot; globals persist for the next call. A first frame needs only this body.script:
5473
+ *
5474
+ * ```js
5475
+ * const f = Insert(document, { type: "frame", name: "Hero", width: 1200, layout: "vertical", padding: 48, fill: "#FFFFFF" }); Insert(f, { type: "text", content: "Hello", fontSize: 32, fill: "#111111" }); Print(f)
5476
+ * ```
5477
+ *
5478
+ * Insert/Copy return the new node id; read the copy with Get(id) — copied descendants get new ids, so change them through Copy's third argument `descendants` keyed by the source node ids. To copy a page and change its title in the same script:
5479
+ *
5480
+ * ```js canvas-example="copy-page"
5481
+ * const page = Insert(document, {type:"frame",name:"Original",width:320,height:160,layout:"vertical",padding:16});
5482
+ * const title = Insert(page, {type:"text",name:"Title",content:"Original",fontSize:24});
5483
+ * const copy = Copy(page, document, {name:"Copy",x:360,descendants:{[title]:{content:"Updated"}}});
5484
+ * Print(copy); Print(Get(copy).children[0].content);
5485
+ * ```
5486
+ *
5487
+ * Use viewer_url to watch the result in Console. TakeScreenshot records node ids in screenshots; call images.list with those ids to fetch PNG data URLs. See the [Canvas execute reference](https://deepraxis.com/en/docs/api/native/canvas/execute) for request fields and results, and the [Canvas node reference](https://deepraxis.com/en/docs/developers/canvas/nodes) for node content.
5488
+ *
5489
+ * A successful write increments version by one. Optionally set expected_version to the version from retrieve or nodes.list; on 409 REVISION_CONFLICT read again, merge your intent and retry with the current version. Every script failure rolls back all writes. On 400 SCRIPT_ERROR, SCRIPT_LIMIT or OPS_REJECTED, use error.details.edit_id plus edits to repair and rerun the stored source without resending the entire script; details may include line, column and rejection. On 400 EDIT_EXPIRED the saved script is older than ten minutes: submit a corrected new script. On 429 CANVAS_BUSY, more than four calls are queued for this canvas: wait for pending calls before retrying.
5490
+ *
5491
+ * Execution errors include error.details.prints containing output printed before failure, with the same string-array shape and output limit as successful prints; rolled-back writes still create no version.
5339
5492
  *
5340
- * 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.
5341
5493
  */
5342
- export const databaseAddField = (options) => (options.client ?? client).post({
5494
+ export const canvasExecute = (options) => (options.client ?? client).post({
5343
5495
  security: [{
5344
- key: 'database-bearerAuth',
5496
+ key: 'canvas-bearerAuth',
5345
5497
  scheme: 'bearer',
5346
5498
  type: 'http'
5347
5499
  }],
5348
- url: '/database/v1/databases/{database_id}/tables/{table}/fields',
5500
+ url: '/canvas/v1/canvases/{canvas_id}:execute',
5349
5501
  ...options,
5350
5502
  headers: {
5351
5503
  'Content-Type': 'application/json',
@@ -5353,31 +5505,39 @@ export const databaseAddField = (options) => (options.client ?? client).post({
5353
5505
  }
5354
5506
  });
5355
5507
  /**
5356
- * Delete field
5508
+ * List collections
5357
5509
  *
5358
- * Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
5510
+ * Find collections and ids for filtering or moving canvases. All organization collections are returned in name order in one response; next_cursor is always null. canvas_count excludes deleted canvases. total_count counts all live canvases, rather than collections, and uncategorized_count counts live canvases without a collection. Use canvases.list with collection_id to read a collection or none to read uncategorized canvases.
5359
5511
  */
5360
- export const databaseDeleteField = (options) => (options.client ?? client).delete({
5512
+ export const canvasListCollections = (options) => (options?.client ?? client).get({
5361
5513
  security: [{
5362
- key: 'database-bearerAuth',
5514
+ key: 'BearerAuth',
5363
5515
  scheme: 'bearer',
5364
5516
  type: 'http'
5517
+ }, {
5518
+ key: 'ApiKeyAuth',
5519
+ name: 'X-API-Key',
5520
+ type: 'apiKey'
5365
5521
  }],
5366
- url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
5522
+ url: '/canvas/v1/collections',
5367
5523
  ...options
5368
5524
  });
5369
5525
  /**
5370
- * Update field
5526
+ * Create collection
5371
5527
  *
5372
- * Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
5528
+ * Organize canvases by creating a one-level collection in your organization. Send a name of 1–100 characters after trimming; duplicate names are allowed. Each call creates a new collection, initially containing no canvases. Use canvases.update with its id as collection_id to move existing canvases into it. Collections cannot be nested and an organization can have at most 200.
5373
5529
  */
5374
- export const databaseUpdateField = (options) => (options.client ?? client).patch({
5530
+ export const canvasCreateCollection = (options) => (options.client ?? client).post({
5375
5531
  security: [{
5376
- key: 'database-bearerAuth',
5532
+ key: 'BearerAuth',
5377
5533
  scheme: 'bearer',
5378
5534
  type: 'http'
5535
+ }, {
5536
+ key: 'ApiKeyAuth',
5537
+ name: 'X-API-Key',
5538
+ type: 'apiKey'
5379
5539
  }],
5380
- url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
5540
+ url: '/canvas/v1/collections',
5381
5541
  ...options,
5382
5542
  headers: {
5383
5543
  'Content-Type': 'application/json',
@@ -5385,93 +5545,97 @@ export const databaseUpdateField = (options) => (options.client ?? client).patch
5385
5545
  }
5386
5546
  });
5387
5547
  /**
5388
- * List events
5548
+ * Delete collection
5389
5549
  *
5390
- * Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
5550
+ * Remove a collection using an id from collections.list. All its canvases are preserved and become uncategorized, with collection_id set to null; read them using canvases.list with collection_id=none. The removed collection cannot be retrieved again, and repeating deletion returns COLLECTION_NOT_FOUND.
5391
5551
  */
5392
- export const databaseListEvents = (options) => (options.client ?? client).get({
5552
+ export const canvasDeleteCollection = (options) => (options.client ?? client).delete({
5393
5553
  security: [{
5394
- key: 'database-bearerAuth',
5554
+ key: 'BearerAuth',
5395
5555
  scheme: 'bearer',
5396
5556
  type: 'http'
5557
+ }, {
5558
+ key: 'ApiKeyAuth',
5559
+ name: 'X-API-Key',
5560
+ type: 'apiKey'
5397
5561
  }],
5398
- url: '/database/v1/databases/{database_id}/events',
5562
+ url: '/canvas/v1/collections/{collection_id}',
5399
5563
  ...options
5400
5564
  });
5401
5565
  /**
5402
- * Delete rows
5566
+ * Retrieve collection
5403
5567
  *
5404
- * Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
5568
+ * Inspect one collection and its current live canvas count using an id from collections.list or collections.create. The collection must belong to the API key organization. To read its canvases, pass the same id as collection_id to canvases.list; this response contains collection metadata only.
5405
5569
  */
5406
- export const databaseDelete = (options) => (options.client ?? client).delete({
5570
+ export const canvasRetrieveCollection = (options) => (options.client ?? client).get({
5407
5571
  security: [{
5408
- key: 'database-bearerAuth',
5572
+ key: 'BearerAuth',
5409
5573
  scheme: 'bearer',
5410
5574
  type: 'http'
5575
+ }, {
5576
+ key: 'ApiKeyAuth',
5577
+ name: 'X-API-Key',
5578
+ type: 'apiKey'
5411
5579
  }],
5412
- url: '/database/v1/databases/{database_id}/rest/{table}',
5580
+ url: '/canvas/v1/collections/{collection_id}',
5413
5581
  ...options
5414
5582
  });
5415
5583
  /**
5416
- * Select rows
5584
+ * Rename collection
5417
5585
  *
5418
- * 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.
5586
+ * Change the display name of a collection from collections.list without changing its id or canvas assignments. Names contain 1–100 characters after trimming and may match another collection name. This operation does not move canvases; use canvases.update with collection_id for that.
5419
5587
  */
5420
- export const databaseSelect = (options) => (options.client ?? client).get({
5588
+ export const canvasUpdateCollection = (options) => (options.client ?? client).patch({
5421
5589
  security: [{
5422
- key: 'database-bearerAuth',
5590
+ key: 'BearerAuth',
5423
5591
  scheme: 'bearer',
5424
5592
  type: 'http'
5593
+ }, {
5594
+ key: 'ApiKeyAuth',
5595
+ name: 'X-API-Key',
5596
+ type: 'apiKey'
5425
5597
  }],
5426
- url: '/database/v1/databases/{database_id}/rest/{table}',
5427
- ...options
5598
+ url: '/canvas/v1/collections/{collection_id}',
5599
+ ...options,
5600
+ headers: {
5601
+ 'Content-Type': 'application/json',
5602
+ ...options.headers
5603
+ }
5428
5604
  });
5429
5605
  /**
5430
- * Count rows
5606
+ * List canvas versions
5431
5607
  *
5432
- * 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.
5608
+ * Inspect retained edits before restoring a canvas or reading historical nodes and images. Supply a canvas_id from canvases.list or create. Results include successful execute, import and restore commits since history was enabled, newest first. limit is 1–100 and defaults to 30; pass next_cursor as cursor until it is null. All versions from the last 30 days are retained unless the 256 MiB history budget requires pruning; the newest 100 versions are always retained regardless of age or size. earliest_restorable_version is the oldest readable and restorable version, including the state immediately before the first retained commit; null means no history has been recorded. Listing does not change the canvas.
5433
5609
  */
5434
- export const databaseHead = (options) => (options.client ?? client).head({
5610
+ export const canvasListVersions = (options) => (options.client ?? client).get({
5435
5611
  security: [{
5436
- key: 'database-bearerAuth',
5612
+ key: 'BearerAuth',
5437
5613
  scheme: 'bearer',
5438
5614
  type: 'http'
5615
+ }, {
5616
+ key: 'ApiKeyAuth',
5617
+ name: 'X-API-Key',
5618
+ type: 'apiKey'
5439
5619
  }],
5440
- url: '/database/v1/databases/{database_id}/rest/{table}',
5620
+ url: '/canvas/v1/canvases/{canvas_id}/versions',
5441
5621
  ...options
5442
5622
  });
5443
5623
  /**
5444
- * Update rows
5445
- *
5446
- * Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
5447
- */
5448
- export const databaseUpdate = (options) => (options.client ?? client).patch({
5449
- security: [{
5450
- key: 'database-bearerAuth',
5451
- scheme: 'bearer',
5452
- type: 'http'
5453
- }],
5454
- url: '/database/v1/databases/{database_id}/rest/{table}',
5455
- ...options,
5456
- headers: {
5457
- 'Content-Type': 'application/json',
5458
- ...options.headers
5459
- }
5460
- });
5461
- /**
5462
- * Insert rows
5624
+ * Restore canvas version
5463
5625
  *
5464
- * 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.
5465
- * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
5466
- * 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.
5626
+ * Recover a canvas after an unwanted edit by restoring a retained version from versions.list or its earliest_restorable_version. This replaces current nodes, variables and themes with the target state and creates one new version; history remains available, so restoring can itself be undone with another restore. Restoring the current version succeeds without creating a version. Optionally guard the write with expected_version from retrieve or nodes.list; if it is stale, inspect current state and retry with the new value. Repeating an unguarded request after another edit can create another restore version. Versions from before history was enabled or outside retention cannot be recovered. Connected viewers resync after a successful restore.
5467
5627
  */
5468
- export const databaseInsert = (options) => (options.client ?? client).post({
5628
+ export const canvasRestoreCanvas = (options) => (options.client ?? client).post({
5469
5629
  security: [{
5470
- key: 'database-bearerAuth',
5630
+ key: 'BearerAuth',
5471
5631
  scheme: 'bearer',
5472
5632
  type: 'http'
5633
+ }, {
5634
+ key: 'ApiKeyAuth',
5635
+ name: 'X-API-Key',
5636
+ type: 'apiKey'
5473
5637
  }],
5474
- url: '/database/v1/databases/{database_id}/rest/{table}',
5638
+ url: '/canvas/v1/canvases/{canvas_id}:restore',
5475
5639
  ...options,
5476
5640
  headers: {
5477
5641
  'Content-Type': 'application/json',
@@ -5479,31 +5643,39 @@ export const databaseInsert = (options) => (options.client ?? client).post({
5479
5643
  }
5480
5644
  });
5481
5645
  /**
5482
- * List knowledge bases
5646
+ * List projects
5483
5647
  *
5484
- * Lists knowledge bases visible to the caller, newest first by default. Use last_id as after to read the next page; for example, ?limit=20.
5648
+ * Discover projects owned by the API key organization and obtain project_id values. Results default to active projects ordered by updateTime descending; use filter state = "deleted" to find retained deleted projects for undelete. Continue with next_page_token as page_token until the token is absent.
5485
5649
  */
5486
- export const knowledgeListVectorStores = (options) => (options?.client ?? client).get({
5650
+ export const cutListProjects = (options) => (options?.client ?? client).get({
5487
5651
  security: [{
5488
- key: 'knowledge-bearerAuth',
5652
+ key: 'BearerAuth',
5489
5653
  scheme: 'bearer',
5490
5654
  type: 'http'
5655
+ }, {
5656
+ key: 'ApiKeyAuth',
5657
+ name: 'X-API-Key',
5658
+ type: 'apiKey'
5491
5659
  }],
5492
- url: '/knowledge/v1/vector_stores',
5660
+ url: '/cut/v1/projects',
5493
5661
  ...options
5494
5662
  });
5495
5663
  /**
5496
- * Create knowledge base
5664
+ * Create project
5497
5665
  *
5498
- * Create a knowledge base, optionally starting ingestion of uploaded file_ids in the same call; no separate attachment or batch is needed for those files. Use the returned id with vectorStores.files.retrieve to poll each attachment until completed, failed or cancelled; store status=completed alone does not mean every file succeeded. Unlike OpenAI vector stores, each file is limited to 100000000 bytes and each account to 100 active/nondeleted stores. Minimal body: {"name":"Refund policies"}.
5666
+ * Create a blank editing project in the API key organization before writing a script. First obtain accessible library ids from praxis.media; bindings must include exactly one read_write library with default_upload true. Each call creates a new project and returns HTTP 201; save its id for execute, state and timeline calls. All editing positions use seconds.
5499
5667
  */
5500
- export const knowledgeCreateVectorStore = (options) => (options.client ?? client).post({
5668
+ export const cutCreateProject = (options) => (options.client ?? client).post({
5501
5669
  security: [{
5502
- key: 'knowledge-bearerAuth',
5670
+ key: 'BearerAuth',
5503
5671
  scheme: 'bearer',
5504
5672
  type: 'http'
5673
+ }, {
5674
+ key: 'ApiKeyAuth',
5675
+ name: 'X-API-Key',
5676
+ type: 'apiKey'
5505
5677
  }],
5506
- url: '/knowledge/v1/vector_stores',
5678
+ url: '/cut/v1/projects',
5507
5679
  ...options,
5508
5680
  headers: {
5509
5681
  'Content-Type': 'application/json',
@@ -5511,45 +5683,57 @@ export const knowledgeCreateVectorStore = (options) => (options.client ?? client
5511
5683
  }
5512
5684
  });
5513
5685
  /**
5514
- * Delete knowledge base
5686
+ * Delete project
5515
5687
  *
5516
- * Remove a knowledge base from active use while keeping a recovery window. Unlike OpenAI vector stores, native DELETE returns the store with status=deleting and ISO purge_at, retains it for 7 days and is idempotent on repeat. Retrieve remains 200; object operations return 409. Use restore before purge_at to recover it, or purge to remove it irreversibly.
5688
+ * Soft-delete a project selected from projects.list. The project is retained for seven days until purge_time and can be restored with undelete before that deadline. Deleted projects cannot be edited; list with filter state = "deleted" to locate retained projects.
5517
5689
  */
5518
- export const knowledgeDeleteVectorStore = (options) => (options.client ?? client).delete({
5690
+ export const cutDeleteProject = (options) => (options.client ?? client).delete({
5519
5691
  security: [{
5520
- key: 'knowledge-bearerAuth',
5692
+ key: 'BearerAuth',
5521
5693
  scheme: 'bearer',
5522
5694
  type: 'http'
5695
+ }, {
5696
+ key: 'ApiKeyAuth',
5697
+ name: 'X-API-Key',
5698
+ type: 'apiKey'
5523
5699
  }],
5524
- url: '/knowledge/v1/vector_stores/{vector_store_id}',
5700
+ url: '/cut/v1/projects/{project_id}',
5525
5701
  ...options
5526
5702
  });
5527
5703
  /**
5528
- * Retrieve knowledge base
5704
+ * Retrieve project
5529
5705
  *
5530
- * Retrieves a knowledge base using an id returned by create or list. Add ?expand=files to include the first page of attached files. Soft-deleted stores remain readable with status=deleting until purged.
5706
+ * Inspect project metadata, settings and library bindings before editing. Copy id from projects.create or list; expand=timeline,exports,versions includes selected related resources. The expanded timeline uses seconds and the returned revision can guard a later execute call with expected_revision.
5531
5707
  */
5532
- export const knowledgeRetrieveVectorStore = (options) => (options.client ?? client).get({
5708
+ export const cutRetrieveProject = (options) => (options.client ?? client).get({
5533
5709
  security: [{
5534
- key: 'knowledge-bearerAuth',
5710
+ key: 'BearerAuth',
5535
5711
  scheme: 'bearer',
5536
5712
  type: 'http'
5713
+ }, {
5714
+ key: 'ApiKeyAuth',
5715
+ name: 'X-API-Key',
5716
+ type: 'apiKey'
5537
5717
  }],
5538
- url: '/knowledge/v1/vector_stores/{vector_store_id}',
5718
+ url: '/cut/v1/projects/{project_id}',
5539
5719
  ...options
5540
5720
  });
5541
5721
  /**
5542
- * Update knowledge base
5722
+ * Update project metadata
5543
5723
  *
5544
- * Updates an active knowledge base using its returned id. Omitted fields stay unchanged; metadata replaces the whole map. Example body: {"name":"Refund policies"}.
5724
+ * Change the project display name or replace its labels by naming those fields in update_mask. Use execute for clip or track edits. Each successful update commits a new revision; labels are replaced as a whole when selected, so read and merge existing labels before overwriting them.
5545
5725
  */
5546
- export const knowledgeUpdateVectorStore = (options) => (options.client ?? client).post({
5726
+ export const cutUpdateProject = (options) => (options.client ?? client).patch({
5547
5727
  security: [{
5548
- key: 'knowledge-bearerAuth',
5728
+ key: 'BearerAuth',
5549
5729
  scheme: 'bearer',
5550
5730
  type: 'http'
5731
+ }, {
5732
+ key: 'ApiKeyAuth',
5733
+ name: 'X-API-Key',
5734
+ type: 'apiKey'
5551
5735
  }],
5552
- url: '/knowledge/v1/vector_stores/{vector_store_id}',
5736
+ url: '/cut/v1/projects/{project_id}',
5553
5737
  ...options,
5554
5738
  headers: {
5555
5739
  'Content-Type': 'application/json',
@@ -5557,95 +5741,121 @@ export const knowledgeUpdateVectorStore = (options) => (options.client ?? client
5557
5741
  }
5558
5742
  });
5559
5743
  /**
5560
- * Search knowledge base
5744
+ * Restore deleted project
5561
5745
  *
5562
- * Search ingested text to answer a question or find supporting passages. Native results contain one chunk each, so file_id can repeat; max_num_results counts chunks (1–50, default 10), while the compatible URL groups results by file. Unlike OpenAI vector stores, next_page is always null even when has_more is true. Only completed attachments are searchable. For keyword-only retrieval set ranking_options.hybrid_search to {"embedding_weight":0,"text_weight":1}; omit rewrite_query or set it to false to avoid query rewriting. Unlike OpenAI, ranker auto does not rerank; only default-2024-11-15 requests reranking. Set praxis.explain=true to inspect scores and use returned content[].chunk_id to retrieve a segment.
5746
+ * Return a retained deleted project to active state before its purge_time. Obtain project_id from projects.list filtered to deleted projects. This restores the project, not an older timeline revision; use versions.restore when reverting editing content.
5563
5747
  */
5564
- export const knowledgeSearchVectorStore = (options) => (options.client ?? client).post({
5748
+ export const cutUndeleteProject = (options) => (options.client ?? client).post({
5565
5749
  security: [{
5566
- key: 'knowledge-bearerAuth',
5750
+ key: 'BearerAuth',
5567
5751
  scheme: 'bearer',
5568
5752
  type: 'http'
5753
+ }, {
5754
+ key: 'ApiKeyAuth',
5755
+ name: 'X-API-Key',
5756
+ type: 'apiKey'
5569
5757
  }],
5570
- url: '/knowledge/v1/vector_stores/{vector_store_id}/search',
5571
- ...options,
5572
- headers: {
5573
- 'Content-Type': 'application/json',
5574
- ...options.headers
5575
- }
5758
+ url: '/cut/v1/projects/{project_id}:undelete',
5759
+ ...options
5576
5760
  });
5577
5761
  /**
5578
- * List files
5762
+ * Execute editing script
5579
5763
  *
5580
- * Lists attached files and their ingestion status, newest attachment first by default. Use last_id as after to continue; ?filter=failed selects files that can be retried.
5764
+ * Edit the current timeline atomically using synchronous JavaScript source. Read state or timeline first, then pass its revision as expected_revision to detect concurrent changes. Use AddTrack, Insert, Update, Delete, Split, Trim, Move, RippleDeleteRange, UpdateTrack, DeleteTrack, SetSettings, AddCaptionsFromTranscript and SetMarker for writes; GetTimeline, GetItem, FindItems, GetMedia, GetTranscript and GetAnalysis read editing context; Print emits text and Preview requests frame previews. All script times are seconds; script object fields use camelCase, for example `media: {libraryId, assetId}`. Unlike Shotstack, execute applies script edits to a persistent project in one transaction. Provide script or a saved edit_id with literal edits, never both; failures roll back writes. A revision conflict while preparing the response may follow a committed edit: retrieve state before retrying. Minimal script after creating a project:
5765
+ *
5766
+ * ```js
5767
+ * const t = AddTrack("video");
5768
+ * Insert(t, {type: "color", color: "#123456", start: 0, length: 3});
5769
+ * Print(t);
5770
+ * ```
5581
5771
  */
5582
- export const knowledgeListFiles = (options) => (options.client ?? client).get({
5772
+ export const cutExecute = (options) => (options.client ?? client).post({
5583
5773
  security: [{
5584
- key: 'knowledge-bearerAuth',
5774
+ key: 'BearerAuth',
5585
5775
  scheme: 'bearer',
5586
5776
  type: 'http'
5777
+ }, {
5778
+ key: 'ApiKeyAuth',
5779
+ name: 'X-API-Key',
5780
+ type: 'apiKey'
5587
5781
  }],
5588
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files',
5589
- ...options
5782
+ url: '/cut/v1/projects/{project_id}:execute',
5783
+ ...options,
5784
+ headers: {
5785
+ 'Content-Type': 'application/json',
5786
+ ...options.headers
5787
+ }
5590
5788
  });
5591
5789
  /**
5592
- * Add file
5790
+ * Read editing state
5593
5791
  *
5594
- * Attach an uploaded File for asynchronous ingestion, then poll this attachment until status is completed, failed or cancelled before searching. Unlike OpenAI vector stores, the file limit is 100000000 bytes; chunk sizes use estimated tokens rather than a model tokenizer. Text, Markdown, CSV, JSON, HTML, PDF, DOCX, PPTX, XLSX and PNG/JPEG/GIF/WebP images can be extracted; audio and video uploads are not knowledge documents. Images may yield generated descriptions rather than verbatim OCR. auto chunking resolves to static 800/400; explicit sizes are 100–4096 with overlap at most half the size. Each store holds at most 10000 attached files. Reattaching the same file returns its existing record without applying new attributes or chunking; inspect last_error after failure.
5792
+ * Read lightweight project context before composing an execute script. Returns current revision, rendering settings, track counts, library bindings and offline media count without individual clips. For complete clip documents or a selected time range, read timeline instead.
5595
5793
  */
5596
- export const knowledgeAttachFile = (options) => (options.client ?? client).post({
5794
+ export const cutRetrieveState = (options) => (options.client ?? client).get({
5597
5795
  security: [{
5598
- key: 'knowledge-bearerAuth',
5796
+ key: 'BearerAuth',
5599
5797
  scheme: 'bearer',
5600
5798
  type: 'http'
5799
+ }, {
5800
+ key: 'ApiKeyAuth',
5801
+ name: 'X-API-Key',
5802
+ type: 'apiKey'
5601
5803
  }],
5602
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files',
5603
- ...options,
5604
- headers: {
5605
- 'Content-Type': 'application/json',
5606
- ...options.headers
5607
- }
5804
+ url: '/cut/v1/projects/{project_id}/state',
5805
+ ...options
5608
5806
  });
5609
5807
  /**
5610
- * Remove file
5808
+ * Read project timeline
5611
5809
  *
5612
- * Removes the file from search immediately; does not delete the original File.
5810
+ * Inspect clips and markers in a selected project range before editing. view=full returns structured tracks with all timeline positions in seconds; view=compact returns compact text for script context. from and to are seconds and tracks limits the selection to comma-separated track ids from state. Concurrent changes while preparing a full timeline return 409; retrieve the latest state and try the read again.
5613
5811
  */
5614
- export const knowledgeRemoveFile = (options) => (options.client ?? client).delete({
5812
+ export const cutRetrieveTimeline = (options) => (options.client ?? client).get({
5615
5813
  security: [{
5616
- key: 'knowledge-bearerAuth',
5814
+ key: 'BearerAuth',
5617
5815
  scheme: 'bearer',
5618
5816
  type: 'http'
5817
+ }, {
5818
+ key: 'ApiKeyAuth',
5819
+ name: 'X-API-Key',
5820
+ type: 'apiKey'
5619
5821
  }],
5620
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
5822
+ url: '/cut/v1/projects/{project_id}/timeline',
5621
5823
  ...options
5622
5824
  });
5623
5825
  /**
5624
- * Retrieve file
5826
+ * Render preview frames
5625
5827
  *
5626
- * Retrieves an attached file using the id returned by attachment or file listing. Poll this operation until status leaves in_progress to observe the ingestion outcome.
5828
+ * Review the visual result at one or more project times without creating an export. Pass comma-separated seconds in at, such as 12,15.5; scale changes preview size and revision selects a committed project revision. Fetch the returned image URLs before expires_at; render again when they expire.
5627
5829
  */
5628
- export const knowledgeRetrieveFile = (options) => (options.client ?? client).get({
5830
+ export const cutListFrames = (options) => (options.client ?? client).get({
5629
5831
  security: [{
5630
- key: 'knowledge-bearerAuth',
5832
+ key: 'BearerAuth',
5631
5833
  scheme: 'bearer',
5632
5834
  type: 'http'
5835
+ }, {
5836
+ key: 'ApiKeyAuth',
5837
+ name: 'X-API-Key',
5838
+ type: 'apiKey'
5633
5839
  }],
5634
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
5840
+ url: '/cut/v1/projects/{project_id}/frames',
5635
5841
  ...options
5636
5842
  });
5637
5843
  /**
5638
- * Update file attributes
5844
+ * Analyze project media
5639
5845
  *
5640
- * Replaces search-filter attributes of an existing attachment without reingesting its content. Use an attached file id. Example body: {"attributes":{"category":"refund"}}; null clears the attributes.
5846
+ * Request silence, filler-word or scene analysis for selected bound assets before editing. Omit media to select project sources; ranges returned in segments use source seconds. A pending result is not completion: use retry_after_sec before checking again, and inspect failed or unsupported asset results before deciding which edits are possible.
5641
5847
  */
5642
- export const knowledgeUpdateFile = (options) => (options.client ?? client).post({
5848
+ export const cutCreateAnalysis = (options) => (options.client ?? client).post({
5643
5849
  security: [{
5644
- key: 'knowledge-bearerAuth',
5850
+ key: 'BearerAuth',
5645
5851
  scheme: 'bearer',
5646
5852
  type: 'http'
5853
+ }, {
5854
+ key: 'ApiKeyAuth',
5855
+ name: 'X-API-Key',
5856
+ type: 'apiKey'
5647
5857
  }],
5648
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
5858
+ url: '/cut/v1/projects/{project_id}/analysis',
5649
5859
  ...options,
5650
5860
  headers: {
5651
5861
  'Content-Type': 'application/json',
@@ -5653,31 +5863,39 @@ export const knowledgeUpdateFile = (options) => (options.client ?? client).post(
5653
5863
  }
5654
5864
  });
5655
5865
  /**
5656
- * Read extracted content
5866
+ * List library bindings
5657
5867
  *
5658
- * Extracted text chunks may overlap. Image content can be a generated description rather than verbatim OCR.
5868
+ * Discover the named media libraries available to this project before selecting source assets or an import/export destination. read bindings supply source assets; read_write bindings also accept uploads. Exactly one writable binding supplies the default upload destination.
5659
5869
  */
5660
- export const knowledgeRetrieveFileContent = (options) => (options.client ?? client).get({
5870
+ export const cutListBindings = (options) => (options.client ?? client).get({
5661
5871
  security: [{
5662
- key: 'knowledge-bearerAuth',
5872
+ key: 'BearerAuth',
5663
5873
  scheme: 'bearer',
5664
5874
  type: 'http'
5875
+ }, {
5876
+ key: 'ApiKeyAuth',
5877
+ name: 'X-API-Key',
5878
+ type: 'apiKey'
5665
5879
  }],
5666
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/content',
5880
+ url: '/cut/v1/projects/{project_id}/bindings',
5667
5881
  ...options
5668
5882
  });
5669
5883
  /**
5670
- * Create file batch
5884
+ * Bind media library
5671
5885
  *
5672
- * Attaches existing Files as a batch for asynchronous ingestion. Supply exactly one of file_ids or files; files allows per-file settings. Existing attachments are reused. Read the returned batch id to monitor status.
5886
+ * Attach an accessible media library to an existing project under a unique name. Obtain library_id from praxis.media and choose read for source-only access or read_write for imports and exports. The project must retain exactly one read_write binding with default_upload true after the change.
5673
5887
  */
5674
- export const knowledgeCreateFileBatch = (options) => (options.client ?? client).post({
5888
+ export const cutCreateBinding = (options) => (options.client ?? client).post({
5675
5889
  security: [{
5676
- key: 'knowledge-bearerAuth',
5890
+ key: 'BearerAuth',
5677
5891
  scheme: 'bearer',
5678
5892
  type: 'http'
5893
+ }, {
5894
+ key: 'ApiKeyAuth',
5895
+ name: 'X-API-Key',
5896
+ type: 'apiKey'
5679
5897
  }],
5680
- url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches',
5898
+ url: '/cut/v1/projects/{project_id}/bindings',
5681
5899
  ...options,
5682
5900
  headers: {
5683
5901
  'Content-Type': 'application/json',
@@ -5685,157 +5903,205 @@ export const knowledgeCreateFileBatch = (options) => (options.client ?? client).
5685
5903
  }
5686
5904
  });
5687
5905
  /**
5688
- * Retrieve file batch
5906
+ * Remove library binding
5689
5907
  *
5690
- * Retrieves a batch created in this knowledge base, including current status and file counts. Use the batch id returned by batch creation to monitor ingestion.
5908
+ * Detach a library alias obtained from bindings.list after removing all timeline clips that reference its library. BINDING_IN_USE returns 409 while references remain; inspect timeline and edit those clips first. Removal must preserve the one writable default upload binding.
5691
5909
  */
5692
- export const knowledgeRetrieveFileBatch = (options) => (options.client ?? client).get({
5910
+ export const cutDeleteBinding = (options) => (options.client ?? client).delete({
5693
5911
  security: [{
5694
- key: 'knowledge-bearerAuth',
5912
+ key: 'BearerAuth',
5695
5913
  scheme: 'bearer',
5696
5914
  type: 'http'
5915
+ }, {
5916
+ key: 'ApiKeyAuth',
5917
+ name: 'X-API-Key',
5918
+ type: 'apiKey'
5697
5919
  }],
5698
- url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}',
5920
+ url: '/cut/v1/projects/{project_id}/bindings/{name}',
5699
5921
  ...options
5700
5922
  });
5701
5923
  /**
5702
- * Cancel file batch
5924
+ * Import project media
5703
5925
  *
5704
- * Cancels only in-progress batches and pending files. Completed, failed and cancelled batches return unchanged (200, idempotent).
5926
+ * Import a URL, data URI or existing file into a writable project media library. Select binding from bindings.list or omit it to use default_upload. Save library_id and asset_id from the result and use them as libraryId and assetId inside execute script media references; overwrites follow the source asset latest version.
5705
5927
  */
5706
- export const knowledgeCancelFileBatch = (options) => (options.client ?? client).post({
5928
+ export const cutImportMedia = (options) => (options.client ?? client).post({
5707
5929
  security: [{
5708
- key: 'knowledge-bearerAuth',
5930
+ key: 'BearerAuth',
5709
5931
  scheme: 'bearer',
5710
5932
  type: 'http'
5933
+ }, {
5934
+ key: 'ApiKeyAuth',
5935
+ name: 'X-API-Key',
5936
+ type: 'apiKey'
5711
5937
  }],
5712
- url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel',
5713
- ...options
5938
+ url: '/cut/v1/projects/{project_id}/media:import',
5939
+ ...options,
5940
+ headers: {
5941
+ 'Content-Type': 'application/json',
5942
+ ...options.headers
5943
+ }
5714
5944
  });
5715
5945
  /**
5716
- * List batch files
5946
+ * List project exports
5717
5947
  *
5718
- * Lists files still attached from the identified batch, newest attachment first by default. Use the batch creation id and ?filter=failed to inspect failures; last_id is the next after cursor.
5948
+ * Find export jobs associated with this project before polling or canceling a render. Copy an export id into praxis.cut.exports.retrieve or cancel. Continue with next_page_token as page_token when present; queued or in-progress jobs have not produced a final media asset.
5719
5949
  */
5720
- export const knowledgeListBatchFiles = (options) => (options.client ?? client).get({
5950
+ export const cutListExports = (options) => (options.client ?? client).get({
5721
5951
  security: [{
5722
- key: 'knowledge-bearerAuth',
5952
+ key: 'BearerAuth',
5723
5953
  scheme: 'bearer',
5724
5954
  type: 'http'
5955
+ }, {
5956
+ key: 'ApiKeyAuth',
5957
+ name: 'X-API-Key',
5958
+ type: 'apiKey'
5725
5959
  }],
5726
- url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files',
5960
+ url: '/cut/v1/projects/{project_id}/exports',
5727
5961
  ...options
5728
5962
  });
5729
5963
  /**
5730
- * Restore knowledge base
5964
+ * Create video export
5731
5965
  *
5732
- * Restores a deleting store within 7 days. Active stores return 409 VECTOR_STORE_INVALID_STATE; absent stores return 404. Empty body is allowed.
5966
+ * Start an asynchronous video export from the project into a writable bound media library. Choose binding from bindings.list or omit it for default_upload, and optionally select revision and output settings. HTTP 202 only accepts the job; poll praxis.cut.exports.retrieve using the returned id until status is done, failed or canceled. On done, asset identifies the video written back to praxis.media. Each call starts a job, so retrieve a known job before retrying a submission.
5733
5967
  */
5734
- export const knowledgeRestoreVectorStore = (options) => (options.client ?? client).post({
5968
+ export const cutCreateExport = (options) => (options.client ?? client).post({
5735
5969
  security: [{
5736
- key: 'knowledge-bearerAuth',
5970
+ key: 'BearerAuth',
5737
5971
  scheme: 'bearer',
5738
5972
  type: 'http'
5973
+ }, {
5974
+ key: 'ApiKeyAuth',
5975
+ name: 'X-API-Key',
5976
+ type: 'apiKey'
5739
5977
  }],
5740
- url: '/knowledge/v1/vector_stores/{vector_store_id}/restore',
5741
- ...options
5978
+ url: '/cut/v1/projects/{project_id}/exports',
5979
+ ...options,
5980
+ headers: {
5981
+ 'Content-Type': 'application/json',
5982
+ ...options.headers
5983
+ }
5742
5984
  });
5743
5985
  /**
5744
- * Permanently purge knowledge base
5986
+ * Retrieve video export
5745
5987
  *
5746
- * Immediately and irreversibly clears a deleting store using the retention cleanup path. Active stores return 409; absent stores return 404. Empty body is allowed.
5988
+ * Poll an export id returned by projects.exports.create or list to observe render progress. queued, fetching, rendering, stitching and saving are in progress; done provides asset in the target library, failed provides error, and canceled means the job stopped. Only done confirms a usable output asset.
5747
5989
  */
5748
- export const knowledgePurgeVectorStore = (options) => (options.client ?? client).post({
5990
+ export const cutRetrieveExport = (options) => (options.client ?? client).get({
5749
5991
  security: [{
5750
- key: 'knowledge-bearerAuth',
5992
+ key: 'BearerAuth',
5751
5993
  scheme: 'bearer',
5752
5994
  type: 'http'
5995
+ }, {
5996
+ key: 'ApiKeyAuth',
5997
+ name: 'X-API-Key',
5998
+ type: 'apiKey'
5753
5999
  }],
5754
- url: '/knowledge/v1/vector_stores/{vector_store_id}/purge',
6000
+ url: '/cut/v1/exports/{export_id}',
5755
6001
  ...options
5756
6002
  });
5757
6003
  /**
5758
- * Retry failed file
6004
+ * Cancel video export
5759
6005
  *
5760
- * Retries only failed files; other states return 409 FILE_INVALID_STATE. Retry after failure has not yet been observed in the documented run.
6006
+ * Request cancellation of an export obtained from projects.exports.create or list when its output is no longer needed. Read the returned job status and retrieve it to confirm the terminal outcome; do not interpret a cancellation request as successful rendering.
5761
6007
  */
5762
- export const knowledgeRetryFile = (options) => (options.client ?? client).post({
6008
+ export const cutCancelExport = (options) => (options.client ?? client).post({
5763
6009
  security: [{
5764
- key: 'knowledge-bearerAuth',
6010
+ key: 'BearerAuth',
5765
6011
  scheme: 'bearer',
5766
6012
  type: 'http'
6013
+ }, {
6014
+ key: 'ApiKeyAuth',
6015
+ name: 'X-API-Key',
6016
+ type: 'apiKey'
5767
6017
  }],
5768
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/retry',
6018
+ url: '/cut/v1/exports/{export_id}:cancel',
5769
6019
  ...options
5770
6020
  });
5771
6021
  /**
5772
- * List file segments
6022
+ * List saved versions
5773
6023
  *
5774
- * Lists the stored chunks of an attached file, ordered by increasing segment index by default. Use the attachment id and last_id as after to continue; returned chunk ids can be retrieved individually.
6024
+ * Find saved timeline snapshots for this project and obtain version_id values for restore. A saved version records its original revision; restoring it creates a new current revision rather than rewinding the revision counter. Continue with next_page_token as page_token until absent.
5775
6025
  */
5776
- export const knowledgeListSegments = (options) => (options.client ?? client).get({
6026
+ export const cutListVersions = (options) => (options.client ?? client).get({
5777
6027
  security: [{
5778
- key: 'knowledge-bearerAuth',
6028
+ key: 'BearerAuth',
5779
6029
  scheme: 'bearer',
5780
6030
  type: 'http'
6031
+ }, {
6032
+ key: 'ApiKeyAuth',
6033
+ name: 'X-API-Key',
6034
+ type: 'apiKey'
5781
6035
  }],
5782
- url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/segments',
6036
+ url: '/cut/v1/projects/{project_id}/versions',
5783
6037
  ...options
5784
6038
  });
5785
6039
  /**
5786
- * Retrieve segment
6040
+ * Save project version
5787
6041
  *
5788
- * Retrieves one chunk and its term statistics. Take chunk_id from segment listing or native search content; the chunk must belong to this knowledge base.
6042
+ * Save the current project timeline as a named recovery point before a substantial edit. Supply an optional label or send an empty object; keep the returned version id for versions.restore. Saving a version does not publish a rendered asset; use projects.exports.create for video output.
5789
6043
  */
5790
- export const knowledgeRetrieveSegment = (options) => (options.client ?? client).get({
6044
+ export const cutCreateVersion = (options) => (options.client ?? client).post({
5791
6045
  security: [{
5792
- key: 'knowledge-bearerAuth',
6046
+ key: 'BearerAuth',
5793
6047
  scheme: 'bearer',
5794
6048
  type: 'http'
6049
+ }, {
6050
+ key: 'ApiKeyAuth',
6051
+ name: 'X-API-Key',
6052
+ type: 'apiKey'
5795
6053
  }],
5796
- url: '/knowledge/v1/vector_stores/{vector_store_id}/segments/{chunk_id}',
5797
- ...options
6054
+ url: '/cut/v1/projects/{project_id}/versions',
6055
+ ...options,
6056
+ headers: {
6057
+ 'Content-Type': 'application/json',
6058
+ ...options.headers
6059
+ }
5798
6060
  });
5799
6061
  /**
5800
- * List events
6062
+ * Restore saved version
5801
6063
  *
5802
- * Reads events for this knowledge base in increasing sequence order, including while soft-deleted. Pass next_seq as after_seq to continue; null next_seq marks the current end. Example: ?after_seq=0&limit=20.
6064
+ * Replace current editing content with a saved project snapshot selected from projects.versions.list. The restore commits a new transaction and revision while preserving the saved version for future use. Inspect the returned summary and timeline before further editing; a response revision conflict can follow a committed restore, so retrieve current state before retrying.
5803
6065
  */
5804
- export const knowledgeListEvents = (options) => (options.client ?? client).get({
6066
+ export const cutRestoreVersion = (options) => (options.client ?? client).post({
5805
6067
  security: [{
5806
- key: 'knowledge-bearerAuth',
6068
+ key: 'BearerAuth',
5807
6069
  scheme: 'bearer',
5808
6070
  type: 'http'
6071
+ }, {
6072
+ key: 'ApiKeyAuth',
6073
+ name: 'X-API-Key',
6074
+ type: 'apiKey'
5809
6075
  }],
5810
- url: '/knowledge/v1/vector_stores/{vector_store_id}/events',
6076
+ url: '/cut/v1/versions/{version_id}:restore',
5811
6077
  ...options
5812
6078
  });
5813
6079
  /**
5814
- * List libraries
6080
+ * List databases
5815
6081
  *
5816
- * List libraries owned by the caller, newest first. By default, deleting and deleted libraries are excluded; use status=deleting to find libraries awaiting purge. All supplied label pairs must match.
6082
+ * Find databases owned by your tenant and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
5817
6083
  */
5818
- export const mediaListLibraries = (options) => (options?.client ?? client).get({
6084
+ export const databaseListDatabases = (options) => (options?.client ?? client).get({
5819
6085
  security: [{
5820
- key: 'media-BearerAuth',
6086
+ key: 'database-bearerAuth',
5821
6087
  scheme: 'bearer',
5822
6088
  type: 'http'
5823
6089
  }],
5824
- url: '/media/v1/libraries',
6090
+ url: '/database/v1/databases',
5825
6091
  ...options
5826
6092
  });
5827
6093
  /**
5828
- * Create library
6094
+ * Create database
5829
6095
  *
5830
- * Create a library owned by the caller with a name, optional labels and understanding settings. Understanding is enabled by default; the returned id is used for subsequent asset operations.
6096
+ * Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
5831
6097
  */
5832
- export const mediaCreateLibrary = (options) => (options.client ?? client).post({
6098
+ export const databaseCreateDatabase = (options) => (options.client ?? client).post({
5833
6099
  security: [{
5834
- key: 'media-BearerAuth',
6100
+ key: 'database-bearerAuth',
5835
6101
  scheme: 'bearer',
5836
6102
  type: 'http'
5837
6103
  }],
5838
- url: '/media/v1/libraries',
6104
+ url: '/database/v1/databases',
5839
6105
  ...options,
5840
6106
  headers: {
5841
6107
  'Content-Type': 'application/json',
@@ -5843,45 +6109,45 @@ export const mediaCreateLibrary = (options) => (options.client ?? client).post({
5843
6109
  }
5844
6110
  });
5845
6111
  /**
5846
- * Delete library
6112
+ * Delete database
5847
6113
  *
5848
- * Soft-delete an active library, returning its deleting status and purge_at deadline. Asset operations and delivery become unavailable; the library can be restored before purge_at. Repeated deletion while deleting returns the current library.
6114
+ * Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
5849
6115
  */
5850
- export const mediaDeleteLibrary = (options) => (options.client ?? client).delete({
6116
+ export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
5851
6117
  security: [{
5852
- key: 'media-BearerAuth',
6118
+ key: 'database-bearerAuth',
5853
6119
  scheme: 'bearer',
5854
6120
  type: 'http'
5855
6121
  }],
5856
- url: '/media/v1/libraries/{library_id}',
6122
+ url: '/database/v1/databases/{database_id}',
5857
6123
  ...options
5858
6124
  });
5859
6125
  /**
5860
- * Get library
6126
+ * Get database
5861
6127
  *
5862
- * Read a caller-owned library’s current settings, usage and lifecycle status. A deleting library remains readable; missing, foreign or purged libraries return LIBRARY_NOT_FOUND.
6128
+ * Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id returns 404 DATABASE_NOT_FOUND.
5863
6129
  */
5864
- export const mediaGetLibrary = (options) => (options.client ?? client).get({
6130
+ export const databaseGetDatabase = (options) => (options.client ?? client).get({
5865
6131
  security: [{
5866
- key: 'media-BearerAuth',
6132
+ key: 'database-bearerAuth',
5867
6133
  scheme: 'bearer',
5868
6134
  type: 'http'
5869
6135
  }],
5870
- url: '/media/v1/libraries/{library_id}',
6136
+ url: '/database/v1/databases/{database_id}',
5871
6137
  ...options
5872
6138
  });
5873
6139
  /**
5874
- * Update library
6140
+ * Update database
5875
6141
  *
5876
- * Update an active library’s supplied settings. Labels replace the complete map; understanding settings and model roles merge with current values. Changing the embedding model is rejected while assets exist.
6142
+ * Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreDatabase.
5877
6143
  */
5878
- export const mediaUpdateLibrary = (options) => (options.client ?? client).patch({
6144
+ export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
5879
6145
  security: [{
5880
- key: 'media-BearerAuth',
6146
+ key: 'database-bearerAuth',
5881
6147
  scheme: 'bearer',
5882
6148
  type: 'http'
5883
6149
  }],
5884
- url: '/media/v1/libraries/{library_id}',
6150
+ url: '/database/v1/databases/{database_id}',
5885
6151
  ...options,
5886
6152
  headers: {
5887
6153
  'Content-Type': 'application/json',
@@ -5889,77 +6155,59 @@ export const mediaUpdateLibrary = (options) => (options.client ?? client).patch(
5889
6155
  }
5890
6156
  });
5891
6157
  /**
5892
- * Restore library
6158
+ * Restore database
5893
6159
  *
5894
- * Restore a deleting library before its purge_at deadline. The library becomes active again and deleted_at and purge_at are cleared; expired or non-deleting libraries cannot be restored.
6160
+ * Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
5895
6161
  */
5896
- export const mediaRestoreLibrary = (options) => (options.client ?? client).post({
6162
+ export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
5897
6163
  security: [{
5898
- key: 'media-BearerAuth',
6164
+ key: 'database-bearerAuth',
5899
6165
  scheme: 'bearer',
5900
6166
  type: 'http'
5901
6167
  }],
5902
- url: '/media/v1/libraries/{library_id}/restore',
6168
+ url: '/database/v1/databases/{database_id}/restore',
5903
6169
  ...options
5904
6170
  });
5905
6171
  /**
5906
- * Purge library
6172
+ * Permanently purge database
5907
6173
  *
5908
- * Permanently remove a library that is already deleting, without waiting for purge_at. Its assets and related resources are removed and cannot be restored; first soft-delete an active library.
6174
+ * Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
5909
6175
  */
5910
- export const mediaPurgeLibrary = (options) => (options.client ?? client).post({
6176
+ export const databasePurgeDatabase = (options) => (options.client ?? client).post({
5911
6177
  security: [{
5912
- key: 'media-BearerAuth',
6178
+ key: 'database-bearerAuth',
5913
6179
  scheme: 'bearer',
5914
6180
  type: 'http'
5915
6181
  }],
5916
- url: '/media/v1/libraries/{library_id}/purge',
6182
+ url: '/database/v1/databases/{database_id}/purge',
5917
6183
  ...options
5918
6184
  });
5919
6185
  /**
5920
- * List assets
6186
+ * List tables
5921
6187
  *
5922
- * List assets in an active library, newest first, optionally filtering by exact folder and stored resource type. Continue using next_cursor; video includes audio-only assets.
6188
+ * Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseGetTable instead when you also need row_count for one table.
5923
6189
  */
5924
- export const mediaListAssets = (options) => (options.client ?? client).get({
6190
+ export const databaseListTables = (options) => (options.client ?? client).get({
5925
6191
  security: [{
5926
- key: 'media-BearerAuth',
6192
+ key: 'database-bearerAuth',
5927
6193
  scheme: 'bearer',
5928
6194
  type: 'http'
5929
6195
  }],
5930
- url: '/media/v1/libraries/{library_id}/assets',
6196
+ url: '/database/v1/databases/{database_id}/tables',
5931
6197
  ...options
5932
6198
  });
5933
6199
  /**
5934
- * Upload asset
5935
- *
5936
- * Upload content into an active library and return a Cloudinary-compatible resource. Use file for a multipart file, data URI, public HTTPS URL or same-owner file identifier. Reusing public_id overwrites by default; overwrite=false returns the existing resource. Chunk uploads require both chunk headers.
5937
- */
5938
- export const mediaUploadAsset = (options) => (options.client ?? client).post({
5939
- security: [{
5940
- key: 'media-BearerAuth',
5941
- scheme: 'bearer',
5942
- type: 'http'
5943
- }],
5944
- url: '/media/v1/libraries/{library_id}/assets',
5945
- ...options,
5946
- headers: {
5947
- 'Content-Type': 'application/json',
5948
- ...options.headers
5949
- }
5950
- });
5951
- /**
5952
- * Import file
6200
+ * Create table
5953
6201
  *
5954
- * Copy source content into an active library using upload options and return the full native Asset. The imported asset is independent of the source after copying. Reusing public_id follows overwrite semantics.
6202
+ * 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.
5955
6203
  */
5956
- export const mediaImportAsset = (options) => (options.client ?? client).post({
6204
+ export const databaseCreateTable = (options) => (options.client ?? client).post({
5957
6205
  security: [{
5958
- key: 'media-BearerAuth',
6206
+ key: 'database-bearerAuth',
5959
6207
  scheme: 'bearer',
5960
6208
  type: 'http'
5961
6209
  }],
5962
- url: '/media/v1/libraries/{library_id}/assets/import',
6210
+ url: '/database/v1/databases/{database_id}/tables',
5963
6211
  ...options,
5964
6212
  headers: {
5965
6213
  'Content-Type': 'application/json',
@@ -5967,45 +6215,45 @@ export const mediaImportAsset = (options) => (options.client ?? client).post({
5967
6215
  }
5968
6216
  });
5969
6217
  /**
5970
- * Delete asset
6218
+ * Delete table
5971
6219
  *
5972
- * Delete an asset from the library so it is no longer readable, searchable or deliverable. This removes the asset rather than placing it in the library’s restoration window; a missing asset returns ASSET_NOT_FOUND.
6220
+ * Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
5973
6221
  */
5974
- export const mediaDeleteAsset = (options) => (options.client ?? client).delete({
6222
+ export const databaseDeleteTable = (options) => (options.client ?? client).delete({
5975
6223
  security: [{
5976
- key: 'media-BearerAuth',
6224
+ key: 'database-bearerAuth',
5977
6225
  scheme: 'bearer',
5978
6226
  type: 'http'
5979
6227
  }],
5980
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6228
+ url: '/database/v1/databases/{database_id}/tables/{table}',
5981
6229
  ...options
5982
6230
  });
5983
6231
  /**
5984
- * Get asset
6232
+ * Get table
5985
6233
  *
5986
- * Read a non-deleted asset by its asset_id in an active library, including content hashes, processing progress and available previews. Missing or deleted assets return ASSET_NOT_FOUND.
6234
+ * Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
5987
6235
  */
5988
- export const mediaGetAsset = (options) => (options.client ?? client).get({
6236
+ export const databaseGetTable = (options) => (options.client ?? client).get({
5989
6237
  security: [{
5990
- key: 'media-BearerAuth',
6238
+ key: 'database-bearerAuth',
5991
6239
  scheme: 'bearer',
5992
6240
  type: 'http'
5993
6241
  }],
5994
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6242
+ url: '/database/v1/databases/{database_id}/tables/{table}',
5995
6243
  ...options
5996
6244
  });
5997
6245
  /**
5998
- * Update asset
6246
+ * Update table
5999
6247
  *
6000
- * Update an asset’s supplied metadata fields. Tags and context replace their current collections; an empty collection clears them. Moving asset_folder or changing display_name preserves public_id and delivery URLs.
6248
+ * Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseAddField, databaseUpdateField and databaseDeleteField.
6001
6249
  */
6002
- export const mediaUpdateAsset = (options) => (options.client ?? client).patch({
6250
+ export const databaseUpdateTable = (options) => (options.client ?? client).patch({
6003
6251
  security: [{
6004
- key: 'media-BearerAuth',
6252
+ key: 'database-bearerAuth',
6005
6253
  scheme: 'bearer',
6006
6254
  type: 'http'
6007
6255
  }],
6008
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6256
+ url: '/database/v1/databases/{database_id}/tables/{table}',
6009
6257
  ...options,
6010
6258
  headers: {
6011
6259
  'Content-Type': 'application/json',
@@ -6013,17 +6261,17 @@ export const mediaUpdateAsset = (options) => (options.client ?? client).patch({
6013
6261
  }
6014
6262
  });
6015
6263
  /**
6016
- * Reprocess asset
6264
+ * Add field
6017
6265
  *
6018
- * Queue reprocessing of the asset’s current version and return its updated state immediately. Omit kinds to retry failed tasks; explicit kinds rerun applicable completed tasks. Replaced understandings become superseded, and processing finishes asynchronously.
6266
+ * 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.
6019
6267
  */
6020
- export const mediaReprocessAsset = (options) => (options.client ?? client).post({
6268
+ export const databaseAddField = (options) => (options.client ?? client).post({
6021
6269
  security: [{
6022
- key: 'media-BearerAuth',
6270
+ key: 'database-bearerAuth',
6023
6271
  scheme: 'bearer',
6024
6272
  type: 'http'
6025
6273
  }],
6026
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}/reprocess',
6274
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields',
6027
6275
  ...options,
6028
6276
  headers: {
6029
6277
  'Content-Type': 'application/json',
@@ -6031,31 +6279,31 @@ export const mediaReprocessAsset = (options) => (options.client ?? client).post(
6031
6279
  }
6032
6280
  });
6033
6281
  /**
6034
- * List understandings
6282
+ * Delete field
6035
6283
  *
6036
- * List an asset’s understanding results in creation order. By default only current, non-superseded results are returned; use include_superseded=true for history or kind to select an output type.
6284
+ * Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
6037
6285
  */
6038
- export const mediaListUnderstandings = (options) => (options.client ?? client).get({
6286
+ export const databaseDeleteField = (options) => (options.client ?? client).delete({
6039
6287
  security: [{
6040
- key: 'media-BearerAuth',
6288
+ key: 'database-bearerAuth',
6041
6289
  scheme: 'bearer',
6042
6290
  type: 'http'
6043
6291
  }],
6044
- url: '/media/v1/libraries/{library_id}/assets/{asset_id}/understandings',
6292
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
6045
6293
  ...options
6046
6294
  });
6047
6295
  /**
6048
- * Expression search
6296
+ * Update field
6049
6297
  *
6050
- * Search active assets using the supported filter-expression syntax, sorting and cursor pagination. Empty expression matches all assets. Tags and context require with_field; inspect the exactness flags before treating counts as complete.
6298
+ * Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
6051
6299
  */
6052
- export const mediaExpressionSearch = (options) => (options.client ?? client).post({
6300
+ export const databaseUpdateField = (options) => (options.client ?? client).patch({
6053
6301
  security: [{
6054
- key: 'media-BearerAuth',
6302
+ key: 'database-bearerAuth',
6055
6303
  scheme: 'bearer',
6056
6304
  type: 'http'
6057
6305
  }],
6058
- url: '/media/v1/libraries/{library_id}/search/expression',
6306
+ url: '/database/v1/databases/{database_id}/tables/{table}/fields/{field}',
6059
6307
  ...options,
6060
6308
  headers: {
6061
6309
  'Content-Type': 'application/json',
@@ -6063,53 +6311,795 @@ export const mediaExpressionSearch = (options) => (options.client ?? client).pos
6063
6311
  }
6064
6312
  });
6065
6313
  /**
6066
- * Visual search
6314
+ * List events
6067
6315
  *
6068
- * Find visually similar assets using exactly one of asset_id or an inline base64 image. The library must support image search; an asset query needs a current image embedding and excludes that source asset from results.
6316
+ * Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
6069
6317
  */
6070
- export const mediaVisualSearch = (options) => (options.client ?? client).post({
6318
+ export const databaseListEvents = (options) => (options.client ?? client).get({
6071
6319
  security: [{
6072
- key: 'media-BearerAuth',
6320
+ key: 'database-bearerAuth',
6073
6321
  scheme: 'bearer',
6074
6322
  type: 'http'
6075
6323
  }],
6076
- url: '/media/v1/libraries/{library_id}/search/visual',
6077
- ...options,
6078
- headers: {
6079
- 'Content-Type': 'application/json',
6080
- ...options.headers
6081
- }
6324
+ url: '/database/v1/databases/{database_id}/events',
6325
+ ...options
6082
6326
  });
6083
6327
  /**
6084
- * Semantic search
6328
+ * Delete rows
6085
6329
  *
6086
- * Search assets with a nonblank text query and optional expression filter. Hybrid mode combines semantic and keyword matches; semantic mode uses vector similarity only. Results are ranked and limited by top_k.
6330
+ * Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
6087
6331
  */
6088
- export const mediaSemanticSearch = (options) => (options.client ?? client).post({
6332
+ export const databaseDelete = (options) => (options.client ?? client).delete({
6089
6333
  security: [{
6090
- key: 'media-BearerAuth',
6334
+ key: 'database-bearerAuth',
6091
6335
  scheme: 'bearer',
6092
6336
  type: 'http'
6093
6337
  }],
6094
- url: '/media/v1/libraries/{library_id}/search/semantic',
6095
- ...options,
6096
- headers: {
6097
- 'Content-Type': 'application/json',
6098
- ...options.headers
6099
- }
6338
+ url: '/database/v1/databases/{database_id}/rest/{table}',
6339
+ ...options
6100
6340
  });
6101
6341
  /**
6102
- * Semantic search alias
6342
+ * Select rows
6343
+ *
6344
+ * 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.
6345
+ */
6346
+ export const databaseSelect = (options) => (options.client ?? client).get({
6347
+ security: [{
6348
+ key: 'database-bearerAuth',
6349
+ scheme: 'bearer',
6350
+ type: 'http'
6351
+ }],
6352
+ url: '/database/v1/databases/{database_id}/rest/{table}',
6353
+ ...options
6354
+ });
6355
+ /**
6356
+ * Count rows
6357
+ *
6358
+ * 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.
6359
+ */
6360
+ export const databaseHead = (options) => (options.client ?? client).head({
6361
+ security: [{
6362
+ key: 'database-bearerAuth',
6363
+ scheme: 'bearer',
6364
+ type: 'http'
6365
+ }],
6366
+ url: '/database/v1/databases/{database_id}/rest/{table}',
6367
+ ...options
6368
+ });
6369
+ /**
6370
+ * Update rows
6371
+ *
6372
+ * Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
6373
+ */
6374
+ export const databaseUpdate = (options) => (options.client ?? client).patch({
6375
+ security: [{
6376
+ key: 'database-bearerAuth',
6377
+ scheme: 'bearer',
6378
+ type: 'http'
6379
+ }],
6380
+ url: '/database/v1/databases/{database_id}/rest/{table}',
6381
+ ...options,
6382
+ headers: {
6383
+ 'Content-Type': 'application/json',
6384
+ ...options.headers
6385
+ }
6386
+ });
6387
+ /**
6388
+ * Insert rows
6389
+ *
6390
+ * 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.
6391
+ * Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
6392
+ * 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.
6393
+ */
6394
+ export const databaseInsert = (options) => (options.client ?? client).post({
6395
+ security: [{
6396
+ key: 'database-bearerAuth',
6397
+ scheme: 'bearer',
6398
+ type: 'http'
6399
+ }],
6400
+ url: '/database/v1/databases/{database_id}/rest/{table}',
6401
+ ...options,
6402
+ headers: {
6403
+ 'Content-Type': 'application/json',
6404
+ ...options.headers
6405
+ }
6406
+ });
6407
+ /**
6408
+ * List knowledge bases
6409
+ *
6410
+ * Lists knowledge bases visible to the caller, newest first by default. Use last_id as after to read the next page; for example, ?limit=20.
6411
+ */
6412
+ export const knowledgeListVectorStores = (options) => (options?.client ?? client).get({
6413
+ security: [{
6414
+ key: 'knowledge-bearerAuth',
6415
+ scheme: 'bearer',
6416
+ type: 'http'
6417
+ }],
6418
+ url: '/knowledge/v1/vector_stores',
6419
+ ...options
6420
+ });
6421
+ /**
6422
+ * Create knowledge base
6423
+ *
6424
+ * Create a knowledge base, optionally starting ingestion of uploaded file_ids in the same call; no separate attachment or batch is needed for those files. Use the returned id with vectorStores.files.retrieve to poll each attachment until completed, failed or cancelled; store status=completed alone does not mean every file succeeded. Unlike OpenAI vector stores, each file is limited to 100000000 bytes and each account to 100 active/nondeleted stores. Minimal body: {"name":"Refund policies"}.
6425
+ */
6426
+ export const knowledgeCreateVectorStore = (options) => (options.client ?? client).post({
6427
+ security: [{
6428
+ key: 'knowledge-bearerAuth',
6429
+ scheme: 'bearer',
6430
+ type: 'http'
6431
+ }],
6432
+ url: '/knowledge/v1/vector_stores',
6433
+ ...options,
6434
+ headers: {
6435
+ 'Content-Type': 'application/json',
6436
+ ...options.headers
6437
+ }
6438
+ });
6439
+ /**
6440
+ * Delete knowledge base
6441
+ *
6442
+ * Remove a knowledge base from active use while keeping a recovery window. Unlike OpenAI vector stores, native DELETE returns the store with status=deleting and ISO purge_at, retains it for 7 days and is idempotent on repeat. Retrieve remains 200; object operations return 409. Use restore before purge_at to recover it, or purge to remove it irreversibly.
6443
+ */
6444
+ export const knowledgeDeleteVectorStore = (options) => (options.client ?? client).delete({
6445
+ security: [{
6446
+ key: 'knowledge-bearerAuth',
6447
+ scheme: 'bearer',
6448
+ type: 'http'
6449
+ }],
6450
+ url: '/knowledge/v1/vector_stores/{vector_store_id}',
6451
+ ...options
6452
+ });
6453
+ /**
6454
+ * Retrieve knowledge base
6455
+ *
6456
+ * Retrieves a knowledge base using an id returned by create or list. Add ?expand=files to include the first page of attached files. Soft-deleted stores remain readable with status=deleting until purged.
6457
+ */
6458
+ export const knowledgeRetrieveVectorStore = (options) => (options.client ?? client).get({
6459
+ security: [{
6460
+ key: 'knowledge-bearerAuth',
6461
+ scheme: 'bearer',
6462
+ type: 'http'
6463
+ }],
6464
+ url: '/knowledge/v1/vector_stores/{vector_store_id}',
6465
+ ...options
6466
+ });
6467
+ /**
6468
+ * Update knowledge base
6469
+ *
6470
+ * Updates an active knowledge base using its returned id. Omitted fields stay unchanged; metadata replaces the whole map. Example body: {"name":"Refund policies"}.
6471
+ */
6472
+ export const knowledgeUpdateVectorStore = (options) => (options.client ?? client).post({
6473
+ security: [{
6474
+ key: 'knowledge-bearerAuth',
6475
+ scheme: 'bearer',
6476
+ type: 'http'
6477
+ }],
6478
+ url: '/knowledge/v1/vector_stores/{vector_store_id}',
6479
+ ...options,
6480
+ headers: {
6481
+ 'Content-Type': 'application/json',
6482
+ ...options.headers
6483
+ }
6484
+ });
6485
+ /**
6486
+ * Search knowledge base
6487
+ *
6488
+ * Search ingested text to answer a question or find supporting passages. Native results contain one chunk each, so file_id can repeat; max_num_results counts chunks (1–50, default 10), while the compatible URL groups results by file. Unlike OpenAI vector stores, next_page is always null even when has_more is true. Only completed attachments are searchable. For keyword-only retrieval set ranking_options.hybrid_search to {"embedding_weight":0,"text_weight":1}; omit rewrite_query or set it to false to avoid query rewriting. Unlike OpenAI, ranker auto does not rerank; only default-2024-11-15 requests reranking. Set praxis.explain=true to inspect scores and use returned content[].chunk_id to retrieve a segment.
6489
+ */
6490
+ export const knowledgeSearchVectorStore = (options) => (options.client ?? client).post({
6491
+ security: [{
6492
+ key: 'knowledge-bearerAuth',
6493
+ scheme: 'bearer',
6494
+ type: 'http'
6495
+ }],
6496
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/search',
6497
+ ...options,
6498
+ headers: {
6499
+ 'Content-Type': 'application/json',
6500
+ ...options.headers
6501
+ }
6502
+ });
6503
+ /**
6504
+ * List files
6505
+ *
6506
+ * Lists attached files and their ingestion status, newest attachment first by default. Use last_id as after to continue; ?filter=failed selects files that can be retried.
6507
+ */
6508
+ export const knowledgeListFiles = (options) => (options.client ?? client).get({
6509
+ security: [{
6510
+ key: 'knowledge-bearerAuth',
6511
+ scheme: 'bearer',
6512
+ type: 'http'
6513
+ }],
6514
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files',
6515
+ ...options
6516
+ });
6517
+ /**
6518
+ * Add file
6519
+ *
6520
+ * Attach an uploaded File for asynchronous ingestion, then poll this attachment until status is completed, failed or cancelled before searching. Unlike OpenAI vector stores, the file limit is 100000000 bytes; chunk sizes use estimated tokens rather than a model tokenizer. Text, Markdown, CSV, JSON, HTML, PDF, DOCX, PPTX, XLSX and PNG/JPEG/GIF/WebP images can be extracted; audio and video uploads are not knowledge documents. Images may yield generated descriptions rather than verbatim OCR. auto chunking resolves to static 800/400; explicit sizes are 100–4096 with overlap at most half the size. Each store holds at most 10000 attached files. Reattaching the same file returns its existing record without applying new attributes or chunking; inspect last_error after failure.
6521
+ */
6522
+ export const knowledgeAttachFile = (options) => (options.client ?? client).post({
6523
+ security: [{
6524
+ key: 'knowledge-bearerAuth',
6525
+ scheme: 'bearer',
6526
+ type: 'http'
6527
+ }],
6528
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files',
6529
+ ...options,
6530
+ headers: {
6531
+ 'Content-Type': 'application/json',
6532
+ ...options.headers
6533
+ }
6534
+ });
6535
+ /**
6536
+ * Remove file
6537
+ *
6538
+ * Removes the file from search immediately; does not delete the original File.
6539
+ */
6540
+ export const knowledgeRemoveFile = (options) => (options.client ?? client).delete({
6541
+ security: [{
6542
+ key: 'knowledge-bearerAuth',
6543
+ scheme: 'bearer',
6544
+ type: 'http'
6545
+ }],
6546
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
6547
+ ...options
6548
+ });
6549
+ /**
6550
+ * Retrieve file
6551
+ *
6552
+ * Retrieves an attached file using the id returned by attachment or file listing. Poll this operation until status leaves in_progress to observe the ingestion outcome.
6553
+ */
6554
+ export const knowledgeRetrieveFile = (options) => (options.client ?? client).get({
6555
+ security: [{
6556
+ key: 'knowledge-bearerAuth',
6557
+ scheme: 'bearer',
6558
+ type: 'http'
6559
+ }],
6560
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
6561
+ ...options
6562
+ });
6563
+ /**
6564
+ * Update file attributes
6565
+ *
6566
+ * Replaces search-filter attributes of an existing attachment without reingesting its content. Use an attached file id. Example body: {"attributes":{"category":"refund"}}; null clears the attributes.
6567
+ */
6568
+ export const knowledgeUpdateFile = (options) => (options.client ?? client).post({
6569
+ security: [{
6570
+ key: 'knowledge-bearerAuth',
6571
+ scheme: 'bearer',
6572
+ type: 'http'
6573
+ }],
6574
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}',
6575
+ ...options,
6576
+ headers: {
6577
+ 'Content-Type': 'application/json',
6578
+ ...options.headers
6579
+ }
6580
+ });
6581
+ /**
6582
+ * Read extracted content
6583
+ *
6584
+ * Extracted text chunks may overlap. Image content can be a generated description rather than verbatim OCR.
6585
+ */
6586
+ export const knowledgeRetrieveFileContent = (options) => (options.client ?? client).get({
6587
+ security: [{
6588
+ key: 'knowledge-bearerAuth',
6589
+ scheme: 'bearer',
6590
+ type: 'http'
6591
+ }],
6592
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/content',
6593
+ ...options
6594
+ });
6595
+ /**
6596
+ * Create file batch
6597
+ *
6598
+ * Attaches existing Files as a batch for asynchronous ingestion. Supply exactly one of file_ids or files; files allows per-file settings. Existing attachments are reused. Read the returned batch id to monitor status.
6599
+ */
6600
+ export const knowledgeCreateFileBatch = (options) => (options.client ?? client).post({
6601
+ security: [{
6602
+ key: 'knowledge-bearerAuth',
6603
+ scheme: 'bearer',
6604
+ type: 'http'
6605
+ }],
6606
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches',
6607
+ ...options,
6608
+ headers: {
6609
+ 'Content-Type': 'application/json',
6610
+ ...options.headers
6611
+ }
6612
+ });
6613
+ /**
6614
+ * Retrieve file batch
6615
+ *
6616
+ * Retrieves a batch created in this knowledge base, including current status and file counts. Use the batch id returned by batch creation to monitor ingestion.
6617
+ */
6618
+ export const knowledgeRetrieveFileBatch = (options) => (options.client ?? client).get({
6619
+ security: [{
6620
+ key: 'knowledge-bearerAuth',
6621
+ scheme: 'bearer',
6622
+ type: 'http'
6623
+ }],
6624
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}',
6625
+ ...options
6626
+ });
6627
+ /**
6628
+ * Cancel file batch
6629
+ *
6630
+ * Cancels only in-progress batches and pending files. Completed, failed and cancelled batches return unchanged (200, idempotent).
6631
+ */
6632
+ export const knowledgeCancelFileBatch = (options) => (options.client ?? client).post({
6633
+ security: [{
6634
+ key: 'knowledge-bearerAuth',
6635
+ scheme: 'bearer',
6636
+ type: 'http'
6637
+ }],
6638
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel',
6639
+ ...options
6640
+ });
6641
+ /**
6642
+ * List batch files
6643
+ *
6644
+ * Lists files still attached from the identified batch, newest attachment first by default. Use the batch creation id and ?filter=failed to inspect failures; last_id is the next after cursor.
6645
+ */
6646
+ export const knowledgeListBatchFiles = (options) => (options.client ?? client).get({
6647
+ security: [{
6648
+ key: 'knowledge-bearerAuth',
6649
+ scheme: 'bearer',
6650
+ type: 'http'
6651
+ }],
6652
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files',
6653
+ ...options
6654
+ });
6655
+ /**
6656
+ * Restore knowledge base
6657
+ *
6658
+ * Restores a deleting store within 7 days. Active stores return 409 VECTOR_STORE_INVALID_STATE; absent stores return 404. Empty body is allowed.
6659
+ */
6660
+ export const knowledgeRestoreVectorStore = (options) => (options.client ?? client).post({
6661
+ security: [{
6662
+ key: 'knowledge-bearerAuth',
6663
+ scheme: 'bearer',
6664
+ type: 'http'
6665
+ }],
6666
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/restore',
6667
+ ...options
6668
+ });
6669
+ /**
6670
+ * Permanently purge knowledge base
6671
+ *
6672
+ * Immediately and irreversibly clears a deleting store using the retention cleanup path. Active stores return 409; absent stores return 404. Empty body is allowed.
6673
+ */
6674
+ export const knowledgePurgeVectorStore = (options) => (options.client ?? client).post({
6675
+ security: [{
6676
+ key: 'knowledge-bearerAuth',
6677
+ scheme: 'bearer',
6678
+ type: 'http'
6679
+ }],
6680
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/purge',
6681
+ ...options
6682
+ });
6683
+ /**
6684
+ * Retry failed file
6685
+ *
6686
+ * Retries only failed files; other states return 409 FILE_INVALID_STATE. Retry after failure has not yet been observed in the documented run.
6687
+ */
6688
+ export const knowledgeRetryFile = (options) => (options.client ?? client).post({
6689
+ security: [{
6690
+ key: 'knowledge-bearerAuth',
6691
+ scheme: 'bearer',
6692
+ type: 'http'
6693
+ }],
6694
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/retry',
6695
+ ...options
6696
+ });
6697
+ /**
6698
+ * List file segments
6699
+ *
6700
+ * Lists the stored chunks of an attached file, ordered by increasing segment index by default. Use the attachment id and last_id as after to continue; returned chunk ids can be retrieved individually.
6701
+ */
6702
+ export const knowledgeListSegments = (options) => (options.client ?? client).get({
6703
+ security: [{
6704
+ key: 'knowledge-bearerAuth',
6705
+ scheme: 'bearer',
6706
+ type: 'http'
6707
+ }],
6708
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/files/{file_id}/segments',
6709
+ ...options
6710
+ });
6711
+ /**
6712
+ * Retrieve segment
6713
+ *
6714
+ * Retrieves one chunk and its term statistics. Take chunk_id from segment listing or native search content; the chunk must belong to this knowledge base.
6715
+ */
6716
+ export const knowledgeRetrieveSegment = (options) => (options.client ?? client).get({
6717
+ security: [{
6718
+ key: 'knowledge-bearerAuth',
6719
+ scheme: 'bearer',
6720
+ type: 'http'
6721
+ }],
6722
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/segments/{chunk_id}',
6723
+ ...options
6724
+ });
6725
+ /**
6726
+ * List events
6727
+ *
6728
+ * Reads events for this knowledge base in increasing sequence order, including while soft-deleted. Pass next_seq as after_seq to continue; null next_seq marks the current end. Example: ?after_seq=0&limit=20.
6729
+ */
6730
+ export const knowledgeListEvents = (options) => (options.client ?? client).get({
6731
+ security: [{
6732
+ key: 'knowledge-bearerAuth',
6733
+ scheme: 'bearer',
6734
+ type: 'http'
6735
+ }],
6736
+ url: '/knowledge/v1/vector_stores/{vector_store_id}/events',
6737
+ ...options
6738
+ });
6739
+ /**
6740
+ * List libraries
6741
+ *
6742
+ * List libraries owned by the caller, newest first. By default, deleting and deleted libraries are excluded; use status=deleting to find libraries awaiting purge. All supplied label pairs must match.
6743
+ */
6744
+ export const mediaListLibraries = (options) => (options?.client ?? client).get({
6745
+ security: [{
6746
+ key: 'media-BearerAuth',
6747
+ scheme: 'bearer',
6748
+ type: 'http'
6749
+ }],
6750
+ url: '/media/v1/libraries',
6751
+ ...options
6752
+ });
6753
+ /**
6754
+ * Create library
6755
+ *
6756
+ * Create a library owned by the caller with a name, optional labels and understanding settings. Understanding is enabled by default; the returned id is used for subsequent asset operations.
6757
+ */
6758
+ export const mediaCreateLibrary = (options) => (options.client ?? client).post({
6759
+ security: [{
6760
+ key: 'media-BearerAuth',
6761
+ scheme: 'bearer',
6762
+ type: 'http'
6763
+ }],
6764
+ url: '/media/v1/libraries',
6765
+ ...options,
6766
+ headers: {
6767
+ 'Content-Type': 'application/json',
6768
+ ...options.headers
6769
+ }
6770
+ });
6771
+ /**
6772
+ * Delete library
6773
+ *
6774
+ * Soft-delete an active library, returning its deleting status and purge_at deadline. Asset operations and delivery become unavailable; the library can be restored before purge_at. Repeated deletion while deleting returns the current library.
6775
+ */
6776
+ export const mediaDeleteLibrary = (options) => (options.client ?? client).delete({
6777
+ security: [{
6778
+ key: 'media-BearerAuth',
6779
+ scheme: 'bearer',
6780
+ type: 'http'
6781
+ }],
6782
+ url: '/media/v1/libraries/{library_id}',
6783
+ ...options
6784
+ });
6785
+ /**
6786
+ * Get library
6787
+ *
6788
+ * Read a caller-owned library’s current settings, usage and lifecycle status. A deleting library remains readable; missing, foreign or purged libraries return LIBRARY_NOT_FOUND.
6789
+ */
6790
+ export const mediaGetLibrary = (options) => (options.client ?? client).get({
6791
+ security: [{
6792
+ key: 'media-BearerAuth',
6793
+ scheme: 'bearer',
6794
+ type: 'http'
6795
+ }],
6796
+ url: '/media/v1/libraries/{library_id}',
6797
+ ...options
6798
+ });
6799
+ /**
6800
+ * Update library
6801
+ *
6802
+ * Update an active library’s supplied settings. Labels replace the complete map; understanding settings and model roles merge with current values. Changing the embedding model is rejected while assets exist.
6803
+ */
6804
+ export const mediaUpdateLibrary = (options) => (options.client ?? client).patch({
6805
+ security: [{
6806
+ key: 'media-BearerAuth',
6807
+ scheme: 'bearer',
6808
+ type: 'http'
6809
+ }],
6810
+ url: '/media/v1/libraries/{library_id}',
6811
+ ...options,
6812
+ headers: {
6813
+ 'Content-Type': 'application/json',
6814
+ ...options.headers
6815
+ }
6816
+ });
6817
+ /**
6818
+ * Restore library
6819
+ *
6820
+ * Restore a deleting library before its purge_at deadline. The library becomes active again and deleted_at and purge_at are cleared; expired or non-deleting libraries cannot be restored.
6821
+ */
6822
+ export const mediaRestoreLibrary = (options) => (options.client ?? client).post({
6823
+ security: [{
6824
+ key: 'media-BearerAuth',
6825
+ scheme: 'bearer',
6826
+ type: 'http'
6827
+ }],
6828
+ url: '/media/v1/libraries/{library_id}/restore',
6829
+ ...options
6830
+ });
6831
+ /**
6832
+ * Purge library
6833
+ *
6834
+ * Permanently remove a library that is already deleting, without waiting for purge_at. Its assets and related resources are removed and cannot be restored; first soft-delete an active library.
6835
+ */
6836
+ export const mediaPurgeLibrary = (options) => (options.client ?? client).post({
6837
+ security: [{
6838
+ key: 'media-BearerAuth',
6839
+ scheme: 'bearer',
6840
+ type: 'http'
6841
+ }],
6842
+ url: '/media/v1/libraries/{library_id}/purge',
6843
+ ...options
6844
+ });
6845
+ /**
6846
+ * List assets
6847
+ *
6848
+ * List assets in an active library, newest first, optionally filtering by exact folder and stored resource type. Continue using next_cursor; video includes audio-only assets.
6849
+ */
6850
+ export const mediaListAssets = (options) => (options.client ?? client).get({
6851
+ security: [{
6852
+ key: 'media-BearerAuth',
6853
+ scheme: 'bearer',
6854
+ type: 'http'
6855
+ }],
6856
+ url: '/media/v1/libraries/{library_id}/assets',
6857
+ ...options
6858
+ });
6859
+ /**
6860
+ * Upload asset
6861
+ *
6862
+ * Upload content into an active library and return a Cloudinary-compatible resource. Use file for a multipart file, data URI, public HTTPS URL or same-owner file identifier. Reusing public_id overwrites by default; overwrite=false returns the existing resource. Chunk uploads require both chunk headers.
6863
+ */
6864
+ export const mediaUploadAsset = (options) => (options.client ?? client).post({
6865
+ security: [{
6866
+ key: 'media-BearerAuth',
6867
+ scheme: 'bearer',
6868
+ type: 'http'
6869
+ }],
6870
+ url: '/media/v1/libraries/{library_id}/assets',
6871
+ ...options,
6872
+ headers: {
6873
+ 'Content-Type': 'application/json',
6874
+ ...options.headers
6875
+ }
6876
+ });
6877
+ /**
6878
+ * Import file
6879
+ *
6880
+ * Copy source content into an active library using upload options and return the full native Asset. The imported asset is independent of the source after copying. Reusing public_id follows overwrite semantics.
6881
+ */
6882
+ export const mediaImportAsset = (options) => (options.client ?? client).post({
6883
+ security: [{
6884
+ key: 'media-BearerAuth',
6885
+ scheme: 'bearer',
6886
+ type: 'http'
6887
+ }],
6888
+ url: '/media/v1/libraries/{library_id}/assets/import',
6889
+ ...options,
6890
+ headers: {
6891
+ 'Content-Type': 'application/json',
6892
+ ...options.headers
6893
+ }
6894
+ });
6895
+ /**
6896
+ * Delete asset
6897
+ *
6898
+ * Delete an asset from the library so it is no longer readable, searchable or deliverable. This removes the asset rather than placing it in the library’s restoration window; a missing asset returns ASSET_NOT_FOUND.
6899
+ */
6900
+ export const mediaDeleteAsset = (options) => (options.client ?? client).delete({
6901
+ security: [{
6902
+ key: 'media-BearerAuth',
6903
+ scheme: 'bearer',
6904
+ type: 'http'
6905
+ }],
6906
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6907
+ ...options
6908
+ });
6909
+ /**
6910
+ * Get asset
6911
+ *
6912
+ * Read a non-deleted asset by its asset_id in an active library, including content hashes, processing progress and available previews. Missing or deleted assets return ASSET_NOT_FOUND.
6913
+ */
6914
+ export const mediaGetAsset = (options) => (options.client ?? client).get({
6915
+ security: [{
6916
+ key: 'media-BearerAuth',
6917
+ scheme: 'bearer',
6918
+ type: 'http'
6919
+ }],
6920
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6921
+ ...options
6922
+ });
6923
+ /**
6924
+ * Update asset
6925
+ *
6926
+ * Update an asset’s supplied metadata fields. Tags and context replace their current collections; an empty collection clears them. Moving asset_folder or changing display_name preserves public_id and delivery URLs.
6927
+ */
6928
+ export const mediaUpdateAsset = (options) => (options.client ?? client).patch({
6929
+ security: [{
6930
+ key: 'media-BearerAuth',
6931
+ scheme: 'bearer',
6932
+ type: 'http'
6933
+ }],
6934
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}',
6935
+ ...options,
6936
+ headers: {
6937
+ 'Content-Type': 'application/json',
6938
+ ...options.headers
6939
+ }
6940
+ });
6941
+ /**
6942
+ * Reprocess asset
6943
+ *
6944
+ * Queue reprocessing of the asset’s current version and return its updated state immediately. Omit kinds to retry failed tasks; explicit kinds rerun applicable completed tasks. Replaced understandings become superseded, and processing finishes asynchronously.
6945
+ */
6946
+ export const mediaReprocessAsset = (options) => (options.client ?? client).post({
6947
+ security: [{
6948
+ key: 'media-BearerAuth',
6949
+ scheme: 'bearer',
6950
+ type: 'http'
6951
+ }],
6952
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/reprocess',
6953
+ ...options,
6954
+ headers: {
6955
+ 'Content-Type': 'application/json',
6956
+ ...options.headers
6957
+ }
6958
+ });
6959
+ /**
6960
+ * List understandings
6961
+ *
6962
+ * List an asset’s understanding results in creation order. By default only current, non-superseded results are returned; use include_superseded=true for history or kind to select an output type.
6963
+ */
6964
+ export const mediaListUnderstandings = (options) => (options.client ?? client).get({
6965
+ security: [{
6966
+ key: 'media-BearerAuth',
6967
+ scheme: 'bearer',
6968
+ type: 'http'
6969
+ }],
6970
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/understandings',
6971
+ ...options
6972
+ });
6973
+ /**
6974
+ * Expression search
6975
+ *
6976
+ * Search active assets using the supported filter-expression syntax, sorting and cursor pagination. Empty expression matches all assets. Tags and context require with_field; inspect the exactness flags before treating counts as complete.
6977
+ */
6978
+ export const mediaExpressionSearch = (options) => (options.client ?? client).post({
6979
+ security: [{
6980
+ key: 'media-BearerAuth',
6981
+ scheme: 'bearer',
6982
+ type: 'http'
6983
+ }],
6984
+ url: '/media/v1/libraries/{library_id}/search/expression',
6985
+ ...options,
6986
+ headers: {
6987
+ 'Content-Type': 'application/json',
6988
+ ...options.headers
6989
+ }
6990
+ });
6991
+ /**
6992
+ * Visual search
6993
+ *
6994
+ * Find visually similar assets using exactly one of asset_id or an inline base64 image. The library must support image search; an asset query needs a current image embedding and excludes that source asset from results.
6995
+ */
6996
+ export const mediaVisualSearch = (options) => (options.client ?? client).post({
6997
+ security: [{
6998
+ key: 'media-BearerAuth',
6999
+ scheme: 'bearer',
7000
+ type: 'http'
7001
+ }],
7002
+ url: '/media/v1/libraries/{library_id}/search/visual',
7003
+ ...options,
7004
+ headers: {
7005
+ 'Content-Type': 'application/json',
7006
+ ...options.headers
7007
+ }
7008
+ });
7009
+ /**
7010
+ * Semantic search
7011
+ *
7012
+ * Search assets with a nonblank text query and optional expression filter. Hybrid mode combines semantic and keyword matches; semantic mode uses vector similarity only. Results are ranked and limited by top_k.
7013
+ */
7014
+ export const mediaSemanticSearch = (options) => (options.client ?? client).post({
7015
+ security: [{
7016
+ key: 'media-BearerAuth',
7017
+ scheme: 'bearer',
7018
+ type: 'http'
7019
+ }],
7020
+ url: '/media/v1/libraries/{library_id}/search/semantic',
7021
+ ...options,
7022
+ headers: {
7023
+ 'Content-Type': 'application/json',
7024
+ ...options.headers
7025
+ }
7026
+ });
7027
+ /**
7028
+ * Semantic search alias
6103
7029
  *
6104
7030
  * Alias of semantic search. Search assets with a nonblank text query, optional expression filter and top_k; hybrid combines semantic and keyword matches, while semantic uses vector similarity only.
6105
7031
  */
6106
- export const mediaSearch = (options) => (options.client ?? client).post({
7032
+ export const mediaSearch = (options) => (options.client ?? client).post({
7033
+ security: [{
7034
+ key: 'media-BearerAuth',
7035
+ scheme: 'bearer',
7036
+ type: 'http'
7037
+ }],
7038
+ url: '/media/v1/libraries/{library_id}/search',
7039
+ ...options,
7040
+ headers: {
7041
+ 'Content-Type': 'application/json',
7042
+ ...options.headers
7043
+ }
7044
+ });
7045
+ /**
7046
+ * List folders
7047
+ *
7048
+ * List all immediate child folders under parent, or under the root when parent is omitted. Counts include descendant assets. The result is unpaginated; limit and cursor are rejected.
7049
+ */
7050
+ export const mediaListFolders = (options) => (options.client ?? client).get({
7051
+ security: [{
7052
+ key: 'media-BearerAuth',
7053
+ scheme: 'bearer',
7054
+ type: 'http'
7055
+ }],
7056
+ url: '/media/v1/libraries/{library_id}/folders',
7057
+ ...options
7058
+ });
7059
+ /**
7060
+ * Create batch
7061
+ *
7062
+ * Create an asynchronous batch for tagging, untagging, replacing context, moving or deleting assets. Select ids or an expression; selection is frozen at creation. Poll the returned job id for completion and per-item failures.
7063
+ */
7064
+ export const mediaCreateBatch = (options) => (options.client ?? client).post({
7065
+ security: [{
7066
+ key: 'media-BearerAuth',
7067
+ scheme: 'bearer',
7068
+ type: 'http'
7069
+ }],
7070
+ url: '/media/v1/libraries/{library_id}/batches',
7071
+ ...options,
7072
+ headers: {
7073
+ 'Content-Type': 'application/json',
7074
+ ...options.headers
7075
+ }
7076
+ });
7077
+ /**
7078
+ * Get batch
7079
+ *
7080
+ * Read a batch job’s status, successful and failed item counts, and a bounded list of failed items. Use the id returned by batch creation; a job outside this library is not found.
7081
+ */
7082
+ export const mediaGetBatch = (options) => (options.client ?? client).get({
7083
+ security: [{
7084
+ key: 'media-BearerAuth',
7085
+ scheme: 'bearer',
7086
+ type: 'http'
7087
+ }],
7088
+ url: '/media/v1/libraries/{library_id}/batches/{job_id}',
7089
+ ...options
7090
+ });
7091
+ /**
7092
+ * Batch assets alias
7093
+ *
7094
+ * Alias of batch creation. Apply one metadata or deletion action to ids or a frozen expression selection asynchronously; poll the returned job id to inspect completion and item failures.
7095
+ */
7096
+ export const mediaBatchAssets = (options) => (options.client ?? client).post({
6107
7097
  security: [{
6108
7098
  key: 'media-BearerAuth',
6109
7099
  scheme: 'bearer',
6110
7100
  type: 'http'
6111
7101
  }],
6112
- url: '/media/v1/libraries/{library_id}/search',
7102
+ url: '/media/v1/libraries/{library_id}/assets:batch',
6113
7103
  ...options,
6114
7104
  headers: {
6115
7105
  'Content-Type': 'application/json',
@@ -6117,31 +7107,45 @@ export const mediaSearch = (options) => (options.client ?? client).post({
6117
7107
  }
6118
7108
  });
6119
7109
  /**
6120
- * List folders
7110
+ * Get job alias
6121
7111
  *
6122
- * List all immediate child folders under parent, or under the root when parent is omitted. Counts include descendant assets. The result is unpaginated; limit and cursor are rejected.
7112
+ * Alias of batch retrieval. Read the job returned by a batch request, including terminal status, successful and failed counts, and individual failure codes.
6123
7113
  */
6124
- export const mediaListFolders = (options) => (options.client ?? client).get({
7114
+ export const mediaGetJob = (options) => (options.client ?? client).get({
6125
7115
  security: [{
6126
7116
  key: 'media-BearerAuth',
6127
7117
  scheme: 'bearer',
6128
7118
  type: 'http'
6129
7119
  }],
6130
- url: '/media/v1/libraries/{library_id}/folders',
7120
+ url: '/media/v1/libraries/{library_id}/jobs/{job_id}',
6131
7121
  ...options
6132
7122
  });
6133
7123
  /**
6134
- * Create batch
7124
+ * List events
6135
7125
  *
6136
- * Create an asynchronous batch for tagging, untagging, replacing context, moving or deleting assets. Select ids or an expression; selection is frozen at creation. Poll the returned job id for completion and per-item failures.
7126
+ * Read library events in sequence order, including while the library is deleting. Page forward with asc and after_seq, or backward with desc and before_seq; never combine the two sequence cursors.
6137
7127
  */
6138
- export const mediaCreateBatch = (options) => (options.client ?? client).post({
7128
+ export const mediaListEvents = (options) => (options.client ?? client).get({
6139
7129
  security: [{
6140
7130
  key: 'media-BearerAuth',
6141
7131
  scheme: 'bearer',
6142
7132
  type: 'http'
6143
7133
  }],
6144
- url: '/media/v1/libraries/{library_id}/batches',
7134
+ url: '/media/v1/libraries/{library_id}/events',
7135
+ ...options
7136
+ });
7137
+ /**
7138
+ * Create delivery token
7139
+ *
7140
+ * Issue a time-limited bearer token for originals and transformed authenticated assets in an active library. Use library_id from library creation or listing; read access is sufficient. Append token as the __cld_token__ query parameter on a matching delivery URL. The default ACL covers this library and the default lifetime is 3600 seconds; narrow acl and expires_in before sharing. Anyone holding the token can read matching paths until expires_at.
7141
+ */
7142
+ export const mediaCreateDeliveryToken = (options) => (options.client ?? client).post({
7143
+ security: [{
7144
+ key: 'media-BearerAuth',
7145
+ scheme: 'bearer',
7146
+ type: 'http'
7147
+ }],
7148
+ url: '/media/v1/libraries/{library_id}/delivery_tokens',
6145
7149
  ...options,
6146
7150
  headers: {
6147
7151
  'Content-Type': 'application/json',
@@ -6149,31 +7153,238 @@ export const mediaCreateBatch = (options) => (options.client ?? client).post({
6149
7153
  }
6150
7154
  });
6151
7155
  /**
6152
- * Get batch
7156
+ * List sandboxes (v2)
6153
7157
  *
6154
- * Read a batch job’s status, successful and failed item counts, and a bounded list of failed items. Use the id returned by batch creation; a job outside this library is not found.
7158
+ * List your running and paused sandboxes with paging and filters. Use it to find a sandboxID before connecting to, pausing or killing a sandbox. Filter by state, template (id or alias), name, metadata (key=value pairs joined with &) and startedAfter; order sorts by start time (default newest first); limit is 1 to 100 (default 100). When more results exist the response carries an x-next-token header; send it back as nextToken for the next page. To read one sandbox use getSandbox.
6155
7159
  */
6156
- export const mediaGetBatch = (options) => (options.client ?? client).get({
6157
- security: [{
6158
- key: 'media-BearerAuth',
7160
+ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).get({
7161
+ querySerializer: { parameters: { state: { array: { explode: false } } } },
7162
+ security: [
7163
+ {
7164
+ key: 'sandbox-ApiKeyAuth',
7165
+ name: 'X-API-Key',
7166
+ type: 'apiKey'
7167
+ },
7168
+ {
7169
+ key: 'sandbox-AuthProviderBearerAuth',
6159
7170
  scheme: 'bearer',
6160
7171
  type: 'http'
6161
- }],
6162
- url: '/media/v1/libraries/{library_id}/batches/{job_id}',
7172
+ },
7173
+ {
7174
+ key: 'sandbox-AuthProviderTeamAuth',
7175
+ name: 'X-Team-ID',
7176
+ type: 'apiKey'
7177
+ },
7178
+ { name: 'X-Admin-Token', type: 'apiKey' },
7179
+ {
7180
+ key: 'sandbox-AdminTeamAuth',
7181
+ name: 'X-Team-ID',
7182
+ type: 'apiKey'
7183
+ },
7184
+ {
7185
+ key: 'sandbox-AdminJWTAuth',
7186
+ scheme: 'bearer',
7187
+ type: 'http'
7188
+ }
7189
+ ],
7190
+ url: '/sandbox/v1/sandboxes',
6163
7191
  ...options
6164
7192
  });
6165
7193
  /**
6166
- * Batch assets alias
7194
+ * Create sandbox (v2)
6167
7195
  *
6168
- * Alias of batch creation. Apply one metadata or deletion action to ids or a frozen expression selection asynchronously; poll the returned job id to inspect completion and item failures.
7196
+ * Create a sandbox from the template. All system communication with the sandbox is secured.
6169
7197
  */
6170
- export const mediaBatchAssets = (options) => (options.client ?? client).post({
6171
- security: [{
6172
- key: 'media-BearerAuth',
7198
+ export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
7199
+ security: [
7200
+ {
7201
+ key: 'sandbox-ApiKeyAuth',
7202
+ name: 'X-API-Key',
7203
+ type: 'apiKey'
7204
+ },
7205
+ {
7206
+ key: 'sandbox-AuthProviderBearerAuth',
7207
+ scheme: 'bearer',
7208
+ type: 'http'
7209
+ },
7210
+ {
7211
+ key: 'sandbox-AuthProviderTeamAuth',
7212
+ name: 'X-Team-ID',
7213
+ type: 'apiKey'
7214
+ },
7215
+ { name: 'X-Admin-Token', type: 'apiKey' },
7216
+ {
7217
+ key: 'sandbox-AdminTeamAuth',
7218
+ name: 'X-Team-ID',
7219
+ type: 'apiKey'
7220
+ },
7221
+ {
7222
+ key: 'sandbox-AdminJWTAuth',
7223
+ scheme: 'bearer',
7224
+ type: 'http'
7225
+ }
7226
+ ],
7227
+ url: '/sandbox/v1/sandboxes',
7228
+ ...options,
7229
+ headers: {
7230
+ 'Content-Type': 'application/json',
7231
+ ...options.headers
7232
+ }
7233
+ });
7234
+ /**
7235
+ * Sandbox metrics
7236
+ *
7237
+ * Read CPU, memory and disk usage samples of a sandbox over a time window. Use it to size a sandbox or find out why it is slow. start and end are Unix timestamps in seconds; without them the recent samples are returned. An unknown id answers 404.
7238
+ */
7239
+ export const getSandboxV1SandboxesBySandboxIdMetrics = (options) => (options.client ?? client).get({
7240
+ security: [
7241
+ {
7242
+ key: 'sandbox-ApiKeyAuth',
7243
+ name: 'X-API-Key',
7244
+ type: 'apiKey'
7245
+ },
7246
+ {
7247
+ key: 'sandbox-AuthProviderBearerAuth',
7248
+ scheme: 'bearer',
7249
+ type: 'http'
7250
+ },
7251
+ {
7252
+ key: 'sandbox-AuthProviderTeamAuth',
7253
+ name: 'X-Team-ID',
7254
+ type: 'apiKey'
7255
+ },
7256
+ { name: 'X-Admin-Token', type: 'apiKey' },
7257
+ {
7258
+ key: 'sandbox-AdminTeamAuth',
7259
+ name: 'X-Team-ID',
7260
+ type: 'apiKey'
7261
+ },
7262
+ {
7263
+ key: 'sandbox-AdminJWTAuth',
7264
+ scheme: 'bearer',
7265
+ type: 'http'
7266
+ }
7267
+ ],
7268
+ url: '/sandbox/v1/sandboxes/{sandboxID}/metrics',
7269
+ ...options
7270
+ });
7271
+ /**
7272
+ * Pause sandbox
7273
+ *
7274
+ * Pause a running sandbox, keeping its files and memory so that connectSandbox can resume it later. Use it to stop paying for compute without losing state; to discard the sandbox use killSandbox. Success answers 204. A sandbox that is not running answers 409.
7275
+ */
7276
+ export const postSandboxV1SandboxesBySandboxIdPause = (options) => (options.client ?? client).post({
7277
+ security: [
7278
+ {
7279
+ key: 'sandbox-ApiKeyAuth',
7280
+ name: 'X-API-Key',
7281
+ type: 'apiKey'
7282
+ },
7283
+ {
7284
+ key: 'sandbox-AuthProviderBearerAuth',
7285
+ scheme: 'bearer',
7286
+ type: 'http'
7287
+ },
7288
+ {
7289
+ key: 'sandbox-AuthProviderTeamAuth',
7290
+ name: 'X-Team-ID',
7291
+ type: 'apiKey'
7292
+ },
7293
+ { name: 'X-Admin-Token', type: 'apiKey' },
7294
+ {
7295
+ key: 'sandbox-AdminTeamAuth',
7296
+ name: 'X-Team-ID',
7297
+ type: 'apiKey'
7298
+ },
7299
+ {
7300
+ key: 'sandbox-AdminJWTAuth',
7301
+ scheme: 'bearer',
7302
+ type: 'http'
7303
+ }
7304
+ ],
7305
+ url: '/sandbox/v1/sandboxes/{sandboxID}/pause',
7306
+ ...options,
7307
+ headers: {
7308
+ 'Content-Type': 'application/json',
7309
+ ...options.headers
7310
+ }
7311
+ });
7312
+ /**
7313
+ * Set sandbox timeout
7314
+ *
7315
+ * Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration.
7316
+ */
7317
+ export const postSandboxV1SandboxesBySandboxIdTimeout = (options) => (options.client ?? client).post({
7318
+ security: [
7319
+ {
7320
+ key: 'sandbox-ApiKeyAuth',
7321
+ name: 'X-API-Key',
7322
+ type: 'apiKey'
7323
+ },
7324
+ {
7325
+ key: 'sandbox-AuthProviderBearerAuth',
7326
+ scheme: 'bearer',
7327
+ type: 'http'
7328
+ },
7329
+ {
7330
+ key: 'sandbox-AuthProviderTeamAuth',
7331
+ name: 'X-Team-ID',
7332
+ type: 'apiKey'
7333
+ },
7334
+ { name: 'X-Admin-Token', type: 'apiKey' },
7335
+ {
7336
+ key: 'sandbox-AdminTeamAuth',
7337
+ name: 'X-Team-ID',
7338
+ type: 'apiKey'
7339
+ },
7340
+ {
7341
+ key: 'sandbox-AdminJWTAuth',
7342
+ scheme: 'bearer',
7343
+ type: 'http'
7344
+ }
7345
+ ],
7346
+ url: '/sandbox/v1/sandboxes/{sandboxID}/timeout',
7347
+ ...options,
7348
+ headers: {
7349
+ 'Content-Type': 'application/json',
7350
+ ...options.headers
7351
+ }
7352
+ });
7353
+ /**
7354
+ * Connect sandbox (v2)
7355
+ *
7356
+ * Returns sandbox details. If the sandbox is paused, it will be resumed. TTL is only extended. The request body is optional; an omitted timeout defaults to 300 seconds.
7357
+ */
7358
+ export const postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.client ?? client).post({
7359
+ security: [
7360
+ {
7361
+ key: 'sandbox-ApiKeyAuth',
7362
+ name: 'X-API-Key',
7363
+ type: 'apiKey'
7364
+ },
7365
+ {
7366
+ key: 'sandbox-AuthProviderBearerAuth',
7367
+ scheme: 'bearer',
7368
+ type: 'http'
7369
+ },
7370
+ {
7371
+ key: 'sandbox-AuthProviderTeamAuth',
7372
+ name: 'X-Team-ID',
7373
+ type: 'apiKey'
7374
+ },
7375
+ { name: 'X-Admin-Token', type: 'apiKey' },
7376
+ {
7377
+ key: 'sandbox-AdminTeamAuth',
7378
+ name: 'X-Team-ID',
7379
+ type: 'apiKey'
7380
+ },
7381
+ {
7382
+ key: 'sandbox-AdminJWTAuth',
6173
7383
  scheme: 'bearer',
6174
7384
  type: 'http'
6175
- }],
6176
- url: '/media/v1/libraries/{library_id}/assets:batch',
7385
+ }
7386
+ ],
7387
+ url: '/sandbox/v1/sandboxes/{sandboxID}/connect',
6177
7388
  ...options,
6178
7389
  headers: {
6179
7390
  'Content-Type': 'application/json',
@@ -6181,40 +7392,89 @@ export const mediaBatchAssets = (options) => (options.client ?? client).post({
6181
7392
  }
6182
7393
  });
6183
7394
  /**
6184
- * Get job alias
7395
+ * List templates (v2)
6185
7396
  *
6186
- * Alias of batch retrieval. Read the job returned by a batch request, including terminal status, successful and failed counts, and individual failure codes.
7397
+ * List official templates and all your custom templates, including waiting, building, ready and error builds. Custom templates appear first; each custom row describes its latest build, not necessarily the current ready build. Use templateID for build management and a ready template name when creating a sandbox. Own-face official distinguishes public catalog entries; sourceKind is omitted until a source is submitted and on official templates. Other organizations' templates are invisible.
6187
7398
  */
6188
- export const mediaGetJob = (options) => (options.client ?? client).get({
6189
- security: [{
6190
- key: 'media-BearerAuth',
7399
+ export const listSandboxTemplates = (options) => (options?.client ?? client).get({
7400
+ security: [
7401
+ {
7402
+ key: 'sandbox-ApiKeyAuth',
7403
+ name: 'X-API-Key',
7404
+ type: 'apiKey'
7405
+ },
7406
+ {
7407
+ key: 'sandbox-AuthProviderBearerAuth',
6191
7408
  scheme: 'bearer',
6192
7409
  type: 'http'
6193
- }],
6194
- url: '/media/v1/libraries/{library_id}/jobs/{job_id}',
7410
+ },
7411
+ {
7412
+ key: 'sandbox-AuthProviderTeamAuth',
7413
+ name: 'X-Team-ID',
7414
+ type: 'apiKey'
7415
+ },
7416
+ { name: 'X-Admin-Token', type: 'apiKey' },
7417
+ {
7418
+ key: 'sandbox-AdminTeamAuth',
7419
+ name: 'X-Team-ID',
7420
+ type: 'apiKey'
7421
+ },
7422
+ {
7423
+ key: 'sandbox-AdminJWTAuth',
7424
+ scheme: 'bearer',
7425
+ type: 'http'
7426
+ }
7427
+ ],
7428
+ url: '/sandbox/v1/templates',
6195
7429
  ...options
6196
7430
  });
6197
7431
  /**
6198
- * List events
7432
+ * Create template (v3)
6199
7433
  *
6200
- * Read library events in sequence order, including while the library is deleting. Page forward with asc and after_seq, or backward with desc and before_seq; never combine the two sequence cursors.
7434
+ * Reserve a waiting build before submitting its source. Reusing a name in your organization allocates a new build on the same template. Returns templateID and buildID; start it with templates.builds.update, then poll templates.builds.status.list. A name:tag suffix and tags are assigned after successful publication. Example: {"name":"my-template","cpuCount":2,"memoryMB":2048}. The own face also accepts diskGb, a positive integer defaulting to 10 GiB.
6201
7435
  */
6202
- export const mediaListEvents = (options) => (options.client ?? client).get({
6203
- security: [{
6204
- key: 'media-BearerAuth',
7436
+ export const requestTemplateBuild = (options) => (options.client ?? client).post({
7437
+ security: [
7438
+ {
7439
+ key: 'sandbox-ApiKeyAuth',
7440
+ name: 'X-API-Key',
7441
+ type: 'apiKey'
7442
+ },
7443
+ {
7444
+ key: 'sandbox-AuthProviderBearerAuth',
6205
7445
  scheme: 'bearer',
6206
7446
  type: 'http'
6207
- }],
6208
- url: '/media/v1/libraries/{library_id}/events',
6209
- ...options
7447
+ },
7448
+ {
7449
+ key: 'sandbox-AuthProviderTeamAuth',
7450
+ name: 'X-Team-ID',
7451
+ type: 'apiKey'
7452
+ },
7453
+ { name: 'X-Admin-Token', type: 'apiKey' },
7454
+ {
7455
+ key: 'sandbox-AdminTeamAuth',
7456
+ name: 'X-Team-ID',
7457
+ type: 'apiKey'
7458
+ },
7459
+ {
7460
+ key: 'sandbox-AdminJWTAuth',
7461
+ scheme: 'bearer',
7462
+ type: 'http'
7463
+ }
7464
+ ],
7465
+ url: '/sandbox/v1/templates',
7466
+ ...options,
7467
+ headers: {
7468
+ 'Content-Type': 'application/json',
7469
+ ...options.headers
7470
+ }
6210
7471
  });
6211
7472
  /**
6212
- * List sandboxes (v2)
7473
+ * List team volumes
6213
7474
  *
6214
- * List your running and paused sandboxes with paging and filters. Use it to find a sandboxID before connecting to, pausing or killing a sandbox. Filter by state, template (id or alias), name, metadata (key=value pairs joined with &) and startedAfter; order sorts by start time (default newest first); limit is 1 to 100 (default 100). When more results exist the response carries an x-next-token header; send it back as nextToken for the next page. To read one sandbox use getSandbox.
7475
+ * List the volumes of your team. Use it to find a volumeID before reading or deleting a volume, or to attach a volume to a sandbox by name when you create it.
6215
7476
  */
6216
- export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).get({
6217
- querySerializer: { parameters: { state: { array: { explode: false } } } },
7477
+ export const getSandboxV1Volumes = (options) => (options?.client ?? client).get({
6218
7478
  security: [
6219
7479
  {
6220
7480
  key: 'sandbox-ApiKeyAuth',
@@ -6243,15 +7503,15 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
6243
7503
  type: 'http'
6244
7504
  }
6245
7505
  ],
6246
- url: '/sandbox/v1/sandboxes',
7506
+ url: '/sandbox/v1/volumes',
6247
7507
  ...options
6248
7508
  });
6249
7509
  /**
6250
- * Create sandbox (v2)
7510
+ * Create team volume
6251
7511
  *
6252
- * Create a sandbox from the template. All system communication with the sandbox is secured.
7512
+ * Create a team volume: persistent storage that can be mounted into sandboxes and outlives them. Send the volume name; the response returns the volume id and name. Use getVolume to read it back and deleteVolume to remove it.
6253
7513
  */
6254
- export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
7514
+ export const postSandboxV1Volumes = (options) => (options.client ?? client).post({
6255
7515
  security: [
6256
7516
  {
6257
7517
  key: 'sandbox-ApiKeyAuth',
@@ -6280,7 +7540,7 @@ export const postSandboxV1Sandboxes = (options) => (options.client ?? client).po
6280
7540
  type: 'http'
6281
7541
  }
6282
7542
  ],
6283
- url: '/sandbox/v1/sandboxes',
7543
+ url: '/sandbox/v1/volumes',
6284
7544
  ...options,
6285
7545
  headers: {
6286
7546
  'Content-Type': 'application/json',
@@ -6288,11 +7548,11 @@ export const postSandboxV1Sandboxes = (options) => (options.client ?? client).po
6288
7548
  }
6289
7549
  });
6290
7550
  /**
6291
- * Sandbox metrics
7551
+ * Delete team volume
6292
7552
  *
6293
- * Read CPU, memory and disk usage samples of a sandbox over a time window. Use it to size a sandbox or find out why it is slow. start and end are Unix timestamps in seconds; without them the recent samples are returned. An unknown id answers 404.
7553
+ * Delete a team volume and its data permanently. Use it only when no sandbox needs the volume any more; the data cannot be recovered. Success answers 204; an unknown id answers 404.
6294
7554
  */
6295
- export const getSandboxV1SandboxesBySandboxIdMetrics = (options) => (options.client ?? client).get({
7555
+ export const deleteSandboxV1VolumesByVolumeId = (options) => (options.client ?? client).delete({
6296
7556
  security: [
6297
7557
  {
6298
7558
  key: 'sandbox-ApiKeyAuth',
@@ -6321,15 +7581,15 @@ export const getSandboxV1SandboxesBySandboxIdMetrics = (options) => (options.cli
6321
7581
  type: 'http'
6322
7582
  }
6323
7583
  ],
6324
- url: '/sandbox/v1/sandboxes/{sandboxID}/metrics',
7584
+ url: '/sandbox/v1/volumes/{volumeID}',
6325
7585
  ...options
6326
7586
  });
6327
7587
  /**
6328
- * Pause sandbox
7588
+ * Team volume
6329
7589
  *
6330
- * Pause a running sandbox, keeping its files and memory so that connectSandbox can resume it later. Use it to stop paying for compute without losing state; to discard the sandbox use killSandbox. Success answers 204. A sandbox that is not running answers 409.
7590
+ * Read one team volume by id. Use it to confirm a volume exists and to read its name before mounting it in a sandbox. An unknown id answers 404.
6331
7591
  */
6332
- export const postSandboxV1SandboxesBySandboxIdPause = (options) => (options.client ?? client).post({
7592
+ export const getSandboxV1VolumesByVolumeId = (options) => (options.client ?? client).get({
6333
7593
  security: [
6334
7594
  {
6335
7595
  key: 'sandbox-ApiKeyAuth',
@@ -6358,19 +7618,15 @@ export const postSandboxV1SandboxesBySandboxIdPause = (options) => (options.clie
6358
7618
  type: 'http'
6359
7619
  }
6360
7620
  ],
6361
- url: '/sandbox/v1/sandboxes/{sandboxID}/pause',
6362
- ...options,
6363
- headers: {
6364
- 'Content-Type': 'application/json',
6365
- ...options.headers
6366
- }
7621
+ url: '/sandbox/v1/volumes/{volumeID}',
7622
+ ...options
6367
7623
  });
6368
7624
  /**
6369
- * Set sandbox timeout
7625
+ * Fork sandbox
6370
7626
  *
6371
- * Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration.
7627
+ * Fork the sandbox: checkpoint the running sandbox in place (it is briefly paused, snapshotted with its full memory state, and resumed on its node, keeping its ID and expiration untouched) and create count new sandboxes from that snapshot. Returns one result per requested fork, each carrying either the created sandbox or the error that prevented it from starting. A non-201 status means the request failed before any fork was attempted.
6372
7628
  */
6373
- export const postSandboxV1SandboxesBySandboxIdTimeout = (options) => (options.client ?? client).post({
7629
+ export const postSandboxV1SandboxesBySandboxIdFork = (options) => (options.client ?? client).post({
6374
7630
  security: [
6375
7631
  {
6376
7632
  key: 'sandbox-ApiKeyAuth',
@@ -6399,7 +7655,7 @@ export const postSandboxV1SandboxesBySandboxIdTimeout = (options) => (options.cl
6399
7655
  type: 'http'
6400
7656
  }
6401
7657
  ],
6402
- url: '/sandbox/v1/sandboxes/{sandboxID}/timeout',
7658
+ url: '/sandbox/v1/sandboxes/{sandboxID}/fork',
6403
7659
  ...options,
6404
7660
  headers: {
6405
7661
  'Content-Type': 'application/json',
@@ -6407,11 +7663,11 @@ export const postSandboxV1SandboxesBySandboxIdTimeout = (options) => (options.cl
6407
7663
  }
6408
7664
  });
6409
7665
  /**
6410
- * Connect sandbox (v2)
7666
+ * Create snapshot
6411
7667
  *
6412
- * Returns sandbox details. If the sandbox is paused, it will be resumed. TTL is only extended. The request body is optional; an omitted timeout defaults to 300 seconds.
7668
+ * Create a persistent snapshot from the sandbox's current state. Snapshots can be used to create new sandboxes and persist beyond the original sandbox's lifetime.
6413
7669
  */
6414
- export const postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.client ?? client).post({
7670
+ export const postSandboxV1SandboxesBySandboxIdSnapshots = (options) => (options.client ?? client).post({
6415
7671
  security: [
6416
7672
  {
6417
7673
  key: 'sandbox-ApiKeyAuth',
@@ -6440,7 +7696,7 @@ export const postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.cl
6440
7696
  type: 'http'
6441
7697
  }
6442
7698
  ],
6443
- url: '/sandbox/v1/sandboxes/{sandboxID}/connect',
7699
+ url: '/sandbox/v1/sandboxes/{sandboxID}/snapshots',
6444
7700
  ...options,
6445
7701
  headers: {
6446
7702
  'Content-Type': 'application/json',
@@ -6448,11 +7704,11 @@ export const postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.cl
6448
7704
  }
6449
7705
  });
6450
7706
  /**
6451
- * List templates (v2)
7707
+ * List snapshots
6452
7708
  *
6453
- * List the templates you can create sandboxes from. Use it to pick the template id or alias for createSandbox. `base` is the default template that createSandbox uses when templateID is omitted. limit is 1 to 100 (default 100); send the cursor from the response back as nextToken to continue.
7709
+ * List the snapshots you created, one cursor page at a time. Use it to find a snapshot id before you create a sandbox from it or delete it. Filter by sandboxID (the source sandbox) or by name or snapshot id, optionally tag-qualified; limit is 1 to 100 (default 100). When more results exist send the cursor from the response back as nextToken.
6454
7710
  */
6455
- export const getSandboxV1Templates = (options) => (options?.client ?? client).get({
7711
+ export const getSandboxV1Snapshots = (options) => (options?.client ?? client).get({
6456
7712
  security: [
6457
7713
  {
6458
7714
  key: 'sandbox-ApiKeyAuth',
@@ -6481,15 +7737,15 @@ export const getSandboxV1Templates = (options) => (options?.client ?? client).ge
6481
7737
  type: 'http'
6482
7738
  }
6483
7739
  ],
6484
- url: '/sandbox/v1/templates',
7740
+ url: '/sandbox/v1/snapshots',
6485
7741
  ...options
6486
7742
  });
6487
7743
  /**
6488
- * List team volumes
7744
+ * Delete template
6489
7745
  *
6490
- * List the volumes of your team. Use it to find a volumeID before reading or deleting a volume, or to attach a volume to a sandbox by name when you create it.
7746
+ * Delete one of your snapshots. Sandboxes already created from it keep running; no new sandbox can be created from it afterwards. Success answers 204. A snapshot that does not exist or belongs to someone else answers 404.
6491
7747
  */
6492
- export const getSandboxV1Volumes = (options) => (options?.client ?? client).get({
7748
+ export const deleteSandboxV1SnapshotsBySnapshotId = (options) => (options.client ?? client).delete({
6493
7749
  security: [
6494
7750
  {
6495
7751
  key: 'sandbox-ApiKeyAuth',
@@ -6518,15 +7774,15 @@ export const getSandboxV1Volumes = (options) => (options?.client ?? client).get(
6518
7774
  type: 'http'
6519
7775
  }
6520
7776
  ],
6521
- url: '/sandbox/v1/volumes',
7777
+ url: '/sandbox/v1/snapshots/{snapshotID}',
6522
7778
  ...options
6523
7779
  });
6524
7780
  /**
6525
- * Create team volume
7781
+ * Update sandbox network
6526
7782
  *
6527
- * Create a team volume: persistent storage that can be mounted into sandboxes and outlives them. Send the volume name; the response returns the volume id and name. Use getVolume to read it back and deleteVolume to remove it.
7783
+ * Update the network configuration for a running sandbox. Replaces the current egress rules with the provided configuration. Omitting field clears it.
6528
7784
  */
6529
- export const postSandboxV1Volumes = (options) => (options.client ?? client).post({
7785
+ export const putSandboxV1SandboxesBySandboxIdNetwork = (options) => (options.client ?? client).put({
6530
7786
  security: [
6531
7787
  {
6532
7788
  key: 'sandbox-ApiKeyAuth',
@@ -6555,7 +7811,7 @@ export const postSandboxV1Volumes = (options) => (options.client ?? client).post
6555
7811
  type: 'http'
6556
7812
  }
6557
7813
  ],
6558
- url: '/sandbox/v1/volumes',
7814
+ url: '/sandbox/v1/sandboxes/{sandboxID}/network',
6559
7815
  ...options,
6560
7816
  headers: {
6561
7817
  'Content-Type': 'application/json',
@@ -6563,11 +7819,11 @@ export const postSandboxV1Volumes = (options) => (options.client ?? client).post
6563
7819
  }
6564
7820
  });
6565
7821
  /**
6566
- * Delete team volume
7822
+ * Sandbox logs (v2)
6567
7823
  *
6568
- * Delete a team volume and its data permanently. Use it only when no sandbox needs the volume any more; the data cannot be recovered. Success answers 204; an unknown id answers 404.
7824
+ * Read the log lines of a sandbox. Use it to debug what ran inside a sandbox. cursor is a start timestamp in milliseconds, direction chooses forward or backward from it, level sets the lowest level to return, search is a case-sensitive substring filter (at most 256 characters) and limit caps the count (at most 1000, default 1000). To continue, pass the timestamp of the last entry as the next cursor.
6569
7825
  */
6570
- export const deleteSandboxV1VolumesByVolumeId = (options) => (options.client ?? client).delete({
7826
+ export const getSandboxV1SandboxesBySandboxIdLogs = (options) => (options.client ?? client).get({
6571
7827
  security: [
6572
7828
  {
6573
7829
  key: 'sandbox-ApiKeyAuth',
@@ -6596,15 +7852,15 @@ export const deleteSandboxV1VolumesByVolumeId = (options) => (options.client ??
6596
7852
  type: 'http'
6597
7853
  }
6598
7854
  ],
6599
- url: '/sandbox/v1/volumes/{volumeID}',
7855
+ url: '/sandbox/v1/sandboxes/{sandboxID}/logs',
6600
7856
  ...options
6601
7857
  });
6602
7858
  /**
6603
- * Team volume
7859
+ * Start template build (v2)
6604
7860
  *
6605
- * Read one team volume by id. Use it to confirm a volume exists and to read its name before mounting it in a sandbox. An unknown id answers 404.
7861
+ * Submit source for a waiting build returned by templates.create; returns 202 after queueing, not after successful publication. Unlike E2B, COPY is rejected (use RUN curl or git clone), fromTemplate accepts official catalog names only, and plaintext registry credentials are rejected. The own face also accepts dockerfile, mutually exclusive with fromImage/fromTemplate/steps, and fromImageRegistry vault references for nonofficial images. Poll templates.builds.status.list until ready or error. Example: {"fromImage":"node:22","steps":[{"type":"RUN","args":["echo hello"]}]}.
6606
7862
  */
6607
- export const getSandboxV1VolumesByVolumeId = (options) => (options.client ?? client).get({
7863
+ export const startTemplateBuild = (options) => (options.client ?? client).post({
6608
7864
  security: [
6609
7865
  {
6610
7866
  key: 'sandbox-ApiKeyAuth',
@@ -6633,15 +7889,19 @@ export const getSandboxV1VolumesByVolumeId = (options) => (options.client ?? cli
6633
7889
  type: 'http'
6634
7890
  }
6635
7891
  ],
6636
- url: '/sandbox/v1/volumes/{volumeID}',
6637
- ...options
7892
+ url: '/sandbox/v1/templates/{templateID}/builds/{buildID}',
7893
+ ...options,
7894
+ headers: {
7895
+ 'Content-Type': 'application/json',
7896
+ ...options.headers
7897
+ }
6638
7898
  });
6639
7899
  /**
6640
- * Fork sandbox
7900
+ * Template build status
6641
7901
  *
6642
- * Fork the sandbox: checkpoint the running sandbox in place (it is briefly paused, snapshotted with its full memory state, and resumed on its node, keeping its ID and expiration untouched) and create count new sandboxes from that snapshot. Returns one result per requested fork, each carrying either the created sandbox or the error that prevented it from starting. A non-201 status means the request failed before any fork was attempted.
7902
+ * Poll a build using templateID and buildID from templates.create. waiting means source has not been submitted; building includes queued work; ready permits sandbox creation; error is terminal, with reason when available. logsOffset counts previously read log entries, starting at zero; add logEntries.length after each response. limit is 0–100, default 100. level selects one log level; offsets then count entries at that level. Drain logs until an empty page, including after a terminal status.
6643
7903
  */
6644
- export const postSandboxV1SandboxesBySandboxIdFork = (options) => (options.client ?? client).post({
7904
+ export const getTemplateBuildStatus = (options) => (options.client ?? client).get({
6645
7905
  security: [
6646
7906
  {
6647
7907
  key: 'sandbox-ApiKeyAuth',
@@ -6670,19 +7930,15 @@ export const postSandboxV1SandboxesBySandboxIdFork = (options) => (options.clien
6670
7930
  type: 'http'
6671
7931
  }
6672
7932
  ],
6673
- url: '/sandbox/v1/sandboxes/{sandboxID}/fork',
6674
- ...options,
6675
- headers: {
6676
- 'Content-Type': 'application/json',
6677
- ...options.headers
6678
- }
7933
+ url: '/sandbox/v1/templates/{templateID}/builds/{buildID}/status',
7934
+ ...options
6679
7935
  });
6680
7936
  /**
6681
- * Create snapshot
7937
+ * Delete template
6682
7938
  *
6683
- * Create a persistent snapshot from the sandbox's current state. Snapshots can be used to create new sandboxes and persist beyond the original sandbox's lifetime.
7939
+ * Permanently remove your template, its builds and tag assignments using templateID from templates.create. Active instances prevent deletion with 409; terminate them first. Unknown or other-organization IDs return 404. Snapshot IDs use snapshots.delete instead.
6684
7940
  */
6685
- export const postSandboxV1SandboxesBySandboxIdSnapshots = (options) => (options.client ?? client).post({
7941
+ export const deleteUserTemplate = (options) => (options.client ?? client).delete({
6686
7942
  security: [
6687
7943
  {
6688
7944
  key: 'sandbox-ApiKeyAuth',
@@ -6711,19 +7967,15 @@ export const postSandboxV1SandboxesBySandboxIdSnapshots = (options) => (options.
6711
7967
  type: 'http'
6712
7968
  }
6713
7969
  ],
6714
- url: '/sandbox/v1/sandboxes/{sandboxID}/snapshots',
6715
- ...options,
6716
- headers: {
6717
- 'Content-Type': 'application/json',
6718
- ...options.headers
6719
- }
7970
+ url: '/sandbox/v1/templates/{templateID}',
7971
+ ...options
6720
7972
  });
6721
7973
  /**
6722
- * List snapshots
7974
+ * List template builds
6723
7975
  *
6724
- * List the snapshots you created, one cursor page at a time. Use it to find a snapshot id before you create a sandbox from it or delete it. Filter by sandboxID (the source sandbox) or by name or snapshot id, optionally tag-qualified; limit is 1 to 100 (default 100). When more results exist send the cursor from the response back as nextToken.
7976
+ * Inspect your template and its newest builds using templateID from templates.create. Build states are waiting, building, ready or error. Use limit and the returned x-next-token header to page builds. Unknown or other-organization templates return 404.
6725
7977
  */
6726
- export const getSandboxV1Snapshots = (options) => (options?.client ?? client).get({
7978
+ export const getTemplateWithBuilds = (options) => (options.client ?? client).get({
6727
7979
  security: [
6728
7980
  {
6729
7981
  key: 'sandbox-ApiKeyAuth',
@@ -6752,15 +8004,15 @@ export const getSandboxV1Snapshots = (options) => (options?.client ?? client).ge
6752
8004
  type: 'http'
6753
8005
  }
6754
8006
  ],
6755
- url: '/sandbox/v1/snapshots',
8007
+ url: '/sandbox/v1/templates/{templateID}',
6756
8008
  ...options
6757
8009
  });
6758
8010
  /**
6759
- * Delete template
8011
+ * Delete template tags
6760
8012
  *
6761
- * Delete one of your snapshots. Sandboxes already created from it keep running; no new sandbox can be created from it afterwards. Success answers 204. A snapshot that does not exist or belongs to someone else answers 404.
8013
+ * Remove the specified tag labels from your template by name, for example {"name":"my-template","tags":["stable"]}. Builds remain available. Removing default means untagged sandbox creation no longer resolves this template. Unknown or other-organization names return 404. b<number> names are reserved read-only build aliases and cannot be assigned or deleted as tags.
6762
8014
  */
6763
- export const deleteSandboxV1SnapshotsBySnapshotId = (options) => (options.client ?? client).delete({
8015
+ export const deleteTemplateTags = (options) => (options.client ?? client).delete({
6764
8016
  security: [
6765
8017
  {
6766
8018
  key: 'sandbox-ApiKeyAuth',
@@ -6789,15 +8041,19 @@ export const deleteSandboxV1SnapshotsBySnapshotId = (options) => (options.client
6789
8041
  type: 'http'
6790
8042
  }
6791
8043
  ],
6792
- url: '/sandbox/v1/snapshots/{snapshotID}',
6793
- ...options
8044
+ url: '/sandbox/v1/templates/tags',
8045
+ ...options,
8046
+ headers: {
8047
+ 'Content-Type': 'application/json',
8048
+ ...options.headers
8049
+ }
6794
8050
  });
6795
8051
  /**
6796
- * Update sandbox network
8052
+ * Assign template tags
6797
8053
  *
6798
- * Update the network configuration for a running sandbox. Replaces the current egress rules with the provided configuration. Omitting field clears it.
8054
+ * Assign tags to the ready build selected by target in name:tag format, for example {"target":"my-template:default","tags":["stable"]}. Names belong to your organization. Tags move an existing label to this build without rebuilding. Obtain available names from templates.list and tags from templates.tags.list. b<number> names are reserved read-only build aliases and cannot be assigned or deleted as tags. target also accepts name:b<number> to select a ready build by number, for example my-template:b1.
6799
8055
  */
6800
- export const putSandboxV1SandboxesBySandboxIdNetwork = (options) => (options.client ?? client).put({
8056
+ export const assignTemplateTags = (options) => (options.client ?? client).post({
6801
8057
  security: [
6802
8058
  {
6803
8059
  key: 'sandbox-ApiKeyAuth',
@@ -6826,7 +8082,7 @@ export const putSandboxV1SandboxesBySandboxIdNetwork = (options) => (options.cli
6826
8082
  type: 'http'
6827
8083
  }
6828
8084
  ],
6829
- url: '/sandbox/v1/sandboxes/{sandboxID}/network',
8085
+ url: '/sandbox/v1/templates/tags',
6830
8086
  ...options,
6831
8087
  headers: {
6832
8088
  'Content-Type': 'application/json',
@@ -6834,11 +8090,11 @@ export const putSandboxV1SandboxesBySandboxIdNetwork = (options) => (options.cli
6834
8090
  }
6835
8091
  });
6836
8092
  /**
6837
- * Sandbox logs (v2)
8093
+ * List template tags
6838
8094
  *
6839
- * Read the log lines of a sandbox. Use it to debug what ran inside a sandbox. cursor is a start timestamp in milliseconds, direction chooses forward or backward from it, level sets the lowest level to return, search is a case-sensitive substring filter (at most 256 characters) and limit caps the count (at most 1000, default 1000). To continue, pass the timestamp of the last entry as the next cursor.
8095
+ * Read the tag-to-build assignments for your template using templateID from templates.create. Only ready builds acquire tags. Use a returned tag with the template name as name:tag when creating a sandbox or assigning additional tags. Foreign IDs return 404.
6840
8096
  */
6841
- export const getSandboxV1SandboxesBySandboxIdLogs = (options) => (options.client ?? client).get({
8097
+ export const listTemplateTags = (options) => (options.client ?? client).get({
6842
8098
  security: [
6843
8099
  {
6844
8100
  key: 'sandbox-ApiKeyAuth',
@@ -6867,7 +8123,44 @@ export const getSandboxV1SandboxesBySandboxIdLogs = (options) => (options.client
6867
8123
  type: 'http'
6868
8124
  }
6869
8125
  ],
6870
- url: '/sandbox/v1/sandboxes/{sandboxID}/logs',
8126
+ url: '/sandbox/v1/templates/{templateID}/tags',
8127
+ ...options
8128
+ });
8129
+ /**
8130
+ * Check template alias
8131
+ *
8132
+ * Resolve a name within your organization to its templateID before reading or managing builds. Use the bare template name, without a :tag suffix. Unknown and other-organization names return 404. The response public field is false for your private templates.
8133
+ */
8134
+ export const resolveTemplateAlias = (options) => (options.client ?? client).get({
8135
+ security: [
8136
+ {
8137
+ key: 'sandbox-ApiKeyAuth',
8138
+ name: 'X-API-Key',
8139
+ type: 'apiKey'
8140
+ },
8141
+ {
8142
+ key: 'sandbox-AuthProviderBearerAuth',
8143
+ scheme: 'bearer',
8144
+ type: 'http'
8145
+ },
8146
+ {
8147
+ key: 'sandbox-AuthProviderTeamAuth',
8148
+ name: 'X-Team-ID',
8149
+ type: 'apiKey'
8150
+ },
8151
+ { name: 'X-Admin-Token', type: 'apiKey' },
8152
+ {
8153
+ key: 'sandbox-AdminTeamAuth',
8154
+ name: 'X-Team-ID',
8155
+ type: 'apiKey'
8156
+ },
8157
+ {
8158
+ key: 'sandbox-AdminJWTAuth',
8159
+ scheme: 'bearer',
8160
+ type: 'http'
8161
+ }
8162
+ ],
8163
+ url: '/sandbox/v1/templates/aliases/{alias}',
6871
8164
  ...options
6872
8165
  });
6873
8166
  /**
@@ -7083,7 +8376,7 @@ export const vaultListSecrets = (options) => (options.client ?? client).get({
7083
8376
  /**
7084
8377
  * Create secret
7085
8378
  *
7086
- * Store a manually supplied token in an active vault for use on requests to its allowed_hosts. Unlike Anthropic credentials, this native operation takes name, value and allowed_hosts directly and creates only static secrets; use praxis.vault.authorizations.create for OAuth. Its name must be unused by any non-archived secret in that vault; the response contains metadata but never the supplied value. Application praxis_vault_ref bindings declare vault_id and secret (the secret name), but currently return 501; do not copy the value into a plain-text binding or metadata as a substitute.
8379
+ * Store a manually supplied token in an active vault. Omit allowed_hosts for name-based resolution only; host-based redemption never matches an empty host list. Unlike Anthropic credentials, this native operation takes name and value directly, with optional allowed_hosts and creates only static secrets; use praxis.vault.authorizations.create for OAuth. Its name must be unused by any non-archived secret in that vault; the response contains metadata but never the supplied value. Application praxis_vault_ref bindings declare vault_id and secret (the secret name), but currently return 501; do not copy the value into a plain-text binding or metadata as a substitute.
7087
8380
  */
7088
8381
  export const vaultCreateSecret = (options) => (options.client ?? client).post({
7089
8382
  security: [{
@@ -7101,7 +8394,7 @@ export const vaultCreateSecret = (options) => (options.client ?? client).post({
7101
8394
  /**
7102
8395
  * Import secrets
7103
8396
  *
7104
- * Import lines or dotenv text into an active vault, reporting success or failure for each entry. Existing names have their values replaced; their hosts change only when that line supplies allowed_hosts. Shared hosts apply only to newly created secrets.
8397
+ * Import lines or dotenv text into an active vault, reporting success or failure for each entry. Existing names have their values replaced; their hosts change only when that line supplies allowed_hosts. Shared hosts apply only to newly created secrets; if neither shared nor per-line hosts are supplied, new secrets use an empty host list for name-based resolution only.
7105
8398
  */
7106
8399
  export const vaultImportSecrets = (options) => (options.client ?? client).post({
7107
8400
  security: [{
@@ -7653,7 +8946,7 @@ export const ticketGetMilestones = (options) => (options?.client ?? client).get(
7653
8946
  /**
7654
8947
  * Create or add milestones
7655
8948
  *
7656
- * Create or add milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.
8949
+ * Create or add milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.
7657
8950
  */
7658
8951
  export const ticketPostMilestones = (options) => (options.client ?? client).post({
7659
8952
  security: [{
@@ -7675,7 +8968,7 @@ export const ticketPostMilestones = (options) => (options.client ?? client).post
7675
8968
  /**
7676
8969
  * Remove milestones
7677
8970
  *
7678
- * Remove milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.
8971
+ * Remove milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.
7679
8972
  */
7680
8973
  export const ticketDeleteMilestonesNumber = (options) => (options.client ?? client).delete({
7681
8974
  security: [{
@@ -7711,7 +9004,7 @@ export const ticketGetMilestonesNumber = (options) => (options.client ?? client)
7711
9004
  /**
7712
9005
  * Update milestones
7713
9006
  *
7714
- * Update milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.
9007
+ * Update milestones within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.
7715
9008
  */
7716
9009
  export const ticketPatchMilestonesNumber = (options) => (options.client ?? client).patch({
7717
9010
  security: [{