@deepraxis/sdk 0.1.1-dev.d775f1e → 0.1.1-dev.ea219e1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/METHODS.md +19 -1
- package/README.md +1 -1
- package/dist/automation.d.ts +7 -0
- package/dist/core/client.d.ts +5 -1
- package/dist/core/client.js +10 -0
- package/dist/core/transport.js +1 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +59 -17
- package/dist/generated/sdk.gen.js +131 -16
- package/dist/generated/types.gen.d.ts +1686 -210
- package/dist/helpers/application-build.d.ts +10 -0
- package/dist/helpers/application-build.js +98 -0
- package/dist/helpers/application-publish.d.ts +8 -0
- package/dist/helpers/application-publish.js +26 -9
- package/dist/helpers/browser-connect.d.ts +78 -0
- package/dist/helpers/browser-connect.js +161 -0
- package/dist/helpers/browser-decisions.d.ts +44 -0
- package/dist/helpers/browser-decisions.js +84 -0
- package/dist/helpers/browser-documentation.d.ts +2 -0
- package/dist/helpers/browser-documentation.js +47 -0
- package/dist/helpers/file-upload.d.ts +2 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/operations.generated.d.ts +220 -40
- package/dist/operations.generated.js +270 -39
- package/dist/resources.generated.d.ts +112 -22
- package/dist/resources.generated.js +11 -0
- package/package.json +1 -1
|
@@ -343,7 +343,7 @@ export const computersList = (options) => (options?.client ?? client).get({
|
|
|
343
343
|
/**
|
|
344
344
|
* Create Computer
|
|
345
345
|
*
|
|
346
|
-
* Create a durable computer: a named machine whose files outlive sessions, for personal agents.
|
|
346
|
+
* Create a durable computer: a named machine whose files outlive sessions, for general and personal agents.
|
|
347
347
|
*
|
|
348
348
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
349
349
|
*/
|
|
@@ -706,7 +706,7 @@ export const stopSessionBackgroundTask = (options) => (options.client ?? client)
|
|
|
706
706
|
*
|
|
707
707
|
* Request session context compaction and retrieve an operation receipt.
|
|
708
708
|
*
|
|
709
|
-
* Available only on /agent/v1. The body may be omitted or {}. Optional instructions must be a string and is forwarded unchanged. Idempotency-Key is forwarded unchanged; a UUID is generated when absent. Returns { type: session_compaction, id, status, reason? }, where id is the operation ID. queued/running return 202; skipped/succeeded/failed return 200. Non-string instructions return 400 invalid_request_error. Missing or inaccessible managed sessions return 404 not_found_error.
|
|
709
|
+
* Available only on /agent/v1. The body may be omitted or {}. Optional instructions must be a string and is forwarded unchanged. Idempotency-Key is forwarded unchanged; a UUID is generated when absent. Returns { type: session_compaction, id, status, reason? }, where id is the operation ID. queued/running return 202; skipped/succeeded/failed/cancelled return 200. Non-string instructions return 400 invalid_request_error. Missing or inaccessible managed sessions return 404 not_found_error.
|
|
710
710
|
*/
|
|
711
711
|
export const compactSession = (options) => (options.client ?? client).post({
|
|
712
712
|
security: [{
|
|
@@ -750,7 +750,7 @@ export const getSessionCompaction = (options) => (options.client ?? client).get(
|
|
|
750
750
|
*
|
|
751
751
|
* Read session compaction history and summaries.
|
|
752
752
|
*
|
|
753
|
-
* Available only on /agent/v1. Returns { data: [...] }. Each entry contains type, id, event_id, trigger, status, model, compacted_message_count, input_tokens_before, input_tokens_after, summary, error and created_at, as recorded by the service. Missing or inaccessible managed sessions return 404 not_found_error.
|
|
753
|
+
* Available only on /agent/v1. Returns { data: [...], active }. active is the queued or running compaction ({ type: session_compaction, id, status, trigger: manual|auto|idle }), or null when none; manual work takes precedence. Each data entry contains type, id, event_id, trigger, status, model, compacted_message_count, input_tokens_before, input_tokens_after, summary, error and created_at, as recorded by the service. Missing or inaccessible managed sessions return 404 not_found_error.
|
|
754
754
|
*/
|
|
755
755
|
export const listSessionCompactions = (options) => (options.client ?? client).get({
|
|
756
756
|
security: [{
|
|
@@ -1092,7 +1092,7 @@ export const fileListFiles = (options) => (options?.client ?? client).get({
|
|
|
1092
1092
|
/**
|
|
1093
1093
|
* Upload file
|
|
1094
1094
|
*
|
|
1095
|
-
* Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 100000000 bytes, and only user_data
|
|
1095
|
+
* Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 100000000 bytes, and only user_data and vision purposes are accepted. Send file bytes as a multipart file part, not a filename or file ID; in the SDK use a File or Blob, for example new File(["Return within 23 days."], "policy.txt", { type: "text/plain" }). Content determines the MIME type. Supported uploads include PDF, DOCX/XLSX/PPTX, PNG/JPEG/GIF/WebP, MP3/WAV/FLAC/OGG/M4A, MP4/WebM, and UTF-8 JSON/NDJSON/CSV/Markdown/plain text; empty, unsupported, oversized files and unsupported purposes return 400. Use Uploads for larger files. The purpose vision accepts only PNG, JPEG, GIF and WebP, while conversation images require user_data. The returned ID belongs to your tenant; upload alone does not ingest the file into Knowledge. Knowledge attachment has a lower limit of 100000000 bytes. Optionally set expires_after[anchor]=created_at with expires_after[seconds] (3600–7776000). Without expiry, the file persists until deleted.
|
|
1096
1096
|
*/
|
|
1097
1097
|
export const fileCreateFile = (options) => (options.client ?? client).post({
|
|
1098
1098
|
...formDataBodySerializer,
|
|
@@ -1169,7 +1169,7 @@ export const fileRetrieveFileContent = (options) => (options.client ?? client).g
|
|
|
1169
1169
|
/**
|
|
1170
1170
|
* Create an upload
|
|
1171
1171
|
*
|
|
1172
|
-
* Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data
|
|
1172
|
+
* Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data and vision purposes. Add parts of at most 64000000 bytes and complete within one hour. Optional part_size enables fixed-size, retryable parts. expires_after applies to the resulting file (3600–7776000 seconds on this own face); without it the file persists until deleted.
|
|
1173
1173
|
*/
|
|
1174
1174
|
export const fileCreateUpload = (options) => (options.client ?? client).post({
|
|
1175
1175
|
security: [{
|
|
@@ -1269,6 +1269,18 @@ export const metaMethodsSearch = (options) => (options?.client ?? client).get({
|
|
|
1269
1269
|
*
|
|
1270
1270
|
*/
|
|
1271
1271
|
export const metaMethodsRetrieve = (options) => (options.client ?? client).get({ url: '/meta/v1/methods/{name}', ...options });
|
|
1272
|
+
/**
|
|
1273
|
+
* Read documentation Markdown
|
|
1274
|
+
*
|
|
1275
|
+
* Read a platform guide or reference before implementing an unfamiliar capability. Public; no API key required. Take path from praxis.meta.docs.search, or use developers/automation/guides/write-workflow. Append #heading-id to path to read only that section, including its subsections. Encode the hash as %23 over HTTP; SDK callers pass it in the path string. lang defaults to zh; en selects the English page. Unknown pages or anchors return DOC_NOT_FOUND; search again for a valid path.
|
|
1276
|
+
*/
|
|
1277
|
+
export const metaDocsRetrieve = (options) => (options.client ?? client).get({ url: '/meta/v1/docs/{path}', ...options });
|
|
1278
|
+
/**
|
|
1279
|
+
* Search platform documentation
|
|
1280
|
+
*
|
|
1281
|
+
* Find guides and references by keyword before reading them with praxis.meta.docs.retrieve. Public; no API key required. Matches documentation titles, headings and page text without case sensitivity; all query words must occur. q is required; limit defaults to 20 and accepts 1–50. lang defaults to zh or use en for English. Returns paths, page titles, canonical URLs and short matching snippets; no matches returns an empty array.
|
|
1282
|
+
*/
|
|
1283
|
+
export const metaDocsSearch = (options) => (options.client ?? client).get({ url: '/meta/v1/docs/search', ...options });
|
|
1272
1284
|
/**
|
|
1273
1285
|
* List Models
|
|
1274
1286
|
*
|
|
@@ -2452,7 +2464,7 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
|
2452
2464
|
/**
|
|
2453
2465
|
* List agents
|
|
2454
2466
|
*
|
|
2455
|
-
* List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=personal for durable-computer agents or kind=service for per-session environments. Pass next_page from the response as page to read the next page; a null next_page means the end.
|
|
2467
|
+
* List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general or kind=personal for durable-computer agents or kind=service for per-session environments. Pass next_page from the response as page to read the next page; a null next_page means the end.
|
|
2456
2468
|
*/
|
|
2457
2469
|
export const agentsList = (options) => (options?.client ?? client).get({
|
|
2458
2470
|
security: [{
|
|
@@ -2586,7 +2598,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
2586
2598
|
/**
|
|
2587
2599
|
* Create session
|
|
2588
2600
|
*
|
|
2589
|
-
* Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive
|
|
2601
|
+
* Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.
|
|
2590
2602
|
*/
|
|
2591
2603
|
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
2592
2604
|
security: [{
|
|
@@ -2966,7 +2978,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
|
|
|
2966
2978
|
/**
|
|
2967
2979
|
* Create deployment
|
|
2968
2980
|
*
|
|
2969
|
-
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for personal agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.
|
|
2981
|
+
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general and personal agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.
|
|
2970
2982
|
*/
|
|
2971
2983
|
export const deploymentsCreate = (options) => (options.client ?? client).post({
|
|
2972
2984
|
security: [{
|
|
@@ -3694,7 +3706,7 @@ export const applicationUploadAssets = (options) => (options.client ?? client).p
|
|
|
3694
3706
|
/**
|
|
3695
3707
|
* List actions
|
|
3696
3708
|
*
|
|
3697
|
-
* Discover callable Actions and their ns/name references without executing them. Combine each returned namespace and name as ns/name; Action calls use the current revision and do not accept @version or @tag. Filter by name or description; results include seven-day statistics and revision summaries without implementation source. Archived actions are excluded by default.
|
|
3709
|
+
* Discover callable Actions and their ns/name references without executing them. Combine each returned namespace and name as ns/name; Action calls use the current revision and do not accept @version or @tag. Filter by name or description; results include seven-day statistics and revision summaries without implementation source. Archived actions are excluded by default. List items carry no input contract: get the action and read current_revision.input_schema. Call it with call("ns/name", input) in a script or call: ns/name with with: in a workflow.
|
|
3698
3710
|
*/
|
|
3699
3711
|
export const automationActionsList = (options) => (options?.client ?? client).get({
|
|
3700
3712
|
querySerializer: { parameters: {
|
|
@@ -3739,7 +3751,7 @@ export const automationActionsCreate = (options) => (options.client ?? client).p
|
|
|
3739
3751
|
/**
|
|
3740
3752
|
* Get an Action with its current input and output JSON Schemas
|
|
3741
3753
|
*
|
|
3742
|
-
* Read the Action and its full current implementation, with input and output JSON Schemas at current_revision.input_schema and current_revision.output_schema. To read a built-in Action, use ns=praxis and name=<bare name>, for example name=ocr; invoke it in a script with call("ocr", input). The response ETag is the current revision ID for conditional updates.
|
|
3754
|
+
* Read the Action and its full current implementation, with input and output JSON Schemas at current_revision.input_schema and current_revision.output_schema. To read a built-in Action, use ns=praxis and name=<bare name>, for example name=ocr; invoke it in a script with call("ocr", input) or in a workflow step with call: ocr and with:. Input that breaks the contract returns INPUT_INVALID, with the fields in errors[]. The response ETag is the current revision ID for conditional updates.
|
|
3743
3755
|
*/
|
|
3744
3756
|
export const automationActionsGet = (options) => (options.client ?? client).get({
|
|
3745
3757
|
security: [{
|
|
@@ -3937,7 +3949,7 @@ export const automationScriptsList = (options) => (options?.client ?? client).ge
|
|
|
3937
3949
|
/**
|
|
3938
3950
|
* Create a script
|
|
3939
3951
|
*
|
|
3940
|
-
* Save a TypeScript script as an editable draft for later reuse; this does not publish or start a run. Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. The draft is a source string with a default-exported function, for example `export default async (input: {name: string}) => ({greeting: "Hello, " + input.name});`. Scripts provide praxis, call, invoke, console and codemode as module-scope bindings, not on globalThis, with no import needed: praxis.<domain>.<resource>.<method>(...) calls a platform API, call("ocr", input) calls a built-in Action, and invoke("namespace/name", input) starts a child run. Action IDs are strings (bare names for built-ins, namespace/name for your own Actions); praxis.ocr(...) does not exist. To test it, pass that source and language=ts to praxis.automation.runs.create without publishing. To publish later, use the returned draft.revision as expected_draft_revision.
|
|
3952
|
+
* Save a TypeScript script as an editable draft for later reuse; this does not publish or start a run. Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. The draft is a source string with a default-exported function, for example `export default async (input: {name: string}) => ({greeting: "Hello, " + input.name});`. Scripts provide praxis, call, invoke, console and codemode as module-scope bindings, not on globalThis, with no import needed: praxis.<domain>.<resource>.<method>(...) calls a platform API, call("ocr", input) calls a built-in Action, and invoke("namespace/name", input) starts a child run. Action IDs are strings (bare names for built-ins, namespace/name for your own Actions); praxis.ocr(...) does not exist. The return value is limited to 1 MiB: write large results to a file with call("write-file", ...) and return the file ID. A call error carries errors[] (pointer, detail, hint); String(e) is only the summary. To test it, pass that source and language=ts to praxis.automation.runs.create without publishing. To publish later, use the returned draft.revision as expected_draft_revision.
|
|
3941
3953
|
*/
|
|
3942
3954
|
export const automationScriptsCreate = (options) => (options.client ?? client).post({
|
|
3943
3955
|
security: [{
|
|
@@ -4200,7 +4212,7 @@ export const automationWorkflowsList = (options) => (options?.client ?? client).
|
|
|
4200
4212
|
/**
|
|
4201
4213
|
* Create a workflow
|
|
4202
4214
|
*
|
|
4203
|
-
* Save a YAML workflow as an editable draft
|
|
4215
|
+
* Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax. Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 30 s (run-sandbox 10 min), workflow 24 h by default and 30 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.
|
|
4204
4216
|
*/
|
|
4205
4217
|
export const automationWorkflowsCreate = (options) => (options.client ?? client).post({
|
|
4206
4218
|
security: [{
|
|
@@ -4240,7 +4252,7 @@ export const automationWorkflowsGet = (options) => (options.client ?? client).ge
|
|
|
4240
4252
|
/**
|
|
4241
4253
|
* Update a workflow draft
|
|
4242
4254
|
*
|
|
4243
|
-
* Update description, labels or draft with the current draft revision in If-Match. Even metadata-only updates create a new draft revision.
|
|
4255
|
+
* Update description, labels or draft with the current draft revision in If-Match, taken from draft.revision in the get-workflow response. Even metadata-only updates create a new draft revision. A mismatch returns 412 PRECONDITION_FAILED; read the draft again, merge and retry. The draft is not validated here, so check it with validate (kind=workflow) before publishing. Error details are in errors[]. See the workflow syntax reference at https://deepraxis.com/docs/developers/automation/reference/workflow-syntax.
|
|
4244
4256
|
*/
|
|
4245
4257
|
export const automationWorkflowsPatch = (options) => (options.client ?? client).patch({
|
|
4246
4258
|
security: [{
|
|
@@ -4324,7 +4336,7 @@ export const automationWorkflowsVersions = (options) => (options.client ?? clien
|
|
|
4324
4336
|
/**
|
|
4325
4337
|
* Publish a workflow version
|
|
4326
4338
|
*
|
|
4327
|
-
* Publish a saved definition from its draft or an ad hoc run as a reusable version for named runs or triggers, validating the definition and locking dependencies. To test unpublished code, use praxis.automation.runs.create with source and language instead. Use draft.revision from create or retrieve as expected_draft_revision. The draft must match expected_draft_revision; an ad hoc run requires from_run and expected_source_sha256. The same version and contents return the existing version; different contents return VERSION_EXISTS, prereleases require an explicit tag (not latest, URL-safe characters only, not a version or range; violations return TAG_REQUIRED or TAG_INVALID with the complete rules in hint), and invalid definitions return DEFINITION_INVALID. Stable releases automatically advance latest only above the highest existing stable version; workflows becoming latest synchronize their declared schedule. String and object run.workflow/run.script references share version resolution and dependency locking. Publishing removes +build metadata from the version number.
|
|
4339
|
+
* Publish a saved definition from its draft or an ad hoc run as a reusable version for named runs or triggers, validating the definition and locking dependencies. To test unpublished code, use praxis.automation.runs.create with source and language instead. Use draft.revision from create or retrieve as expected_draft_revision. The draft must match expected_draft_revision; an ad hoc run requires from_run and expected_source_sha256. The same version and contents return the existing version; different contents return VERSION_EXISTS, prereleases require an explicit tag (not latest, URL-safe characters only, not a version or range; violations return TAG_REQUIRED or TAG_INVALID with the complete rules in hint), and invalid definitions return DEFINITION_INVALID. Stable releases automatically advance latest only above the highest existing stable version; workflows becoming latest synchronize their declared schedule. String and object run.workflow/run.script references share version resolution and dependency locking. Publishing removes +build metadata from the version number. For a workflow, document namespace, name and version must equal the publish target, otherwise DEFINITION_IDENTITY_MISMATCH; where a DEFINITION_INVALID failure sits is listed in errors[] (pointer, detail, hint).
|
|
4328
4340
|
*/
|
|
4329
4341
|
export const automationWorkflowsPublish = (options) => (options.client ?? client).post({
|
|
4330
4342
|
security: [{
|
|
@@ -4444,7 +4456,7 @@ export const automationWorkflowsSetDistTag = (options) => (options.client ?? cli
|
|
|
4444
4456
|
/**
|
|
4445
4457
|
* Validate a definition
|
|
4446
4458
|
*
|
|
4447
|
-
* Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation.
|
|
4459
|
+
* Check source without executing it when you need diagnostics, inferred schemas or references. This is optional before praxis.automation.runs.create, which also validates source before execution. Actions, scripts and workflows are supported; results include validity without saving. Invalid source is reported with valid=false. Script/action output schemas are inferred from return types: Promise unwrapping, Record, intersections and Date. Unknown types yield an empty schema and a warning in warnings. Source diagnostics use /source or /implementation/source with 1-based line/column. For kind=action the same admission checks as action creation apply (no external imports, platform operations only as direct call(praxis/<api>.<op>, input) calls, no agent or automation calls), so source that validates is not rejected at creation. For kind=workflow the YAML needs document (dsl, namespace, name, version) and do; each problem is one entry in errors[] (pointer, detail, hint), so read the first one. A listen outside the supported subset (to.all, inside a fork) and emit are not reported here and fail with DEFINITION_INVALID only when a run is created. Workflow syntax reference: https://deepraxis.com/docs/developers/automation/reference/workflow-syntax.
|
|
4448
4460
|
*/
|
|
4449
4461
|
export const automationValidateValidate = (options) => (options.client ?? client).post({
|
|
4450
4462
|
security: [{
|
|
@@ -4532,7 +4544,7 @@ export const automationRunsList = (options) => (options?.client ?? client).get({
|
|
|
4532
4544
|
/**
|
|
4533
4545
|
* Run a published target or execute draft source
|
|
4534
4546
|
*
|
|
4535
|
-
* Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 30 s (run-sandbox after 10 min); scripts have a 5 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to
|
|
4547
|
+
* Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 30 s (run-sandbox after 10 min); scripts have a 5 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 30 days. Each run can start at most 100 child runs, with at most 20 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.
|
|
4536
4548
|
*/
|
|
4537
4549
|
export const automationRunsCreate = (options) => (options.client ?? client).post({
|
|
4538
4550
|
security: [{
|
|
@@ -5035,6 +5047,109 @@ export const automationHooksReceive = (options) => (options.client ?? client).po
|
|
|
5035
5047
|
...options.headers
|
|
5036
5048
|
}
|
|
5037
5049
|
});
|
|
5050
|
+
/**
|
|
5051
|
+
* List human tasks
|
|
5052
|
+
*
|
|
5053
|
+
* List the human tasks that praxis/approval workflow steps opened, newest first. By default it returns only open tasks assigned to the caller: their approval inbox. scope=all lists every task of the organization, and status and run_id narrow the list. Use a returned id with retrieve for details and respond to decide. Read-only: listing never changes a task.
|
|
5054
|
+
*/
|
|
5055
|
+
export const automationHumanTasksList = (options) => (options?.client ?? client).get({
|
|
5056
|
+
querySerializer: { parameters: { status: { array: { explode: false } } } },
|
|
5057
|
+
security: [{
|
|
5058
|
+
key: 'BearerAuth',
|
|
5059
|
+
scheme: 'bearer',
|
|
5060
|
+
type: 'http'
|
|
5061
|
+
}, {
|
|
5062
|
+
key: 'ApiKeyAuth',
|
|
5063
|
+
name: 'X-API-Key',
|
|
5064
|
+
type: 'apiKey'
|
|
5065
|
+
}],
|
|
5066
|
+
url: '/automation/v1/human-tasks',
|
|
5067
|
+
...options
|
|
5068
|
+
});
|
|
5069
|
+
/**
|
|
5070
|
+
* Retrieve a human task
|
|
5071
|
+
*
|
|
5072
|
+
* Read one human task - title, Markdown body, context, actions, form, assignees, mode, due time, responses and outcome - so an assignee can choose an action and fill the form. Read-only; the Console approval page /automation/tasks/{id} reads the same resource.
|
|
5073
|
+
*/
|
|
5074
|
+
export const automationHumanTasksGet = (options) => (options.client ?? client).get({
|
|
5075
|
+
security: [{
|
|
5076
|
+
key: 'BearerAuth',
|
|
5077
|
+
scheme: 'bearer',
|
|
5078
|
+
type: 'http'
|
|
5079
|
+
}, {
|
|
5080
|
+
key: 'ApiKeyAuth',
|
|
5081
|
+
name: 'X-API-Key',
|
|
5082
|
+
type: 'apiKey'
|
|
5083
|
+
}],
|
|
5084
|
+
url: '/automation/v1/human-tasks/{id}',
|
|
5085
|
+
...options
|
|
5086
|
+
});
|
|
5087
|
+
/**
|
|
5088
|
+
* Respond to a human task
|
|
5089
|
+
*
|
|
5090
|
+
* Submit an action (action_id), form values (values) and a comment as the calling user. Depending on the task's mode the response either decides it (status becomes completed, outcome is set, and the waiting workflow resumes with outcome as the step output) or is recorded while other assignees are awaited. When two assignees respond at once, exactly one decides and the other gets TASK_CLOSED. An agent may respond only if the workflow set allow_agent_decision. Send an Idempotency-Key to retry safely.
|
|
5091
|
+
*/
|
|
5092
|
+
export const automationHumanTasksRespond = (options) => (options.client ?? client).post({
|
|
5093
|
+
security: [{
|
|
5094
|
+
key: 'BearerAuth',
|
|
5095
|
+
scheme: 'bearer',
|
|
5096
|
+
type: 'http'
|
|
5097
|
+
}, {
|
|
5098
|
+
key: 'ApiKeyAuth',
|
|
5099
|
+
name: 'X-API-Key',
|
|
5100
|
+
type: 'apiKey'
|
|
5101
|
+
}],
|
|
5102
|
+
url: '/automation/v1/human-tasks/{id}/respond',
|
|
5103
|
+
...options,
|
|
5104
|
+
headers: {
|
|
5105
|
+
'Content-Type': 'application/json',
|
|
5106
|
+
...options.headers
|
|
5107
|
+
}
|
|
5108
|
+
});
|
|
5109
|
+
/**
|
|
5110
|
+
* Cancel a human task
|
|
5111
|
+
*
|
|
5112
|
+
* Cancel an open human task; only the person who started the run or an organization API key may cancel. The task becomes cancelled and the waiting workflow step raises a runtime error with code HUMAN_TASK_CANCELLED, which try/catch can catch. Open tasks are cancelled automatically when their run ends, so this call is not needed then.
|
|
5113
|
+
*/
|
|
5114
|
+
export const automationHumanTasksCancel = (options) => (options.client ?? client).post({
|
|
5115
|
+
security: [{
|
|
5116
|
+
key: 'BearerAuth',
|
|
5117
|
+
scheme: 'bearer',
|
|
5118
|
+
type: 'http'
|
|
5119
|
+
}, {
|
|
5120
|
+
key: 'ApiKeyAuth',
|
|
5121
|
+
name: 'X-API-Key',
|
|
5122
|
+
type: 'apiKey'
|
|
5123
|
+
}],
|
|
5124
|
+
url: '/automation/v1/human-tasks/{id}/cancel',
|
|
5125
|
+
...options,
|
|
5126
|
+
headers: {
|
|
5127
|
+
'Content-Type': 'application/json',
|
|
5128
|
+
...options.headers
|
|
5129
|
+
}
|
|
5130
|
+
});
|
|
5131
|
+
/**
|
|
5132
|
+
* Delegate a human task
|
|
5133
|
+
*
|
|
5134
|
+
* An assignee who has not responded hands their place to another user (to_user), replacing their entry in assignees.users in place, so sequential order is kept. The new user cannot already be an assignee, nor the initiator unless self-approval is allowed. The task must still be open.
|
|
5135
|
+
*/
|
|
5136
|
+
export const automationHumanTasksDelegate = (options) => (options.client ?? client).post({
|
|
5137
|
+
security: [{
|
|
5138
|
+
key: 'BearerAuth',
|
|
5139
|
+
scheme: 'bearer',
|
|
5140
|
+
type: 'http'
|
|
5141
|
+
}, {
|
|
5142
|
+
key: 'ApiKeyAuth',
|
|
5143
|
+
name: 'X-API-Key',
|
|
5144
|
+
type: 'apiKey'
|
|
5145
|
+
}],
|
|
5146
|
+
url: '/automation/v1/human-tasks/{id}/delegate',
|
|
5147
|
+
...options,
|
|
5148
|
+
headers: {
|
|
5149
|
+
'Content-Type': 'application/json',
|
|
5150
|
+
...options.headers
|
|
5151
|
+
}
|
|
5152
|
+
});
|
|
5038
5153
|
/**
|
|
5039
5154
|
* List databases
|
|
5040
5155
|
*
|