@naturali/cli 0.206.10 → 0.207.0

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 (2) hide show
  1. package/dist/index.mjs +171 -3
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ var __exportAll = (all, no_symbols) => {
17
17
  };
18
18
  //#endregion
19
19
  //#region package.json
20
- var version = "0.206.10";
20
+ var version = "0.207.0";
21
21
  //#endregion
22
22
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
23
23
  const serializeFormDataPair = (data, key, value) => {
@@ -5630,6 +5630,21 @@ var Tasks = class {
5630
5630
  });
5631
5631
  }
5632
5632
  /**
5633
+ * Migrate a task to a newer workflow version
5634
+ *
5635
+ * Moves an open task onto a newer version of its workflow. A state the target version also declares maps to itself; `state_map` maps a state it lacks. The payload is re-validated against the target `payload_schema`. The mapped state's `on_enter` is not fired: transition the task when you want the target's automation. A task with a dispatch in flight or a transition pending approval is refused, since both belong to the version they started under. Recorded in history as a row with `transition: null` and both versions.
5636
+ */
5637
+ static migrateTask(options) {
5638
+ return (options.client ?? client).post({
5639
+ url: "/v1/projects/{project_id}/tasks/{task_id}/migrate",
5640
+ ...options,
5641
+ headers: {
5642
+ "Content-Type": "application/json",
5643
+ ...options.headers
5644
+ }
5645
+ });
5646
+ }
5647
+ /**
5633
5648
  * Pause a task
5634
5649
  *
5635
5650
  * Pauses a task's automation. While a pause is in force no state's `on_enter` dispatches and no retry chain continues — an agent generation, a tool call and a sub-orchestration alike — so the task stops spending without losing its place.
@@ -6421,7 +6436,7 @@ var Workflows = class {
6421
6436
  /**
6422
6437
  * Fetch an archived workflow version
6423
6438
  *
6424
- * Returns the exact state machine a given version describes. Every task records the version it entered on in `workflow_version` and runs on that machine for its whole life, so this is how you read the definition a task is actually being validated against — including a task whose workflow has been rewired since.
6439
+ * Returns the exact state machine a given version describes. Every task records the version it runs on in `workflow_version`, fixed at creation and moved only by migrate-task, so this is how you read the definition a task is actually being validated against — including a task whose workflow has been rewired since.
6425
6440
  *
6426
6441
  */
6427
6442
  static getWorkflowVersion(options) {
@@ -6448,6 +6463,32 @@ var Workflows = class {
6448
6463
  }
6449
6464
  });
6450
6465
  }
6466
+ /**
6467
+ * Migrate a workflow's open tasks to one of its versions
6468
+ *
6469
+ * Moves every open task of the workflow that runs on an older version, or on none, onto `to_version`. Each task is migrated as migrate-task migrates one and needs `tasks:MigrateTask` on it; a task it would refuse is reported as `refused` with the error, and the run goes on. The tasks and the caller's permission on each are fixed when the run is recorded. A `state_map` target the version lacks, or a terminal one, refuses the request before any task moves. Runs in the background by default (`status: queued`); `wait: true` answers once every task has settled. See [Migrating every open task](/docs/modules/workflows#migrating-every-open-task).
6470
+ */
6471
+ static createWorkflowMigration(options) {
6472
+ return (options.client ?? client).post({
6473
+ url: "/v1/projects/{project_id}/workflows/{workflow_id}/migrations",
6474
+ ...options,
6475
+ headers: {
6476
+ "Content-Type": "application/json",
6477
+ ...options.headers
6478
+ }
6479
+ });
6480
+ }
6481
+ /**
6482
+ * Get a workflow migration
6483
+ *
6484
+ * Returns a workflow migration with the outcome of each task.
6485
+ */
6486
+ static getWorkflowMigration(options) {
6487
+ return (options.client ?? client).get({
6488
+ url: "/v1/projects/{project_id}/workflows/{workflow_id}/migrations/{migration_id}",
6489
+ ...options
6490
+ });
6491
+ }
6451
6492
  };
6452
6493
  //#endregion
6453
6494
  //#region ../sdk/src/naturaliClient.ts
@@ -22420,6 +22461,47 @@ const routes = {
22420
22461
  }
22421
22462
  ]
22422
22463
  },
22464
+ "migrate-task": {
22465
+ serviceClass: "Tasks",
22466
+ operationId: "migrateTask",
22467
+ description: "Moves an open task onto a newer version of its workflow. A state the target version also declares maps to itself; `state_map` maps a state it lacks. The payload is re-validated against the target `payload_schema`. The mapped state's `on_enter` is not fired: transition the task when you want the target's automation. A task with a dispatch in flight or a transition pending approval is refused, since both belong to the version they started under. Recorded in history as a row with `transition: null` and both versions.",
22468
+ moduleDocsUrl: "https://naturali.ai/docs/modules/tasks",
22469
+ httpMethod: "post",
22470
+ pathParams: ["project_id", "task_id"],
22471
+ queryParams: [],
22472
+ headerParams: [],
22473
+ cookieParams: [],
22474
+ flags: [
22475
+ {
22476
+ "name": "project_id",
22477
+ "description": "Project public ID (proj_ prefix).",
22478
+ "required": true,
22479
+ "type": "string",
22480
+ "in": "path"
22481
+ },
22482
+ {
22483
+ "name": "task_id",
22484
+ "description": "The task to migrate.",
22485
+ "required": true,
22486
+ "type": "string",
22487
+ "in": "path"
22488
+ },
22489
+ {
22490
+ "name": "to_version",
22491
+ "description": "The workflow version to move the task onto; newer than its current one.",
22492
+ "required": true,
22493
+ "type": "integer",
22494
+ "in": "body"
22495
+ },
22496
+ {
22497
+ "name": "state_map",
22498
+ "description": "Current state name to a state the target version declares. Required only for a state the target lacks; an entry for a state both declare overrides the identity mapping.",
22499
+ "required": false,
22500
+ "type": "object",
22501
+ "in": "body"
22502
+ }
22503
+ ]
22504
+ },
22423
22505
  "pause-task": {
22424
22506
  serviceClass: "Tasks",
22425
22507
  operationId: "pauseTask",
@@ -24419,7 +24501,7 @@ const routes = {
24419
24501
  "get-workflow-version": {
24420
24502
  serviceClass: "Workflows",
24421
24503
  operationId: "getWorkflowVersion",
24422
- description: "Returns the exact state machine a given version describes. Every task records the version it entered on in `workflow_version` and runs on that machine for its whole life, so this is how you read the definition a task is actually being validated against — including a task whose workflow has been rewired since.",
24504
+ description: "Returns the exact state machine a given version describes. Every task records the version it runs on in `workflow_version`, fixed at creation and moved only by migrate-task, so this is how you read the definition a task is actually being validated against — including a task whose workflow has been rewired since.",
24423
24505
  moduleDocsUrl: "https://naturali.ai/docs/modules/workflows",
24424
24506
  httpMethod: "get",
24425
24507
  pathParams: [
@@ -24498,6 +24580,92 @@ const routes = {
24498
24580
  "in": "body"
24499
24581
  }
24500
24582
  ]
24583
+ },
24584
+ "create-workflow-migration": {
24585
+ serviceClass: "Workflows",
24586
+ operationId: "createWorkflowMigration",
24587
+ description: "Moves every open task of the workflow that runs on an older version, or on none, onto `to_version`. Each task is migrated as migrate-task migrates one and needs `tasks:MigrateTask` on it; a task it would refuse is reported as `refused` with the error, and the run goes on. The tasks and the caller's permission on each are fixed when the run is recorded. A `state_map` target the version lacks, or a terminal one, refuses the request before any task moves. Runs in the background by default (`status: queued`); `wait: true` answers once every task has settled. See [Migrating every open task](/docs/modules/workflows#migrating-every-open-task).",
24588
+ moduleDocsUrl: "https://naturali.ai/docs/modules/workflows",
24589
+ httpMethod: "post",
24590
+ pathParams: ["project_id", "workflow_id"],
24591
+ queryParams: [],
24592
+ headerParams: [],
24593
+ cookieParams: [],
24594
+ flags: [
24595
+ {
24596
+ "name": "project_id",
24597
+ "description": "Project public ID (proj_ prefix).",
24598
+ "required": true,
24599
+ "type": "string",
24600
+ "in": "path"
24601
+ },
24602
+ {
24603
+ "name": "workflow_id",
24604
+ "description": "The workflow whose tasks migrate.",
24605
+ "required": true,
24606
+ "type": "string",
24607
+ "in": "path"
24608
+ },
24609
+ {
24610
+ "name": "to_version",
24611
+ "description": "The workflow version to move the open tasks onto.",
24612
+ "required": true,
24613
+ "type": "integer",
24614
+ "in": "body"
24615
+ },
24616
+ {
24617
+ "name": "state_map",
24618
+ "description": "Current state name to a state the target version declares, applied to every task as migrate-task applies it to one.",
24619
+ "required": false,
24620
+ "type": "object",
24621
+ "in": "body"
24622
+ },
24623
+ {
24624
+ "name": "wait",
24625
+ "description": "When omitted or `false` (default), the run is answered `queued` and settles in the background; poll get-workflow-migration. Pass `true` to answer once every task has settled.",
24626
+ "required": false,
24627
+ "type": "boolean",
24628
+ "in": "body"
24629
+ }
24630
+ ]
24631
+ },
24632
+ "get-workflow-migration": {
24633
+ serviceClass: "Workflows",
24634
+ operationId: "getWorkflowMigration",
24635
+ description: "Returns a workflow migration with the outcome of each task.",
24636
+ moduleDocsUrl: "https://naturali.ai/docs/modules/workflows",
24637
+ httpMethod: "get",
24638
+ pathParams: [
24639
+ "project_id",
24640
+ "workflow_id",
24641
+ "migration_id"
24642
+ ],
24643
+ queryParams: [],
24644
+ headerParams: [],
24645
+ cookieParams: [],
24646
+ flags: [
24647
+ {
24648
+ "name": "project_id",
24649
+ "description": "Project public ID (proj_ prefix).",
24650
+ "required": true,
24651
+ "type": "string",
24652
+ "in": "path"
24653
+ },
24654
+ {
24655
+ "name": "workflow_id",
24656
+ "description": "The workflow whose tasks migrate.",
24657
+ "required": true,
24658
+ "type": "string",
24659
+ "in": "path"
24660
+ },
24661
+ {
24662
+ "name": "migration_id",
24663
+ "description": "The workflow migration to read.",
24664
+ "required": true,
24665
+ "type": "string",
24666
+ "in": "path"
24667
+ }
24668
+ ]
24501
24669
  }
24502
24670
  };
24503
24671
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.206.10",
3
+ "version": "0.207.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "keywords": [
6
6
  "naturali",
@@ -31,7 +31,7 @@
31
31
  "yaml": "^2.9.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@naturali/sdk": "0.206.10",
34
+ "@naturali/sdk": "0.207.0",
35
35
  "@ttoss/openapi-codegen": "^0.5.0",
36
36
  "@types/node": "^26.5.1",
37
37
  "tsdown": "^0.23.0",