@naturali/cli 0.194.2 → 0.195.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 +1435 -1
  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.194.2";
20
+ var version = "0.195.0";
21
21
  //#endregion
22
22
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
23
23
  const serializeFormDataPair = (data, key, value) => {
@@ -4515,6 +4515,361 @@ var Orchestrations = class {
4515
4515
  });
4516
4516
  }
4517
4517
  };
4518
+ var Playbooks = class {
4519
+ /**
4520
+ * List playbooks
4521
+ *
4522
+ * Returns the playbooks defined in a project, newest first.
4523
+ */
4524
+ static listPlaybooks(options) {
4525
+ return (options.client ?? client).get({
4526
+ url: "/v1/projects/{project_id}/playbooks",
4527
+ ...options
4528
+ });
4529
+ }
4530
+ /**
4531
+ * Create a playbook
4532
+ *
4533
+ * Creates a playbook at version 1. The definition is refused with `400 PLAYBOOK_VALIDATION_FAILED` when it holds a duplicate node or input, an input reading a missing node or field, an `execute` node without an executor or another kind with one, transformations on a non-final node, or a cycle; `meta.problems` lists every one. A duplicate `name` in the project is `409 NAME_CONFLICT`.
4534
+ *
4535
+ * The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403 PLAYBOOK_EXECUTOR_FORBIDDEN`). A definition with executors written with a trigger or OAuth token is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`: those carry their boundary in the token, so no run can act as them.
4536
+ */
4537
+ static createPlaybook(options) {
4538
+ return (options.client ?? client).post({
4539
+ url: "/v1/projects/{project_id}/playbooks",
4540
+ ...options,
4541
+ headers: {
4542
+ "Content-Type": "application/json",
4543
+ ...options.headers
4544
+ }
4545
+ });
4546
+ }
4547
+ /**
4548
+ * Validate a playbook definition
4549
+ *
4550
+ * Answers what a create or update would be told about a definition, without writing: `valid`, and every graph problem it holds. A definition whose shape cannot be read is `400 VALIDATION_FAILED`, as on a write.
4551
+ */
4552
+ static validatePlaybook(options) {
4553
+ return (options.client ?? client).post({
4554
+ url: "/v1/projects/{project_id}/playbooks/validate",
4555
+ ...options,
4556
+ headers: {
4557
+ "Content-Type": "application/json",
4558
+ ...options.headers
4559
+ }
4560
+ });
4561
+ }
4562
+ /**
4563
+ * Delete a playbook
4564
+ *
4565
+ * Deletes a playbook and its version archive. A playbook with cases is refused with `409 PLAYBOOK_HAS_CASES`.
4566
+ */
4567
+ static deletePlaybook(options) {
4568
+ return (options.client ?? client).delete({
4569
+ url: "/v1/projects/{project_id}/playbooks/{playbook_id}",
4570
+ ...options
4571
+ });
4572
+ }
4573
+ /**
4574
+ * Get a playbook
4575
+ *
4576
+ * Returns a playbook with its current definition and version.
4577
+ */
4578
+ static getPlaybook(options) {
4579
+ return (options.client ?? client).get({
4580
+ url: "/v1/projects/{project_id}/playbooks/{playbook_id}",
4581
+ ...options
4582
+ });
4583
+ }
4584
+ /**
4585
+ * Update a playbook
4586
+ *
4587
+ * Updates any of `name`, `description` and `definition`. Only a change to `definition` archives a new version; a rename or a rewrite of the definition the playbook already holds leaves `version` where it is. A case keeps the version it was created on.
4588
+ *
4589
+ * A new version is authored by the caller, checked as on create: `403 PLAYBOOK_EXECUTOR_FORBIDDEN` for an executor it may not start, `409 PLAYBOOK_AUTHOR_UNAVAILABLE` for a trigger or OAuth token.
4590
+ */
4591
+ static updatePlaybook(options) {
4592
+ return (options.client ?? client).patch({
4593
+ url: "/v1/projects/{project_id}/playbooks/{playbook_id}",
4594
+ ...options,
4595
+ headers: {
4596
+ "Content-Type": "application/json",
4597
+ ...options.headers
4598
+ }
4599
+ });
4600
+ }
4601
+ /**
4602
+ * List a playbook's versions
4603
+ *
4604
+ * Returns the playbook's archived definitions, newest first. A version is written on create and on every write that changes `definition`.
4605
+ */
4606
+ static listPlaybookVersions(options) {
4607
+ return (options.client ?? client).get({
4608
+ url: "/v1/projects/{project_id}/playbooks/{playbook_id}/versions",
4609
+ ...options
4610
+ });
4611
+ }
4612
+ /**
4613
+ * Fetch an archived playbook version
4614
+ *
4615
+ * Returns the definition a version held: what a case pinned to it is evaluated against.
4616
+ */
4617
+ static getPlaybookVersion(options) {
4618
+ return (options.client ?? client).get({
4619
+ url: "/v1/projects/{project_id}/playbooks/{playbook_id}/versions/{version}",
4620
+ ...options
4621
+ });
4622
+ }
4623
+ /**
4624
+ * Restore an archived playbook version
4625
+ *
4626
+ * Writes an archived definition back as the playbook's live one, which archives it again as a new version rather than rewinding the counter. Restoring the definition the playbook already holds is a no-op. The caller authors the new version, checked as on create.
4627
+ */
4628
+ static restorePlaybookVersion(options) {
4629
+ return (options.client ?? client).post({
4630
+ url: "/v1/projects/{project_id}/playbooks/{playbook_id}/versions/{version}/restore",
4631
+ ...options,
4632
+ headers: {
4633
+ "Content-Type": "application/json",
4634
+ ...options.headers
4635
+ }
4636
+ });
4637
+ }
4638
+ /**
4639
+ * Create a case
4640
+ *
4641
+ * Creates a case for one subject on the playbook's current version. The case stays on that version however the playbook changes later.
4642
+ */
4643
+ static createPlaybookCase(options) {
4644
+ return (options.client ?? client).post({
4645
+ url: "/v1/projects/{project_id}/playbooks/{playbook_id}/cases",
4646
+ ...options,
4647
+ headers: {
4648
+ "Content-Type": "application/json",
4649
+ ...options.headers
4650
+ }
4651
+ });
4652
+ }
4653
+ /**
4654
+ * List playbook cases
4655
+ *
4656
+ * Returns a project's cases, newest first, without node states; read one case for those.
4657
+ */
4658
+ static listPlaybookCases(options) {
4659
+ return (options.client ?? client).get({
4660
+ url: "/v1/projects/{project_id}/playbook-cases",
4661
+ ...options
4662
+ });
4663
+ }
4664
+ /**
4665
+ * Delete a case
4666
+ *
4667
+ * Deletes a case and every entry written to it.
4668
+ */
4669
+ static deletePlaybookCase(options) {
4670
+ return (options.client ?? client).delete({
4671
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}",
4672
+ ...options
4673
+ });
4674
+ }
4675
+ /**
4676
+ * Get a case
4677
+ *
4678
+ * Returns a case with every node's state, computed from its entries on each read and never stored.
4679
+ */
4680
+ static getPlaybookCase(options) {
4681
+ return (options.client ?? client).get({
4682
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}",
4683
+ ...options
4684
+ });
4685
+ }
4686
+ /**
4687
+ * Write a case's inputs
4688
+ *
4689
+ * Writes a batch of manual inputs, all or none. Each write names the revision it read in `expected_revision`, `null` for a field still unset; when any field has moved on the whole batch is refused with `409 PLAYBOOK_INPUT_CONFLICT` and `meta.conflicts` names each field. An input the case's version does not declare, one that reads another node, or a value its schema refuses is `400 PLAYBOOK_INPUT_INVALID`. A value equal to the field's current one writes no revision. Once written, every node the write makes runnable is queued to run, unless the case is paused. A write made with a credential the case's own work runs as — the case, one of its executions in flight, or the task or run one started — is `403 PLAYBOOK_SELF_WRITE`.
4690
+ */
4691
+ static writePlaybookCaseInputs(options) {
4692
+ return (options.client ?? client).post({
4693
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/inputs",
4694
+ ...options,
4695
+ headers: {
4696
+ "Content-Type": "application/json",
4697
+ ...options.headers
4698
+ }
4699
+ });
4700
+ }
4701
+ /**
4702
+ * List what a node still needs
4703
+ *
4704
+ * Returns the manual inputs still unset, or refused by their schema, before `node` can be reached, grouped in waves: nothing in a later wave can run before the earlier ones are filled.
4705
+ */
4706
+ static getPlaybookCaseMissing(options) {
4707
+ return (options.client ?? client).get({
4708
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/missing",
4709
+ ...options
4710
+ });
4711
+ }
4712
+ /**
4713
+ * List a case's entries
4714
+ *
4715
+ * Returns every value written to the case, newest first. Entries are never rewritten, so this is the case's full history.
4716
+ */
4717
+ static listPlaybookCaseEntries(options) {
4718
+ return (options.client ?? client).get({
4719
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/entries",
4720
+ ...options
4721
+ });
4722
+ }
4723
+ /**
4724
+ * Run a node of a case
4725
+ *
4726
+ * Runs one node now. The cascade already runs every node whose inputs are set once a write, a settle or a resume makes it runnable, and never reruns a `failed` one: this is how a failed node is retried. A `collect` node takes its own input values as its output, any other node starts its executor with the node's input values mapped through the executor's `input`. The executor runs as the author of the case's playbook version, whose permission to start it is checked again here (`403 PLAYBOOK_EXECUTOR_FORBIDDEN`); an author that no longer exists is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`. Only a `ready`, `stale` or `failed` node with every required input set runs; anything else is `409 PLAYBOOK_NODE_NOT_RUNNABLE`. A paused case is `409 PLAYBOOK_CASE_PAUSED`.
4727
+ *
4728
+ * The output is written as an entry when the execution settles. A value equal to the node's current output writes no revision. If the node's inputs change while it runs, the execution settles as `superseded` and writes nothing.
4729
+ *
4730
+ * Without `wait` the execution answers `running` and settles in the background. With `wait: true` it answers once the executor settles, or once it parks: a workflow task still open, or an orchestration run waiting on a person or a timer, settles the node when it closes or ends.
4731
+ */
4732
+ static runPlaybookCaseNode(options) {
4733
+ return (options.client ?? client).post({
4734
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/nodes/{node}/run",
4735
+ ...options,
4736
+ headers: {
4737
+ "Content-Type": "application/json",
4738
+ ...options.headers
4739
+ }
4740
+ });
4741
+ }
4742
+ /**
4743
+ * List a case's executions
4744
+ *
4745
+ * Returns every run of the case's nodes, newest first.
4746
+ */
4747
+ static listPlaybookCaseExecutions(options) {
4748
+ return (options.client ?? client).get({
4749
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/executions",
4750
+ ...options
4751
+ });
4752
+ }
4753
+ /**
4754
+ * Get an execution
4755
+ *
4756
+ * Returns one run of a case's node.
4757
+ */
4758
+ static getPlaybookCaseExecution(options) {
4759
+ return (options.client ?? client).get({
4760
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/executions/{execution_id}",
4761
+ ...options
4762
+ });
4763
+ }
4764
+ /**
4765
+ * Export a final node
4766
+ *
4767
+ * Renders one revision of a final node as files, one export per transformation: each transformation's tool is called with the case's `case_id` and `subject`, the `node`, the `revision` and that revision's `output`, and must answer a file (`execute.response_mode: base64`) of its `format`'s content type. The file is kept in the project's files under `/.system/playbooks/`. An export never feeds a node.
4768
+ *
4769
+ * Without `revision` the node's current output is exported, which needs the node `done` (`409 PLAYBOOK_NODE_NOT_EXPORTABLE`); a `revision` names an earlier output or confirmation of the node. Each tool runs as the author of the case's playbook version, whose permission to call it is checked here (`403 PLAYBOOK_EXECUTOR_FORBIDDEN`). A paused case is `409 PLAYBOOK_CASE_PAUSED`.
4770
+ *
4771
+ * Without `wait` every export answers `running` and settles in the background; with `wait: true` it answers once each has its file or its error.
4772
+ */
4773
+ static exportPlaybookCaseNode(options) {
4774
+ return (options.client ?? client).post({
4775
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/nodes/{node}/exports",
4776
+ ...options,
4777
+ headers: {
4778
+ "Content-Type": "application/json",
4779
+ ...options.headers
4780
+ }
4781
+ });
4782
+ }
4783
+ /**
4784
+ * List a case's exports
4785
+ *
4786
+ * Returns every file rendered from the case's final nodes, newest first.
4787
+ */
4788
+ static listPlaybookCaseExports(options) {
4789
+ return (options.client ?? client).get({
4790
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/exports",
4791
+ ...options
4792
+ });
4793
+ }
4794
+ /**
4795
+ * Get an export
4796
+ *
4797
+ * Returns one file rendered from a case's final node.
4798
+ */
4799
+ static getPlaybookCaseExport(options) {
4800
+ return (options.client ?? client).get({
4801
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/exports/{export_id}",
4802
+ ...options
4803
+ });
4804
+ }
4805
+ /**
4806
+ * Upgrade a case
4807
+ *
4808
+ * Moves a case to another version of its playbook: the playbook's current version, or the `version` named, an earlier one included. Values carry over by node key, and every node's state is read against the new version: a node added is open, a node removed leaves the structure while its entries stay, a node whose input reads another field is `stale`, and a value its input's new schema refuses is missing again. The cascade then runs what became runnable. Each upgrade is recorded with what moved; the version the case is already on records nothing.
4809
+ *
4810
+ * An execution running is `409 PLAYBOOK_CASE_BUSY`; one queued but not started settles `superseded`. An upgrade made with a credential the case's own work runs as is `403 PLAYBOOK_SELF_WRITE`.
4811
+ */
4812
+ static upgradePlaybookCase(options) {
4813
+ return (options.client ?? client).post({
4814
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/upgrade",
4815
+ ...options,
4816
+ headers: {
4817
+ "Content-Type": "application/json",
4818
+ ...options.headers
4819
+ }
4820
+ });
4821
+ }
4822
+ /**
4823
+ * List a case's upgrades
4824
+ *
4825
+ * Returns every version change of the case, newest first.
4826
+ */
4827
+ static listPlaybookCaseUpgrades(options) {
4828
+ return (options.client ?? client).get({
4829
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/upgrades",
4830
+ ...options
4831
+ });
4832
+ }
4833
+ /**
4834
+ * Pause a case
4835
+ *
4836
+ * Stops the case starting anything: no node is queued and no queued execution starts until it is resumed. Executions already running settle. Input writes are still accepted. Pausing a paused case keeps the first pause.
4837
+ */
4838
+ static pausePlaybookCase(options) {
4839
+ return (options.client ?? client).post({
4840
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/pause",
4841
+ ...options
4842
+ });
4843
+ }
4844
+ /**
4845
+ * Resume a case
4846
+ *
4847
+ * Lifts the pause and starts what became runnable while the case was paused. A case that is not paused is `409 PLAYBOOK_CASE_NOT_PAUSED`.
4848
+ */
4849
+ static resumePlaybookCase(options) {
4850
+ return (options.client ?? client).post({
4851
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/resume",
4852
+ ...options
4853
+ });
4854
+ }
4855
+ /**
4856
+ * Confirm a node of a case
4857
+ *
4858
+ * Approves or rejects a `confirm` node on the inputs the confirmer read. `expected_revisions` names the revision of each of the node's inputs as read (`nodes[].inputs[].revision` on the case); an input that moved since is `409 PLAYBOOK_INPUT_CONFLICT`, `meta.conflicts` naming each, and nothing is written.
4859
+ *
4860
+ * An approval writes a `confirmation` entry whose value is the node's input values: it is the node's output, and the nodes reading it run next. A rejection writes a `rejection` entry with the `reason`: the node is `rejected`, and every node reading it is blocked, until its inputs change or it is approved. Another node, or a `confirm` node with a required input unset or reading a node that is not `done`, is `409 PLAYBOOK_NODE_NOT_CONFIRMABLE`. A confirmation made with a credential the case's own work runs as is `403 PLAYBOOK_SELF_WRITE`.
4861
+ */
4862
+ static confirmPlaybookCaseNode(options) {
4863
+ return (options.client ?? client).post({
4864
+ url: "/v1/projects/{project_id}/playbook-cases/{case_id}/nodes/{node}/confirmation",
4865
+ ...options,
4866
+ headers: {
4867
+ "Content-Type": "application/json",
4868
+ ...options.headers
4869
+ }
4870
+ });
4871
+ }
4872
+ };
4518
4873
  var Projects = class {
4519
4874
  /**
4520
4875
  * List projects
@@ -6150,6 +6505,7 @@ var NaturaliClient = class {
6150
6505
  quotas;
6151
6506
  models;
6152
6507
  orchestrations;
6508
+ playbooks;
6153
6509
  projects;
6154
6510
  secrets;
6155
6511
  sessions;
@@ -6205,6 +6561,7 @@ var NaturaliClient = class {
6205
6561
  this.quotas = bindResource(Quotas, this.http);
6206
6562
  this.models = bindResource(Models, this.http);
6207
6563
  this.orchestrations = bindResource(Orchestrations, this.http);
6564
+ this.playbooks = bindResource(Playbooks, this.http);
6208
6565
  this.projects = bindResource(Projects, this.http);
6209
6566
  this.secrets = bindResource(Secrets, this.http);
6210
6567
  this.sessions = bindResource(Sessions, this.http);
@@ -6255,6 +6612,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
6255
6612
  Models: () => Models,
6256
6613
  NaturaliClient: () => NaturaliClient,
6257
6614
  Orchestrations: () => Orchestrations,
6615
+ Playbooks: () => Playbooks,
6258
6616
  Projects: () => Projects,
6259
6617
  Quotas: () => Quotas,
6260
6618
  Secrets: () => Secrets,
@@ -18642,6 +19000,1082 @@ const routes = {
18642
19000
  }
18643
19001
  ]
18644
19002
  },
19003
+ "list-playbooks": {
19004
+ serviceClass: "Playbooks",
19005
+ operationId: "listPlaybooks",
19006
+ description: "Returns the playbooks defined in a project, newest first.",
19007
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19008
+ httpMethod: "get",
19009
+ pathParams: ["project_id"],
19010
+ queryParams: ["limit", "offset"],
19011
+ headerParams: [],
19012
+ cookieParams: [],
19013
+ flags: [
19014
+ {
19015
+ "name": "project_id",
19016
+ "description": "Project public ID (proj_ prefix).",
19017
+ "required": true,
19018
+ "type": "string",
19019
+ "in": "path"
19020
+ },
19021
+ {
19022
+ "name": "limit",
19023
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
19024
+ "required": false,
19025
+ "type": "integer",
19026
+ "in": "query"
19027
+ },
19028
+ {
19029
+ "name": "offset",
19030
+ "description": "Results to skip. Negative or not an integer it is `400`.",
19031
+ "required": false,
19032
+ "type": "integer",
19033
+ "in": "query"
19034
+ }
19035
+ ]
19036
+ },
19037
+ "create-playbook": {
19038
+ serviceClass: "Playbooks",
19039
+ operationId: "createPlaybook",
19040
+ description: "Creates a playbook at version 1. The definition is refused with `400 PLAYBOOK_VALIDATION_FAILED` when it holds a duplicate node or input, an input reading a missing node or field, an `execute` node without an executor or another kind with one, transformations on a non-final node, or a cycle; `meta.problems` lists every one. A duplicate `name` in the project is `409 NAME_CONFLICT`. The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403 PLAYBOOK_EXECUTOR_FORBIDDEN`). A definition with executors written with a trigger or OAuth token is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`: those carry their boundary in the token, so no run can act as them.",
19041
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19042
+ httpMethod: "post",
19043
+ pathParams: ["project_id"],
19044
+ queryParams: [],
19045
+ headerParams: [],
19046
+ cookieParams: [],
19047
+ flags: [
19048
+ {
19049
+ "name": "project_id",
19050
+ "description": "Project public ID (proj_ prefix).",
19051
+ "required": true,
19052
+ "type": "string",
19053
+ "in": "path"
19054
+ },
19055
+ {
19056
+ "name": "name",
19057
+ "description": "Human-readable name, unique per project",
19058
+ "required": true,
19059
+ "type": "string",
19060
+ "in": "body"
19061
+ },
19062
+ {
19063
+ "name": "description",
19064
+ "description": "What the playbook is for",
19065
+ "required": false,
19066
+ "type": "string",
19067
+ "in": "body"
19068
+ },
19069
+ {
19070
+ "name": "definition",
19071
+ "description": "The nodes and how their inputs are sourced",
19072
+ "required": true,
19073
+ "type": "object",
19074
+ "in": "body"
19075
+ },
19076
+ {
19077
+ "name": "version_label",
19078
+ "description": "Optional tag for version 1, e.g. `initial`",
19079
+ "required": false,
19080
+ "type": "string",
19081
+ "in": "body"
19082
+ }
19083
+ ]
19084
+ },
19085
+ "validate-playbook": {
19086
+ serviceClass: "Playbooks",
19087
+ operationId: "validatePlaybook",
19088
+ description: "Answers what a create or update would be told about a definition, without writing: `valid`, and every graph problem it holds. A definition whose shape cannot be read is `400 VALIDATION_FAILED`, as on a write.",
19089
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19090
+ httpMethod: "post",
19091
+ pathParams: ["project_id"],
19092
+ queryParams: [],
19093
+ headerParams: [],
19094
+ cookieParams: [],
19095
+ flags: [{
19096
+ "name": "project_id",
19097
+ "description": "Project public ID (proj_ prefix).",
19098
+ "required": true,
19099
+ "type": "string",
19100
+ "in": "path"
19101
+ }, {
19102
+ "name": "definition",
19103
+ "description": "The definition to check",
19104
+ "required": true,
19105
+ "type": "object",
19106
+ "in": "body"
19107
+ }]
19108
+ },
19109
+ "get-playbook": {
19110
+ serviceClass: "Playbooks",
19111
+ operationId: "getPlaybook",
19112
+ description: "Returns a playbook with its current definition and version.",
19113
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19114
+ httpMethod: "get",
19115
+ pathParams: ["project_id", "playbook_id"],
19116
+ queryParams: [],
19117
+ headerParams: [],
19118
+ cookieParams: [],
19119
+ flags: [{
19120
+ "name": "project_id",
19121
+ "description": "Project public ID (proj_ prefix).",
19122
+ "required": true,
19123
+ "type": "string",
19124
+ "in": "path"
19125
+ }, {
19126
+ "name": "playbook_id",
19127
+ "description": "The playbook ID",
19128
+ "required": true,
19129
+ "type": "string",
19130
+ "in": "path"
19131
+ }]
19132
+ },
19133
+ "update-playbook": {
19134
+ serviceClass: "Playbooks",
19135
+ operationId: "updatePlaybook",
19136
+ description: "Updates any of `name`, `description` and `definition`. Only a change to `definition` archives a new version; a rename or a rewrite of the definition the playbook already holds leaves `version` where it is. A case keeps the version it was created on. A new version is authored by the caller, checked as on create: `403 PLAYBOOK_EXECUTOR_FORBIDDEN` for an executor it may not start, `409 PLAYBOOK_AUTHOR_UNAVAILABLE` for a trigger or OAuth token.",
19137
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19138
+ httpMethod: "patch",
19139
+ pathParams: ["project_id", "playbook_id"],
19140
+ queryParams: [],
19141
+ headerParams: ["If-Match"],
19142
+ cookieParams: [],
19143
+ flags: [
19144
+ {
19145
+ "name": "project_id",
19146
+ "description": "Project public ID (proj_ prefix).",
19147
+ "required": true,
19148
+ "type": "string",
19149
+ "in": "path"
19150
+ },
19151
+ {
19152
+ "name": "playbook_id",
19153
+ "description": "The playbook ID",
19154
+ "required": true,
19155
+ "type": "string",
19156
+ "in": "path"
19157
+ },
19158
+ {
19159
+ "name": "If-Match",
19160
+ "description": "The version the caller believes the resource holds, as an entity tag (`3` or `\"3\"`). Equivalent to `expected_version` in the request body; `*` states no precondition beyond the resource existing. A mismatch is `409 VERSION_CONFLICT`.",
19161
+ "required": false,
19162
+ "type": "string",
19163
+ "in": "header"
19164
+ },
19165
+ {
19166
+ "name": "name",
19167
+ "description": "Human-readable name, unique per project",
19168
+ "required": false,
19169
+ "type": "string",
19170
+ "in": "body"
19171
+ },
19172
+ {
19173
+ "name": "description",
19174
+ "description": "What the playbook is for",
19175
+ "required": false,
19176
+ "type": "string",
19177
+ "in": "body"
19178
+ },
19179
+ {
19180
+ "name": "definition",
19181
+ "description": "Replaces the whole definition; a change archives a new version",
19182
+ "required": false,
19183
+ "type": "object",
19184
+ "in": "body"
19185
+ },
19186
+ {
19187
+ "name": "version_label",
19188
+ "description": "Optional tag for the version this write archives. Ignored when the write changes no definition, since no version is archived.",
19189
+ "required": false,
19190
+ "type": "string",
19191
+ "in": "body"
19192
+ },
19193
+ {
19194
+ "name": "expected_version",
19195
+ "description": "Refuses the write unless the playbook is at this version.",
19196
+ "required": false,
19197
+ "type": "integer",
19198
+ "in": "body"
19199
+ }
19200
+ ]
19201
+ },
19202
+ "delete-playbook": {
19203
+ serviceClass: "Playbooks",
19204
+ operationId: "deletePlaybook",
19205
+ description: "Deletes a playbook and its version archive. A playbook with cases is refused with `409 PLAYBOOK_HAS_CASES`.",
19206
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19207
+ httpMethod: "delete",
19208
+ pathParams: ["project_id", "playbook_id"],
19209
+ queryParams: [],
19210
+ headerParams: [],
19211
+ cookieParams: [],
19212
+ flags: [{
19213
+ "name": "project_id",
19214
+ "description": "Project public ID (proj_ prefix).",
19215
+ "required": true,
19216
+ "type": "string",
19217
+ "in": "path"
19218
+ }, {
19219
+ "name": "playbook_id",
19220
+ "description": "The playbook ID",
19221
+ "required": true,
19222
+ "type": "string",
19223
+ "in": "path"
19224
+ }]
19225
+ },
19226
+ "list-playbook-versions": {
19227
+ serviceClass: "Playbooks",
19228
+ operationId: "listPlaybookVersions",
19229
+ description: "Returns the playbook's archived definitions, newest first. A version is written on create and on every write that changes `definition`.",
19230
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19231
+ httpMethod: "get",
19232
+ pathParams: ["project_id", "playbook_id"],
19233
+ queryParams: ["limit", "offset"],
19234
+ headerParams: [],
19235
+ cookieParams: [],
19236
+ flags: [
19237
+ {
19238
+ "name": "project_id",
19239
+ "description": "Project public ID (proj_ prefix).",
19240
+ "required": true,
19241
+ "type": "string",
19242
+ "in": "path"
19243
+ },
19244
+ {
19245
+ "name": "playbook_id",
19246
+ "description": "The playbook ID",
19247
+ "required": true,
19248
+ "type": "string",
19249
+ "in": "path"
19250
+ },
19251
+ {
19252
+ "name": "limit",
19253
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
19254
+ "required": false,
19255
+ "type": "integer",
19256
+ "in": "query"
19257
+ },
19258
+ {
19259
+ "name": "offset",
19260
+ "description": "Results to skip. Negative or not an integer it is `400`.",
19261
+ "required": false,
19262
+ "type": "integer",
19263
+ "in": "query"
19264
+ }
19265
+ ]
19266
+ },
19267
+ "get-playbook-version": {
19268
+ serviceClass: "Playbooks",
19269
+ operationId: "getPlaybookVersion",
19270
+ description: "Returns the definition a version held: what a case pinned to it is evaluated against.",
19271
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19272
+ httpMethod: "get",
19273
+ pathParams: [
19274
+ "project_id",
19275
+ "playbook_id",
19276
+ "version"
19277
+ ],
19278
+ queryParams: [],
19279
+ headerParams: [],
19280
+ cookieParams: [],
19281
+ flags: [
19282
+ {
19283
+ "name": "project_id",
19284
+ "description": "Project public ID (proj_ prefix).",
19285
+ "required": true,
19286
+ "type": "string",
19287
+ "in": "path"
19288
+ },
19289
+ {
19290
+ "name": "playbook_id",
19291
+ "description": "The playbook ID",
19292
+ "required": true,
19293
+ "type": "string",
19294
+ "in": "path"
19295
+ },
19296
+ {
19297
+ "name": "version",
19298
+ "description": "The archived version number",
19299
+ "required": true,
19300
+ "type": "integer",
19301
+ "in": "path"
19302
+ }
19303
+ ]
19304
+ },
19305
+ "restore-playbook-version": {
19306
+ serviceClass: "Playbooks",
19307
+ operationId: "restorePlaybookVersion",
19308
+ description: "Writes an archived definition back as the playbook's live one, which archives it again as a new version rather than rewinding the counter. Restoring the definition the playbook already holds is a no-op. The caller authors the new version, checked as on create.",
19309
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19310
+ httpMethod: "post",
19311
+ pathParams: [
19312
+ "project_id",
19313
+ "playbook_id",
19314
+ "version"
19315
+ ],
19316
+ queryParams: [],
19317
+ headerParams: [],
19318
+ cookieParams: [],
19319
+ flags: [
19320
+ {
19321
+ "name": "project_id",
19322
+ "description": "Project public ID (proj_ prefix).",
19323
+ "required": true,
19324
+ "type": "string",
19325
+ "in": "path"
19326
+ },
19327
+ {
19328
+ "name": "playbook_id",
19329
+ "description": "The playbook ID",
19330
+ "required": true,
19331
+ "type": "string",
19332
+ "in": "path"
19333
+ },
19334
+ {
19335
+ "name": "version",
19336
+ "description": "The archived version number",
19337
+ "required": true,
19338
+ "type": "integer",
19339
+ "in": "path"
19340
+ },
19341
+ {
19342
+ "name": "label",
19343
+ "description": "Optional tag for the new version. Defaults to `restored from vN`.",
19344
+ "required": false,
19345
+ "type": "string",
19346
+ "in": "body"
19347
+ }
19348
+ ]
19349
+ },
19350
+ "create-playbook-case": {
19351
+ serviceClass: "Playbooks",
19352
+ operationId: "createPlaybookCase",
19353
+ description: "Creates a case for one subject on the playbook's current version. The case stays on that version however the playbook changes later.",
19354
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19355
+ httpMethod: "post",
19356
+ pathParams: ["project_id", "playbook_id"],
19357
+ queryParams: [],
19358
+ headerParams: [],
19359
+ cookieParams: [],
19360
+ flags: [
19361
+ {
19362
+ "name": "project_id",
19363
+ "description": "Project public ID (proj_ prefix).",
19364
+ "required": true,
19365
+ "type": "string",
19366
+ "in": "path"
19367
+ },
19368
+ {
19369
+ "name": "playbook_id",
19370
+ "description": "The playbook ID",
19371
+ "required": true,
19372
+ "type": "string",
19373
+ "in": "path"
19374
+ },
19375
+ {
19376
+ "name": "subject",
19377
+ "description": "Who or what the case is about, as you name it",
19378
+ "required": true,
19379
+ "type": "string",
19380
+ "in": "body"
19381
+ }
19382
+ ]
19383
+ },
19384
+ "list-playbook-cases": {
19385
+ serviceClass: "Playbooks",
19386
+ operationId: "listPlaybookCases",
19387
+ description: "Returns a project's cases, newest first, without node states; read one case for those.",
19388
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19389
+ httpMethod: "get",
19390
+ pathParams: ["project_id"],
19391
+ queryParams: [
19392
+ "playbook_id",
19393
+ "automation_status",
19394
+ "limit",
19395
+ "offset"
19396
+ ],
19397
+ headerParams: [],
19398
+ cookieParams: [],
19399
+ flags: [
19400
+ {
19401
+ "name": "project_id",
19402
+ "description": "Project public ID (proj_ prefix).",
19403
+ "required": true,
19404
+ "type": "string",
19405
+ "in": "path"
19406
+ },
19407
+ {
19408
+ "name": "playbook_id",
19409
+ "description": "Only the cases of this playbook",
19410
+ "required": false,
19411
+ "type": "string",
19412
+ "in": "query"
19413
+ },
19414
+ {
19415
+ "name": "automation_status",
19416
+ "description": "Only the cases in this automation status",
19417
+ "required": false,
19418
+ "type": "string",
19419
+ "in": "query"
19420
+ },
19421
+ {
19422
+ "name": "limit",
19423
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
19424
+ "required": false,
19425
+ "type": "integer",
19426
+ "in": "query"
19427
+ },
19428
+ {
19429
+ "name": "offset",
19430
+ "description": "Results to skip. Negative or not an integer it is `400`.",
19431
+ "required": false,
19432
+ "type": "integer",
19433
+ "in": "query"
19434
+ }
19435
+ ]
19436
+ },
19437
+ "get-playbook-case": {
19438
+ serviceClass: "Playbooks",
19439
+ operationId: "getPlaybookCase",
19440
+ description: "Returns a case with every node's state, computed from its entries on each read and never stored.",
19441
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19442
+ httpMethod: "get",
19443
+ pathParams: ["project_id", "case_id"],
19444
+ queryParams: [],
19445
+ headerParams: [],
19446
+ cookieParams: [],
19447
+ flags: [{
19448
+ "name": "project_id",
19449
+ "description": "Project public ID (proj_ prefix).",
19450
+ "required": true,
19451
+ "type": "string",
19452
+ "in": "path"
19453
+ }, {
19454
+ "name": "case_id",
19455
+ "description": "The case ID",
19456
+ "required": true,
19457
+ "type": "string",
19458
+ "in": "path"
19459
+ }]
19460
+ },
19461
+ "delete-playbook-case": {
19462
+ serviceClass: "Playbooks",
19463
+ operationId: "deletePlaybookCase",
19464
+ description: "Deletes a case and every entry written to it.",
19465
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19466
+ httpMethod: "delete",
19467
+ pathParams: ["project_id", "case_id"],
19468
+ queryParams: [],
19469
+ headerParams: [],
19470
+ cookieParams: [],
19471
+ flags: [{
19472
+ "name": "project_id",
19473
+ "description": "Project public ID (proj_ prefix).",
19474
+ "required": true,
19475
+ "type": "string",
19476
+ "in": "path"
19477
+ }, {
19478
+ "name": "case_id",
19479
+ "description": "The case ID",
19480
+ "required": true,
19481
+ "type": "string",
19482
+ "in": "path"
19483
+ }]
19484
+ },
19485
+ "write-playbook-case-inputs": {
19486
+ serviceClass: "Playbooks",
19487
+ operationId: "writePlaybookCaseInputs",
19488
+ description: "Writes a batch of manual inputs, all or none. Each write names the revision it read in `expected_revision`, `null` for a field still unset; when any field has moved on the whole batch is refused with `409 PLAYBOOK_INPUT_CONFLICT` and `meta.conflicts` names each field. An input the case's version does not declare, one that reads another node, or a value its schema refuses is `400 PLAYBOOK_INPUT_INVALID`. A value equal to the field's current one writes no revision. Once written, every node the write makes runnable is queued to run, unless the case is paused. A write made with a credential the case's own work runs as — the case, one of its executions in flight, or the task or run one started — is `403 PLAYBOOK_SELF_WRITE`.",
19489
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19490
+ httpMethod: "post",
19491
+ pathParams: ["project_id", "case_id"],
19492
+ queryParams: [],
19493
+ headerParams: [],
19494
+ cookieParams: [],
19495
+ flags: [
19496
+ {
19497
+ "name": "project_id",
19498
+ "description": "Project public ID (proj_ prefix).",
19499
+ "required": true,
19500
+ "type": "string",
19501
+ "in": "path"
19502
+ },
19503
+ {
19504
+ "name": "case_id",
19505
+ "description": "The case ID",
19506
+ "required": true,
19507
+ "type": "string",
19508
+ "in": "path"
19509
+ },
19510
+ {
19511
+ "name": "inputs",
19512
+ "description": "The writes, applied all or none",
19513
+ "required": true,
19514
+ "type": "array",
19515
+ "in": "body"
19516
+ }
19517
+ ]
19518
+ },
19519
+ "get-playbook-case-missing": {
19520
+ serviceClass: "Playbooks",
19521
+ operationId: "getPlaybookCaseMissing",
19522
+ description: "Returns the manual inputs still unset, or refused by their schema, before `node` can be reached, grouped in waves: nothing in a later wave can run before the earlier ones are filled.",
19523
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19524
+ httpMethod: "get",
19525
+ pathParams: ["project_id", "case_id"],
19526
+ queryParams: ["node"],
19527
+ headerParams: [],
19528
+ cookieParams: [],
19529
+ flags: [
19530
+ {
19531
+ "name": "project_id",
19532
+ "description": "Project public ID (proj_ prefix).",
19533
+ "required": true,
19534
+ "type": "string",
19535
+ "in": "path"
19536
+ },
19537
+ {
19538
+ "name": "case_id",
19539
+ "description": "The case ID",
19540
+ "required": true,
19541
+ "type": "string",
19542
+ "in": "path"
19543
+ },
19544
+ {
19545
+ "name": "node",
19546
+ "description": "The key of the node to reach, usually a final node",
19547
+ "required": true,
19548
+ "type": "string",
19549
+ "in": "query"
19550
+ }
19551
+ ]
19552
+ },
19553
+ "list-playbook-case-entries": {
19554
+ serviceClass: "Playbooks",
19555
+ operationId: "listPlaybookCaseEntries",
19556
+ description: "Returns every value written to the case, newest first. Entries are never rewritten, so this is the case's full history.",
19557
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19558
+ httpMethod: "get",
19559
+ pathParams: ["project_id", "case_id"],
19560
+ queryParams: [
19561
+ "node",
19562
+ "limit",
19563
+ "offset"
19564
+ ],
19565
+ headerParams: [],
19566
+ cookieParams: [],
19567
+ flags: [
19568
+ {
19569
+ "name": "project_id",
19570
+ "description": "Project public ID (proj_ prefix).",
19571
+ "required": true,
19572
+ "type": "string",
19573
+ "in": "path"
19574
+ },
19575
+ {
19576
+ "name": "case_id",
19577
+ "description": "The case ID",
19578
+ "required": true,
19579
+ "type": "string",
19580
+ "in": "path"
19581
+ },
19582
+ {
19583
+ "name": "node",
19584
+ "description": "Only the entries of this node",
19585
+ "required": false,
19586
+ "type": "string",
19587
+ "in": "query"
19588
+ },
19589
+ {
19590
+ "name": "limit",
19591
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
19592
+ "required": false,
19593
+ "type": "integer",
19594
+ "in": "query"
19595
+ },
19596
+ {
19597
+ "name": "offset",
19598
+ "description": "Results to skip. Negative or not an integer it is `400`.",
19599
+ "required": false,
19600
+ "type": "integer",
19601
+ "in": "query"
19602
+ }
19603
+ ]
19604
+ },
19605
+ "run-playbook-case-node": {
19606
+ serviceClass: "Playbooks",
19607
+ operationId: "runPlaybookCaseNode",
19608
+ description: "Runs one node now. The cascade already runs every node whose inputs are set once a write, a settle or a resume makes it runnable, and never reruns a `failed` one: this is how a failed node is retried. A `collect` node takes its own input values as its output, any other node starts its executor with the node's input values mapped through the executor's `input`. The executor runs as the author of the case's playbook version, whose permission to start it is checked again here (`403 PLAYBOOK_EXECUTOR_FORBIDDEN`); an author that no longer exists is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`. Only a `ready`, `stale` or `failed` node with every required input set runs; anything else is `409 PLAYBOOK_NODE_NOT_RUNNABLE`. A paused case is `409 PLAYBOOK_CASE_PAUSED`. The output is written as an entry when the execution settles. A value equal to the node's current output writes no revision. If the node's inputs change while it runs, the execution settles as `superseded` and writes nothing. Without `wait` the execution answers `running` and settles in the background. With `wait: true` it answers once the executor settles, or once it parks: a workflow task still open, or an orchestration run waiting on a person or a timer, settles the node when it closes or ends.",
19609
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19610
+ httpMethod: "post",
19611
+ pathParams: [
19612
+ "project_id",
19613
+ "case_id",
19614
+ "node"
19615
+ ],
19616
+ queryParams: [],
19617
+ headerParams: [],
19618
+ cookieParams: [],
19619
+ flags: [
19620
+ {
19621
+ "name": "project_id",
19622
+ "description": "Project public ID (proj_ prefix).",
19623
+ "required": true,
19624
+ "type": "string",
19625
+ "in": "path"
19626
+ },
19627
+ {
19628
+ "name": "case_id",
19629
+ "description": "The case ID",
19630
+ "required": true,
19631
+ "type": "string",
19632
+ "in": "path"
19633
+ },
19634
+ {
19635
+ "name": "node",
19636
+ "description": "The key of a node of the case's playbook version",
19637
+ "required": true,
19638
+ "type": "string",
19639
+ "in": "path"
19640
+ },
19641
+ {
19642
+ "name": "wait",
19643
+ "description": "Answer once the executor settles or parks instead of right away",
19644
+ "required": false,
19645
+ "type": "boolean",
19646
+ "in": "body"
19647
+ }
19648
+ ]
19649
+ },
19650
+ "list-playbook-case-executions": {
19651
+ serviceClass: "Playbooks",
19652
+ operationId: "listPlaybookCaseExecutions",
19653
+ description: "Returns every run of the case's nodes, newest first.",
19654
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19655
+ httpMethod: "get",
19656
+ pathParams: ["project_id", "case_id"],
19657
+ queryParams: [
19658
+ "node",
19659
+ "limit",
19660
+ "offset"
19661
+ ],
19662
+ headerParams: [],
19663
+ cookieParams: [],
19664
+ flags: [
19665
+ {
19666
+ "name": "project_id",
19667
+ "description": "Project public ID (proj_ prefix).",
19668
+ "required": true,
19669
+ "type": "string",
19670
+ "in": "path"
19671
+ },
19672
+ {
19673
+ "name": "case_id",
19674
+ "description": "The case ID",
19675
+ "required": true,
19676
+ "type": "string",
19677
+ "in": "path"
19678
+ },
19679
+ {
19680
+ "name": "node",
19681
+ "description": "Only the executions of this node",
19682
+ "required": false,
19683
+ "type": "string",
19684
+ "in": "query"
19685
+ },
19686
+ {
19687
+ "name": "limit",
19688
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
19689
+ "required": false,
19690
+ "type": "integer",
19691
+ "in": "query"
19692
+ },
19693
+ {
19694
+ "name": "offset",
19695
+ "description": "Results to skip. Negative or not an integer it is `400`.",
19696
+ "required": false,
19697
+ "type": "integer",
19698
+ "in": "query"
19699
+ }
19700
+ ]
19701
+ },
19702
+ "get-playbook-case-execution": {
19703
+ serviceClass: "Playbooks",
19704
+ operationId: "getPlaybookCaseExecution",
19705
+ description: "Returns one run of a case's node.",
19706
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19707
+ httpMethod: "get",
19708
+ pathParams: [
19709
+ "project_id",
19710
+ "case_id",
19711
+ "execution_id"
19712
+ ],
19713
+ queryParams: [],
19714
+ headerParams: [],
19715
+ cookieParams: [],
19716
+ flags: [
19717
+ {
19718
+ "name": "project_id",
19719
+ "description": "Project public ID (proj_ prefix).",
19720
+ "required": true,
19721
+ "type": "string",
19722
+ "in": "path"
19723
+ },
19724
+ {
19725
+ "name": "case_id",
19726
+ "description": "The case ID",
19727
+ "required": true,
19728
+ "type": "string",
19729
+ "in": "path"
19730
+ },
19731
+ {
19732
+ "name": "execution_id",
19733
+ "description": "The execution ID",
19734
+ "required": true,
19735
+ "type": "string",
19736
+ "in": "path"
19737
+ }
19738
+ ]
19739
+ },
19740
+ "export-playbook-case-node": {
19741
+ serviceClass: "Playbooks",
19742
+ operationId: "exportPlaybookCaseNode",
19743
+ description: "Renders one revision of a final node as files, one export per transformation: each transformation's tool is called with the case's `case_id` and `subject`, the `node`, the `revision` and that revision's `output`, and must answer a file (`execute.response_mode: base64`) of its `format`'s content type. The file is kept in the project's files under `/.system/playbooks/`. An export never feeds a node. Without `revision` the node's current output is exported, which needs the node `done` (`409 PLAYBOOK_NODE_NOT_EXPORTABLE`); a `revision` names an earlier output or confirmation of the node. Each tool runs as the author of the case's playbook version, whose permission to call it is checked here (`403 PLAYBOOK_EXECUTOR_FORBIDDEN`). A paused case is `409 PLAYBOOK_CASE_PAUSED`. Without `wait` every export answers `running` and settles in the background; with `wait: true` it answers once each has its file or its error.",
19744
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19745
+ httpMethod: "post",
19746
+ pathParams: [
19747
+ "project_id",
19748
+ "case_id",
19749
+ "node"
19750
+ ],
19751
+ queryParams: [],
19752
+ headerParams: [],
19753
+ cookieParams: [],
19754
+ flags: [
19755
+ {
19756
+ "name": "project_id",
19757
+ "description": "Project public ID (proj_ prefix).",
19758
+ "required": true,
19759
+ "type": "string",
19760
+ "in": "path"
19761
+ },
19762
+ {
19763
+ "name": "case_id",
19764
+ "description": "The case ID",
19765
+ "required": true,
19766
+ "type": "string",
19767
+ "in": "path"
19768
+ },
19769
+ {
19770
+ "name": "node",
19771
+ "description": "The key of a node of the case's playbook version",
19772
+ "required": true,
19773
+ "type": "string",
19774
+ "in": "path"
19775
+ },
19776
+ {
19777
+ "name": "transformations",
19778
+ "description": "The names of the transformations to render; every one the node declares when omitted",
19779
+ "required": false,
19780
+ "type": "array",
19781
+ "in": "body"
19782
+ },
19783
+ {
19784
+ "name": "revision",
19785
+ "description": "The output or confirmation of the node to render; its current output when omitted",
19786
+ "required": false,
19787
+ "type": "integer",
19788
+ "in": "body"
19789
+ },
19790
+ {
19791
+ "name": "wait",
19792
+ "description": "Answer once every export settles instead of right away. An MCP tool call always waits.",
19793
+ "required": false,
19794
+ "type": "boolean",
19795
+ "in": "body"
19796
+ }
19797
+ ]
19798
+ },
19799
+ "list-playbook-case-exports": {
19800
+ serviceClass: "Playbooks",
19801
+ operationId: "listPlaybookCaseExports",
19802
+ description: "Returns every file rendered from the case's final nodes, newest first.",
19803
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19804
+ httpMethod: "get",
19805
+ pathParams: ["project_id", "case_id"],
19806
+ queryParams: [
19807
+ "node",
19808
+ "transformation",
19809
+ "limit",
19810
+ "offset"
19811
+ ],
19812
+ headerParams: [],
19813
+ cookieParams: [],
19814
+ flags: [
19815
+ {
19816
+ "name": "project_id",
19817
+ "description": "Project public ID (proj_ prefix).",
19818
+ "required": true,
19819
+ "type": "string",
19820
+ "in": "path"
19821
+ },
19822
+ {
19823
+ "name": "case_id",
19824
+ "description": "The case ID",
19825
+ "required": true,
19826
+ "type": "string",
19827
+ "in": "path"
19828
+ },
19829
+ {
19830
+ "name": "node",
19831
+ "description": "Only the exports of this node",
19832
+ "required": false,
19833
+ "type": "string",
19834
+ "in": "query"
19835
+ },
19836
+ {
19837
+ "name": "transformation",
19838
+ "description": "Only the exports of this transformation",
19839
+ "required": false,
19840
+ "type": "string",
19841
+ "in": "query"
19842
+ },
19843
+ {
19844
+ "name": "limit",
19845
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
19846
+ "required": false,
19847
+ "type": "integer",
19848
+ "in": "query"
19849
+ },
19850
+ {
19851
+ "name": "offset",
19852
+ "description": "Results to skip. Negative or not an integer it is `400`.",
19853
+ "required": false,
19854
+ "type": "integer",
19855
+ "in": "query"
19856
+ }
19857
+ ]
19858
+ },
19859
+ "get-playbook-case-export": {
19860
+ serviceClass: "Playbooks",
19861
+ operationId: "getPlaybookCaseExport",
19862
+ description: "Returns one file rendered from a case's final node.",
19863
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19864
+ httpMethod: "get",
19865
+ pathParams: [
19866
+ "project_id",
19867
+ "case_id",
19868
+ "export_id"
19869
+ ],
19870
+ queryParams: [],
19871
+ headerParams: [],
19872
+ cookieParams: [],
19873
+ flags: [
19874
+ {
19875
+ "name": "project_id",
19876
+ "description": "Project public ID (proj_ prefix).",
19877
+ "required": true,
19878
+ "type": "string",
19879
+ "in": "path"
19880
+ },
19881
+ {
19882
+ "name": "case_id",
19883
+ "description": "The case ID",
19884
+ "required": true,
19885
+ "type": "string",
19886
+ "in": "path"
19887
+ },
19888
+ {
19889
+ "name": "export_id",
19890
+ "description": "The export ID",
19891
+ "required": true,
19892
+ "type": "string",
19893
+ "in": "path"
19894
+ }
19895
+ ]
19896
+ },
19897
+ "upgrade-playbook-case": {
19898
+ serviceClass: "Playbooks",
19899
+ operationId: "upgradePlaybookCase",
19900
+ description: "Moves a case to another version of its playbook: the playbook's current version, or the `version` named, an earlier one included. Values carry over by node key, and every node's state is read against the new version: a node added is open, a node removed leaves the structure while its entries stay, a node whose input reads another field is `stale`, and a value its input's new schema refuses is missing again. The cascade then runs what became runnable. Each upgrade is recorded with what moved; the version the case is already on records nothing. An execution running is `409 PLAYBOOK_CASE_BUSY`; one queued but not started settles `superseded`. An upgrade made with a credential the case's own work runs as is `403 PLAYBOOK_SELF_WRITE`.",
19901
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19902
+ httpMethod: "post",
19903
+ pathParams: ["project_id", "case_id"],
19904
+ queryParams: [],
19905
+ headerParams: [],
19906
+ cookieParams: [],
19907
+ flags: [
19908
+ {
19909
+ "name": "project_id",
19910
+ "description": "Project public ID (proj_ prefix).",
19911
+ "required": true,
19912
+ "type": "string",
19913
+ "in": "path"
19914
+ },
19915
+ {
19916
+ "name": "case_id",
19917
+ "description": "The case ID",
19918
+ "required": true,
19919
+ "type": "string",
19920
+ "in": "path"
19921
+ },
19922
+ {
19923
+ "name": "version",
19924
+ "description": "The version to move the case to; the playbook's current one when omitted",
19925
+ "required": false,
19926
+ "type": "integer",
19927
+ "in": "body"
19928
+ }
19929
+ ]
19930
+ },
19931
+ "list-playbook-case-upgrades": {
19932
+ serviceClass: "Playbooks",
19933
+ operationId: "listPlaybookCaseUpgrades",
19934
+ description: "Returns every version change of the case, newest first.",
19935
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19936
+ httpMethod: "get",
19937
+ pathParams: ["project_id", "case_id"],
19938
+ queryParams: ["limit", "offset"],
19939
+ headerParams: [],
19940
+ cookieParams: [],
19941
+ flags: [
19942
+ {
19943
+ "name": "project_id",
19944
+ "description": "Project public ID (proj_ prefix).",
19945
+ "required": true,
19946
+ "type": "string",
19947
+ "in": "path"
19948
+ },
19949
+ {
19950
+ "name": "case_id",
19951
+ "description": "The case ID",
19952
+ "required": true,
19953
+ "type": "string",
19954
+ "in": "path"
19955
+ },
19956
+ {
19957
+ "name": "limit",
19958
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
19959
+ "required": false,
19960
+ "type": "integer",
19961
+ "in": "query"
19962
+ },
19963
+ {
19964
+ "name": "offset",
19965
+ "description": "Results to skip. Negative or not an integer it is `400`.",
19966
+ "required": false,
19967
+ "type": "integer",
19968
+ "in": "query"
19969
+ }
19970
+ ]
19971
+ },
19972
+ "pause-playbook-case": {
19973
+ serviceClass: "Playbooks",
19974
+ operationId: "pausePlaybookCase",
19975
+ description: "Stops the case starting anything: no node is queued and no queued execution starts until it is resumed. Executions already running settle. Input writes are still accepted. Pausing a paused case keeps the first pause.",
19976
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
19977
+ httpMethod: "post",
19978
+ pathParams: ["project_id", "case_id"],
19979
+ queryParams: [],
19980
+ headerParams: [],
19981
+ cookieParams: [],
19982
+ flags: [{
19983
+ "name": "project_id",
19984
+ "description": "Project public ID (proj_ prefix).",
19985
+ "required": true,
19986
+ "type": "string",
19987
+ "in": "path"
19988
+ }, {
19989
+ "name": "case_id",
19990
+ "description": "The case ID",
19991
+ "required": true,
19992
+ "type": "string",
19993
+ "in": "path"
19994
+ }]
19995
+ },
19996
+ "resume-playbook-case": {
19997
+ serviceClass: "Playbooks",
19998
+ operationId: "resumePlaybookCase",
19999
+ description: "Lifts the pause and starts what became runnable while the case was paused. A case that is not paused is `409 PLAYBOOK_CASE_NOT_PAUSED`.",
20000
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
20001
+ httpMethod: "post",
20002
+ pathParams: ["project_id", "case_id"],
20003
+ queryParams: [],
20004
+ headerParams: [],
20005
+ cookieParams: [],
20006
+ flags: [{
20007
+ "name": "project_id",
20008
+ "description": "Project public ID (proj_ prefix).",
20009
+ "required": true,
20010
+ "type": "string",
20011
+ "in": "path"
20012
+ }, {
20013
+ "name": "case_id",
20014
+ "description": "The case ID",
20015
+ "required": true,
20016
+ "type": "string",
20017
+ "in": "path"
20018
+ }]
20019
+ },
20020
+ "confirm-playbook-case-node": {
20021
+ serviceClass: "Playbooks",
20022
+ operationId: "confirmPlaybookCaseNode",
20023
+ description: "Approves or rejects a `confirm` node on the inputs the confirmer read. `expected_revisions` names the revision of each of the node's inputs as read (`nodes[].inputs[].revision` on the case); an input that moved since is `409 PLAYBOOK_INPUT_CONFLICT`, `meta.conflicts` naming each, and nothing is written. An approval writes a `confirmation` entry whose value is the node's input values: it is the node's output, and the nodes reading it run next. A rejection writes a `rejection` entry with the `reason`: the node is `rejected`, and every node reading it is blocked, until its inputs change or it is approved. Another node, or a `confirm` node with a required input unset or reading a node that is not `done`, is `409 PLAYBOOK_NODE_NOT_CONFIRMABLE`. A confirmation made with a credential the case's own work runs as is `403 PLAYBOOK_SELF_WRITE`.",
20024
+ moduleDocsUrl: "https://naturali.ai/docs/modules/playbooks",
20025
+ httpMethod: "post",
20026
+ pathParams: [
20027
+ "project_id",
20028
+ "case_id",
20029
+ "node"
20030
+ ],
20031
+ queryParams: [],
20032
+ headerParams: [],
20033
+ cookieParams: [],
20034
+ flags: [
20035
+ {
20036
+ "name": "project_id",
20037
+ "description": "Project public ID (proj_ prefix).",
20038
+ "required": true,
20039
+ "type": "string",
20040
+ "in": "path"
20041
+ },
20042
+ {
20043
+ "name": "case_id",
20044
+ "description": "The case ID",
20045
+ "required": true,
20046
+ "type": "string",
20047
+ "in": "path"
20048
+ },
20049
+ {
20050
+ "name": "node",
20051
+ "description": "The key of a node of the case's playbook version",
20052
+ "required": true,
20053
+ "type": "string",
20054
+ "in": "path"
20055
+ },
20056
+ {
20057
+ "name": "decision",
20058
+ "description": "Whether the node's inputs, as read, are approved",
20059
+ "required": true,
20060
+ "type": "string",
20061
+ "in": "body"
20062
+ },
20063
+ {
20064
+ "name": "reason",
20065
+ "description": "Why the inputs were rejected; required on a rejection",
20066
+ "required": false,
20067
+ "type": "string",
20068
+ "in": "body"
20069
+ },
20070
+ {
20071
+ "name": "expected_revisions",
20072
+ "description": "Each of the node's inputs, by name, mapped to the revision read, or null for one read as unset",
20073
+ "required": true,
20074
+ "type": "object",
20075
+ "in": "body"
20076
+ }
20077
+ ]
20078
+ },
18645
20079
  "list-projects": {
18646
20080
  serviceClass: "Projects",
18647
20081
  operationId: "listProjects",