@deepraxis/cli 0.2.1-dev.2ce6637 → 0.2.1-dev.de0a917

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.
Files changed (3) hide show
  1. package/COMMANDS.md +16 -4
  2. package/dist/praxis.js +980 -64
  3. package/package.json +1 -1
package/dist/praxis.js CHANGED
@@ -193,7 +193,7 @@ across all toolsets allowed.`
193
193
  name: "settings",
194
194
  type: "object",
195
195
  required: false,
196
- description: "Praxis extension: managed settings saved with the configuration revision. Omit to preserve; null clears. Configuration storage only; these switches and hooks are not applied to runtime yet. /agent/v1 only."
196
+ description: "Agent runtime settings follow Claude Code managed settings. Praxis freezes output-style selection for each new session; inline output_styles extend file-based styles. Omit settings to keep saved settings; null clears them."
197
197
  },
198
198
  {
199
199
  name: "models",
@@ -230,6 +230,13 @@ across all toolsets allowed.`
230
230
  ],
231
231
  required: false,
232
232
  description: "Optional tool preset. minimal enables read, glob, grep and ask_user_question; data-editor also enables write and edit; full uses the default toolset with always_allow. Explicit tools override matching preset entries. codemode requires bash and is absent from data-editor."
233
+ },
234
+ {
235
+ name: "output_styles",
236
+ type: "array",
237
+ itemType: "object",
238
+ required: false,
239
+ description: "Inline custom output styles, including for agents without a computer. Omit to keep the saved list; null or [] clears it. Same-name precedence is inline, project files, personal files, then plugins. Selection is settings.outputStyle; styles apply to main conversations and are frozen per session."
233
240
  }
234
241
  ]
235
242
  }
@@ -413,7 +420,7 @@ toolsets allowed.`
413
420
  name: "settings",
414
421
  type: "object",
415
422
  required: false,
416
- description: "Praxis extension: managed settings saved with the configuration revision. Omit to preserve; null clears. Configuration storage only; these switches and hooks are not applied to runtime yet. /agent/v1 only."
423
+ description: "Agent runtime settings follow Claude Code managed settings. Praxis freezes output-style selection for each new session; inline output_styles extend file-based styles. Omit settings to keep saved settings; null clears them."
417
424
  },
418
425
  {
419
426
  name: "models",
@@ -450,6 +457,13 @@ toolsets allowed.`
450
457
  ],
451
458
  required: false,
452
459
  description: "Optional tool preset. minimal enables read, glob, grep and ask_user_question; data-editor also enables write and edit; full uses the default toolset with always_allow. Explicit tools override matching preset entries. codemode requires bash and is absent from data-editor."
460
+ },
461
+ {
462
+ name: "output_styles",
463
+ type: "array",
464
+ itemType: "object",
465
+ required: false,
466
+ description: "Inline custom output styles, including for agents without a computer. Omit to keep the saved list; null or [] clears it. Same-name precedence is inline, project files, personal files, then plugins. Selection is settings.outputStyle; styles apply to main conversations and are frozen per session."
453
467
  }
454
468
  ]
455
469
  }
@@ -4080,7 +4094,7 @@ file at the root of that directory.`
4080
4094
  name: "timeout_ms",
4081
4095
  type: "number",
4082
4096
  required: false,
4083
- description: "Positive integer milliseconds; code defaults to and is capped at 30,000. container/shell are not yet available."
4097
+ description: "Positive integer milliseconds; code defaults to and is capped at 300,000. container/shell are not yet available."
4084
4098
  },
4085
4099
  {
4086
4100
  name: "implementation",
@@ -4130,7 +4144,7 @@ file at the root of that directory.`
4130
4144
  resource: "automation.actions",
4131
4145
  method: "update",
4132
4146
  summary: "Update an action",
4133
- description: "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.",
4147
+ description: "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.",
4134
4148
  http: "PUT",
4135
4149
  path: "/automation/v1/actions/{ns}/{name}",
4136
4150
  streaming: "no",
@@ -4199,7 +4213,7 @@ file at the root of that directory.`
4199
4213
  name: "timeout_ms",
4200
4214
  type: "number",
4201
4215
  required: false,
4202
- description: "Positive integer milliseconds; code defaults to and is capped at 30,000. container/shell are not yet available."
4216
+ description: "Positive integer milliseconds; code defaults to and is capped at 300,000. container/shell are not yet available."
4203
4217
  },
4204
4218
  {
4205
4219
  name: "implementation",
@@ -4874,7 +4888,7 @@ file at the root of that directory.`
4874
4888
  resource: "automation.runs",
4875
4889
  method: "create",
4876
4890
  summary: "Run a published target or execute draft source",
4877
- description: '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.',
4891
+ description: '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.',
4878
4892
  http: "POST",
4879
4893
  path: "/automation/v1/runs",
4880
4894
  streaming: "no",
@@ -6512,7 +6526,7 @@ file at the root of that directory.`
6512
6526
  resource: "automation.workflows",
6513
6527
  method: "create",
6514
6528
  summary: "Create a workflow",
6515
- description: '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. 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.',
6529
+ description: '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.',
6516
6530
  http: "POST",
6517
6531
  path: "/automation/v1/workflows",
6518
6532
  streaming: "no",
@@ -7727,6 +7741,12 @@ file at the root of that directory.`
7727
7741
  }
7728
7742
  ],
7729
7743
  query: [
7744
+ {
7745
+ name: "version",
7746
+ type: "string",
7747
+ required: false,
7748
+ description: "Decimal version from versions.list, or its earliest_restorable_version, for a read-only historical snapshot; omit to read current state. Unavailable versions return VERSION_NOT_FOUND."
7749
+ },
7730
7750
  {
7731
7751
  name: "ids",
7732
7752
  type: "string",
@@ -7767,6 +7787,12 @@ file at the root of that directory.`
7767
7787
  }
7768
7788
  ],
7769
7789
  query: [
7790
+ {
7791
+ name: "version",
7792
+ type: "string",
7793
+ required: false,
7794
+ description: "Decimal version from versions.list, or its earliest_restorable_version, for a read-only historical snapshot; omit to read current state. Unavailable versions return VERSION_NOT_FOUND."
7795
+ },
7770
7796
  {
7771
7797
  name: "ids",
7772
7798
  type: "string",
@@ -7781,6 +7807,37 @@ file at the root of that directory.`
7781
7807
  }
7782
7808
  ]
7783
7809
  },
7810
+ {
7811
+ resource: "canvas.canvases.versions",
7812
+ method: "list",
7813
+ summary: "List canvas versions",
7814
+ description: "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.",
7815
+ http: "GET",
7816
+ path: "/canvas/v1/canvases/{canvas_id}/versions",
7817
+ streaming: "no",
7818
+ pagination: false,
7819
+ pathParams: [
7820
+ {
7821
+ name: "canvas_id",
7822
+ sdkName: "canvas_id",
7823
+ description: "Canvas id returned by create or list, in the form cvs_ followed by 16 lowercase letters or digits; a display name is not accepted."
7824
+ }
7825
+ ],
7826
+ query: [
7827
+ {
7828
+ name: "limit",
7829
+ type: "integer",
7830
+ required: false,
7831
+ description: "Maximum commits to return, from 1 to 100 inclusive; omission uses 30."
7832
+ },
7833
+ {
7834
+ name: "cursor",
7835
+ type: "string",
7836
+ required: false,
7837
+ description: "Copy next_cursor from the preceding page to continue toward older commits; omit for the first page."
7838
+ }
7839
+ ]
7840
+ },
7784
7841
  {
7785
7842
  resource: "canvas.canvases",
7786
7843
  method: "execute",
@@ -7793,9 +7850,20 @@ The root variable is document. Synchronous functions are Insert / Copy / Update
7793
7850
  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)
7794
7851
  \`\`\`
7795
7852
 
7853
+ 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:
7854
+
7855
+ \`\`\`js canvas-example="copy-page"
7856
+ const page = Insert(document, {type:"frame",name:"Original",width:320,height:160,layout:"vertical",padding:16});
7857
+ const title = Insert(page, {type:"text",name:"Title",content:"Original",fontSize:24});
7858
+ const copy = Copy(page, document, {name:"Copy",x:360,descendants:{[title]:{content:"Updated"}}});
7859
+ Print(copy); Print(Get(copy).children[0].content);
7860
+ \`\`\`
7861
+
7796
7862
  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.
7797
7863
 
7798
7864
  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.
7865
+
7866
+ 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.
7799
7867
  `,
7800
7868
  http: "POST",
7801
7869
  path: "/canvas/v1/canvases/{canvas_id}:execute",
@@ -7840,6 +7908,41 @@ A successful write increments version by one. Optionally set expected_version to
7840
7908
  ]
7841
7909
  }
7842
7910
  },
7911
+ {
7912
+ resource: "canvas.canvases",
7913
+ method: "restore",
7914
+ summary: "Restore canvas version",
7915
+ description: "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.",
7916
+ http: "POST",
7917
+ path: "/canvas/v1/canvases/{canvas_id}:restore",
7918
+ streaming: "no",
7919
+ pagination: false,
7920
+ pathParams: [
7921
+ {
7922
+ name: "canvas_id",
7923
+ sdkName: "canvas_id",
7924
+ description: "Canvas id returned by create or list, in the form cvs_ followed by 16 lowercase letters or digits; a display name is not accepted."
7925
+ }
7926
+ ],
7927
+ query: [],
7928
+ body: {
7929
+ required: true,
7930
+ fields: [
7931
+ {
7932
+ name: "version",
7933
+ type: "string",
7934
+ required: true,
7935
+ description: "Historical target from versions.list or earliest_restorable_version; restoring the current version creates no new commit."
7936
+ },
7937
+ {
7938
+ name: "expected_version",
7939
+ type: "string",
7940
+ required: false,
7941
+ description: "Current version from retrieve or nodes.list to guard against concurrent edits; omission applies the restore to whichever version is current."
7942
+ }
7943
+ ]
7944
+ }
7945
+ },
7843
7946
  {
7844
7947
  resource: "canvas.collections",
7845
7948
  method: "list",
@@ -9745,7 +9848,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
9745
9848
  resource: "file.files.contentLinks",
9746
9849
  method: "revoke",
9747
9850
  summary: "Revoke a file content link",
9748
- description: 'Stop a previously issued content link from reading a file. 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/>"}.',
9851
+ description: '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/>"}.',
9749
9852
  http: "POST",
9750
9853
  path: "/file/v1/files/{file_id}/content_links:revoke",
9751
9854
  streaming: "no",
@@ -9770,6 +9873,35 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
9770
9873
  ]
9771
9874
  }
9772
9875
  },
9876
+ {
9877
+ resource: "file.files.contentUrl",
9878
+ method: "create",
9879
+ summary: "Create a download URL",
9880
+ description: `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}.`,
9881
+ http: "POST",
9882
+ path: "/file/v1/files/{file_id}/content_url",
9883
+ streaming: "no",
9884
+ pagination: false,
9885
+ pathParams: [
9886
+ {
9887
+ name: "file_id",
9888
+ sdkName: "file_id",
9889
+ description: "Tenant-owned live file identifier from file creation or listing; the file must be active to issue a download URL."
9890
+ }
9891
+ ],
9892
+ query: [],
9893
+ body: {
9894
+ required: false,
9895
+ fields: [
9896
+ {
9897
+ name: "ttl_seconds",
9898
+ type: "integer",
9899
+ required: false,
9900
+ description: "Download link lifetime in seconds, from 1 through 604800; omitted means 3600. This does not change the file's own expiry."
9901
+ }
9902
+ ]
9903
+ }
9904
+ },
9773
9905
  {
9774
9906
  resource: "file.uploads",
9775
9907
  method: "create",
@@ -10030,7 +10162,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
10030
10162
  resource: "knowledge.vectorStores",
10031
10163
  method: "create",
10032
10164
  summary: "Create knowledge base",
10033
- description: '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"}.',
10165
+ description: '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. Each file accepts up to 52428800 bytes and 5000000 estimated tokens; each account holds up to 100 active/nondeleted stores. Minimal body: {"name":"Refund policies"}.',
10034
10166
  http: "POST",
10035
10167
  path: "/knowledge/v1/vector_stores",
10036
10168
  streaming: "no",
@@ -10081,7 +10213,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
10081
10213
  name: "models",
10082
10214
  type: "object",
10083
10215
  required: false,
10084
- description: "Model roles to set. The model must exist in the model catalog and serve the role (embedding → openai.embeddings, rerank → cohere.rerank, query_rewrite → openai.chat.completions). The embedding model must output 1024-dimension vectors. Omitted roles stay unchanged; null restores all defaults. Unknown roles or empty IDs return 400 INVALID_PARAMS. The OpenAI-compatible API rejects this field with 400."
10216
+ description: "Model roles to set. The model must exist in the model catalog and serve the role (embedding → openai.embeddings, rerank → cohere.rerank, query_rewrite → openai.chat.completions, ocr → mistral.ocr or pdf_input capability, vision → vision capability). The embedding model must output 1024-dimension vectors. Omitted roles stay unchanged; null restores all defaults. Unknown roles or empty IDs return 400 INVALID_PARAMS. The OpenAI-compatible API rejects this field with 400."
10085
10217
  }
10086
10218
  ]
10087
10219
  }
@@ -10185,7 +10317,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
10185
10317
  name: "models",
10186
10318
  type: "object",
10187
10319
  required: false,
10188
- description: "Model roles to set. The model must exist in the model catalog and serve the role (embedding → openai.embeddings, rerank → cohere.rerank, query_rewrite → openai.chat.completions). The embedding model must output 1024-dimension vectors. Omitted roles stay unchanged; null restores all defaults. Unknown roles or empty IDs return 400 INVALID_PARAMS. The OpenAI-compatible API rejects this field with 400."
10320
+ description: "Model roles to set. The model must exist in the model catalog and serve the role (embedding → openai.embeddings, rerank → cohere.rerank, query_rewrite → openai.chat.completions, ocr → mistral.ocr or pdf_input capability, vision → vision capability). The embedding model must output 1024-dimension vectors. Omitted roles stay unchanged; null restores all defaults. Unknown roles or empty IDs return 400 INVALID_PARAMS. The OpenAI-compatible API rejects this field with 400."
10189
10321
  }
10190
10322
  ]
10191
10323
  }
@@ -10416,7 +10548,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
10416
10548
  resource: "knowledge.vectorStores.files",
10417
10549
  method: "create",
10418
10550
  summary: "Add file",
10419
- description: "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.",
10551
+ description: "Attach an uploaded File for asynchronous ingestion, then poll this attachment until status is completed, failed or cancelled before searching. Each file accepts up to 52428800 bytes and 5000000 estimated tokens; 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.",
10420
10552
  http: "POST",
10421
10553
  path: "/knowledge/v1/vector_stores/{vector_store_id}/files",
10422
10554
  streaming: "no",
@@ -15459,6 +15591,12 @@ for more details.`
15459
15591
  required: true,
15460
15592
  description: "Shell command to execute, for example echo hi."
15461
15593
  },
15594
+ {
15595
+ name: "background",
15596
+ type: "boolean",
15597
+ required: false,
15598
+ description: "When true, return 202 with the pid as soon as the process starts; it keeps running after the request ends. Read its status and output with GET /sandbox/v1/sandboxes/{sandbox_id}/commands/{pid}, stop it with DELETE. Same idea as E2B background commands."
15599
+ },
15462
15600
  {
15463
15601
  name: "cwd",
15464
15602
  type: "string",
@@ -15475,7 +15613,7 @@ for more details.`
15475
15613
  name: "timeoutMs",
15476
15614
  type: "integer",
15477
15615
  required: false,
15478
- description: "Execution timeout in milliseconds, from 1 to 3600000 (1 hour); defaults to 600000 (10 minutes)."
15616
+ description: "Execution timeout in milliseconds, from 1 to 3600000 (1 hour); defaults to 600000 (10 minutes). In background mode this limits process runtime; expiry records exit code 124."
15479
15617
  }
15480
15618
  ]
15481
15619
  }
@@ -15674,7 +15812,7 @@ for more details.`
15674
15812
  resource: "sandbox.templates",
15675
15813
  method: "list",
15676
15814
  summary: "List templates (v2)",
15677
- description: "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.",
15815
+ description: "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.",
15678
15816
  http: "GET",
15679
15817
  path: "/sandbox/v1/templates",
15680
15818
  streaming: "no",
@@ -15685,7 +15823,7 @@ for more details.`
15685
15823
  name: "teamID",
15686
15824
  type: "string",
15687
15825
  required: false,
15688
- description: "Id of the team whose templates to list. Omit it to list the templates of your own team; a team you do not belong to answers 403."
15826
+ description: "Upstream team selector; Praxis always lists the authenticated organization's templates."
15689
15827
  },
15690
15828
  {
15691
15829
  name: "nextToken",
@@ -15702,24 +15840,126 @@ for more details.`
15702
15840
  ]
15703
15841
  },
15704
15842
  {
15705
- resource: "sandbox.volumes",
15706
- method: "list",
15707
- summary: "List team volumes",
15708
- description: "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.",
15709
- http: "GET",
15710
- path: "/sandbox/v1/volumes",
15843
+ resource: "sandbox.templates",
15844
+ method: "create",
15845
+ summary: "Create template (v3)",
15846
+ description: '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.',
15847
+ http: "POST",
15848
+ path: "/sandbox/v1/templates",
15711
15849
  streaming: "no",
15712
15850
  pagination: false,
15713
15851
  pathParams: [],
15852
+ query: [],
15853
+ body: {
15854
+ required: true,
15855
+ fields: [
15856
+ {
15857
+ name: "name",
15858
+ type: "string",
15859
+ required: false,
15860
+ description: 'Name of the template. Can include a tag with colon separator (e.g. "my-template" or "my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array.'
15861
+ },
15862
+ {
15863
+ name: "tags",
15864
+ type: "array",
15865
+ itemType: "string",
15866
+ required: false,
15867
+ description: "Tags to assign to the template build"
15868
+ },
15869
+ {
15870
+ name: "alias",
15871
+ type: "string",
15872
+ required: false,
15873
+ description: "Alias of the template. Deprecated, use name instead."
15874
+ },
15875
+ {
15876
+ name: "teamID",
15877
+ type: "string",
15878
+ required: false,
15879
+ description: "Identifier of the team"
15880
+ },
15881
+ {
15882
+ name: "cpuCount",
15883
+ type: "integer",
15884
+ required: false,
15885
+ description: "Requested virtual CPU count; a positive integer, default 2 for template builds."
15886
+ },
15887
+ {
15888
+ name: "memoryMB",
15889
+ type: "integer",
15890
+ required: false,
15891
+ description: "Requested build memory in MiB; a positive integer, default 1024."
15892
+ },
15893
+ {
15894
+ name: "minFreeDiskMb",
15895
+ type: "integer",
15896
+ required: false,
15897
+ description: "Upstream minimum free disk request in MiB; use the native diskGb field to set the build disk size."
15898
+ },
15899
+ {
15900
+ name: "diskGb",
15901
+ type: "integer",
15902
+ required: false,
15903
+ description: "Build disk size in GiB, a positive safe integer. Defaults to 10; available only on the own face."
15904
+ }
15905
+ ]
15906
+ }
15907
+ },
15908
+ {
15909
+ resource: "sandbox.templates.aliases",
15910
+ method: "retrieve",
15911
+ summary: "Check template alias",
15912
+ description: "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.",
15913
+ http: "GET",
15914
+ path: "/sandbox/v1/templates/aliases/{alias}",
15915
+ streaming: "no",
15916
+ pagination: false,
15917
+ pathParams: [
15918
+ {
15919
+ name: "alias",
15920
+ sdkName: "alias",
15921
+ description: "Bare template name belonging to your organization, without a tag or provider namespace."
15922
+ }
15923
+ ],
15714
15924
  query: []
15715
15925
  },
15716
15926
  {
15717
- resource: "sandbox.volumes",
15927
+ resource: "sandbox.templates.tags",
15928
+ method: "delete",
15929
+ summary: "Delete template tags",
15930
+ description: '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.',
15931
+ http: "DELETE",
15932
+ path: "/sandbox/v1/templates/tags",
15933
+ streaming: "no",
15934
+ pagination: false,
15935
+ pathParams: [],
15936
+ query: [],
15937
+ body: {
15938
+ required: true,
15939
+ fields: [
15940
+ {
15941
+ name: "name",
15942
+ type: "string",
15943
+ required: true,
15944
+ description: "Name of the template"
15945
+ },
15946
+ {
15947
+ name: "tags",
15948
+ type: "array",
15949
+ itemType: "string",
15950
+ required: true,
15951
+ description: "Tags to delete"
15952
+ }
15953
+ ]
15954
+ }
15955
+ },
15956
+ {
15957
+ resource: "sandbox.templates.tags",
15718
15958
  method: "create",
15719
- summary: "Create team volume",
15720
- description: "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.",
15959
+ summary: "Assign template tags",
15960
+ description: '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.',
15721
15961
  http: "POST",
15722
- path: "/sandbox/v1/volumes",
15962
+ path: "/sandbox/v1/templates/tags",
15723
15963
  streaming: "no",
15724
15964
  pagination: false,
15725
15965
  pathParams: [],
@@ -15728,69 +15968,303 @@ for more details.`
15728
15968
  required: true,
15729
15969
  fields: [
15730
15970
  {
15731
- name: "name",
15971
+ name: "target",
15732
15972
  type: "string",
15733
15973
  required: true,
15734
- description: "Volume name, unique within your team. Use one or more ASCII letters, digits, underscores or hyphens."
15974
+ description: 'Target template in "name:tag" format'
15975
+ },
15976
+ {
15977
+ name: "tags",
15978
+ type: "array",
15979
+ itemType: "string",
15980
+ required: true,
15981
+ description: "Tags to assign to the template"
15735
15982
  }
15736
15983
  ]
15737
15984
  }
15738
15985
  },
15739
15986
  {
15740
- resource: "sandbox.volumes",
15987
+ resource: "sandbox.templates",
15741
15988
  method: "delete",
15742
- summary: "Delete team volume",
15743
- description: "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.",
15989
+ summary: "Delete template",
15990
+ description: "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.",
15744
15991
  http: "DELETE",
15745
- path: "/sandbox/v1/volumes/{volumeID}",
15992
+ path: "/sandbox/v1/templates/{templateID}",
15746
15993
  streaming: "no",
15747
15994
  pagination: false,
15748
15995
  pathParams: [
15749
15996
  {
15750
- name: "volumeID",
15751
- sdkName: "volumeID",
15752
- description: "Id of the team volume, the `volumeID` returned by createVolume or listVolumes."
15997
+ name: "templateID",
15998
+ sdkName: "templateID",
15999
+ description: "Template identifier from templates.create or templates.list. Use your organization's templateID, not a provider handle."
15753
16000
  }
15754
16001
  ],
15755
16002
  query: []
15756
16003
  },
15757
16004
  {
15758
- resource: "sandbox.volumes",
16005
+ resource: "sandbox.templates",
15759
16006
  method: "retrieve",
15760
- summary: "Team volume",
15761
- description: "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.",
16007
+ summary: "List template builds",
16008
+ description: "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.",
15762
16009
  http: "GET",
15763
- path: "/sandbox/v1/volumes/{volumeID}",
16010
+ path: "/sandbox/v1/templates/{templateID}",
15764
16011
  streaming: "no",
15765
16012
  pagination: false,
15766
16013
  pathParams: [
15767
16014
  {
15768
- name: "volumeID",
15769
- sdkName: "volumeID",
15770
- description: "Id of the team volume, the `volumeID` returned by createVolume or listVolumes."
16015
+ name: "templateID",
16016
+ sdkName: "templateID",
16017
+ description: "Template identifier from templates.create or templates.list. Use your organization's templateID, not a provider handle."
15771
16018
  }
15772
16019
  ],
15773
- query: []
16020
+ query: [
16021
+ {
16022
+ name: "nextToken",
16023
+ type: "string",
16024
+ required: false,
16025
+ description: "Cursor to start the list from"
16026
+ },
16027
+ {
16028
+ name: "limit",
16029
+ type: "integer",
16030
+ required: false,
16031
+ description: "Maximum number of items to return per page"
16032
+ }
16033
+ ]
15774
16034
  },
15775
16035
  {
15776
- resource: "search.crawl",
15777
- method: "create",
15778
- summary: "Initiate a web crawl from a base URL",
15779
- description: "Tavily Crawl is a graph-based website traversal tool that can explore hundreds of paths in parallel with built-in extraction and intelligent discovery.",
16036
+ resource: "sandbox.templates.builds",
16037
+ method: "update",
16038
+ summary: "Start template build (v2)",
16039
+ description: '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"]}]}.',
15780
16040
  http: "POST",
15781
- path: "/search/v1/crawl",
16041
+ path: "/sandbox/v1/templates/{templateID}/builds/{buildID}",
15782
16042
  streaming: "no",
15783
16043
  pagination: false,
15784
- pathParams: [],
16044
+ pathParams: [
16045
+ {
16046
+ name: "templateID",
16047
+ sdkName: "templateID",
16048
+ description: "Template identifier from templates.create or templates.list. Use your organization's templateID, not a provider handle."
16049
+ },
16050
+ {
16051
+ name: "buildID",
16052
+ sdkName: "buildID",
16053
+ description: "Build identifier returned by templates.create. It must belong to the selected template in your organization."
16054
+ }
16055
+ ],
15785
16056
  query: [],
15786
16057
  body: {
15787
16058
  required: true,
15788
16059
  fields: [
15789
16060
  {
15790
- name: "url",
16061
+ name: "fromImage",
15791
16062
  type: "string",
15792
- required: true,
15793
- description: "The root URL to begin the crawl."
16063
+ required: false,
16064
+ description: "Image to use as a base for the template build"
16065
+ },
16066
+ {
16067
+ name: "fromTemplate",
16068
+ type: "string",
16069
+ required: false,
16070
+ description: "Template to use as a base for the template build"
16071
+ },
16072
+ {
16073
+ name: "fromImageRegistry",
16074
+ type: "object",
16075
+ required: false,
16076
+ description: "Registry authentication. Unlike E2B, only the vault reference variant is accepted; plaintext aws, gcp and registry variants return 400. Cannot be used with official templates."
16077
+ },
16078
+ {
16079
+ name: "force",
16080
+ type: "boolean",
16081
+ required: false,
16082
+ description: "Whether the whole build should be forced to run regardless of the cache"
16083
+ },
16084
+ {
16085
+ name: "steps",
16086
+ type: "array",
16087
+ itemType: "object",
16088
+ required: false,
16089
+ description: "List of steps to execute in the template build"
16090
+ },
16091
+ {
16092
+ name: "startCmd",
16093
+ type: "string",
16094
+ required: false,
16095
+ description: "Start command to execute in the template after the build"
16096
+ },
16097
+ {
16098
+ name: "readyCmd",
16099
+ type: "string",
16100
+ required: false,
16101
+ description: "Ready check command to execute in the template after the build"
16102
+ },
16103
+ {
16104
+ name: "dockerfile",
16105
+ type: "string",
16106
+ required: false,
16107
+ description: "Dockerfile text, at most 64 KiB UTF-8. Mutually exclusive with fromImage, fromTemplate and steps. COPY/ADD are rejected; fetch remote content using RUN. Registry credentials require a nonofficial image in the first FROM."
16108
+ }
16109
+ ]
16110
+ }
16111
+ },
16112
+ {
16113
+ resource: "sandbox.templates.builds.status",
16114
+ method: "list",
16115
+ summary: "Template build status",
16116
+ description: "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.",
16117
+ http: "GET",
16118
+ path: "/sandbox/v1/templates/{templateID}/builds/{buildID}/status",
16119
+ streaming: "no",
16120
+ pagination: false,
16121
+ pathParams: [
16122
+ {
16123
+ name: "templateID",
16124
+ sdkName: "templateID",
16125
+ description: "Template identifier from templates.create or templates.list. Use your organization's templateID, not a provider handle."
16126
+ },
16127
+ {
16128
+ name: "buildID",
16129
+ sdkName: "buildID",
16130
+ description: "Build identifier returned by templates.create. It must belong to the selected template in your organization."
16131
+ }
16132
+ ],
16133
+ query: [
16134
+ {
16135
+ name: "logsOffset",
16136
+ type: "integer",
16137
+ required: false,
16138
+ description: "Index of the starting build log that should be returned with the template"
16139
+ },
16140
+ {
16141
+ name: "limit",
16142
+ type: "integer",
16143
+ required: false,
16144
+ description: "Maximum number of logs that should be returned"
16145
+ },
16146
+ {
16147
+ name: "level",
16148
+ type: "string",
16149
+ enum: [
16150
+ "debug",
16151
+ "info",
16152
+ "warn",
16153
+ "error"
16154
+ ],
16155
+ required: false,
16156
+ description: "Select one exact log severity: debug for diagnostics, info for progress, warn for warnings, error for failures. Offsets count matching entries."
16157
+ }
16158
+ ]
16159
+ },
16160
+ {
16161
+ resource: "sandbox.templates.tags",
16162
+ method: "list",
16163
+ summary: "List template tags",
16164
+ description: "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.",
16165
+ http: "GET",
16166
+ path: "/sandbox/v1/templates/{templateID}/tags",
16167
+ streaming: "no",
16168
+ pagination: false,
16169
+ pathParams: [
16170
+ {
16171
+ name: "templateID",
16172
+ sdkName: "templateID",
16173
+ description: "Template identifier from templates.create or templates.list. Use your organization's templateID, not a provider handle."
16174
+ }
16175
+ ],
16176
+ query: []
16177
+ },
16178
+ {
16179
+ resource: "sandbox.volumes",
16180
+ method: "list",
16181
+ summary: "List team volumes",
16182
+ description: "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.",
16183
+ http: "GET",
16184
+ path: "/sandbox/v1/volumes",
16185
+ streaming: "no",
16186
+ pagination: false,
16187
+ pathParams: [],
16188
+ query: []
16189
+ },
16190
+ {
16191
+ resource: "sandbox.volumes",
16192
+ method: "create",
16193
+ summary: "Create team volume",
16194
+ description: "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.",
16195
+ http: "POST",
16196
+ path: "/sandbox/v1/volumes",
16197
+ streaming: "no",
16198
+ pagination: false,
16199
+ pathParams: [],
16200
+ query: [],
16201
+ body: {
16202
+ required: true,
16203
+ fields: [
16204
+ {
16205
+ name: "name",
16206
+ type: "string",
16207
+ required: true,
16208
+ description: "Volume name, unique within your team. Use one or more ASCII letters, digits, underscores or hyphens."
16209
+ }
16210
+ ]
16211
+ }
16212
+ },
16213
+ {
16214
+ resource: "sandbox.volumes",
16215
+ method: "delete",
16216
+ summary: "Delete team volume",
16217
+ description: "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.",
16218
+ http: "DELETE",
16219
+ path: "/sandbox/v1/volumes/{volumeID}",
16220
+ streaming: "no",
16221
+ pagination: false,
16222
+ pathParams: [
16223
+ {
16224
+ name: "volumeID",
16225
+ sdkName: "volumeID",
16226
+ description: "Id of the team volume, the `volumeID` returned by createVolume or listVolumes."
16227
+ }
16228
+ ],
16229
+ query: []
16230
+ },
16231
+ {
16232
+ resource: "sandbox.volumes",
16233
+ method: "retrieve",
16234
+ summary: "Team volume",
16235
+ description: "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.",
16236
+ http: "GET",
16237
+ path: "/sandbox/v1/volumes/{volumeID}",
16238
+ streaming: "no",
16239
+ pagination: false,
16240
+ pathParams: [
16241
+ {
16242
+ name: "volumeID",
16243
+ sdkName: "volumeID",
16244
+ description: "Id of the team volume, the `volumeID` returned by createVolume or listVolumes."
16245
+ }
16246
+ ],
16247
+ query: []
16248
+ },
16249
+ {
16250
+ resource: "search.crawl",
16251
+ method: "create",
16252
+ summary: "Initiate a web crawl from a base URL",
16253
+ description: "Tavily Crawl is a graph-based website traversal tool that can explore hundreds of paths in parallel with built-in extraction and intelligent discovery.",
16254
+ http: "POST",
16255
+ path: "/search/v1/crawl",
16256
+ streaming: "no",
16257
+ pagination: false,
16258
+ pathParams: [],
16259
+ query: [],
16260
+ body: {
16261
+ required: true,
16262
+ fields: [
16263
+ {
16264
+ name: "url",
16265
+ type: "string",
16266
+ required: true,
16267
+ description: "The root URL to begin the crawl."
15794
16268
  },
15795
16269
  {
15796
16270
  name: "instructions",
@@ -18823,6 +19297,65 @@ async function fetchWithRetry(request, fetcher, options) {
18823
19297
  }
18824
19298
  }
18825
19299
 
19300
+ // ../../packages/sdk/typescript/src/helpers/sandbox-templates.ts
19301
+ class SandboxTemplateBuildError extends Error {
19302
+ templateID;
19303
+ buildID;
19304
+ reason;
19305
+ logEntries;
19306
+ name = "SandboxTemplateBuildError";
19307
+ constructor(templateID, buildID, reason, logEntries) {
19308
+ super(`Template build failed: ${reason?.message ?? "Unknown build error"}${logEntries.length ? `
19309
+ ${logEntries.map((log) => log.message).join(`
19310
+ `)}` : ""}`);
19311
+ this.templateID = templateID;
19312
+ this.buildID = buildID;
19313
+ this.reason = reason;
19314
+ this.logEntries = logEntries;
19315
+ }
19316
+ }
19317
+ async function buildSandboxTemplate(client, input) {
19318
+ const signal = input.signal ?? new AbortController().signal;
19319
+ signal.throwIfAborted();
19320
+ const interval = input.pollIntervalMs ?? 1000;
19321
+ if (!Number.isSafeInteger(interval) || interval < 0)
19322
+ throw new RangeError("pollIntervalMs must be a nonnegative integer");
19323
+ if ([input.dockerfile, input.fromTemplate, input.fromImage].filter((value) => value !== undefined).length !== 1 || input.dockerfile !== undefined && input.steps !== undefined)
19324
+ throw new TypeError("Supply dockerfile, fromTemplate or fromImage; dockerfile cannot include steps");
19325
+ const created = await client.sandbox.templates.create({ body: {
19326
+ name: input.name,
19327
+ cpuCount: input.cpuCount,
19328
+ memoryMB: input.memoryMB,
19329
+ diskGb: input.diskGb,
19330
+ tags: input.tags
19331
+ }, signal });
19332
+ const path = { templateID: created.templateID, buildID: created.buildID };
19333
+ await client.sandbox.templates.builds.update({ path, body: input.dockerfile !== undefined ? { dockerfile: input.dockerfile } : { fromTemplate: input.fromTemplate, fromImage: input.fromImage, steps: input.steps }, signal });
19334
+ let logsOffset = 0;
19335
+ const tail = [];
19336
+ let terminal;
19337
+ while (true) {
19338
+ signal.throwIfAborted();
19339
+ const result = await client.sandbox.templates.builds.status.list({ path, query: { logsOffset }, signal });
19340
+ for (const entry of result.logEntries) {
19341
+ signal.throwIfAborted();
19342
+ await input.onLog?.(entry);
19343
+ tail.push({ ...entry, message: entry.message.slice(-4096) });
19344
+ if (tail.length > 20)
19345
+ tail.shift();
19346
+ }
19347
+ logsOffset += result.logEntries.length;
19348
+ if (!terminal && (result.status === "ready" || result.status === "error"))
19349
+ terminal = result;
19350
+ if (terminal && result.logEntries.length === 0) {
19351
+ if (terminal.status === "error")
19352
+ throw new SandboxTemplateBuildError(path.templateID, path.buildID, terminal.reason, tail);
19353
+ return { ...terminal, status: "ready", logEntries: [] };
19354
+ }
19355
+ await sleep(interval, signal);
19356
+ }
19357
+ }
19358
+
18826
19359
  // ../../packages/sdk/typescript/src/helpers/file-upload.ts
18827
19360
  var MAX_RETRIES = 5;
18828
19361
  function retryable(error) {
@@ -20601,6 +21134,23 @@ var fileCreateSignedUpload = (options) => (options.client ?? client).post({
20601
21134
  ...options.headers
20602
21135
  }
20603
21136
  });
21137
+ var fileCreateContentUrl = (options) => (options.client ?? client).post({
21138
+ security: [{
21139
+ key: "BearerAuth",
21140
+ scheme: "bearer",
21141
+ type: "http"
21142
+ }, {
21143
+ key: "ApiKeyAuth",
21144
+ name: "X-API-Key",
21145
+ type: "apiKey"
21146
+ }],
21147
+ url: "/file/v1/files/{file_id}/content_url",
21148
+ ...options,
21149
+ headers: {
21150
+ "Content-Type": "application/json",
21151
+ ...options.headers
21152
+ }
21153
+ });
20604
21154
  var fileRevokeContentLink = (options) => (options.client ?? client).post({
20605
21155
  security: [{
20606
21156
  key: "BearerAuth",
@@ -23741,6 +24291,36 @@ var canvasUpdateCollection = (options) => (options.client ?? client).patch({
23741
24291
  ...options.headers
23742
24292
  }
23743
24293
  });
24294
+ var canvasListVersions = (options) => (options.client ?? client).get({
24295
+ security: [{
24296
+ key: "BearerAuth",
24297
+ scheme: "bearer",
24298
+ type: "http"
24299
+ }, {
24300
+ key: "ApiKeyAuth",
24301
+ name: "X-API-Key",
24302
+ type: "apiKey"
24303
+ }],
24304
+ url: "/canvas/v1/canvases/{canvas_id}/versions",
24305
+ ...options
24306
+ });
24307
+ var canvasRestoreCanvas = (options) => (options.client ?? client).post({
24308
+ security: [{
24309
+ key: "BearerAuth",
24310
+ scheme: "bearer",
24311
+ type: "http"
24312
+ }, {
24313
+ key: "ApiKeyAuth",
24314
+ name: "X-API-Key",
24315
+ type: "apiKey"
24316
+ }],
24317
+ url: "/canvas/v1/canvases/{canvas_id}:restore",
24318
+ ...options,
24319
+ headers: {
24320
+ "Content-Type": "application/json",
24321
+ ...options.headers
24322
+ }
24323
+ });
23744
24324
  var cutListProjects = (options) => (options?.client ?? client).get({
23745
24325
  security: [{
23746
24326
  key: "BearerAuth",
@@ -24997,7 +25577,7 @@ var postSandboxV1SandboxesBySandboxIdConnect = (options) => (options.client ?? c
24997
25577
  ...options.headers
24998
25578
  }
24999
25579
  });
25000
- var getSandboxV1Templates = (options) => (options?.client ?? client).get({
25580
+ var listSandboxTemplates = (options) => (options?.client ?? client).get({
25001
25581
  security: [
25002
25582
  {
25003
25583
  key: "sandbox-ApiKeyAuth",
@@ -25029,6 +25609,42 @@ var getSandboxV1Templates = (options) => (options?.client ?? client).get({
25029
25609
  url: "/sandbox/v1/templates",
25030
25610
  ...options
25031
25611
  });
25612
+ var requestTemplateBuild = (options) => (options.client ?? client).post({
25613
+ security: [
25614
+ {
25615
+ key: "sandbox-ApiKeyAuth",
25616
+ name: "X-API-Key",
25617
+ type: "apiKey"
25618
+ },
25619
+ {
25620
+ key: "sandbox-AuthProviderBearerAuth",
25621
+ scheme: "bearer",
25622
+ type: "http"
25623
+ },
25624
+ {
25625
+ key: "sandbox-AuthProviderTeamAuth",
25626
+ name: "X-Team-ID",
25627
+ type: "apiKey"
25628
+ },
25629
+ { name: "X-Admin-Token", type: "apiKey" },
25630
+ {
25631
+ key: "sandbox-AdminTeamAuth",
25632
+ name: "X-Team-ID",
25633
+ type: "apiKey"
25634
+ },
25635
+ {
25636
+ key: "sandbox-AdminJWTAuth",
25637
+ scheme: "bearer",
25638
+ type: "http"
25639
+ }
25640
+ ],
25641
+ url: "/sandbox/v1/templates",
25642
+ ...options,
25643
+ headers: {
25644
+ "Content-Type": "application/json",
25645
+ ...options.headers
25646
+ }
25647
+ });
25032
25648
  var getSandboxV1Volumes = (options) => (options?.client ?? client).get({
25033
25649
  security: [
25034
25650
  {
@@ -25365,6 +25981,274 @@ var getSandboxV1SandboxesBySandboxIdLogs = (options) => (options.client ?? clien
25365
25981
  url: "/sandbox/v1/sandboxes/{sandboxID}/logs",
25366
25982
  ...options
25367
25983
  });
25984
+ var startTemplateBuild = (options) => (options.client ?? client).post({
25985
+ security: [
25986
+ {
25987
+ key: "sandbox-ApiKeyAuth",
25988
+ name: "X-API-Key",
25989
+ type: "apiKey"
25990
+ },
25991
+ {
25992
+ key: "sandbox-AuthProviderBearerAuth",
25993
+ scheme: "bearer",
25994
+ type: "http"
25995
+ },
25996
+ {
25997
+ key: "sandbox-AuthProviderTeamAuth",
25998
+ name: "X-Team-ID",
25999
+ type: "apiKey"
26000
+ },
26001
+ { name: "X-Admin-Token", type: "apiKey" },
26002
+ {
26003
+ key: "sandbox-AdminTeamAuth",
26004
+ name: "X-Team-ID",
26005
+ type: "apiKey"
26006
+ },
26007
+ {
26008
+ key: "sandbox-AdminJWTAuth",
26009
+ scheme: "bearer",
26010
+ type: "http"
26011
+ }
26012
+ ],
26013
+ url: "/sandbox/v1/templates/{templateID}/builds/{buildID}",
26014
+ ...options,
26015
+ headers: {
26016
+ "Content-Type": "application/json",
26017
+ ...options.headers
26018
+ }
26019
+ });
26020
+ var getTemplateBuildStatus = (options) => (options.client ?? client).get({
26021
+ security: [
26022
+ {
26023
+ key: "sandbox-ApiKeyAuth",
26024
+ name: "X-API-Key",
26025
+ type: "apiKey"
26026
+ },
26027
+ {
26028
+ key: "sandbox-AuthProviderBearerAuth",
26029
+ scheme: "bearer",
26030
+ type: "http"
26031
+ },
26032
+ {
26033
+ key: "sandbox-AuthProviderTeamAuth",
26034
+ name: "X-Team-ID",
26035
+ type: "apiKey"
26036
+ },
26037
+ { name: "X-Admin-Token", type: "apiKey" },
26038
+ {
26039
+ key: "sandbox-AdminTeamAuth",
26040
+ name: "X-Team-ID",
26041
+ type: "apiKey"
26042
+ },
26043
+ {
26044
+ key: "sandbox-AdminJWTAuth",
26045
+ scheme: "bearer",
26046
+ type: "http"
26047
+ }
26048
+ ],
26049
+ url: "/sandbox/v1/templates/{templateID}/builds/{buildID}/status",
26050
+ ...options
26051
+ });
26052
+ var deleteUserTemplate = (options) => (options.client ?? client).delete({
26053
+ security: [
26054
+ {
26055
+ key: "sandbox-ApiKeyAuth",
26056
+ name: "X-API-Key",
26057
+ type: "apiKey"
26058
+ },
26059
+ {
26060
+ key: "sandbox-AuthProviderBearerAuth",
26061
+ scheme: "bearer",
26062
+ type: "http"
26063
+ },
26064
+ {
26065
+ key: "sandbox-AuthProviderTeamAuth",
26066
+ name: "X-Team-ID",
26067
+ type: "apiKey"
26068
+ },
26069
+ { name: "X-Admin-Token", type: "apiKey" },
26070
+ {
26071
+ key: "sandbox-AdminTeamAuth",
26072
+ name: "X-Team-ID",
26073
+ type: "apiKey"
26074
+ },
26075
+ {
26076
+ key: "sandbox-AdminJWTAuth",
26077
+ scheme: "bearer",
26078
+ type: "http"
26079
+ }
26080
+ ],
26081
+ url: "/sandbox/v1/templates/{templateID}",
26082
+ ...options
26083
+ });
26084
+ var getTemplateWithBuilds = (options) => (options.client ?? client).get({
26085
+ security: [
26086
+ {
26087
+ key: "sandbox-ApiKeyAuth",
26088
+ name: "X-API-Key",
26089
+ type: "apiKey"
26090
+ },
26091
+ {
26092
+ key: "sandbox-AuthProviderBearerAuth",
26093
+ scheme: "bearer",
26094
+ type: "http"
26095
+ },
26096
+ {
26097
+ key: "sandbox-AuthProviderTeamAuth",
26098
+ name: "X-Team-ID",
26099
+ type: "apiKey"
26100
+ },
26101
+ { name: "X-Admin-Token", type: "apiKey" },
26102
+ {
26103
+ key: "sandbox-AdminTeamAuth",
26104
+ name: "X-Team-ID",
26105
+ type: "apiKey"
26106
+ },
26107
+ {
26108
+ key: "sandbox-AdminJWTAuth",
26109
+ scheme: "bearer",
26110
+ type: "http"
26111
+ }
26112
+ ],
26113
+ url: "/sandbox/v1/templates/{templateID}",
26114
+ ...options
26115
+ });
26116
+ var deleteTemplateTags = (options) => (options.client ?? client).delete({
26117
+ security: [
26118
+ {
26119
+ key: "sandbox-ApiKeyAuth",
26120
+ name: "X-API-Key",
26121
+ type: "apiKey"
26122
+ },
26123
+ {
26124
+ key: "sandbox-AuthProviderBearerAuth",
26125
+ scheme: "bearer",
26126
+ type: "http"
26127
+ },
26128
+ {
26129
+ key: "sandbox-AuthProviderTeamAuth",
26130
+ name: "X-Team-ID",
26131
+ type: "apiKey"
26132
+ },
26133
+ { name: "X-Admin-Token", type: "apiKey" },
26134
+ {
26135
+ key: "sandbox-AdminTeamAuth",
26136
+ name: "X-Team-ID",
26137
+ type: "apiKey"
26138
+ },
26139
+ {
26140
+ key: "sandbox-AdminJWTAuth",
26141
+ scheme: "bearer",
26142
+ type: "http"
26143
+ }
26144
+ ],
26145
+ url: "/sandbox/v1/templates/tags",
26146
+ ...options,
26147
+ headers: {
26148
+ "Content-Type": "application/json",
26149
+ ...options.headers
26150
+ }
26151
+ });
26152
+ var assignTemplateTags = (options) => (options.client ?? client).post({
26153
+ security: [
26154
+ {
26155
+ key: "sandbox-ApiKeyAuth",
26156
+ name: "X-API-Key",
26157
+ type: "apiKey"
26158
+ },
26159
+ {
26160
+ key: "sandbox-AuthProviderBearerAuth",
26161
+ scheme: "bearer",
26162
+ type: "http"
26163
+ },
26164
+ {
26165
+ key: "sandbox-AuthProviderTeamAuth",
26166
+ name: "X-Team-ID",
26167
+ type: "apiKey"
26168
+ },
26169
+ { name: "X-Admin-Token", type: "apiKey" },
26170
+ {
26171
+ key: "sandbox-AdminTeamAuth",
26172
+ name: "X-Team-ID",
26173
+ type: "apiKey"
26174
+ },
26175
+ {
26176
+ key: "sandbox-AdminJWTAuth",
26177
+ scheme: "bearer",
26178
+ type: "http"
26179
+ }
26180
+ ],
26181
+ url: "/sandbox/v1/templates/tags",
26182
+ ...options,
26183
+ headers: {
26184
+ "Content-Type": "application/json",
26185
+ ...options.headers
26186
+ }
26187
+ });
26188
+ var listTemplateTags = (options) => (options.client ?? client).get({
26189
+ security: [
26190
+ {
26191
+ key: "sandbox-ApiKeyAuth",
26192
+ name: "X-API-Key",
26193
+ type: "apiKey"
26194
+ },
26195
+ {
26196
+ key: "sandbox-AuthProviderBearerAuth",
26197
+ scheme: "bearer",
26198
+ type: "http"
26199
+ },
26200
+ {
26201
+ key: "sandbox-AuthProviderTeamAuth",
26202
+ name: "X-Team-ID",
26203
+ type: "apiKey"
26204
+ },
26205
+ { name: "X-Admin-Token", type: "apiKey" },
26206
+ {
26207
+ key: "sandbox-AdminTeamAuth",
26208
+ name: "X-Team-ID",
26209
+ type: "apiKey"
26210
+ },
26211
+ {
26212
+ key: "sandbox-AdminJWTAuth",
26213
+ scheme: "bearer",
26214
+ type: "http"
26215
+ }
26216
+ ],
26217
+ url: "/sandbox/v1/templates/{templateID}/tags",
26218
+ ...options
26219
+ });
26220
+ var resolveTemplateAlias = (options) => (options.client ?? client).get({
26221
+ security: [
26222
+ {
26223
+ key: "sandbox-ApiKeyAuth",
26224
+ name: "X-API-Key",
26225
+ type: "apiKey"
26226
+ },
26227
+ {
26228
+ key: "sandbox-AuthProviderBearerAuth",
26229
+ scheme: "bearer",
26230
+ type: "http"
26231
+ },
26232
+ {
26233
+ key: "sandbox-AuthProviderTeamAuth",
26234
+ name: "X-Team-ID",
26235
+ type: "apiKey"
26236
+ },
26237
+ { name: "X-Admin-Token", type: "apiKey" },
26238
+ {
26239
+ key: "sandbox-AdminTeamAuth",
26240
+ name: "X-Team-ID",
26241
+ type: "apiKey"
26242
+ },
26243
+ {
26244
+ key: "sandbox-AdminJWTAuth",
26245
+ scheme: "bearer",
26246
+ type: "http"
26247
+ }
26248
+ ],
26249
+ url: "/sandbox/v1/templates/aliases/{alias}",
26250
+ ...options
26251
+ });
25368
26252
  var searchSearch = (options) => (options.client ?? client).post({
25369
26253
  security: [{
25370
26254
  key: "search-bearerAuth",
@@ -26701,8 +27585,12 @@ function createCanvas(transport) {
26701
27585
  nodes: {
26702
27586
  list: bind(transport, canvasListNodes)
26703
27587
  },
27588
+ restore: bind(transport, canvasRestoreCanvas),
26704
27589
  retrieve: bind(transport, canvasRetrieveCanvas),
26705
- update: bind(transport, canvasUpdateCanvas)
27590
+ update: bind(transport, canvasUpdateCanvas),
27591
+ versions: {
27592
+ list: bind(transport, canvasListVersions)
27593
+ }
26706
27594
  },
26707
27595
  collections: {
26708
27596
  create: bind(transport, canvasCreateCollection),
@@ -26800,6 +27688,9 @@ function createFile(transport) {
26800
27688
  contentLinks: {
26801
27689
  revoke: bind(transport, fileRevokeContentLink)
26802
27690
  },
27691
+ contentUrl: {
27692
+ create: bind(transport, fileCreateContentUrl)
27693
+ },
26803
27694
  create: bind(transport, (options) => fileCreateFile({ ...options, bodySerializer: multipartBodySerializer, headers: { "Content-Type": null, ...options.headers } })),
26804
27695
  delete: bind(transport, fileDeleteFile),
26805
27696
  list: bind(transport, fileListFiles),
@@ -27094,7 +27985,24 @@ function createSandbox(transport) {
27094
27985
  list: bind(transport, getSandboxV1Snapshots)
27095
27986
  },
27096
27987
  templates: {
27097
- list: bind(transport, getSandboxV1Templates)
27988
+ aliases: {
27989
+ retrieve: bind(transport, resolveTemplateAlias)
27990
+ },
27991
+ builds: {
27992
+ status: {
27993
+ list: bind(transport, getTemplateBuildStatus)
27994
+ },
27995
+ update: bind(transport, startTemplateBuild)
27996
+ },
27997
+ create: bind(transport, requestTemplateBuild),
27998
+ delete: bind(transport, deleteUserTemplate),
27999
+ list: bind(transport, listSandboxTemplates),
28000
+ retrieve: bind(transport, getTemplateWithBuilds),
28001
+ tags: {
28002
+ create: bind(transport, assignTemplateTags),
28003
+ delete: bind(transport, deleteTemplateTags),
28004
+ list: bind(transport, listTemplateTags)
28005
+ }
27098
28006
  },
27099
28007
  volumes: {
27100
28008
  create: bind(transport, postSandboxV1Volumes),
@@ -28015,6 +28923,8 @@ class Praxis {
28015
28923
  const transport = new Transport(options);
28016
28924
  for (const [name, create] of Object.entries(resourceFactories)) {
28017
28925
  const resource = create(transport);
28926
+ if (name === "sandbox")
28927
+ Object.assign(resource.templates, { build: (input) => buildSandboxTemplate(this, input) });
28018
28928
  if (name === "file")
28019
28929
  Object.assign(resource, { uploadFile: (file, options2) => uploadFile(this, file, options2) });
28020
28930
  if (name === "database")
@@ -29445,9 +30355,9 @@ function randomSecret(bytes = 32) {
29445
30355
  function decideBuildOutput(mode) {
29446
30356
  return mode === "human" ? "stream" : "capture";
29447
30357
  }
29448
- function tailLines(text, count3) {
30358
+ function tailLines(text, count2) {
29449
30359
  return text.replace(/\s+$/, "").split(`
29450
- `).slice(-count3).join(`
30360
+ `).slice(-count2).join(`
29451
30361
  `);
29452
30362
  }
29453
30363
  function nextSteps(dir, bunAvailable) {
@@ -29848,7 +30758,7 @@ function projectList(items, op) {
29848
30758
  }
29849
30759
 
29850
30760
  // src/output/human.ts
29851
- var count3 = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
30761
+ var count2 = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
29852
30762
  function identity(result, ctx) {
29853
30763
  const op = "op" in result ? result.op : undefined;
29854
30764
  const split = op?.lastIndexOf(".") ?? -1;
@@ -29936,7 +30846,7 @@ function objectView(data, resource, id, ctx, paint) {
29936
30846
  return v.map(scalar).map(plain).join(", ");
29937
30847
  folded = true;
29938
30848
  const preview = v.slice(0, 3).map((item) => record(item).id ?? record(item).name).filter((x) => x !== undefined).map((x) => plain(scalar(x)));
29939
- return `${count3(v.length, "item")}${preview.length ? ` (${preview.join(", ")})` : ""}`;
30849
+ return `${count2(v.length, "item")}${preview.length ? ` (${preview.join(", ")})` : ""}`;
29940
30850
  }
29941
30851
  if (v !== null && typeof v === "object") {
29942
30852
  if (depth >= 1) {
@@ -29968,16 +30878,20 @@ function renderHuman(result, ctx) {
29968
30878
  const out = ansi(colorEnabled("human", ctx.stdoutIsTTY, vars)), err = ansi(colorEnabled("human", ctx.stderrIsTTY ?? Boolean(process.stderr.isTTY), vars));
29969
30879
  const { resource, verb, id } = identity(result, ctx);
29970
30880
  switch (result.kind) {
29971
- case "error":
30881
+ case "error": {
30882
+ const details = result.details !== undefined ? JSON.stringify(result.details) : undefined;
30883
+ const detailsLine = details !== undefined ? ` details ${details.length > 2000 ? details.slice(0, 1999) + "…" : details}
30884
+ ` : "";
29972
30885
  return { stderr: err.red(`✗ ${plain(result.message)}`) + `
29973
30886
  ` + err.dim(` code ${plain(result.code)}${result.status !== undefined ? ` · ${result.status}` : ""} · env ${plain(result.env)}${result.request_id ? ` · request ${plain(result.request_id)}` : ""}`) + `
29974
- ` + (result.hint ? ` → ${plain(result.hint)}
30887
+ ` + detailsLine + (result.hint ? ` → ${plain(result.hint)}
29975
30888
  ` : "") };
30889
+ }
29976
30890
  case "list":
29977
30891
  return {
29978
30892
  stdout: result.items.length ? table(projectList(result.items, result.op), ctx, out) : out.dim(`No ${plain(resource)}${/(s|x|ch|sh)$/.test(resource) ? "es" : "s"}.`) + `
29979
30893
  `,
29980
- stderr: err.dim(`${result.total !== undefined ? `${result.items.length} of ${result.total} items` : count3(result.items.length, "item")}${result.nextCursor ? ` · next: ${ctx.nextCommand ?? "praxis --help"}` : ""}`) + `
30894
+ stderr: err.dim(`${result.total !== undefined ? `${result.items.length} of ${result.total} items` : count2(result.items.length, "item")}${result.nextCursor ? ` · next: ${ctx.nextCommand ?? "praxis --help"}` : ""}`) + `
29981
30895
  `
29982
30896
  };
29983
30897
  case "object": {
@@ -30059,7 +30973,7 @@ ${usage ? `usage: ${JSON.stringify(usage)}
30059
30973
 
30060
30974
  // src/output/render.ts
30061
30975
  function errorJSON(result, ctx) {
30062
- return JSON.stringify({ error: { code: result.code, message: result.message, hint: result.hint ?? null, env: result.env, command: ctx.command ?? null, status: result.status ?? null, request_id: result.request_id ?? null, ...result.credential_source ? { credential_source: result.credential_source } : {} } }) + `
30976
+ return JSON.stringify({ error: { code: result.code, ...result.details !== undefined ? { details: result.details } : {}, message: result.message, hint: result.hint ?? null, env: result.env, command: ctx.command ?? null, status: result.status ?? null, request_id: result.request_id ?? null, ...result.credential_source ? { credential_source: result.credential_source } : {} } }) + `
30063
30977
  `;
30064
30978
  }
30065
30979
  function render(result, ctx) {
@@ -30213,6 +31127,8 @@ function authHint(source) {
30213
31127
  function errorInput(error, ctx) {
30214
31128
  const sdk = error instanceof PraxisError ? error : undefined;
30215
31129
  const raw = record(sdk?.raw), nested = record(raw.error);
31130
+ const candidate = nested.details ?? raw.details;
31131
+ const details = candidate !== null && typeof candidate === "object" && !Array.isArray(candidate) ? candidate : undefined;
30216
31132
  let message = error instanceof Error ? error.message : "Unexpected error";
30217
31133
  const prefix = message.match(/^([A-Z][A-Z0-9_]+):\s*/)?.[1];
30218
31134
  const code = error instanceof UsageError ? error.code : businessCode(raw.code) ?? businessCode(nested.code) ?? businessCode(raw.error_code) ?? prefix ?? businessCode(sdk?.code) ?? (sdk?.status ? `HTTP_${sdk.status}` : sdk ? "API_ERROR" : "RUNTIME_ERROR");
@@ -30239,7 +31155,7 @@ function errorInput(error, ctx) {
30239
31155
  hint = "Rate limited; retry later.";
30240
31156
  else if (status !== undefined && status >= 500)
30241
31157
  hint = `Server error; retry later.${request_id ? ` Request id: ${request_id}.` : ""}`;
30242
- return { kind: "error", code, message, hint, env: ctx.env, ...authFailure ? { credential_source: source } : {}, ...status !== undefined ? { status } : {}, ...request_id ? { request_id } : {} };
31158
+ return { kind: "error", code, message, hint, ...details !== undefined ? { details } : {}, env: ctx.env, ...authFailure ? { credential_source: source } : {}, ...status !== undefined ? { status } : {}, ...request_id ? { request_id } : {} };
30243
31159
  }
30244
31160
 
30245
31161
  // src/output/progress.ts
@@ -30269,7 +31185,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
30269
31185
  }
30270
31186
 
30271
31187
  // src/main.ts
30272
- var version = "0.2.1-dev.2ce6637";
31188
+ var version = "0.2.1-dev.de0a917";
30273
31189
  var commands = commandTree(operations);
30274
31190
  var manual = [...workflows.map((w) => w.words), [API_WORD]];
30275
31191
  function route(argv) {