@deepraxis/cli 0.2.0-dev.4a17623 → 0.2.0-dev.661a857

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/COMMANDS.md +16 -2
  2. package/dist/praxis.js +730 -76
  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",
@@ -3614,7 +3620,7 @@ file at the root of that directory.`
3614
3620
  resource: "application.workers.grants",
3615
3621
  method: "create",
3616
3622
  summary: "Create grant",
3617
- description: "Let this Worker's platform token access one of your databases, folders or knowledge bases.",
3623
+ description: "Record access to an organization-owned database or knowledge base, all organization files (files, id *), or models (models, id *, read only). Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).",
3618
3624
  http: "POST",
3619
3625
  path: "/application/v1/workers/{worker_id}/grants",
3620
3626
  streaming: "no",
@@ -3634,7 +3640,13 @@ file at the root of that directory.`
3634
3640
  name: "resource",
3635
3641
  type: "object",
3636
3642
  required: true,
3637
- description: "Resource to grant."
3643
+ description: "Resource to grant. Each (type, id) may be granted once per Worker; duplicates return GRANT_CONFLICT (409)."
3644
+ },
3645
+ {
3646
+ name: "alias",
3647
+ type: "string",
3648
+ required: false,
3649
+ description: "Optional name, unique within this Worker. Available for reuse after the grant is deleted."
3638
3650
  },
3639
3651
  {
3640
3652
  name: "access",
@@ -3644,7 +3656,7 @@ file at the root of that directory.`
3644
3656
  "read_write"
3645
3657
  ],
3646
3658
  required: true,
3647
- description: "Access level."
3659
+ description: "Access level; models accepts read only."
3648
3660
  }
3649
3661
  ]
3650
3662
  }
@@ -3926,7 +3938,7 @@ file at the root of that directory.`
3926
3938
  resource: "automation.actions",
3927
3939
  method: "list",
3928
3940
  summary: "List actions",
3929
- description: "Discover callable Actions and their ns/name references without executing them. Combine each returned namespace and name as ns/name; Action calls use the current revision and do not accept @version or @tag. Filter by name or description; results include seven-day statistics and revision summaries without implementation source. Archived actions are excluded by default.",
3941
+ description: 'Discover callable Actions and their ns/name references without executing them. Combine each returned namespace and name as ns/name; Action calls use the current revision and do not accept @version or @tag. Filter by name or description; results include seven-day statistics and revision summaries without implementation source. Archived actions are excluded by default. List items carry no input contract: get the action and read current_revision.input_schema. Call it with call("ns/name", input) in a script or call: ns/name with with: in a workflow.',
3930
3942
  http: "GET",
3931
3943
  path: "/automation/v1/actions",
3932
3944
  streaming: "no",
@@ -4095,7 +4107,7 @@ file at the root of that directory.`
4095
4107
  resource: "automation.actions",
4096
4108
  method: "retrieve",
4097
4109
  summary: "Get an Action with its current input and output JSON Schemas",
4098
- description: 'Read the Action and its full current implementation, with input and output JSON Schemas at current_revision.input_schema and current_revision.output_schema. To read a built-in Action, use ns=praxis and name=<bare name>, for example name=ocr; invoke it in a script with call("ocr", input). The response ETag is the current revision ID for conditional updates.',
4110
+ description: 'Read the Action and its full current implementation, with input and output JSON Schemas at current_revision.input_schema and current_revision.output_schema. To read a built-in Action, use ns=praxis and name=<bare name>, for example name=ocr; invoke it in a script with call("ocr", input) or in a workflow step with call: ocr and with:. Input that breaks the contract returns INPUT_INVALID, with the fields in errors[]. The response ETag is the current revision ID for conditional updates.',
4099
4111
  http: "GET",
4100
4112
  path: "/automation/v1/actions/{ns}/{name}",
4101
4113
  streaming: "no",
@@ -4511,6 +4523,177 @@ file at the root of that directory.`
4511
4523
  fields: []
4512
4524
  }
4513
4525
  },
4526
+ {
4527
+ resource: "automation.humanTasks",
4528
+ method: "list",
4529
+ summary: "List human tasks",
4530
+ 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.",
4531
+ http: "GET",
4532
+ path: "/automation/v1/human-tasks",
4533
+ streaming: "no",
4534
+ pagination: true,
4535
+ pathParams: [],
4536
+ query: [
4537
+ {
4538
+ name: "limit",
4539
+ type: "integer",
4540
+ required: false,
4541
+ description: "Page size, 1–100, default 50."
4542
+ },
4543
+ {
4544
+ name: "cursor",
4545
+ type: "string",
4546
+ required: false,
4547
+ description: "The next_cursor of the previous page; omit for the first page."
4548
+ },
4549
+ {
4550
+ name: "status",
4551
+ type: "array",
4552
+ itemType: "string",
4553
+ enum: [
4554
+ "open",
4555
+ "completed",
4556
+ "expired",
4557
+ "cancelled"
4558
+ ],
4559
+ required: false,
4560
+ description: "Filter by status, comma-separated: open, completed, expired, cancelled. Defaults to open."
4561
+ },
4562
+ {
4563
+ name: "run_id",
4564
+ type: "string",
4565
+ required: false,
4566
+ description: "Only tasks opened by this run (run_)."
4567
+ },
4568
+ {
4569
+ name: "scope",
4570
+ type: "string",
4571
+ enum: [
4572
+ "assigned",
4573
+ "all"
4574
+ ],
4575
+ required: false,
4576
+ description: "assigned (default) lists only tasks assigned to the caller; all lists every task of the organization."
4577
+ }
4578
+ ]
4579
+ },
4580
+ {
4581
+ resource: "automation.humanTasks",
4582
+ method: "retrieve",
4583
+ summary: "Retrieve a human task",
4584
+ 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.",
4585
+ http: "GET",
4586
+ path: "/automation/v1/human-tasks/{id}",
4587
+ streaming: "no",
4588
+ pagination: false,
4589
+ pathParams: [
4590
+ {
4591
+ name: "id",
4592
+ sdkName: "id",
4593
+ description: "Human task ID (htask_), from the list or the run's waits."
4594
+ }
4595
+ ],
4596
+ query: []
4597
+ },
4598
+ {
4599
+ resource: "automation.humanTasks",
4600
+ method: "cancel",
4601
+ summary: "Cancel a human task",
4602
+ 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.",
4603
+ http: "POST",
4604
+ path: "/automation/v1/human-tasks/{id}/cancel",
4605
+ streaming: "no",
4606
+ pagination: false,
4607
+ pathParams: [
4608
+ {
4609
+ name: "id",
4610
+ sdkName: "id",
4611
+ description: "Human task ID (htask_)."
4612
+ }
4613
+ ],
4614
+ query: [],
4615
+ body: {
4616
+ required: false,
4617
+ fields: [
4618
+ {
4619
+ name: "reason",
4620
+ type: "string",
4621
+ required: false,
4622
+ description: "Optional cancellation reason, at most 500 characters."
4623
+ }
4624
+ ]
4625
+ }
4626
+ },
4627
+ {
4628
+ resource: "automation.humanTasks",
4629
+ method: "delegate",
4630
+ summary: "Delegate a human task",
4631
+ 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.",
4632
+ http: "POST",
4633
+ path: "/automation/v1/human-tasks/{id}/delegate",
4634
+ streaming: "no",
4635
+ pagination: false,
4636
+ pathParams: [
4637
+ {
4638
+ name: "id",
4639
+ sdkName: "id",
4640
+ description: "Human task ID (htask_)."
4641
+ }
4642
+ ],
4643
+ query: [],
4644
+ body: {
4645
+ required: true,
4646
+ fields: [
4647
+ {
4648
+ name: "to_user",
4649
+ type: "string",
4650
+ required: true,
4651
+ description: "User ID taking over; cannot already be an assignee, nor the initiator unless self-approval is allowed."
4652
+ }
4653
+ ]
4654
+ }
4655
+ },
4656
+ {
4657
+ resource: "automation.humanTasks",
4658
+ method: "respond",
4659
+ summary: "Respond to a human task",
4660
+ 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.",
4661
+ http: "POST",
4662
+ path: "/automation/v1/human-tasks/{id}/respond",
4663
+ streaming: "no",
4664
+ pagination: false,
4665
+ pathParams: [
4666
+ {
4667
+ name: "id",
4668
+ sdkName: "id",
4669
+ description: "Human task ID (htask_)."
4670
+ }
4671
+ ],
4672
+ query: [],
4673
+ body: {
4674
+ required: true,
4675
+ fields: [
4676
+ {
4677
+ name: "action_id",
4678
+ type: "string",
4679
+ required: true,
4680
+ description: "The chosen action ID from the task's actions, for example approve."
4681
+ },
4682
+ {
4683
+ name: "values",
4684
+ type: "object",
4685
+ required: false,
4686
+ description: "Any JSON object whose keys are strings and whose values are any JSON value."
4687
+ },
4688
+ {
4689
+ name: "comment",
4690
+ type: "string",
4691
+ required: false,
4692
+ description: "Comment of at most 4000 characters; required when the action has require_comment true."
4693
+ }
4694
+ ]
4695
+ }
4696
+ },
4514
4697
  {
4515
4698
  resource: "automation.resolve",
4516
4699
  method: "retrieve",
@@ -4691,7 +4874,7 @@ file at the root of that directory.`
4691
4874
  resource: "automation.runs",
4692
4875
  method: "create",
4693
4876
  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. 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.',
4877
+ description: 'Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 30 s (run-sandbox after 10 min); scripts have a 5 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 30 days. Each run can start at most 100 child runs, with at most 20 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.',
4695
4878
  http: "POST",
4696
4879
  path: "/automation/v1/runs",
4697
4880
  streaming: "no",
@@ -5183,7 +5366,7 @@ file at the root of that directory.`
5183
5366
  resource: "automation.scripts",
5184
5367
  method: "create",
5185
5368
  summary: "Create a script",
5186
- description: 'Save a TypeScript script as an editable draft for later reuse; this does not publish or start a run. Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. The draft is a source string with a default-exported function, for example `export default async (input: {name: string}) => ({greeting: "Hello, " + input.name});`. Scripts provide praxis, call, invoke, console and codemode as module-scope bindings, not on globalThis, with no import needed: praxis.<domain>.<resource>.<method>(...) calls a platform API, call("ocr", input) calls a built-in Action, and invoke("namespace/name", input) starts a child run. Action IDs are strings (bare names for built-ins, namespace/name for your own Actions); praxis.ocr(...) does not exist. To test it, pass that source and language=ts to praxis.automation.runs.create without publishing. To publish later, use the returned draft.revision as expected_draft_revision.',
5369
+ description: 'Save a TypeScript script as an editable draft for later reuse; this does not publish or start a run. Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. The draft is a source string with a default-exported function, for example `export default async (input: {name: string}) => ({greeting: "Hello, " + input.name});`. Scripts provide praxis, call, invoke, console and codemode as module-scope bindings, not on globalThis, with no import needed: praxis.<domain>.<resource>.<method>(...) calls a platform API, call("ocr", input) calls a built-in Action, and invoke("namespace/name", input) starts a child run. Action IDs are strings (bare names for built-ins, namespace/name for your own Actions); praxis.ocr(...) does not exist. The return value is limited to 1 MiB: write large results to a file with call("write-file", ...) and return the file ID. A call error carries errors[] (pointer, detail, hint); String(e) is only the summary. To test it, pass that source and language=ts to praxis.automation.runs.create without publishing. To publish later, use the returned draft.revision as expected_draft_revision.',
5187
5370
  http: "POST",
5188
5371
  path: "/automation/v1/scripts",
5189
5372
  streaming: "no",
@@ -6132,7 +6315,7 @@ file at the root of that directory.`
6132
6315
  resource: "automation.validate",
6133
6316
  method: "create",
6134
6317
  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.",
6318
+ 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
6319
  http: "POST",
6137
6320
  path: "/automation/v1/validate",
6138
6321
  streaming: "no",
@@ -6239,7 +6422,7 @@ file at the root of that directory.`
6239
6422
  resource: "automation.workflows",
6240
6423
  method: "create",
6241
6424
  summary: "Create a workflow",
6242
- description: "Save a YAML workflow as an editable draft without publishing or starting a run. Choose your own namespace without registering it first; praxis is reserved for built-in Actions. To test the draft, send its source and language=yaml to praxis.automation.runs.create. 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.",
6425
+ 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
6426
  http: "POST",
6244
6427
  path: "/automation/v1/workflows",
6245
6428
  streaming: "no",
@@ -6309,7 +6492,7 @@ file at the root of that directory.`
6309
6492
  resource: "automation.workflows",
6310
6493
  method: "update",
6311
6494
  summary: "Update a workflow draft",
6312
- description: "Update description, labels or draft with the current draft revision in If-Match. Even metadata-only updates create a new draft revision.",
6495
+ 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
6496
  http: "PATCH",
6314
6497
  path: "/automation/v1/workflows/{ns}/{name}",
6315
6498
  streaming: "no",
@@ -6547,7 +6730,7 @@ file at the root of that directory.`
6547
6730
  "publish"
6548
6731
  ],
6549
6732
  summary: "Publish a workflow version",
6550
- description: "Publish a saved definition from its draft or an ad hoc run as a reusable version for named runs or triggers, validating the definition and locking dependencies. To test unpublished code, use praxis.automation.runs.create with source and language instead. Use draft.revision from create or retrieve as expected_draft_revision. The draft must match expected_draft_revision; an ad hoc run requires from_run and expected_source_sha256. The same version and contents return the existing version; different contents return VERSION_EXISTS, prereleases require an explicit tag (not latest, URL-safe characters only, not a version or range; violations return TAG_REQUIRED or TAG_INVALID with the complete rules in hint), and invalid definitions return DEFINITION_INVALID. Stable releases automatically advance latest only above the highest existing stable version; workflows becoming latest synchronize their declared schedule. String and object run.workflow/run.script references share version resolution and dependency locking. Publishing removes +build metadata from the version number.",
6733
+ description: "Publish a saved definition from its draft or an ad hoc run as a reusable version for named runs or triggers, validating the definition and locking dependencies. To test unpublished code, use praxis.automation.runs.create with source and language instead. Use draft.revision from create or retrieve as expected_draft_revision. The draft must match expected_draft_revision; an ad hoc run requires from_run and expected_source_sha256. The same version and contents return the existing version; different contents return VERSION_EXISTS, prereleases require an explicit tag (not latest, URL-safe characters only, not a version or range; violations return TAG_REQUIRED or TAG_INVALID with the complete rules in hint), and invalid definitions return DEFINITION_INVALID. Stable releases automatically advance latest only above the highest existing stable version; workflows becoming latest synchronize their declared schedule. String and object run.workflow/run.script references share version resolution and dependency locking. Publishing removes +build metadata from the version number. For a workflow, document namespace, name and version must equal the publish target, otherwise DEFINITION_IDENTITY_MISMATCH; where a DEFINITION_INVALID failure sits is listed in errors[] (pointer, detail, hint).",
6551
6734
  http: "POST",
6552
6735
  path: "/automation/v1/workflows/{ns}/{name}/versions",
6553
6736
  streaming: "no",
@@ -7222,6 +7405,220 @@ file at the root of that directory.`
7222
7405
  ]
7223
7406
  }
7224
7407
  },
7408
+ {
7409
+ resource: "canvas.canvases",
7410
+ method: "list",
7411
+ summary: "List canvases",
7412
+ 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.",
7413
+ http: "GET",
7414
+ path: "/canvas/v1/canvases",
7415
+ streaming: "no",
7416
+ pagination: true,
7417
+ pathParams: [],
7418
+ query: [
7419
+ {
7420
+ name: "limit",
7421
+ type: "integer",
7422
+ required: false,
7423
+ description: "Maximum canvases to return per page, from 1 to 100; defaults to 50 when omitted."
7424
+ },
7425
+ {
7426
+ name: "cursor",
7427
+ type: "string",
7428
+ required: false,
7429
+ description: "Opaque next_cursor from the preceding list response; omit for the first page and stop when next_cursor is null."
7430
+ }
7431
+ ]
7432
+ },
7433
+ {
7434
+ resource: "canvas.canvases",
7435
+ method: "create",
7436
+ summary: "Create canvas",
7437
+ 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.",
7438
+ http: "POST",
7439
+ path: "/canvas/v1/canvases",
7440
+ streaming: "no",
7441
+ pagination: false,
7442
+ pathParams: [],
7443
+ query: [],
7444
+ body: {
7445
+ required: false,
7446
+ fields: [
7447
+ {
7448
+ name: "name",
7449
+ type: "string",
7450
+ required: false,
7451
+ description: "Display name for the new canvas, at most 200 characters; omission uses Untitled."
7452
+ }
7453
+ ]
7454
+ }
7455
+ },
7456
+ {
7457
+ resource: "canvas.canvases",
7458
+ method: "delete",
7459
+ summary: "Delete canvas",
7460
+ 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.",
7461
+ http: "DELETE",
7462
+ path: "/canvas/v1/canvases/{canvas_id}",
7463
+ streaming: "no",
7464
+ pagination: false,
7465
+ pathParams: [
7466
+ {
7467
+ name: "canvas_id",
7468
+ sdkName: "canvas_id",
7469
+ 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."
7470
+ }
7471
+ ],
7472
+ query: []
7473
+ },
7474
+ {
7475
+ resource: "canvas.canvases",
7476
+ method: "retrieve",
7477
+ summary: "Retrieve canvas",
7478
+ 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.",
7479
+ http: "GET",
7480
+ path: "/canvas/v1/canvases/{canvas_id}",
7481
+ streaming: "no",
7482
+ pagination: false,
7483
+ pathParams: [
7484
+ {
7485
+ name: "canvas_id",
7486
+ sdkName: "canvas_id",
7487
+ 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."
7488
+ }
7489
+ ],
7490
+ query: []
7491
+ },
7492
+ {
7493
+ resource: "canvas.canvases.images",
7494
+ method: "list",
7495
+ summary: "Render canvas nodes",
7496
+ 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.",
7497
+ http: "GET",
7498
+ path: "/canvas/v1/canvases/{canvas_id}/images",
7499
+ streaming: "no",
7500
+ pagination: false,
7501
+ pathParams: [
7502
+ {
7503
+ name: "canvas_id",
7504
+ sdkName: "canvas_id",
7505
+ 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."
7506
+ }
7507
+ ],
7508
+ query: [
7509
+ {
7510
+ name: "ids",
7511
+ type: "string",
7512
+ required: true,
7513
+ description: "Comma-separated list of 1–4 node ids to render, from retrieve, execute.created or execute.screenshots."
7514
+ },
7515
+ {
7516
+ name: "scale",
7517
+ type: "number",
7518
+ required: false,
7519
+ description: "Output pixel scale relative to canvas dimensions, from 0.25 to 4 inclusive; defaults to 1 when omitted."
7520
+ },
7521
+ {
7522
+ name: "format",
7523
+ type: "string",
7524
+ enum: [
7525
+ "png"
7526
+ ],
7527
+ required: false,
7528
+ description: "Image encoding; png produces a PNG data URL and is the only supported value. Omit to use png."
7529
+ }
7530
+ ]
7531
+ },
7532
+ {
7533
+ resource: "canvas.canvases.nodes",
7534
+ method: "list",
7535
+ summary: "Read canvas nodes",
7536
+ 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.",
7537
+ http: "GET",
7538
+ path: "/canvas/v1/canvases/{canvas_id}/nodes",
7539
+ streaming: "no",
7540
+ pagination: false,
7541
+ pathParams: [
7542
+ {
7543
+ name: "canvas_id",
7544
+ sdkName: "canvas_id",
7545
+ 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."
7546
+ }
7547
+ ],
7548
+ query: [
7549
+ {
7550
+ name: "ids",
7551
+ type: "string",
7552
+ required: true,
7553
+ 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."
7554
+ },
7555
+ {
7556
+ name: "depth",
7557
+ type: "integer",
7558
+ required: false,
7559
+ 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."
7560
+ }
7561
+ ]
7562
+ },
7563
+ {
7564
+ resource: "canvas.canvases",
7565
+ method: "execute",
7566
+ summary: "Execute canvas script",
7567
+ 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.
7568
+
7569
+ 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:
7570
+
7571
+ \`\`\`js
7572
+ 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)
7573
+ \`\`\`
7574
+
7575
+ Use viewer_url to watch the result in Console. TakeScreenshot records node ids in screenshots; call images.list with those ids to fetch PNG data URLs. See the [Canvas execute reference](https://deepraxis.com/en/docs/api/native/canvas/execute) for request fields and results, and the [Canvas node reference](https://deepraxis.com/en/docs/developers/canvas/nodes) for node content.
7576
+
7577
+ 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.
7578
+ `,
7579
+ http: "POST",
7580
+ path: "/canvas/v1/canvases/{canvas_id}:execute",
7581
+ streaming: "no",
7582
+ pagination: false,
7583
+ pathParams: [
7584
+ {
7585
+ name: "canvas_id",
7586
+ sdkName: "canvas_id",
7587
+ 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."
7588
+ }
7589
+ ],
7590
+ query: [],
7591
+ body: {
7592
+ required: true,
7593
+ fields: [
7594
+ {
7595
+ name: "script",
7596
+ type: "string",
7597
+ required: false,
7598
+ 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."
7599
+ },
7600
+ {
7601
+ name: "edit_id",
7602
+ type: "string",
7603
+ required: false,
7604
+ description: "Saved failed-script identifier from error.details.edit_id; use with edits instead of script within ten minutes of the failure."
7605
+ },
7606
+ {
7607
+ name: "edits",
7608
+ type: "array",
7609
+ itemType: "object",
7610
+ required: false,
7611
+ description: "Text replacements applied to the source identified by edit_id before rerunning; use error line, column or rejection to choose the correction."
7612
+ },
7613
+ {
7614
+ name: "expected_version",
7615
+ type: "string",
7616
+ required: false,
7617
+ 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."
7618
+ }
7619
+ ]
7620
+ }
7621
+ },
7225
7622
  {
7226
7623
  resource: "database.databases",
7227
7624
  method: "list",
@@ -8234,7 +8631,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
8234
8631
  resource: "file.files",
8235
8632
  method: "create",
8236
8633
  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.',
8634
+ 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
8635
  http: "POST",
8239
8636
  path: "/file/v1/files",
8240
8637
  streaming: "no",
@@ -8256,23 +8653,16 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
8256
8653
  type: "string",
8257
8654
  enum: [
8258
8655
  "user_data",
8259
- "assistants",
8260
8656
  "vision"
8261
8657
  ],
8262
8658
  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."
8659
+ 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
8660
  },
8265
8661
  {
8266
8662
  name: "expires_after",
8267
8663
  type: "object",
8268
8664
  required: false,
8269
8665
  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
8666
  }
8277
8667
  ]
8278
8668
  }
@@ -8335,7 +8725,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
8335
8725
  resource: "file.uploads",
8336
8726
  method: "create",
8337
8727
  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.",
8728
+ 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
8729
  http: "POST",
8340
8730
  path: "/file/v1/uploads",
8341
8731
  streaming: "no",
@@ -8368,11 +8758,10 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
8368
8758
  type: "string",
8369
8759
  enum: [
8370
8760
  "user_data",
8371
- "assistants",
8372
8761
  "vision"
8373
8762
  ],
8374
8763
  required: true,
8375
- description: "Use user_data for conversation attachments, assistants for assistant files, or vision for PNG, JPEG, GIF and WebP images."
8764
+ description: "Use user_data for conversation attachments, or vision for PNG, JPEG, GIF and WebP images."
8376
8765
  },
8377
8766
  {
8378
8767
  name: "expires_after",
@@ -9552,7 +9941,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
9552
9941
  name: "overwrite",
9553
9942
  type: "boolean",
9554
9943
  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."
9944
+ 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
9945
  },
9557
9946
  {
9558
9947
  name: "tags",
@@ -9611,7 +10000,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
9611
10000
  name: "file_id",
9612
10001
  type: "string",
9613
10002
  required: true,
9614
- description: "File ID to copy into this library; passed as the upload source instead of file bytes."
10003
+ 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
10004
  },
9616
10005
  {
9617
10006
  name: "public_id",
@@ -9665,7 +10054,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
9665
10054
  name: "overwrite",
9666
10055
  type: "boolean",
9667
10056
  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."
10057
+ 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
10058
  },
9670
10059
  {
9671
10060
  name: "tags",
@@ -10182,7 +10571,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
10182
10571
  name: "expression",
10183
10572
  type: "string",
10184
10573
  required: false,
10185
- description: "Asset filter expression supporting field comparisons, AND, OR, NOT, parentheses and suffix wildcards. An empty expression matches all assets."
10574
+ 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
10575
  },
10187
10576
  {
10188
10577
  name: "sort_by",
@@ -10328,6 +10717,70 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
10328
10717
  ]
10329
10718
  }
10330
10719
  },
10720
+ {
10721
+ resource: "meta.docs",
10722
+ method: "search",
10723
+ summary: "Search platform documentation",
10724
+ 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.",
10725
+ http: "GET",
10726
+ path: "/meta/v1/docs/search",
10727
+ streaming: "no",
10728
+ pagination: false,
10729
+ pathParams: [],
10730
+ query: [
10731
+ {
10732
+ name: "q",
10733
+ type: "string",
10734
+ required: true,
10735
+ description: "Keywords describing the syntax or guide needed, for example export or workflow."
10736
+ },
10737
+ {
10738
+ name: "limit",
10739
+ type: "integer",
10740
+ required: false,
10741
+ description: "Maximum number of matching pages returned; integer 1–50, default 20."
10742
+ },
10743
+ {
10744
+ name: "lang",
10745
+ type: "string",
10746
+ enum: [
10747
+ "zh",
10748
+ "en"
10749
+ ],
10750
+ required: false,
10751
+ description: "Documentation language: zh for Chinese (default), en for English."
10752
+ }
10753
+ ]
10754
+ },
10755
+ {
10756
+ resource: "meta.docs",
10757
+ method: "retrieve",
10758
+ summary: "Read documentation Markdown",
10759
+ 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.",
10760
+ http: "GET",
10761
+ path: "/meta/v1/docs/{path}",
10762
+ streaming: "no",
10763
+ pagination: false,
10764
+ pathParams: [
10765
+ {
10766
+ name: "path",
10767
+ sdkName: "path",
10768
+ description: "Slash-separated documentation path from docs.search; optionally append #heading-id to select a section."
10769
+ }
10770
+ ],
10771
+ query: [
10772
+ {
10773
+ name: "lang",
10774
+ type: "string",
10775
+ enum: [
10776
+ "zh",
10777
+ "en"
10778
+ ],
10779
+ required: false,
10780
+ description: "Documentation language: zh for Chinese (default), en for English."
10781
+ }
10782
+ ]
10783
+ },
10331
10784
  {
10332
10785
  resource: "meta.health",
10333
10786
  method: "retrieve",
@@ -18931,6 +19384,8 @@ var fileCancelUpload = (options) => (options.client ?? client).post({
18931
19384
  var healthCheck = (options) => (options?.client ?? client).get({ url: "/meta/v1/health", ...options });
18932
19385
  var metaMethodsSearch = (options) => (options?.client ?? client).get({ url: "/meta/v1/methods", ...options });
18933
19386
  var metaMethodsRetrieve = (options) => (options.client ?? client).get({ url: "/meta/v1/methods/{name}", ...options });
19387
+ var metaDocsRetrieve = (options) => (options.client ?? client).get({ url: "/meta/v1/docs/{path}", ...options });
19388
+ var metaDocsSearch = (options) => (options.client ?? client).get({ url: "/meta/v1/docs/search", ...options });
18934
19389
  var listModels = (options) => (options?.client ?? client).get({
18935
19390
  querySerializer: { parameters: {
18936
19391
  supported_api: { array: { explode: false } },
@@ -21707,6 +22162,155 @@ var automationHooksReceive = (options) => (options.client ?? client).post({
21707
22162
  ...options.headers
21708
22163
  }
21709
22164
  });
22165
+ var automationHumanTasksList = (options) => (options?.client ?? client).get({
22166
+ querySerializer: { parameters: { status: { array: { explode: false } } } },
22167
+ security: [{
22168
+ key: "BearerAuth",
22169
+ scheme: "bearer",
22170
+ type: "http"
22171
+ }, {
22172
+ key: "ApiKeyAuth",
22173
+ name: "X-API-Key",
22174
+ type: "apiKey"
22175
+ }],
22176
+ url: "/automation/v1/human-tasks",
22177
+ ...options
22178
+ });
22179
+ var automationHumanTasksGet = (options) => (options.client ?? client).get({
22180
+ security: [{
22181
+ key: "BearerAuth",
22182
+ scheme: "bearer",
22183
+ type: "http"
22184
+ }, {
22185
+ key: "ApiKeyAuth",
22186
+ name: "X-API-Key",
22187
+ type: "apiKey"
22188
+ }],
22189
+ url: "/automation/v1/human-tasks/{id}",
22190
+ ...options
22191
+ });
22192
+ var automationHumanTasksRespond = (options) => (options.client ?? client).post({
22193
+ security: [{
22194
+ key: "BearerAuth",
22195
+ scheme: "bearer",
22196
+ type: "http"
22197
+ }, {
22198
+ key: "ApiKeyAuth",
22199
+ name: "X-API-Key",
22200
+ type: "apiKey"
22201
+ }],
22202
+ url: "/automation/v1/human-tasks/{id}/respond",
22203
+ ...options,
22204
+ headers: {
22205
+ "Content-Type": "application/json",
22206
+ ...options.headers
22207
+ }
22208
+ });
22209
+ var automationHumanTasksCancel = (options) => (options.client ?? client).post({
22210
+ security: [{
22211
+ key: "BearerAuth",
22212
+ scheme: "bearer",
22213
+ type: "http"
22214
+ }, {
22215
+ key: "ApiKeyAuth",
22216
+ name: "X-API-Key",
22217
+ type: "apiKey"
22218
+ }],
22219
+ url: "/automation/v1/human-tasks/{id}/cancel",
22220
+ ...options,
22221
+ headers: {
22222
+ "Content-Type": "application/json",
22223
+ ...options.headers
22224
+ }
22225
+ });
22226
+ var automationHumanTasksDelegate = (options) => (options.client ?? client).post({
22227
+ security: [{
22228
+ key: "BearerAuth",
22229
+ scheme: "bearer",
22230
+ type: "http"
22231
+ }, {
22232
+ key: "ApiKeyAuth",
22233
+ name: "X-API-Key",
22234
+ type: "apiKey"
22235
+ }],
22236
+ url: "/automation/v1/human-tasks/{id}/delegate",
22237
+ ...options,
22238
+ headers: {
22239
+ "Content-Type": "application/json",
22240
+ ...options.headers
22241
+ }
22242
+ });
22243
+ var canvasListCanvases = (options) => (options?.client ?? client).get({
22244
+ security: [{
22245
+ key: "canvas-bearerAuth",
22246
+ scheme: "bearer",
22247
+ type: "http"
22248
+ }],
22249
+ url: "/canvas/v1/canvases",
22250
+ ...options
22251
+ });
22252
+ var canvasCreateCanvas = (options) => (options?.client ?? client).post({
22253
+ security: [{
22254
+ key: "canvas-bearerAuth",
22255
+ scheme: "bearer",
22256
+ type: "http"
22257
+ }],
22258
+ url: "/canvas/v1/canvases",
22259
+ ...options,
22260
+ headers: {
22261
+ "Content-Type": "application/json",
22262
+ ...options?.headers
22263
+ }
22264
+ });
22265
+ var canvasDeleteCanvas = (options) => (options.client ?? client).delete({
22266
+ security: [{
22267
+ key: "canvas-bearerAuth",
22268
+ scheme: "bearer",
22269
+ type: "http"
22270
+ }],
22271
+ url: "/canvas/v1/canvases/{canvas_id}",
22272
+ ...options
22273
+ });
22274
+ var canvasRetrieveCanvas = (options) => (options.client ?? client).get({
22275
+ security: [{
22276
+ key: "canvas-bearerAuth",
22277
+ scheme: "bearer",
22278
+ type: "http"
22279
+ }],
22280
+ url: "/canvas/v1/canvases/{canvas_id}",
22281
+ ...options
22282
+ });
22283
+ var canvasListNodes = (options) => (options.client ?? client).get({
22284
+ security: [{
22285
+ key: "canvas-bearerAuth",
22286
+ scheme: "bearer",
22287
+ type: "http"
22288
+ }],
22289
+ url: "/canvas/v1/canvases/{canvas_id}/nodes",
22290
+ ...options
22291
+ });
22292
+ var canvasListImages = (options) => (options.client ?? client).get({
22293
+ security: [{
22294
+ key: "canvas-bearerAuth",
22295
+ scheme: "bearer",
22296
+ type: "http"
22297
+ }],
22298
+ url: "/canvas/v1/canvases/{canvas_id}/images",
22299
+ ...options
22300
+ });
22301
+ var canvasExecute = (options) => (options.client ?? client).post({
22302
+ security: [{
22303
+ key: "canvas-bearerAuth",
22304
+ scheme: "bearer",
22305
+ type: "http"
22306
+ }],
22307
+ url: "/canvas/v1/canvases/{canvas_id}:execute",
22308
+ ...options,
22309
+ headers: {
22310
+ "Content-Type": "application/json",
22311
+ ...options.headers
22312
+ }
22313
+ });
21710
22314
  var databaseListDatabases = (options) => (options?.client ?? client).get({
21711
22315
  security: [{
21712
22316
  key: "database-bearerAuth",
@@ -24177,6 +24781,13 @@ function createAutomation(transport) {
24177
24781
  hooks: {
24178
24782
  send: bind(transport, automationHooksReceive)
24179
24783
  },
24784
+ humanTasks: {
24785
+ cancel: bind(transport, automationHumanTasksCancel),
24786
+ delegate: bind(transport, automationHumanTasksDelegate),
24787
+ list: bindPage(transport, automationHumanTasksList),
24788
+ respond: bind(transport, automationHumanTasksRespond),
24789
+ retrieve: bind(transport, automationHumanTasksGet)
24790
+ },
24180
24791
  resolve: {
24181
24792
  retrieve: bind(transport, automationResolveResolve)
24182
24793
  },
@@ -24306,6 +24917,23 @@ function createBrowser(transport) {
24306
24917
  }
24307
24918
  };
24308
24919
  }
24920
+ function createCanvas(transport) {
24921
+ return {
24922
+ canvases: {
24923
+ create: bind(transport, canvasCreateCanvas),
24924
+ delete: bind(transport, canvasDeleteCanvas),
24925
+ execute: bind(transport, canvasExecute),
24926
+ images: {
24927
+ list: bind(transport, canvasListImages)
24928
+ },
24929
+ list: bindPage(transport, canvasListCanvases),
24930
+ nodes: {
24931
+ list: bind(transport, canvasListNodes)
24932
+ },
24933
+ retrieve: bind(transport, canvasRetrieveCanvas)
24934
+ }
24935
+ };
24936
+ }
24309
24937
  function createDatabase(transport) {
24310
24938
  return {
24311
24939
  databases: {
@@ -24467,6 +25095,10 @@ function createMedia(transport) {
24467
25095
  }
24468
25096
  function createMeta(transport) {
24469
25097
  return {
25098
+ docs: {
25099
+ retrieve: bind(transport, metaDocsRetrieve),
25100
+ search: bind(transport, metaDocsSearch)
25101
+ },
24470
25102
  health: {
24471
25103
  retrieve: bind(transport, healthCheck)
24472
25104
  },
@@ -24791,6 +25423,7 @@ var resourceFactories = {
24791
25423
  application: createApplication,
24792
25424
  automation: createAutomation,
24793
25425
  browser: createBrowser,
25426
+ canvas: createCanvas,
24794
25427
  database: createDatabase,
24795
25428
  file: createFile,
24796
25429
  knowledge: createKnowledge,
@@ -24958,7 +25591,7 @@ function assertKnownOptions(options) {
24958
25591
  class Transport {
24959
25592
  config;
24960
25593
  constructor(options) {
24961
- this.config = { timeoutMs: 60000, maxRetries: 2, fetch: globalThis.fetch, ...options };
25594
+ this.config = { timeoutMs: 600000, maxRetries: 2, fetch: globalThis.fetch, ...options };
24962
25595
  this.validate(this.config.timeoutMs, this.config.maxRetries);
24963
25596
  }
24964
25597
  validate(timeout, retries) {
@@ -26430,8 +27063,9 @@ function jwtFetch(fetchImpl, token) {
26430
27063
  function credentials(config, vars, ports) {
26431
27064
  const path = ports.path ?? tokenPath(config.env);
26432
27065
  const store = ports.store ?? createTokenStore(config.env, path, ports.secretStore);
27066
+ const source = credentialSource(vars);
26433
27067
  const apiKey = vars.PRAXIS_API_KEY;
26434
- const machineToken = credentialSource(vars) === "machine-token" ? vars.PRAXIS_API_TOKEN : undefined;
27068
+ const machineToken = source === "machine-token" ? vars.PRAXIS_API_TOKEN : undefined;
26435
27069
  const remember = ports.remember ?? (() => {});
26436
27070
  if (apiKey)
26437
27071
  remember(apiKey);
@@ -26493,6 +27127,7 @@ function credentials(config, vars, ports) {
26493
27127
  }
26494
27128
  }
26495
27129
  return {
27130
+ source,
26496
27131
  get,
26497
27132
  requireLogin,
26498
27133
  async client(org) {
@@ -26548,13 +27183,13 @@ function skillDocument(commands) {
26548
27183
  "## General rules",
26549
27184
  "",
26550
27185
  "- 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.",
27186
+ "- 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
27187
  "- AI mode is enabled automatically in supported agent environments. Use `--format agent` to select it explicitly.",
26553
27188
  "- Use `--json` for the complete JSON response without presentation truncation. Successful JSON output goes to stdout; errors go to stderr.",
26554
27189
  "- Supply bodies with `--data JSON`, `--data @file.json`, or `--data -` for stdin. Scalar field options override matching JSON fields. Structured fields require `--data`.",
26555
27190
  "- Deletion requires `--yes` in AI mode. Confirm the intended resource before using it.",
26556
27191
  "- 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.",
27192
+ "- 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
27193
  "- Append `--help` to a command for its optional parameters. Required scalar body options below can also be supplied as fields in `--data`.",
26559
27194
  "- 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
27195
  "",
@@ -26685,7 +27320,12 @@ Enter code: ${code.user_code}` });
26685
27320
  const location = await (ports.store ?? createTokenStore(config.env, path)).save(toStored(flow.tokens, ports.now()));
26686
27321
  if (location !== "keychain")
26687
27322
  ports.emit({ kind: "message", channel: "stderr", text: "stored in a file (no system keychain available)" });
27323
+ const shadowedBy = ports.source === "api-key" ? "PRAXIS_API_KEY" : ports.source === "machine-token" ? "PRAXIS_API_TOKEN" : undefined;
26688
27324
  ports.emit({ kind: "message", text: `Logged in (${config.env}).` });
27325
+ if (shadowedBy)
27326
+ 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.` });
27327
+ if (ports.json)
27328
+ ports.emit({ kind: "object", data: { env: config.env, ...shadowedBy ? { shadowed_by: shadowedBy } : {} } });
26689
27329
  }
26690
27330
  async function whoami(auth, env, org) {
26691
27331
  const credential = await auth.get(org);
@@ -27487,7 +28127,7 @@ ${usage ? `usage: ${JSON.stringify(usage)}
27487
28127
 
27488
28128
  // src/output/render.ts
27489
28129
  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 } }) + `
28130
+ 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
28131
  `;
27492
28132
  }
27493
28133
  function render(result, ctx) {
@@ -27628,6 +28268,16 @@ var humanize = (code) => {
27628
28268
  const words = code.toLowerCase().split("_").filter(Boolean).join(" ");
27629
28269
  return words.charAt(0).toUpperCase() + words.slice(1);
27630
28270
  };
28271
+ function authHint(source) {
28272
+ switch (source) {
28273
+ case "api-key":
28274
+ return "The API key from PRAXIS_API_KEY was rejected; check or replace it, or unset it to use `praxis login`.";
28275
+ case "machine-token":
28276
+ return "The machine token from PRAXIS_API_TOKEN was rejected (it may have expired); unset it to use `praxis login`, or refresh it.";
28277
+ case "login":
28278
+ return "Run `praxis login` or set PRAXIS_API_KEY.";
28279
+ }
28280
+ }
27631
28281
  function errorInput(error, ctx) {
27632
28282
  const sdk = error instanceof PraxisError ? error : undefined;
27633
28283
  const raw = record(sdk?.raw), nested = record(raw.error);
@@ -27642,11 +28292,13 @@ function errorInput(error, ctx) {
27642
28292
  if (stripped)
27643
28293
  message = `${humanize(code)}${message ? `: ${message}` : ""}`;
27644
28294
  const status = sdk?.status, request_id = sdk?.requestId;
28295
+ const authFailure = status === 401 || ["NOT_LOGGED_IN", "UNAUTHENTICATED", "TOKEN_REVOKED", "LOGIN_FAILED"].includes(code);
28296
+ const source = ctx.credentialSource ?? "login";
27645
28297
  let hint = genericHint;
27646
28298
  if (error instanceof UsageError)
27647
28299
  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.";
28300
+ else if (authFailure)
28301
+ hint = authHint(source);
27650
28302
  else if (status === 404)
27651
28303
  hint = ctx.listCommand ? `Check the id; list existing ones with \`${ctx.listCommand}\`` : "Check the id.";
27652
28304
  else if (status === 403)
@@ -27655,7 +28307,7 @@ function errorInput(error, ctx) {
27655
28307
  hint = "Rate limited; retry later.";
27656
28308
  else if (status !== undefined && status >= 500)
27657
28309
  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 } : {} };
28310
+ return { kind: "error", code, message, hint, env: ctx.env, ...authFailure ? { credential_source: source } : {}, ...status !== undefined ? { status } : {}, ...request_id ? { request_id } : {} };
27659
28311
  }
27660
28312
 
27661
28313
  // src/output/progress.ts
@@ -27685,7 +28337,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
27685
28337
  }
27686
28338
 
27687
28339
  // src/main.ts
27688
- var version = "0.2.0-dev.4a17623";
28340
+ var version = "0.2.0-dev.661a857";
27689
28341
  var commands = commandTree(operations);
27690
28342
  var manual = [...workflows.map((w) => w.words), [API_WORD]];
27691
28343
  function route(argv) {
@@ -27880,6 +28532,7 @@ Examples:
27880
28532
  const auth = credentials(config, ports.env, { fetch: wireFetch, now: ports.now, path, store, remember: (s) => {
27881
28533
  secrets.push(s);
27882
28534
  } });
28535
+ ctx.credentialSource = auth.source;
27883
28536
  const org = flags.org;
27884
28537
  const confirm = (method) => confirmOperation(method, { yes: Boolean(flags.yes), noInput: Boolean(flags["no-input"]) || ctx.mode === "agent", stdinIsTTY: ports.stdinIsTTY, ask: async () => {
27885
28538
  stopProgress();
@@ -27946,7 +28599,8 @@ Examples:
27946
28599
  case "login":
27947
28600
  if (flags["no-input"] || quiet)
27948
28601
  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) });
28602
+ ctx.credentialSource = "login";
28603
+ await login(config, path, { ...ports, source: auth.source, json: ctx.mode === "json", store, fetch: wireFetch, emit, remember: (s) => secrets.push(s) });
27950
28604
  break;
27951
28605
  case "logout":
27952
28606
  emit({ kind: "message", text: await store.delete() ? "Logged out." : "Not logged in." });