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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/COMMANDS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Generated by `bun run commands`. DO NOT EDIT.
4
4
 
5
- 421 HTTP operations; 423 commands including aliases.
5
+ 426 HTTP operations; 428 commands including aliases.
6
6
 
7
7
  Environment: `PRAXIS_ENV=develop|production` (dev package defaults to `develop`; stable package defaults to `production`). No `--env` option.
8
8
 
@@ -142,6 +142,11 @@ Handwritten commands: `login`, `logout`, `whoami`, `org list`, `org switch <orga
142
142
  | `praxis api automation action rollback <name>` | `automation.actions.rollback` | POST `/automation/v1/actions/{ns}/{name}/rollback` | `--action`, `--revision`, `--message` |
143
143
  | `praxis api automation action update <name>` | `automation.actions.update` | PUT `/automation/v1/actions/{ns}/{name}` | `--action`, `--dry-run`, `--description`, `--timeout-ms`, `--message` |
144
144
  | `praxis api automation hook send <token>` | `automation.hooks.send` | POST `/automation/v1/hooks/{trigger_id}/{token}` | `--hook` |
145
+ | `praxis api automation human-task cancel <id>` | `automation.humanTasks.cancel` | POST `/automation/v1/human-tasks/{id}/cancel` | `--reason` |
146
+ | `praxis api automation human-task delegate <id>` | `automation.humanTasks.delegate` | POST `/automation/v1/human-tasks/{id}/delegate` | `--to-user` |
147
+ | `praxis api automation human-task get <id>` | `automation.humanTasks.retrieve` | GET `/automation/v1/human-tasks/{id}` | |
148
+ | `praxis api automation human-task list` | `automation.humanTasks.list` | GET `/automation/v1/human-tasks` | `--param-limit`, `--param-cursor`, `--status`, `--run-id`, `--scope` |
149
+ | `praxis api automation human-task respond <id>` | `automation.humanTasks.respond` | POST `/automation/v1/human-tasks/{id}/respond` | `--action-id`, `--comment` |
145
150
  | `praxis api automation resolve get` | `automation.resolve.retrieve` | GET `/automation/v1/resolve` | `--target` |
146
151
  | `praxis api automation run artifact list` | `automation.runs.artifacts.list` | GET `/automation/v1/runs/{id}/artifacts` | `--run`, `--param-limit`, `--param-cursor` |
147
152
  | `praxis api automation run call list` | `automation.runs.calls.list` | GET `/automation/v1/runs/{id}/calls` | `--run`, `--param-limit`, `--param-cursor` |
package/dist/praxis.js CHANGED
@@ -4511,6 +4511,177 @@ file at the root of that directory.`
4511
4511
  fields: []
4512
4512
  }
4513
4513
  },
4514
+ {
4515
+ resource: "automation.humanTasks",
4516
+ method: "list",
4517
+ summary: "List human tasks",
4518
+ 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.",
4519
+ http: "GET",
4520
+ path: "/automation/v1/human-tasks",
4521
+ streaming: "no",
4522
+ pagination: true,
4523
+ pathParams: [],
4524
+ query: [
4525
+ {
4526
+ name: "limit",
4527
+ type: "integer",
4528
+ required: false,
4529
+ description: "Page size, 1–100, default 50."
4530
+ },
4531
+ {
4532
+ name: "cursor",
4533
+ type: "string",
4534
+ required: false,
4535
+ description: "The next_cursor of the previous page; omit for the first page."
4536
+ },
4537
+ {
4538
+ name: "status",
4539
+ type: "array",
4540
+ itemType: "string",
4541
+ enum: [
4542
+ "open",
4543
+ "completed",
4544
+ "expired",
4545
+ "cancelled"
4546
+ ],
4547
+ required: false,
4548
+ description: "Filter by status, comma-separated: open, completed, expired, cancelled. Defaults to open."
4549
+ },
4550
+ {
4551
+ name: "run_id",
4552
+ type: "string",
4553
+ required: false,
4554
+ description: "Only tasks opened by this run (run_)."
4555
+ },
4556
+ {
4557
+ name: "scope",
4558
+ type: "string",
4559
+ enum: [
4560
+ "assigned",
4561
+ "all"
4562
+ ],
4563
+ required: false,
4564
+ description: "assigned (default) lists only tasks assigned to the caller; all lists every task of the organization."
4565
+ }
4566
+ ]
4567
+ },
4568
+ {
4569
+ resource: "automation.humanTasks",
4570
+ method: "retrieve",
4571
+ summary: "Retrieve a human task",
4572
+ 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.",
4573
+ http: "GET",
4574
+ path: "/automation/v1/human-tasks/{id}",
4575
+ streaming: "no",
4576
+ pagination: false,
4577
+ pathParams: [
4578
+ {
4579
+ name: "id",
4580
+ sdkName: "id",
4581
+ description: "Human task ID (htask_), from the list or the run's waits."
4582
+ }
4583
+ ],
4584
+ query: []
4585
+ },
4586
+ {
4587
+ resource: "automation.humanTasks",
4588
+ method: "cancel",
4589
+ summary: "Cancel a human task",
4590
+ 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.",
4591
+ http: "POST",
4592
+ path: "/automation/v1/human-tasks/{id}/cancel",
4593
+ streaming: "no",
4594
+ pagination: false,
4595
+ pathParams: [
4596
+ {
4597
+ name: "id",
4598
+ sdkName: "id",
4599
+ description: "Human task ID (htask_)."
4600
+ }
4601
+ ],
4602
+ query: [],
4603
+ body: {
4604
+ required: false,
4605
+ fields: [
4606
+ {
4607
+ name: "reason",
4608
+ type: "string",
4609
+ required: false,
4610
+ description: "Optional cancellation reason, at most 500 characters."
4611
+ }
4612
+ ]
4613
+ }
4614
+ },
4615
+ {
4616
+ resource: "automation.humanTasks",
4617
+ method: "delegate",
4618
+ summary: "Delegate a human task",
4619
+ 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.",
4620
+ http: "POST",
4621
+ path: "/automation/v1/human-tasks/{id}/delegate",
4622
+ streaming: "no",
4623
+ pagination: false,
4624
+ pathParams: [
4625
+ {
4626
+ name: "id",
4627
+ sdkName: "id",
4628
+ description: "Human task ID (htask_)."
4629
+ }
4630
+ ],
4631
+ query: [],
4632
+ body: {
4633
+ required: true,
4634
+ fields: [
4635
+ {
4636
+ name: "to_user",
4637
+ type: "string",
4638
+ required: true,
4639
+ description: "User ID taking over; cannot already be an assignee, nor the initiator unless self-approval is allowed."
4640
+ }
4641
+ ]
4642
+ }
4643
+ },
4644
+ {
4645
+ resource: "automation.humanTasks",
4646
+ method: "respond",
4647
+ summary: "Respond to a human task",
4648
+ 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.",
4649
+ http: "POST",
4650
+ path: "/automation/v1/human-tasks/{id}/respond",
4651
+ streaming: "no",
4652
+ pagination: false,
4653
+ pathParams: [
4654
+ {
4655
+ name: "id",
4656
+ sdkName: "id",
4657
+ description: "Human task ID (htask_)."
4658
+ }
4659
+ ],
4660
+ query: [],
4661
+ body: {
4662
+ required: true,
4663
+ fields: [
4664
+ {
4665
+ name: "action_id",
4666
+ type: "string",
4667
+ required: true,
4668
+ description: "The chosen action ID from the task's actions, for example approve."
4669
+ },
4670
+ {
4671
+ name: "values",
4672
+ type: "object",
4673
+ required: false,
4674
+ description: "Any JSON object whose keys are strings and whose values are any JSON value."
4675
+ },
4676
+ {
4677
+ name: "comment",
4678
+ type: "string",
4679
+ required: false,
4680
+ description: "Comment of at most 4000 characters; required when the action has require_comment true."
4681
+ }
4682
+ ]
4683
+ }
4684
+ },
4514
4685
  {
4515
4686
  resource: "automation.resolve",
4516
4687
  method: "retrieve",
@@ -4691,7 +4862,7 @@ file at the root of that directory.`
4691
4862
  resource: "automation.runs",
4692
4863
  method: "create",
4693
4864
  summary: "Run a published target or execute draft source",
4694
- description: 'Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: `export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }`; send it as source with language="ts", input={"file_id":"<uploaded file ID>"} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example `praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } })`; Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 30 s (run-sandbox after 10 min); scripts have a 5 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 7 days. Each run can start at most 100 child runs, with at most 20 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.',
4865
+ 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
4866
  http: "POST",
4696
4867
  path: "/automation/v1/runs",
4697
4868
  streaming: "no",
@@ -6239,7 +6410,7 @@ file at the root of that directory.`
6239
6410
  resource: "automation.workflows",
6240
6411
  method: "create",
6241
6412
  summary: "Create a workflow",
6242
- description: 'Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 30 s (run-sandbox 10 min), workflow 24 h by default and 7 days at most, payload 1 MiB. Test the draft by sending its source and language=yaml to praxis.automation.runs.create. Guide: /docs/developers/automation/guides/write-workflow. Error details are in the errors[] of the response (pointer, detail, hint). Choose your own namespace without registering it first; praxis is reserved for built-in Actions. Scripts and workflows share names within the tenant; a duplicate returns NAME_TAKEN. run.workflow accepts ns/name@range or {namespace, name, version, input}; run.script uses the same reference shape as a platform extension. Object namespace, name and version are required; version accepts an exact version, dist-tag or range, locked at publication. Object input defaults to {} and supports expressions; string references retain task-level with. run.await defaults to true and returns the child output. With false, the child uses detach and the task immediately returns {run_id}; parent cancellation does not cascade. Inline script.code returns DEFINITION_INVALID with a detail asking you to save a script and reference it first. raise.error retains its type URI, status, title and detail in the run error.',
6413
+ description: 'Save a YAML workflow as an editable draft; this does not validate, publish or run it, so check it with validate (kind=workflow) first. Minimal draft: document with dsl ("1.0.3"), namespace, name and version, plus a do list of steps, for example document: {dsl: "1.0.3", namespace: demo, name: add, version: "1.0.0"} and do: [{first: {call: demo/add-one, with: {n: "${ .n }"}}}]. call: <ns/name> calls an Action directly (bare name for built-ins such as ocr) and with is the Action input; the input contract is at current_revision.input_schema in the get-action response. run: starts a saved script or child workflow. The run input is . in the first step, and expressions are jq written as a whole ${ ... } string. Limits: Action 30 s (run-sandbox 10 min), workflow 24 h by default and 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
6414
  http: "POST",
6244
6415
  path: "/automation/v1/workflows",
6245
6416
  streaming: "no",
@@ -21707,6 +21878,84 @@ var automationHooksReceive = (options) => (options.client ?? client).post({
21707
21878
  ...options.headers
21708
21879
  }
21709
21880
  });
21881
+ var automationHumanTasksList = (options) => (options?.client ?? client).get({
21882
+ querySerializer: { parameters: { status: { array: { explode: false } } } },
21883
+ security: [{
21884
+ key: "BearerAuth",
21885
+ scheme: "bearer",
21886
+ type: "http"
21887
+ }, {
21888
+ key: "ApiKeyAuth",
21889
+ name: "X-API-Key",
21890
+ type: "apiKey"
21891
+ }],
21892
+ url: "/automation/v1/human-tasks",
21893
+ ...options
21894
+ });
21895
+ var automationHumanTasksGet = (options) => (options.client ?? client).get({
21896
+ security: [{
21897
+ key: "BearerAuth",
21898
+ scheme: "bearer",
21899
+ type: "http"
21900
+ }, {
21901
+ key: "ApiKeyAuth",
21902
+ name: "X-API-Key",
21903
+ type: "apiKey"
21904
+ }],
21905
+ url: "/automation/v1/human-tasks/{id}",
21906
+ ...options
21907
+ });
21908
+ var automationHumanTasksRespond = (options) => (options.client ?? client).post({
21909
+ security: [{
21910
+ key: "BearerAuth",
21911
+ scheme: "bearer",
21912
+ type: "http"
21913
+ }, {
21914
+ key: "ApiKeyAuth",
21915
+ name: "X-API-Key",
21916
+ type: "apiKey"
21917
+ }],
21918
+ url: "/automation/v1/human-tasks/{id}/respond",
21919
+ ...options,
21920
+ headers: {
21921
+ "Content-Type": "application/json",
21922
+ ...options.headers
21923
+ }
21924
+ });
21925
+ var automationHumanTasksCancel = (options) => (options.client ?? client).post({
21926
+ security: [{
21927
+ key: "BearerAuth",
21928
+ scheme: "bearer",
21929
+ type: "http"
21930
+ }, {
21931
+ key: "ApiKeyAuth",
21932
+ name: "X-API-Key",
21933
+ type: "apiKey"
21934
+ }],
21935
+ url: "/automation/v1/human-tasks/{id}/cancel",
21936
+ ...options,
21937
+ headers: {
21938
+ "Content-Type": "application/json",
21939
+ ...options.headers
21940
+ }
21941
+ });
21942
+ var automationHumanTasksDelegate = (options) => (options.client ?? client).post({
21943
+ security: [{
21944
+ key: "BearerAuth",
21945
+ scheme: "bearer",
21946
+ type: "http"
21947
+ }, {
21948
+ key: "ApiKeyAuth",
21949
+ name: "X-API-Key",
21950
+ type: "apiKey"
21951
+ }],
21952
+ url: "/automation/v1/human-tasks/{id}/delegate",
21953
+ ...options,
21954
+ headers: {
21955
+ "Content-Type": "application/json",
21956
+ ...options.headers
21957
+ }
21958
+ });
21710
21959
  var databaseListDatabases = (options) => (options?.client ?? client).get({
21711
21960
  security: [{
21712
21961
  key: "database-bearerAuth",
@@ -24177,6 +24426,13 @@ function createAutomation(transport) {
24177
24426
  hooks: {
24178
24427
  send: bind(transport, automationHooksReceive)
24179
24428
  },
24429
+ humanTasks: {
24430
+ cancel: bind(transport, automationHumanTasksCancel),
24431
+ delegate: bind(transport, automationHumanTasksDelegate),
24432
+ list: bindPage(transport, automationHumanTasksList),
24433
+ respond: bind(transport, automationHumanTasksRespond),
24434
+ retrieve: bind(transport, automationHumanTasksGet)
24435
+ },
24180
24436
  resolve: {
24181
24437
  retrieve: bind(transport, automationResolveResolve)
24182
24438
  },
@@ -27685,7 +27941,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
27685
27941
  }
27686
27942
 
27687
27943
  // src/main.ts
27688
- var version = "0.2.0-dev.b71d0f4";
27944
+ var version = "0.2.0-dev.ed5af3e";
27689
27945
  var commands = commandTree(operations);
27690
27946
  var manual = [...workflows.map((w) => w.words), [API_WORD]];
27691
27947
  function route(argv) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepraxis/cli",
3
- "version": "0.2.0-dev.b71d0f4",
3
+ "version": "0.2.0-dev.ed5af3e",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "praxis": "dist/praxis.js"