@deepraxis/cli 0.2.0-dev.b71d0f4 → 0.2.0-dev.b9bc446

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 +15 -1
  2. package/dist/praxis.js +717 -69
  3. package/package.json +1 -1
package/dist/praxis.js CHANGED
@@ -11,7 +11,7 @@ var operations = [
11
11
  resource: "agent.agents",
12
12
  method: "list",
13
13
  summary: "List agents",
14
- description: "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.",
14
+ description: "List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general or kind=personal for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.",
15
15
  http: "GET",
16
16
  path: "/agent/v1/agents",
17
17
  streaming: "no",
@@ -56,8 +56,10 @@ var operations = [
56
56
  name: "kind",
57
57
  type: "string",
58
58
  enum: [
59
+ "general",
59
60
  "personal",
60
- "service"
61
+ "service",
62
+ "assume"
61
63
  ],
62
64
  required: false,
63
65
  description: "Filter agents by their immutable kind, including agents created before kind was recorded."
@@ -68,7 +70,7 @@ var operations = [
68
70
  resource: "agent.agents",
69
71
  method: "create",
70
72
  summary: "Create agent",
71
- description: `Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}.`,
73
+ description: `Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. For kind assume, provide name and computer_id without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.`,
72
74
  http: "POST",
73
75
  path: "/agent/v1/agents",
74
76
  streaming: "no",
@@ -81,8 +83,8 @@ var operations = [
81
83
  {
82
84
  name: "model",
83
85
  type: "object",
84
- required: true,
85
- description: "A model id from the Praxis model catalog (`praxis.model.models.list`), or a `model_config` object for additional configuration control. Unlike Anthropic, Claude model ids other than those in the catalog are rejected."
86
+ required: false,
87
+ description: "A model id from the Praxis model catalog (`praxis.model.models.list`), or a `model_config` object for additional configuration control. Unlike Anthropic, Claude model ids other than those in the catalog are rejected. Forbidden and omitted on assume agents."
86
88
  },
87
89
  {
88
90
  name: "name",
@@ -141,17 +143,19 @@ across all toolsets allowed.`
141
143
  type: "array",
142
144
  itemType: "object",
143
145
  required: false,
144
- description: "Platform resources and services this service agent's codemode may reach, as one list of typed bindings. Only kind=service accepts a nonempty list; personal agents return 400. There are two kinds. A resource binding names one resource with id and access: database (id db_..., read_only or read_write), vector_store (id vs_..., read_only or read_write), file (id file- plus 24 letters or digits, as the File API returns it; read_only), media_library (any id without ':' or whitespace, read_only or read_write), model (a model catalog id, invoke), workflow and script (id <namespace>/<name>, invoke). A service binding opens a whole service and carries only enabled: search or browser. At most 20 bindings per type, no repeated type and id, and each service type at most once. A session is authorized by the agent version it runs: newly added bindings apply only to new sessions, and a version saved with apply=false changes no access until it is applied. Applying a version that disables, removes or downgrades a binding revokes it immediately in running sessions on older versions. A resource that is not bound returns 404, a service that is not opened returns 403, and a write to a resource bound read_only returns 403 BINDING_READ_ONLY. Unknown types, fields on the wrong kind (id, access or instructions on a service binding), wrong access and malformed ids return 400. The former databases, vector_stores and files fields are removed and return 400. Omit on create for no bindings. Saving checks added or changed database, vector_store, media_library and file bindings in the organization: unknown or deleted ids return 400. If an owner is unavailable or takes more than 3 seconds, saving succeeds with verified=false for the affected bindings. Unchanged bindings keep their previous verification result and are not rechecked. workflow and script ids are not verified at save time."
146
+ description: "Platform resources and services this service agent's codemode may reach, as one list of typed bindings. Only kind=service accepts a nonempty list; general and personal agents return 400. There are two kinds. A resource binding names one resource with id and access: database (id db_..., read_only or read_write), vector_store (id vs_..., read_only or read_write), file (id file- plus 24 letters or digits, as the File API returns it; read_only), media_library (any id without ':' or whitespace, read_only or read_write), model (a model catalog id, invoke), workflow and script (id <namespace>/<name>, invoke). A service binding opens a whole service and carries only enabled: search or browser. At most 20 bindings per type, no repeated type and id, and each service type at most once. A session is authorized by the agent version it runs: newly added bindings apply only to new sessions, and a version saved with apply=false changes no access until it is applied. Applying a version that disables, removes or downgrades a binding revokes it immediately in running sessions on older versions. A resource that is not bound returns 404, a service that is not opened returns 403, and a write to a resource bound read_only returns 403 BINDING_READ_ONLY. Unknown types, fields on the wrong kind (id, access or instructions on a service binding), wrong access and malformed ids return 400. The former databases, vector_stores and files fields are removed and return 400. Omit on create for no bindings. Saving checks added or changed database, vector_store, media_library and file bindings in the organization: unknown or deleted ids return 400. If an owner is unavailable or takes more than 3 seconds, saving succeeds with verified=false for the affected bindings. Unchanged bindings keep their previous verification result and are not rechecked. workflow and script ids are not verified at save time."
145
147
  },
146
148
  {
147
149
  name: "kind",
148
150
  type: "string",
149
151
  enum: [
152
+ "general",
150
153
  "personal",
151
- "service"
154
+ "service",
155
+ "assume"
152
156
  ],
153
157
  required: false,
154
- description: "Immutable agent kind. personal requires computer_id; service cannot bind a computer. Omit on create to infer from computer_id. On update, the same kind is ignored; changing kind or crossing its computer binding returns 400 invalid_request_error."
158
+ description: "Immutable agent kind. general and personal require computer_id; service cannot bind a computer. Omit on create to infer from computer_id (general with a computer, service without). On update, the same kind is ignored; changing kind or crossing its computer binding returns 400 invalid_request_error. Assume agents use a durable computer driven over MCP without a conversation model; model, models, subagent_model, subagents and multiagent are forbidden and omitted."
155
159
  },
156
160
  {
157
161
  name: "computer_id",
@@ -201,7 +205,7 @@ across all toolsets allowed.`
201
205
  name: "avatar",
202
206
  type: "string",
203
207
  required: false,
204
- description: "Avatar image of the agent: an absolute https URL of at most 2048 characters, without credentials; any other value returns 400 avatar must be an https URL. It is the default picture in agent lists, the agent detail, the chat header and embedded chat when the embed appearance sets none. Saved with the agent version like other configuration, so apply=false keeps the previous avatar in effect until that version is applied. Omit on create for no avatar; on update, omit to keep it and send null to clear it. Both personal and service agents accept it. /agent/v1 only; /anthropic neither accepts nor returns it."
208
+ description: "Avatar image of the agent: an absolute https URL of at most 2048 characters, without credentials; any other value returns 400 avatar must be an https URL. It is the default picture in agent lists, the agent detail, the chat header and embedded chat when the embed appearance sets none. Saved with the agent version like other configuration, so apply=false keeps the previous avatar in effect until that version is applied. Omit on create for no avatar; on update, omit to keep it and send null to clear it. General, personal and service agents accept it. /agent/v1 only; /anthropic neither accepts nor returns it."
205
209
  },
206
210
  {
207
211
  name: "environment_id",
@@ -243,7 +247,7 @@ across all toolsets allowed.`
243
247
  {
244
248
  name: "agent_id",
245
249
  sdkName: "agent_id",
246
- description: "Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name."
250
+ description: "Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
247
251
  }
248
252
  ],
249
253
  query: [
@@ -259,7 +263,7 @@ across all toolsets allowed.`
259
263
  resource: "agent.agents",
260
264
  method: "update",
261
265
  summary: "Update agent",
262
- description: "Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: \"custom\", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send \"latest\", to use the skill's newest version when a session starts. type anthropic returns 400.",
266
+ description: "Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. skills attaches uploaded custom skills as [{type: \"custom\", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send \"latest\", to use the skill's newest version when a session starts. type anthropic returns 400. Assume agents reject model, models, subagent_model, subagents and multiagent on every update; other fields follow the general agent rules, with vault_ids also accepted.",
263
267
  http: "POST",
264
268
  path: "/agent/v1/agents/{agent_id}",
265
269
  streaming: "no",
@@ -268,7 +272,7 @@ across all toolsets allowed.`
268
272
  {
269
273
  name: "agent_id",
270
274
  sdkName: "agent_id",
271
- description: "Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name."
275
+ description: "Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
272
276
  }
273
277
  ],
274
278
  query: [],
@@ -300,7 +304,7 @@ to 64 chars each) with values up to 512 chars.`
300
304
  name: "model",
301
305
  type: "object",
302
306
  required: false,
303
- description: "A model id from the Praxis model catalog (`praxis.model.models.list`), or a `model_config` object for additional configuration control. Unlike Anthropic, Claude model ids other than those in the catalog are rejected."
307
+ description: "A model id from the Praxis model catalog (`praxis.model.models.list`), or a `model_config` object for additional configuration control. Unlike Anthropic, Claude model ids other than those in the catalog are rejected. Forbidden and omitted on assume agents."
304
308
  },
305
309
  {
306
310
  name: "multiagent",
@@ -365,11 +369,13 @@ toolsets allowed.`
365
369
  name: "kind",
366
370
  type: "string",
367
371
  enum: [
372
+ "general",
368
373
  "personal",
369
- "service"
374
+ "service",
375
+ "assume"
370
376
  ],
371
377
  required: false,
372
- description: "Immutable agent kind. personal requires computer_id; service cannot bind a computer. Omit on create to infer from computer_id. On update, the same kind is ignored; changing kind or crossing its computer binding returns 400 invalid_request_error."
378
+ description: "Immutable agent kind. general and personal require computer_id; service cannot bind a computer. Omit on create to infer from computer_id (general with a computer, service without). On update, the same kind is ignored; changing kind or crossing its computer binding returns 400 invalid_request_error. Assume agents use a durable computer driven over MCP without a conversation model; model, models, subagent_model, subagents and multiagent are forbidden and omitted."
373
379
  },
374
380
  {
375
381
  name: "computer_id",
@@ -419,7 +425,7 @@ toolsets allowed.`
419
425
  name: "avatar",
420
426
  type: "string",
421
427
  required: false,
422
- description: "Avatar image of the agent: an absolute https URL of at most 2048 characters, without credentials; any other value returns 400 avatar must be an https URL. It is the default picture in agent lists, the agent detail, the chat header and embedded chat when the embed appearance sets none. Saved with the agent version like other configuration, so apply=false keeps the previous avatar in effect until that version is applied. Omit on create for no avatar; on update, omit to keep it and send null to clear it. Both personal and service agents accept it. /agent/v1 only; /anthropic neither accepts nor returns it."
428
+ description: "Avatar image of the agent: an absolute https URL of at most 2048 characters, without credentials; any other value returns 400 avatar must be an https URL. It is the default picture in agent lists, the agent detail, the chat header and embedded chat when the embed appearance sets none. Saved with the agent version like other configuration, so apply=false keeps the previous avatar in effect until that version is applied. Omit on create for no avatar; on update, omit to keep it and send null to clear it. General, personal and service agents accept it. /agent/v1 only; /anthropic neither accepts nor returns it."
423
429
  },
424
430
  {
425
431
  name: "environment_id",
@@ -463,7 +469,7 @@ Agent Kit calls this from the page with a customer access token of this agent; y
463
469
  {
464
470
  name: "agent_id",
465
471
  sdkName: "agent_id",
466
- description: "Service agent id from agent creation or listing; with a customer access token, the agent the token was issued for."
472
+ description: "Service agent id from agent creation or listing; with a customer access token, the agent the token was issued for. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
467
473
  }
468
474
  ],
469
475
  query: []
@@ -481,7 +487,7 @@ Agent Kit calls this from the page with a customer access token of this agent; y
481
487
  {
482
488
  name: "agent_id",
483
489
  sdkName: "agent_id",
484
- description: "Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name."
490
+ description: "Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
485
491
  }
486
492
  ],
487
493
  query: []
@@ -501,7 +507,7 @@ Call this from your backend with your API key, or from the console. Customers fo
501
507
  {
502
508
  name: "agent_id",
503
509
  sdkName: "agent_id",
504
- description: "Active service agent id from agent creation or listing."
510
+ description: "Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
505
511
  }
506
512
  ],
507
513
  query: [
@@ -556,7 +562,7 @@ No Authorization header is required: the grant code or the publishable key is th
556
562
  {
557
563
  name: "agent_id",
558
564
  sdkName: "agent_id",
559
- description: "Service agent id (agent_…) or its short identity number, from agent creation or listing."
565
+ description: "Service agent id (agent_…) or its short identity number, from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
560
566
  }
561
567
  ],
562
568
  query: [],
@@ -580,7 +586,7 @@ Send the current customer access token as the Bearer credential, with no body, w
580
586
  {
581
587
  name: "agent_id",
582
588
  sdkName: "agent_id",
583
- description: "Service agent id (agent_…) or its short identity number, from agent creation or listing."
589
+ description: "Service agent id (agent_…) or its short identity number, from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
584
590
  }
585
591
  ],
586
592
  query: []
@@ -600,7 +606,7 @@ Send the current customer access token as the Bearer credential, with no body, a
600
606
  {
601
607
  name: "agent_id",
602
608
  sdkName: "agent_id",
603
- description: "Service agent id (agent_…) or its short identity number, from agent creation or listing."
609
+ description: "Service agent id (agent_…) or its short identity number, from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
604
610
  }
605
611
  ],
606
612
  query: []
@@ -620,7 +626,7 @@ Call this from your backend with your API key after your own login succeeds, the
620
626
  {
621
627
  name: "agent_id",
622
628
  sdkName: "agent_id",
623
- description: "Service agent id (agent_…) or its short identity number, from agent creation or listing."
629
+ description: "Service agent id (agent_…) or its short identity number, from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
624
630
  }
625
631
  ],
626
632
  query: [],
@@ -712,7 +718,7 @@ Develop only. Set confirm to the exact customer id; a missing or different confi
712
718
  {
713
719
  name: "agent_id",
714
720
  sdkName: "agent_id",
715
- description: "Active service agent id from agent creation or listing."
721
+ description: "Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
716
722
  },
717
723
  {
718
724
  name: "customer_id",
@@ -744,7 +750,7 @@ Use the customer id from the list or your own customer_id. An unknown customer r
744
750
  {
745
751
  name: "agent_id",
746
752
  sdkName: "agent_id",
747
- description: "Active service agent id from agent creation or listing."
753
+ description: "Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
748
754
  },
749
755
  {
750
756
  name: "customer_id",
@@ -769,7 +775,7 @@ Blocks the customer, then ends every live sign-in the way logout does: each acce
769
775
  {
770
776
  name: "agent_id",
771
777
  sdkName: "agent_id",
772
- description: "Active service agent id from agent creation or listing."
778
+ description: "Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
773
779
  },
774
780
  {
775
781
  name: "customer_id",
@@ -794,7 +800,7 @@ Use the same agent_id and customer id as the confirmed DELETE. Status is pending
794
800
  {
795
801
  name: "agent_id",
796
802
  sdkName: "agent_id",
797
- description: "Active service agent id from agent creation or listing."
803
+ description: "Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
798
804
  },
799
805
  {
800
806
  name: "customer_id",
@@ -819,7 +825,7 @@ Ends every live sign-in of the customer, revoking each access token and closing
819
825
  {
820
826
  name: "agent_id",
821
827
  sdkName: "agent_id",
822
- description: "Active service agent id from agent creation or listing."
828
+ description: "Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
823
829
  },
824
830
  {
825
831
  name: "customer_id",
@@ -844,7 +850,7 @@ Idempotent. Access tokens revoked while the customer was blocked stay revoked; s
844
850
  {
845
851
  name: "agent_id",
846
852
  sdkName: "agent_id",
847
- description: "Active service agent id from agent creation or listing."
853
+ description: "Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
848
854
  },
849
855
  {
850
856
  name: "customer_id",
@@ -867,7 +873,7 @@ Idempotent. Access tokens revoked while the customer was blocked stay revoked; s
867
873
  {
868
874
  name: "agent_id",
869
875
  sdkName: "agent_id",
870
- description: "Agent id from creation or listing."
876
+ description: "Agent id from creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
871
877
  }
872
878
  ],
873
879
  query: []
@@ -885,7 +891,7 @@ Idempotent. Access tokens revoked while the customer was blocked stay revoked; s
885
891
  {
886
892
  name: "agent_id",
887
893
  sdkName: "agent_id",
888
- description: "Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name."
894
+ description: "Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
889
895
  }
890
896
  ],
891
897
  query: [
@@ -916,7 +922,7 @@ Idempotent. Access tokens revoked while the customer was blocked stay revoked; s
916
922
  {
917
923
  name: "agent_id",
918
924
  sdkName: "agent_id",
919
- description: "Agent identifier from agents.create or agents.list."
925
+ description: "Agent identifier from agents.create or agents.list. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…."
920
926
  },
921
927
  {
922
928
  name: "version",
@@ -958,7 +964,7 @@ Praxis extension: MA only has session-scoped temporary containers and memory_sto
958
964
  resource: "agent.computers",
959
965
  method: "create",
960
966
  summary: "Create Computer",
961
- description: `Create a durable computer: a named machine whose files outlive sessions, for personal agents.
967
+ description: `Create a durable computer: a named machine whose files outlive sessions, for general and personal agents.
962
968
 
963
969
  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.`,
964
970
  http: "POST",
@@ -1409,7 +1415,7 @@ archived).`
1409
1415
  resource: "agent.deployments",
1410
1416
  method: "create",
1411
1417
  summary: "Create deployment",
1412
- description: "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.",
1418
+ description: "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.",
1413
1419
  http: "POST",
1414
1420
  path: "/agent/v1/deployments",
1415
1421
  streaming: "no",
@@ -1490,7 +1496,7 @@ created from this deployment. Maximum 50.`
1490
1496
  name: "target",
1491
1497
  type: "object",
1492
1498
  required: false,
1493
- description: "Execution target. environment (default) requires an existing, unarchived environment_id. computer is available only for personal agents and permits environment_id to be omitted."
1499
+ description: "Execution target. environment (default) requires an existing, unarchived environment_id. computer is available only for general and personal agents and permits environment_id to be omitted."
1494
1500
  }
1495
1501
  ]
1496
1502
  }
@@ -1607,7 +1613,7 @@ null to clear. Maximum 50.`
1607
1613
  name: "target",
1608
1614
  type: "object",
1609
1615
  required: false,
1610
- description: "Execution target. environment (default) requires an existing, unarchived environment_id. computer is available only for personal agents and permits environment_id to be omitted."
1616
+ description: "Execution target. environment (default) requires an existing, unarchived environment_id. computer is available only for general and personal agents and permits environment_id to be omitted."
1611
1617
  }
1612
1618
  ]
1613
1619
  }
@@ -1973,7 +1979,7 @@ clears to null; an empty string is stored as an empty string.`
1973
1979
  resource: "agent.sessions",
1974
1980
  method: "create",
1975
1981
  summary: "Create session",
1976
- description: `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.`,
1982
+ description: `Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.`,
1977
1983
  http: "POST",
1978
1984
  path: "/agent/v1/sessions",
1979
1985
  streaming: "no",
@@ -2277,7 +2283,7 @@ Own-face extension. No request body is required. Uses the same stop implementati
2277
2283
  summary: "Compact Session (Extension)",
2278
2284
  description: `Request session context compaction and retrieve an operation receipt.
2279
2285
 
2280
- 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.`,
2286
+ 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.`,
2281
2287
  http: "POST",
2282
2288
  path: "/agent/v1/sessions/{session_id}/compact",
2283
2289
  streaming: "no",
@@ -2333,7 +2339,7 @@ Available only on /agent/v1. Returns { type: session_compaction, id, status, rea
2333
2339
  summary: "List Session Compactions (Extension)",
2334
2340
  description: `Read session compaction history and summaries.
2335
2341
 
2336
- 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.`,
2342
+ 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.`,
2337
2343
  http: "GET",
2338
2344
  path: "/agent/v1/sessions/{session_id}/compactions",
2339
2345
  streaming: "no",
@@ -4511,6 +4517,177 @@ file at the root of that directory.`
4511
4517
  fields: []
4512
4518
  }
4513
4519
  },
4520
+ {
4521
+ resource: "automation.humanTasks",
4522
+ method: "list",
4523
+ summary: "List human tasks",
4524
+ description: "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.",
4525
+ http: "GET",
4526
+ path: "/automation/v1/human-tasks",
4527
+ streaming: "no",
4528
+ pagination: true,
4529
+ pathParams: [],
4530
+ query: [
4531
+ {
4532
+ name: "limit",
4533
+ type: "integer",
4534
+ required: false,
4535
+ description: "Page size, 1–100, default 50."
4536
+ },
4537
+ {
4538
+ name: "cursor",
4539
+ type: "string",
4540
+ required: false,
4541
+ description: "The next_cursor of the previous page; omit for the first page."
4542
+ },
4543
+ {
4544
+ name: "status",
4545
+ type: "array",
4546
+ itemType: "string",
4547
+ enum: [
4548
+ "open",
4549
+ "completed",
4550
+ "expired",
4551
+ "cancelled"
4552
+ ],
4553
+ required: false,
4554
+ description: "Filter by status, comma-separated: open, completed, expired, cancelled. Defaults to open."
4555
+ },
4556
+ {
4557
+ name: "run_id",
4558
+ type: "string",
4559
+ required: false,
4560
+ description: "Only tasks opened by this run (run_)."
4561
+ },
4562
+ {
4563
+ name: "scope",
4564
+ type: "string",
4565
+ enum: [
4566
+ "assigned",
4567
+ "all"
4568
+ ],
4569
+ required: false,
4570
+ description: "assigned (default) lists only tasks assigned to the caller; all lists every task of the organization."
4571
+ }
4572
+ ]
4573
+ },
4574
+ {
4575
+ resource: "automation.humanTasks",
4576
+ method: "retrieve",
4577
+ summary: "Retrieve a human task",
4578
+ description: "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.",
4579
+ http: "GET",
4580
+ path: "/automation/v1/human-tasks/{id}",
4581
+ streaming: "no",
4582
+ pagination: false,
4583
+ pathParams: [
4584
+ {
4585
+ name: "id",
4586
+ sdkName: "id",
4587
+ description: "Human task ID (htask_), from the list or the run's waits."
4588
+ }
4589
+ ],
4590
+ query: []
4591
+ },
4592
+ {
4593
+ resource: "automation.humanTasks",
4594
+ method: "cancel",
4595
+ summary: "Cancel a human task",
4596
+ description: "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.",
4597
+ http: "POST",
4598
+ path: "/automation/v1/human-tasks/{id}/cancel",
4599
+ streaming: "no",
4600
+ pagination: false,
4601
+ pathParams: [
4602
+ {
4603
+ name: "id",
4604
+ sdkName: "id",
4605
+ description: "Human task ID (htask_)."
4606
+ }
4607
+ ],
4608
+ query: [],
4609
+ body: {
4610
+ required: false,
4611
+ fields: [
4612
+ {
4613
+ name: "reason",
4614
+ type: "string",
4615
+ required: false,
4616
+ description: "Optional cancellation reason, at most 500 characters."
4617
+ }
4618
+ ]
4619
+ }
4620
+ },
4621
+ {
4622
+ resource: "automation.humanTasks",
4623
+ method: "delegate",
4624
+ summary: "Delegate a human task",
4625
+ description: "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.",
4626
+ http: "POST",
4627
+ path: "/automation/v1/human-tasks/{id}/delegate",
4628
+ streaming: "no",
4629
+ pagination: false,
4630
+ pathParams: [
4631
+ {
4632
+ name: "id",
4633
+ sdkName: "id",
4634
+ description: "Human task ID (htask_)."
4635
+ }
4636
+ ],
4637
+ query: [],
4638
+ body: {
4639
+ required: true,
4640
+ fields: [
4641
+ {
4642
+ name: "to_user",
4643
+ type: "string",
4644
+ required: true,
4645
+ description: "User ID taking over; cannot already be an assignee, nor the initiator unless self-approval is allowed."
4646
+ }
4647
+ ]
4648
+ }
4649
+ },
4650
+ {
4651
+ resource: "automation.humanTasks",
4652
+ method: "respond",
4653
+ summary: "Respond to a human task",
4654
+ description: "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.",
4655
+ http: "POST",
4656
+ path: "/automation/v1/human-tasks/{id}/respond",
4657
+ streaming: "no",
4658
+ pagination: false,
4659
+ pathParams: [
4660
+ {
4661
+ name: "id",
4662
+ sdkName: "id",
4663
+ description: "Human task ID (htask_)."
4664
+ }
4665
+ ],
4666
+ query: [],
4667
+ body: {
4668
+ required: true,
4669
+ fields: [
4670
+ {
4671
+ name: "action_id",
4672
+ type: "string",
4673
+ required: true,
4674
+ description: "The chosen action ID from the task's actions, for example approve."
4675
+ },
4676
+ {
4677
+ name: "values",
4678
+ type: "object",
4679
+ required: false,
4680
+ description: "Any JSON object whose keys are strings and whose values are any JSON value."
4681
+ },
4682
+ {
4683
+ name: "comment",
4684
+ type: "string",
4685
+ required: false,
4686
+ description: "Comment of at most 4000 characters; required when the action has require_comment true."
4687
+ }
4688
+ ]
4689
+ }
4690
+ },
4514
4691
  {
4515
4692
  resource: "automation.resolve",
4516
4693
  method: "retrieve",
@@ -4691,7 +4868,7 @@ file at the root of that directory.`
4691
4868
  resource: "automation.runs",
4692
4869
  method: "create",
4693
4870
  summary: "Run a published target or execute draft source",
4694
- 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 7 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.',
4871
+ 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.',
4695
4872
  http: "POST",
4696
4873
  path: "/automation/v1/runs",
4697
4874
  streaming: "no",
@@ -6132,7 +6309,7 @@ file at the root of that directory.`
6132
6309
  resource: "automation.validate",
6133
6310
  method: "create",
6134
6311
  summary: "Validate a definition",
6135
- description: "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.",
6312
+ description: "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.",
6136
6313
  http: "POST",
6137
6314
  path: "/automation/v1/validate",
6138
6315
  streaming: "no",
@@ -6239,7 +6416,7 @@ file at the root of that directory.`
6239
6416
  resource: "automation.workflows",
6240
6417
  method: "create",
6241
6418
  summary: "Create a workflow",
6242
- description: '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 7 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.',
6419
+ 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. 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.',
6243
6420
  http: "POST",
6244
6421
  path: "/automation/v1/workflows",
6245
6422
  streaming: "no",
@@ -6309,7 +6486,7 @@ file at the root of that directory.`
6309
6486
  resource: "automation.workflows",
6310
6487
  method: "update",
6311
6488
  summary: "Update a workflow draft",
6312
- description: "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[].",
6489
+ description: "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.",
6313
6490
  http: "PATCH",
6314
6491
  path: "/automation/v1/workflows/{ns}/{name}",
6315
6492
  streaming: "no",
@@ -7222,6 +7399,220 @@ file at the root of that directory.`
7222
7399
  ]
7223
7400
  }
7224
7401
  },
7402
+ {
7403
+ resource: "canvas.canvases",
7404
+ method: "list",
7405
+ summary: "List canvases",
7406
+ description: "Discover canvases in the API key's organization and obtain ids for retrieval or editing. Results are ordered by updated_at from newest to oldest. limit is 1–100 and defaults to 50; omit cursor for the first page, then copy next_cursor into the next request until it is null. Deleted canvases are unavailable.",
7407
+ http: "GET",
7408
+ path: "/canvas/v1/canvases",
7409
+ streaming: "no",
7410
+ pagination: true,
7411
+ pathParams: [],
7412
+ query: [
7413
+ {
7414
+ name: "limit",
7415
+ type: "integer",
7416
+ required: false,
7417
+ description: "Maximum canvases to return per page, from 1 to 100; defaults to 50 when omitted."
7418
+ },
7419
+ {
7420
+ name: "cursor",
7421
+ type: "string",
7422
+ required: false,
7423
+ description: "Opaque next_cursor from the preceding list response; omit for the first page and stop when next_cursor is null."
7424
+ }
7425
+ ]
7426
+ },
7427
+ {
7428
+ resource: "canvas.canvases",
7429
+ method: "create",
7430
+ summary: "Create canvas",
7431
+ description: "Create a blank design canvas in the API key's organization before drawing with praxis.canvas.canvases.execute. Send an optional name of at most 200 characters; omitting name uses Untitled. Each successful call creates a new canvas and returns its id and viewer_url with HTTP 201; save the id for subsequent reads, edits and deletion.",
7432
+ http: "POST",
7433
+ path: "/canvas/v1/canvases",
7434
+ streaming: "no",
7435
+ pagination: false,
7436
+ pathParams: [],
7437
+ query: [],
7438
+ body: {
7439
+ required: false,
7440
+ fields: [
7441
+ {
7442
+ name: "name",
7443
+ type: "string",
7444
+ required: false,
7445
+ description: "Display name for the new canvas, at most 200 characters; omission uses Untitled."
7446
+ }
7447
+ ]
7448
+ }
7449
+ },
7450
+ {
7451
+ resource: "canvas.canvases",
7452
+ method: "delete",
7453
+ summary: "Delete canvas",
7454
+ description: "Permanently delete a canvas and its design content when it is no longer needed. Obtain canvas_id from create or list and confirm the target before calling; deletion cannot be undone. HTTP 200 confirms deletion with deleted=true. Subsequent access returns CANVAS_NOT_FOUND, as it does for a missing canvas or one outside the API key's organization.",
7455
+ http: "DELETE",
7456
+ path: "/canvas/v1/canvases/{canvas_id}",
7457
+ streaming: "no",
7458
+ pagination: false,
7459
+ pathParams: [
7460
+ {
7461
+ name: "canvas_id",
7462
+ sdkName: "canvas_id",
7463
+ 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."
7464
+ }
7465
+ ],
7466
+ query: []
7467
+ },
7468
+ {
7469
+ resource: "canvas.canvases",
7470
+ method: "retrieve",
7471
+ summary: "Retrieve canvas",
7472
+ description: "Inspect the current canvas before editing, like Pencil get_app_state. The response adds top-level node summaries in canvas order and reusable component ids to the canvas metadata. Use these ids in nodes.list, images.list or an execute script; use the returned version as expected_version to detect concurrent edits. Read full node content with nodes.list rather than guessing fields from these summaries.",
7473
+ http: "GET",
7474
+ path: "/canvas/v1/canvases/{canvas_id}",
7475
+ streaming: "no",
7476
+ pagination: false,
7477
+ pathParams: [
7478
+ {
7479
+ name: "canvas_id",
7480
+ sdkName: "canvas_id",
7481
+ 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."
7482
+ }
7483
+ ],
7484
+ query: []
7485
+ },
7486
+ {
7487
+ resource: "canvas.canvases.images",
7488
+ method: "list",
7489
+ summary: "Render canvas nodes",
7490
+ description: "Render 1–4 nodes to inspect the visual result of a design edit. Use ids from retrieve, execute.created or execute.screenshots; scale defaults to 1 and accepts 0.25–4, and png is the only supported format. Unlike Figma, images contains inline data:image/png;base64,... URLs, not hosted image URLs; a null entry means no image is available for that id. Use nodes.list for editable node content instead of pixels.",
7491
+ http: "GET",
7492
+ path: "/canvas/v1/canvases/{canvas_id}/images",
7493
+ streaming: "no",
7494
+ pagination: false,
7495
+ pathParams: [
7496
+ {
7497
+ name: "canvas_id",
7498
+ sdkName: "canvas_id",
7499
+ 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."
7500
+ }
7501
+ ],
7502
+ query: [
7503
+ {
7504
+ name: "ids",
7505
+ type: "string",
7506
+ required: true,
7507
+ description: "Comma-separated list of 1–4 node ids to render, from retrieve, execute.created or execute.screenshots."
7508
+ },
7509
+ {
7510
+ name: "scale",
7511
+ type: "number",
7512
+ required: false,
7513
+ description: "Output pixel scale relative to canvas dimensions, from 0.25 to 4 inclusive; defaults to 1 when omitted."
7514
+ },
7515
+ {
7516
+ name: "format",
7517
+ type: "string",
7518
+ enum: [
7519
+ "png"
7520
+ ],
7521
+ required: false,
7522
+ description: "Image encoding; png produces a PNG data URL and is the only supported value. Omit to use png."
7523
+ }
7524
+ ]
7525
+ },
7526
+ {
7527
+ resource: "canvas.canvases.nodes",
7528
+ method: "list",
7529
+ summary: "Read canvas nodes",
7530
+ description: "Read node documents for inspection before changing individual nodes. Supply 1–100 comma-separated node ids from retrieve or execute, or instance paths such as a/b. depth is an integer at least 0; omit it for complete subtrees. Each requested id maps to a document wrapper or null if absent. Unlike Figma, document contains a Pencil .pen 2.21 node, not a Figma node. For top-level summaries use canvases.retrieve; for pixels use images.list.",
7531
+ http: "GET",
7532
+ path: "/canvas/v1/canvases/{canvas_id}/nodes",
7533
+ streaming: "no",
7534
+ pagination: false,
7535
+ pathParams: [
7536
+ {
7537
+ name: "canvas_id",
7538
+ sdkName: "canvas_id",
7539
+ 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."
7540
+ }
7541
+ ],
7542
+ query: [
7543
+ {
7544
+ name: "ids",
7545
+ type: "string",
7546
+ required: true,
7547
+ description: "Comma-separated list of 1–100 node ids from retrieve or execute, or instance paths such as a/b; missing ids map to null."
7548
+ },
7549
+ {
7550
+ name: "depth",
7551
+ type: "integer",
7552
+ required: false,
7553
+ description: "Maximum child depth below each requested node, as an integer at least 0; 0 returns the node without descendants, and omission returns the complete subtree."
7554
+ }
7555
+ ]
7556
+ },
7557
+ {
7558
+ resource: "canvas.canvases",
7559
+ method: "execute",
7560
+ summary: "Execute canvas script",
7561
+ description: `Draw or edit a canvas atomically with a synchronous Pencil execute script. First create a canvas with praxis.canvas.canvases.create and use its id as canvas_id; inspect an existing canvas with retrieve before modifying it. Send exactly one of script (new source) or edit_id (a failed script to patch using edits). Unlike Figma REST, :execute writes design content; nodes use Pencil .pen schema 2.21 (frame/group/rectangle/ellipse/polygon/path/text/icon/ref/note), not Figma node fields.
7562
+
7563
+ The root variable is document. Synchronous functions are Insert / Copy / Update / Replace / Move / Delete / SetVariables / Get / GetVariables / FindEmptySpace / Print / TakeScreenshot; globals persist for the next call. A first frame needs only this body.script:
7564
+
7565
+ \`\`\`js
7566
+ 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)
7567
+ \`\`\`
7568
+
7569
+ 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 [Pencil node schema](https://docs.pencil.dev/core-concepts/pen-files) for node content.
7570
+
7571
+ 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.
7572
+ `,
7573
+ http: "POST",
7574
+ path: "/canvas/v1/canvases/{canvas_id}:execute",
7575
+ streaming: "no",
7576
+ pagination: false,
7577
+ pathParams: [
7578
+ {
7579
+ name: "canvas_id",
7580
+ sdkName: "canvas_id",
7581
+ 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."
7582
+ }
7583
+ ],
7584
+ query: [],
7585
+ body: {
7586
+ required: true,
7587
+ fields: [
7588
+ {
7589
+ name: "script",
7590
+ type: "string",
7591
+ required: false,
7592
+ description: "New synchronous Pencil execute source using document as the root; provide this or edit_id, never both. See the operation's first-frame example."
7593
+ },
7594
+ {
7595
+ name: "edit_id",
7596
+ type: "string",
7597
+ required: false,
7598
+ description: "Saved failed-script identifier from error.details.edit_id; use with edits instead of script within ten minutes of the failure."
7599
+ },
7600
+ {
7601
+ name: "edits",
7602
+ type: "array",
7603
+ itemType: "object",
7604
+ required: false,
7605
+ description: "Text replacements applied to the source identified by edit_id before rerunning; use error line, column or rejection to choose the correction."
7606
+ },
7607
+ {
7608
+ name: "expected_version",
7609
+ type: "string",
7610
+ required: false,
7611
+ description: "Revision from retrieve, nodes.list or the previous execute response; omit for an unguarded write. A mismatch returns 409 REVISION_CONFLICT with details.version."
7612
+ }
7613
+ ]
7614
+ }
7615
+ },
7225
7616
  {
7226
7617
  resource: "database.databases",
7227
7618
  method: "list",
@@ -8234,7 +8625,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
8234
8625
  resource: "file.files",
8235
8626
  method: "create",
8236
8627
  summary: "Upload file",
8237
- description: '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, assistants 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–2592000), or praxis[expires_in_seconds] (3600–7776000), never both. Without expiry, the file persists until deleted.',
8628
+ description: '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.',
8238
8629
  http: "POST",
8239
8630
  path: "/file/v1/files",
8240
8631
  streaming: "no",
@@ -8256,23 +8647,16 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
8256
8647
  type: "string",
8257
8648
  enum: [
8258
8649
  "user_data",
8259
- "assistants",
8260
8650
  "vision"
8261
8651
  ],
8262
8652
  required: true,
8263
- description: "Purpose label stored with the file: user_data, assistants or vision. The vision purpose accepts only PNG, JPEG, GIF and WebP images. Conversation image references require user_data."
8653
+ description: "Purpose label stored with the file: user_data or vision. The vision purpose accepts only PNG, JPEG, GIF and WebP images. Conversation image references require user_data."
8264
8654
  },
8265
8655
  {
8266
8656
  name: "expires_after",
8267
8657
  type: "object",
8268
8658
  required: false,
8269
8659
  description: "Optional expiry relative to created_at. Files without an expiry persist until deleted."
8270
- },
8271
- {
8272
- name: "praxis",
8273
- type: "object",
8274
- required: false,
8275
- description: "Own-face extensions. Use at most one expiry setting."
8276
8660
  }
8277
8661
  ]
8278
8662
  }
@@ -8335,7 +8719,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
8335
8719
  resource: "file.uploads",
8336
8720
  method: "create",
8337
8721
  summary: "Create an upload",
8338
- description: "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, assistants 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.",
8722
+ description: "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.",
8339
8723
  http: "POST",
8340
8724
  path: "/file/v1/uploads",
8341
8725
  streaming: "no",
@@ -8368,11 +8752,10 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
8368
8752
  type: "string",
8369
8753
  enum: [
8370
8754
  "user_data",
8371
- "assistants",
8372
8755
  "vision"
8373
8756
  ],
8374
8757
  required: true,
8375
- description: "Use user_data for conversation attachments, assistants for assistant files, or vision for PNG, JPEG, GIF and WebP images."
8758
+ description: "Use user_data for conversation attachments, or vision for PNG, JPEG, GIF and WebP images."
8376
8759
  },
8377
8760
  {
8378
8761
  name: "expires_after",
@@ -9552,7 +9935,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
9552
9935
  name: "overwrite",
9553
9936
  type: "boolean",
9554
9937
  required: false,
9555
- description: "Allow replacing an existing public_id, preserving its asset_id and increasing its version. False returns the existing resource without replacing it; defaults to true."
9938
+ description: "Allow replacing an existing public_id, preserving its asset_id and increasing its version. Only the latest version is deliverable; old version URLs return 404. Create a new public_id to retain old deliveries. False returns the existing resource without replacing it; defaults to true."
9556
9939
  },
9557
9940
  {
9558
9941
  name: "tags",
@@ -9611,7 +9994,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
9611
9994
  name: "file_id",
9612
9995
  type: "string",
9613
9996
  required: true,
9614
- description: "File ID to copy into this library; passed as the upload source instead of file bytes."
9997
+ description: "File ID to copy into this library; passed as the upload source instead of file bytes. This creates an independent public copy readable without authentication. Deleting the source File does not delete this asset; do not import confidential content."
9615
9998
  },
9616
9999
  {
9617
10000
  name: "public_id",
@@ -9665,7 +10048,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
9665
10048
  name: "overwrite",
9666
10049
  type: "boolean",
9667
10050
  required: false,
9668
- description: "Allow replacing an existing public_id, preserving its asset_id and increasing its version. False returns the existing resource without replacing it; defaults to true."
10051
+ description: "Allow replacing an existing public_id, preserving its asset_id and increasing its version. Only the latest version is deliverable; old version URLs return 404. Create a new public_id to retain old deliveries. False returns the existing resource without replacing it; defaults to true."
9669
10052
  },
9670
10053
  {
9671
10054
  name: "tags",
@@ -10182,7 +10565,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
10182
10565
  name: "expression",
10183
10566
  type: "string",
10184
10567
  required: false,
10185
- description: "Asset filter expression supporting field comparisons, AND, OR, NOT, parentheses and suffix wildcards. An empty expression matches all assets."
10568
+ description: 'Asset filter expression supporting field comparisons, AND, OR, NOT, parentheses and suffix wildcards. An empty expression matches all assets. For business metadata use context.sku=KETTLE-RED AND context.revision=2; request with_field: ["context"] to include context.'
10186
10569
  },
10187
10570
  {
10188
10571
  name: "sort_by",
@@ -10328,6 +10711,70 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
10328
10711
  ]
10329
10712
  }
10330
10713
  },
10714
+ {
10715
+ resource: "meta.docs",
10716
+ method: "search",
10717
+ summary: "Search platform documentation",
10718
+ description: "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.",
10719
+ http: "GET",
10720
+ path: "/meta/v1/docs/search",
10721
+ streaming: "no",
10722
+ pagination: false,
10723
+ pathParams: [],
10724
+ query: [
10725
+ {
10726
+ name: "q",
10727
+ type: "string",
10728
+ required: true,
10729
+ description: "Keywords describing the syntax or guide needed, for example export or workflow."
10730
+ },
10731
+ {
10732
+ name: "limit",
10733
+ type: "integer",
10734
+ required: false,
10735
+ description: "Maximum number of matching pages returned; integer 1–50, default 20."
10736
+ },
10737
+ {
10738
+ name: "lang",
10739
+ type: "string",
10740
+ enum: [
10741
+ "zh",
10742
+ "en"
10743
+ ],
10744
+ required: false,
10745
+ description: "Documentation language: zh for Chinese (default), en for English."
10746
+ }
10747
+ ]
10748
+ },
10749
+ {
10750
+ resource: "meta.docs",
10751
+ method: "retrieve",
10752
+ summary: "Read documentation Markdown",
10753
+ description: "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.",
10754
+ http: "GET",
10755
+ path: "/meta/v1/docs/{path}",
10756
+ streaming: "no",
10757
+ pagination: false,
10758
+ pathParams: [
10759
+ {
10760
+ name: "path",
10761
+ sdkName: "path",
10762
+ description: "Slash-separated documentation path from docs.search; optionally append #heading-id to select a section."
10763
+ }
10764
+ ],
10765
+ query: [
10766
+ {
10767
+ name: "lang",
10768
+ type: "string",
10769
+ enum: [
10770
+ "zh",
10771
+ "en"
10772
+ ],
10773
+ required: false,
10774
+ description: "Documentation language: zh for Chinese (default), en for English."
10775
+ }
10776
+ ]
10777
+ },
10331
10778
  {
10332
10779
  resource: "meta.health",
10333
10780
  method: "retrieve",
@@ -18931,6 +19378,8 @@ var fileCancelUpload = (options) => (options.client ?? client).post({
18931
19378
  var healthCheck = (options) => (options?.client ?? client).get({ url: "/meta/v1/health", ...options });
18932
19379
  var metaMethodsSearch = (options) => (options?.client ?? client).get({ url: "/meta/v1/methods", ...options });
18933
19380
  var metaMethodsRetrieve = (options) => (options.client ?? client).get({ url: "/meta/v1/methods/{name}", ...options });
19381
+ var metaDocsRetrieve = (options) => (options.client ?? client).get({ url: "/meta/v1/docs/{path}", ...options });
19382
+ var metaDocsSearch = (options) => (options.client ?? client).get({ url: "/meta/v1/docs/search", ...options });
18934
19383
  var listModels = (options) => (options?.client ?? client).get({
18935
19384
  querySerializer: { parameters: {
18936
19385
  supported_api: { array: { explode: false } },
@@ -21707,6 +22156,155 @@ var automationHooksReceive = (options) => (options.client ?? client).post({
21707
22156
  ...options.headers
21708
22157
  }
21709
22158
  });
22159
+ var automationHumanTasksList = (options) => (options?.client ?? client).get({
22160
+ querySerializer: { parameters: { status: { array: { explode: false } } } },
22161
+ security: [{
22162
+ key: "BearerAuth",
22163
+ scheme: "bearer",
22164
+ type: "http"
22165
+ }, {
22166
+ key: "ApiKeyAuth",
22167
+ name: "X-API-Key",
22168
+ type: "apiKey"
22169
+ }],
22170
+ url: "/automation/v1/human-tasks",
22171
+ ...options
22172
+ });
22173
+ var automationHumanTasksGet = (options) => (options.client ?? client).get({
22174
+ security: [{
22175
+ key: "BearerAuth",
22176
+ scheme: "bearer",
22177
+ type: "http"
22178
+ }, {
22179
+ key: "ApiKeyAuth",
22180
+ name: "X-API-Key",
22181
+ type: "apiKey"
22182
+ }],
22183
+ url: "/automation/v1/human-tasks/{id}",
22184
+ ...options
22185
+ });
22186
+ var automationHumanTasksRespond = (options) => (options.client ?? client).post({
22187
+ security: [{
22188
+ key: "BearerAuth",
22189
+ scheme: "bearer",
22190
+ type: "http"
22191
+ }, {
22192
+ key: "ApiKeyAuth",
22193
+ name: "X-API-Key",
22194
+ type: "apiKey"
22195
+ }],
22196
+ url: "/automation/v1/human-tasks/{id}/respond",
22197
+ ...options,
22198
+ headers: {
22199
+ "Content-Type": "application/json",
22200
+ ...options.headers
22201
+ }
22202
+ });
22203
+ var automationHumanTasksCancel = (options) => (options.client ?? client).post({
22204
+ security: [{
22205
+ key: "BearerAuth",
22206
+ scheme: "bearer",
22207
+ type: "http"
22208
+ }, {
22209
+ key: "ApiKeyAuth",
22210
+ name: "X-API-Key",
22211
+ type: "apiKey"
22212
+ }],
22213
+ url: "/automation/v1/human-tasks/{id}/cancel",
22214
+ ...options,
22215
+ headers: {
22216
+ "Content-Type": "application/json",
22217
+ ...options.headers
22218
+ }
22219
+ });
22220
+ var automationHumanTasksDelegate = (options) => (options.client ?? client).post({
22221
+ security: [{
22222
+ key: "BearerAuth",
22223
+ scheme: "bearer",
22224
+ type: "http"
22225
+ }, {
22226
+ key: "ApiKeyAuth",
22227
+ name: "X-API-Key",
22228
+ type: "apiKey"
22229
+ }],
22230
+ url: "/automation/v1/human-tasks/{id}/delegate",
22231
+ ...options,
22232
+ headers: {
22233
+ "Content-Type": "application/json",
22234
+ ...options.headers
22235
+ }
22236
+ });
22237
+ var canvasListCanvases = (options) => (options?.client ?? client).get({
22238
+ security: [{
22239
+ key: "canvas-bearerAuth",
22240
+ scheme: "bearer",
22241
+ type: "http"
22242
+ }],
22243
+ url: "/canvas/v1/canvases",
22244
+ ...options
22245
+ });
22246
+ var canvasCreateCanvas = (options) => (options?.client ?? client).post({
22247
+ security: [{
22248
+ key: "canvas-bearerAuth",
22249
+ scheme: "bearer",
22250
+ type: "http"
22251
+ }],
22252
+ url: "/canvas/v1/canvases",
22253
+ ...options,
22254
+ headers: {
22255
+ "Content-Type": "application/json",
22256
+ ...options?.headers
22257
+ }
22258
+ });
22259
+ var canvasDeleteCanvas = (options) => (options.client ?? client).delete({
22260
+ security: [{
22261
+ key: "canvas-bearerAuth",
22262
+ scheme: "bearer",
22263
+ type: "http"
22264
+ }],
22265
+ url: "/canvas/v1/canvases/{canvas_id}",
22266
+ ...options
22267
+ });
22268
+ var canvasRetrieveCanvas = (options) => (options.client ?? client).get({
22269
+ security: [{
22270
+ key: "canvas-bearerAuth",
22271
+ scheme: "bearer",
22272
+ type: "http"
22273
+ }],
22274
+ url: "/canvas/v1/canvases/{canvas_id}",
22275
+ ...options
22276
+ });
22277
+ var canvasListNodes = (options) => (options.client ?? client).get({
22278
+ security: [{
22279
+ key: "canvas-bearerAuth",
22280
+ scheme: "bearer",
22281
+ type: "http"
22282
+ }],
22283
+ url: "/canvas/v1/canvases/{canvas_id}/nodes",
22284
+ ...options
22285
+ });
22286
+ var canvasListImages = (options) => (options.client ?? client).get({
22287
+ security: [{
22288
+ key: "canvas-bearerAuth",
22289
+ scheme: "bearer",
22290
+ type: "http"
22291
+ }],
22292
+ url: "/canvas/v1/canvases/{canvas_id}/images",
22293
+ ...options
22294
+ });
22295
+ var canvasExecute = (options) => (options.client ?? client).post({
22296
+ security: [{
22297
+ key: "canvas-bearerAuth",
22298
+ scheme: "bearer",
22299
+ type: "http"
22300
+ }],
22301
+ url: "/canvas/v1/canvases/{canvas_id}:execute",
22302
+ ...options,
22303
+ headers: {
22304
+ "Content-Type": "application/json",
22305
+ ...options.headers
22306
+ }
22307
+ });
21710
22308
  var databaseListDatabases = (options) => (options?.client ?? client).get({
21711
22309
  security: [{
21712
22310
  key: "database-bearerAuth",
@@ -24177,6 +24775,13 @@ function createAutomation(transport) {
24177
24775
  hooks: {
24178
24776
  send: bind(transport, automationHooksReceive)
24179
24777
  },
24778
+ humanTasks: {
24779
+ cancel: bind(transport, automationHumanTasksCancel),
24780
+ delegate: bind(transport, automationHumanTasksDelegate),
24781
+ list: bindPage(transport, automationHumanTasksList),
24782
+ respond: bind(transport, automationHumanTasksRespond),
24783
+ retrieve: bind(transport, automationHumanTasksGet)
24784
+ },
24180
24785
  resolve: {
24181
24786
  retrieve: bind(transport, automationResolveResolve)
24182
24787
  },
@@ -24306,6 +24911,23 @@ function createBrowser(transport) {
24306
24911
  }
24307
24912
  };
24308
24913
  }
24914
+ function createCanvas(transport) {
24915
+ return {
24916
+ canvases: {
24917
+ create: bind(transport, canvasCreateCanvas),
24918
+ delete: bind(transport, canvasDeleteCanvas),
24919
+ execute: bind(transport, canvasExecute),
24920
+ images: {
24921
+ list: bind(transport, canvasListImages)
24922
+ },
24923
+ list: bindPage(transport, canvasListCanvases),
24924
+ nodes: {
24925
+ list: bind(transport, canvasListNodes)
24926
+ },
24927
+ retrieve: bind(transport, canvasRetrieveCanvas)
24928
+ }
24929
+ };
24930
+ }
24309
24931
  function createDatabase(transport) {
24310
24932
  return {
24311
24933
  databases: {
@@ -24467,6 +25089,10 @@ function createMedia(transport) {
24467
25089
  }
24468
25090
  function createMeta(transport) {
24469
25091
  return {
25092
+ docs: {
25093
+ retrieve: bind(transport, metaDocsRetrieve),
25094
+ search: bind(transport, metaDocsSearch)
25095
+ },
24470
25096
  health: {
24471
25097
  retrieve: bind(transport, healthCheck)
24472
25098
  },
@@ -24791,6 +25417,7 @@ var resourceFactories = {
24791
25417
  application: createApplication,
24792
25418
  automation: createAutomation,
24793
25419
  browser: createBrowser,
25420
+ canvas: createCanvas,
24794
25421
  database: createDatabase,
24795
25422
  file: createFile,
24796
25423
  knowledge: createKnowledge,
@@ -24958,7 +25585,7 @@ function assertKnownOptions(options) {
24958
25585
  class Transport {
24959
25586
  config;
24960
25587
  constructor(options) {
24961
- this.config = { timeoutMs: 60000, maxRetries: 2, fetch: globalThis.fetch, ...options };
25588
+ this.config = { timeoutMs: 600000, maxRetries: 2, fetch: globalThis.fetch, ...options };
24962
25589
  this.validate(this.config.timeoutMs, this.config.maxRetries);
24963
25590
  }
24964
25591
  validate(timeout, retries) {
@@ -26430,8 +27057,9 @@ function jwtFetch(fetchImpl, token) {
26430
27057
  function credentials(config, vars, ports) {
26431
27058
  const path = ports.path ?? tokenPath(config.env);
26432
27059
  const store = ports.store ?? createTokenStore(config.env, path, ports.secretStore);
27060
+ const source = credentialSource(vars);
26433
27061
  const apiKey = vars.PRAXIS_API_KEY;
26434
- const machineToken = credentialSource(vars) === "machine-token" ? vars.PRAXIS_API_TOKEN : undefined;
27062
+ const machineToken = source === "machine-token" ? vars.PRAXIS_API_TOKEN : undefined;
26435
27063
  const remember = ports.remember ?? (() => {});
26436
27064
  if (apiKey)
26437
27065
  remember(apiKey);
@@ -26493,6 +27121,7 @@ function credentials(config, vars, ports) {
26493
27121
  }
26494
27122
  }
26495
27123
  return {
27124
+ source,
26496
27125
  get,
26497
27126
  requireLogin,
26498
27127
  async client(org) {
@@ -26548,13 +27177,13 @@ function skillDocument(commands) {
26548
27177
  "## General rules",
26549
27178
  "",
26550
27179
  "- Select the environment only with `PRAXIS_ENV`; there is no `--env` option. The dev package defaults to develop.",
26551
- "- Authenticate with `PRAXIS_API_KEY`, `PRAXIS_API_TOKEN` (a machine token, sent in the Authorization header; computers have it set) or `praxis login`, in that order. API keys and machine tokens determine the organization; login sessions can use `--org <organization_id>`. `PRAXIS_API_URL` overrides the API base and must be an https deepraxis.com URL.",
27180
+ "- Authenticate with `PRAXIS_API_KEY`, `PRAXIS_API_TOKEN` (a machine token, sent in the Authorization header; computers have it set) or `praxis login`, in that order. Login saves the session even when an environment credential takes precedence; unset the named variable in its warning to use the saved login. API keys and machine tokens determine the organization; login sessions can use `--org <organization_id>`. `PRAXIS_API_URL` overrides the API base and must be an https deepraxis.com URL.",
26552
27181
  "- AI mode is enabled automatically in supported agent environments. Use `--format agent` to select it explicitly.",
26553
27182
  "- Use `--json` for the complete JSON response without presentation truncation. Successful JSON output goes to stdout; errors go to stderr.",
26554
27183
  "- Supply bodies with `--data JSON`, `--data @file.json`, or `--data -` for stdin. Scalar field options override matching JSON fields. Structured fields require `--data`.",
26555
27184
  "- Deletion requires `--yes` in AI mode. Confirm the intended resource before using it.",
26556
27185
  "- Use `--limit N` to limit a server page for SDK-paginated commands. Other lists apply it only to displayed rows; `--param-limit` still sends the API parameter when available. `--all` follows supported pagination and cannot be combined with `--limit`.",
26557
- "- Error JSON has an `error` object: `code` identifies the failure, `message` describes it, `hint` suggests recovery, `env` identifies the environment, `command` identifies the command, `status` is the HTTP status, and `request_id` correlates diagnostics. Unavailable fields are null. Exit codes: 0 success, 1 runtime/API error, 2 usage error.",
27186
+ "- Error JSON has an `error` object: `code` identifies the failure, `message` describes it, `hint` suggests recovery, `env` identifies the environment, `command` identifies the command, `status` is the HTTP status, and `request_id` correlates diagnostics. Authentication failures also include `credential_source` (api-key, machine-token, or login); follow the source-specific hint. Unavailable fields are null. Exit codes: 0 success, 1 runtime/API error, 2 usage error.",
26558
27187
  "- Append `--help` to a command for its optional parameters. Required scalar body options below can also be supplied as fields in `--data`.",
26559
27188
  "- Two layers: top-level commands (`login`, `org`, `skill`, …) are workflows and session commands; every API operation is under `praxis api <domain> …`. `praxis api <METHOD> <path>` sends a raw request (the method is uppercase).",
26560
27189
  "",
@@ -26685,7 +27314,12 @@ Enter code: ${code.user_code}` });
26685
27314
  const location = await (ports.store ?? createTokenStore(config.env, path)).save(toStored(flow.tokens, ports.now()));
26686
27315
  if (location !== "keychain")
26687
27316
  ports.emit({ kind: "message", channel: "stderr", text: "stored in a file (no system keychain available)" });
27317
+ const shadowedBy = ports.source === "api-key" ? "PRAXIS_API_KEY" : ports.source === "machine-token" ? "PRAXIS_API_TOKEN" : undefined;
26688
27318
  ports.emit({ kind: "message", text: `Logged in (${config.env}).` });
27319
+ if (shadowedBy)
27320
+ ports.emit({ kind: "message", channel: "stderr", text: `Note: ${shadowedBy} is set and takes precedence over this login. Unset it (unset ${shadowedBy}) to use the login.` });
27321
+ if (ports.json)
27322
+ ports.emit({ kind: "object", data: { env: config.env, ...shadowedBy ? { shadowed_by: shadowedBy } : {} } });
26689
27323
  }
26690
27324
  async function whoami(auth, env, org) {
26691
27325
  const credential = await auth.get(org);
@@ -27487,7 +28121,7 @@ ${usage ? `usage: ${JSON.stringify(usage)}
27487
28121
 
27488
28122
  // src/output/render.ts
27489
28123
  function errorJSON(result, ctx) {
27490
- 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 } }) + `
28124
+ 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 } : {} } }) + `
27491
28125
  `;
27492
28126
  }
27493
28127
  function render(result, ctx) {
@@ -27628,6 +28262,16 @@ var humanize = (code) => {
27628
28262
  const words = code.toLowerCase().split("_").filter(Boolean).join(" ");
27629
28263
  return words.charAt(0).toUpperCase() + words.slice(1);
27630
28264
  };
28265
+ function authHint(source) {
28266
+ switch (source) {
28267
+ case "api-key":
28268
+ return "The API key from PRAXIS_API_KEY was rejected; check or replace it, or unset it to use `praxis login`.";
28269
+ case "machine-token":
28270
+ return "The machine token from PRAXIS_API_TOKEN was rejected (it may have expired); unset it to use `praxis login`, or refresh it.";
28271
+ case "login":
28272
+ return "Run `praxis login` or set PRAXIS_API_KEY.";
28273
+ }
28274
+ }
27631
28275
  function errorInput(error, ctx) {
27632
28276
  const sdk = error instanceof PraxisError ? error : undefined;
27633
28277
  const raw = record(sdk?.raw), nested = record(raw.error);
@@ -27642,11 +28286,13 @@ function errorInput(error, ctx) {
27642
28286
  if (stripped)
27643
28287
  message = `${humanize(code)}${message ? `: ${message}` : ""}`;
27644
28288
  const status = sdk?.status, request_id = sdk?.requestId;
28289
+ const authFailure = status === 401 || ["NOT_LOGGED_IN", "UNAUTHENTICATED", "TOKEN_REVOKED", "LOGIN_FAILED"].includes(code);
28290
+ const source = ctx.credentialSource ?? "login";
27645
28291
  let hint = genericHint;
27646
28292
  if (error instanceof UsageError)
27647
28293
  hint = error.hint;
27648
- else if (status === 401 || ["NOT_LOGGED_IN", "UNAUTHENTICATED", "TOKEN_REVOKED", "LOGIN_FAILED"].includes(code))
27649
- hint = "Run `praxis login` or set PRAXIS_API_KEY.";
28294
+ else if (authFailure)
28295
+ hint = authHint(source);
27650
28296
  else if (status === 404)
27651
28297
  hint = ctx.listCommand ? `Check the id; list existing ones with \`${ctx.listCommand}\`` : "Check the id.";
27652
28298
  else if (status === 403)
@@ -27655,7 +28301,7 @@ function errorInput(error, ctx) {
27655
28301
  hint = "Rate limited; retry later.";
27656
28302
  else if (status !== undefined && status >= 500)
27657
28303
  hint = `Server error; retry later.${request_id ? ` Request id: ${request_id}.` : ""}`;
27658
- return { kind: "error", code, message, hint, env: ctx.env, ...status !== undefined ? { status } : {}, ...request_id ? { request_id } : {} };
28304
+ return { kind: "error", code, message, hint, env: ctx.env, ...authFailure ? { credential_source: source } : {}, ...status !== undefined ? { status } : {}, ...request_id ? { request_id } : {} };
27659
28305
  }
27660
28306
 
27661
28307
  // src/output/progress.ts
@@ -27685,7 +28331,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
27685
28331
  }
27686
28332
 
27687
28333
  // src/main.ts
27688
- var version = "0.2.0-dev.b71d0f4";
28334
+ var version = "0.2.0-dev.b9bc446";
27689
28335
  var commands = commandTree(operations);
27690
28336
  var manual = [...workflows.map((w) => w.words), [API_WORD]];
27691
28337
  function route(argv) {
@@ -27880,6 +28526,7 @@ Examples:
27880
28526
  const auth = credentials(config, ports.env, { fetch: wireFetch, now: ports.now, path, store, remember: (s) => {
27881
28527
  secrets.push(s);
27882
28528
  } });
28529
+ ctx.credentialSource = auth.source;
27883
28530
  const org = flags.org;
27884
28531
  const confirm = (method) => confirmOperation(method, { yes: Boolean(flags.yes), noInput: Boolean(flags["no-input"]) || ctx.mode === "agent", stdinIsTTY: ports.stdinIsTTY, ask: async () => {
27885
28532
  stopProgress();
@@ -27946,7 +28593,8 @@ Examples:
27946
28593
  case "login":
27947
28594
  if (flags["no-input"] || quiet)
27948
28595
  throw new UsageError("login requires displaying a device code", "Remove --no-input / --quiet or set PRAXIS_API_KEY for scripts.");
27949
- await login(config, path, { ...ports, store, fetch: wireFetch, emit, remember: (s) => secrets.push(s) });
28596
+ ctx.credentialSource = "login";
28597
+ await login(config, path, { ...ports, source: auth.source, json: ctx.mode === "json", store, fetch: wireFetch, emit, remember: (s) => secrets.push(s) });
27950
28598
  break;
27951
28599
  case "logout":
27952
28600
  emit({ kind: "message", text: await store.delete() ? "Logged out." : "Not logged in." });