@soat/sdk 0.77.1 → 0.79.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.
package/dist/index.mjs CHANGED
@@ -3685,6 +3685,361 @@ var Orchestrations = class {
3685
3685
  });
3686
3686
  }
3687
3687
  };
3688
+ var Playbooks = class {
3689
+ /**
3690
+ * List playbooks
3691
+ *
3692
+ * Returns the playbooks defined in a project, newest first.
3693
+ */
3694
+ static listPlaybooks(options) {
3695
+ return (options?.client ?? client).get({
3696
+ url: "/api/v1/playbooks",
3697
+ ...options
3698
+ });
3699
+ }
3700
+ /**
3701
+ * Create a playbook
3702
+ *
3703
+ * 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`.
3704
+ *
3705
+ * 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.
3706
+ */
3707
+ static createPlaybook(options) {
3708
+ return (options.client ?? client).post({
3709
+ url: "/api/v1/playbooks",
3710
+ ...options,
3711
+ headers: {
3712
+ "Content-Type": "application/json",
3713
+ ...options.headers
3714
+ }
3715
+ });
3716
+ }
3717
+ /**
3718
+ * Validate a playbook definition
3719
+ *
3720
+ * 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.
3721
+ */
3722
+ static validatePlaybook(options) {
3723
+ return (options.client ?? client).post({
3724
+ url: "/api/v1/playbooks/validate",
3725
+ ...options,
3726
+ headers: {
3727
+ "Content-Type": "application/json",
3728
+ ...options.headers
3729
+ }
3730
+ });
3731
+ }
3732
+ /**
3733
+ * Delete a playbook
3734
+ *
3735
+ * Deletes a playbook and its version archive. A playbook with cases is refused with `409 PLAYBOOK_HAS_CASES`.
3736
+ */
3737
+ static deletePlaybook(options) {
3738
+ return (options.client ?? client).delete({
3739
+ url: "/api/v1/playbooks/{playbook_id}",
3740
+ ...options
3741
+ });
3742
+ }
3743
+ /**
3744
+ * Get a playbook
3745
+ *
3746
+ * Returns a playbook with its current definition and version.
3747
+ */
3748
+ static getPlaybook(options) {
3749
+ return (options.client ?? client).get({
3750
+ url: "/api/v1/playbooks/{playbook_id}",
3751
+ ...options
3752
+ });
3753
+ }
3754
+ /**
3755
+ * Update a playbook
3756
+ *
3757
+ * 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.
3758
+ *
3759
+ * 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.
3760
+ */
3761
+ static updatePlaybook(options) {
3762
+ return (options.client ?? client).patch({
3763
+ url: "/api/v1/playbooks/{playbook_id}",
3764
+ ...options,
3765
+ headers: {
3766
+ "Content-Type": "application/json",
3767
+ ...options.headers
3768
+ }
3769
+ });
3770
+ }
3771
+ /**
3772
+ * List a playbook's versions
3773
+ *
3774
+ * Returns the playbook's archived definitions, newest first. A version is written on create and on every write that changes `definition`.
3775
+ */
3776
+ static listPlaybookVersions(options) {
3777
+ return (options.client ?? client).get({
3778
+ url: "/api/v1/playbooks/{playbook_id}/versions",
3779
+ ...options
3780
+ });
3781
+ }
3782
+ /**
3783
+ * Fetch an archived playbook version
3784
+ *
3785
+ * Returns the definition a version held: what a case pinned to it is evaluated against.
3786
+ */
3787
+ static getPlaybookVersion(options) {
3788
+ return (options.client ?? client).get({
3789
+ url: "/api/v1/playbooks/{playbook_id}/versions/{version}",
3790
+ ...options
3791
+ });
3792
+ }
3793
+ /**
3794
+ * Restore an archived playbook version
3795
+ *
3796
+ * 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.
3797
+ */
3798
+ static restorePlaybookVersion(options) {
3799
+ return (options.client ?? client).post({
3800
+ url: "/api/v1/playbooks/{playbook_id}/versions/{version}/restore",
3801
+ ...options,
3802
+ headers: {
3803
+ "Content-Type": "application/json",
3804
+ ...options.headers
3805
+ }
3806
+ });
3807
+ }
3808
+ /**
3809
+ * Create a case
3810
+ *
3811
+ * Creates a case for one subject on the playbook's current version. The case stays on that version however the playbook changes later.
3812
+ */
3813
+ static createPlaybookCase(options) {
3814
+ return (options.client ?? client).post({
3815
+ url: "/api/v1/playbooks/{playbook_id}/cases",
3816
+ ...options,
3817
+ headers: {
3818
+ "Content-Type": "application/json",
3819
+ ...options.headers
3820
+ }
3821
+ });
3822
+ }
3823
+ /**
3824
+ * List playbook cases
3825
+ *
3826
+ * Returns a project's cases, newest first, without node states; read one case for those.
3827
+ */
3828
+ static listPlaybookCases(options) {
3829
+ return (options?.client ?? client).get({
3830
+ url: "/api/v1/playbook-cases",
3831
+ ...options
3832
+ });
3833
+ }
3834
+ /**
3835
+ * Delete a case
3836
+ *
3837
+ * Deletes a case and every entry written to it.
3838
+ */
3839
+ static deletePlaybookCase(options) {
3840
+ return (options.client ?? client).delete({
3841
+ url: "/api/v1/playbook-cases/{case_id}",
3842
+ ...options
3843
+ });
3844
+ }
3845
+ /**
3846
+ * Get a case
3847
+ *
3848
+ * Returns a case with every node's state, computed from its entries on each read and never stored.
3849
+ */
3850
+ static getPlaybookCase(options) {
3851
+ return (options.client ?? client).get({
3852
+ url: "/api/v1/playbook-cases/{case_id}",
3853
+ ...options
3854
+ });
3855
+ }
3856
+ /**
3857
+ * Write a case's inputs
3858
+ *
3859
+ * 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`.
3860
+ */
3861
+ static writePlaybookCaseInputs(options) {
3862
+ return (options.client ?? client).post({
3863
+ url: "/api/v1/playbook-cases/{case_id}/inputs",
3864
+ ...options,
3865
+ headers: {
3866
+ "Content-Type": "application/json",
3867
+ ...options.headers
3868
+ }
3869
+ });
3870
+ }
3871
+ /**
3872
+ * List what a node still needs
3873
+ *
3874
+ * 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.
3875
+ */
3876
+ static getPlaybookCaseMissing(options) {
3877
+ return (options.client ?? client).get({
3878
+ url: "/api/v1/playbook-cases/{case_id}/missing",
3879
+ ...options
3880
+ });
3881
+ }
3882
+ /**
3883
+ * List a case's entries
3884
+ *
3885
+ * Returns every value written to the case, newest first. Entries are never rewritten, so this is the case's full history.
3886
+ */
3887
+ static listPlaybookCaseEntries(options) {
3888
+ return (options.client ?? client).get({
3889
+ url: "/api/v1/playbook-cases/{case_id}/entries",
3890
+ ...options
3891
+ });
3892
+ }
3893
+ /**
3894
+ * Run a node of a case
3895
+ *
3896
+ * 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`.
3897
+ *
3898
+ * 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.
3899
+ *
3900
+ * 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.
3901
+ */
3902
+ static runPlaybookCaseNode(options) {
3903
+ return (options.client ?? client).post({
3904
+ url: "/api/v1/playbook-cases/{case_id}/nodes/{node}/run",
3905
+ ...options,
3906
+ headers: {
3907
+ "Content-Type": "application/json",
3908
+ ...options.headers
3909
+ }
3910
+ });
3911
+ }
3912
+ /**
3913
+ * List a case's executions
3914
+ *
3915
+ * Returns every run of the case's nodes, newest first.
3916
+ */
3917
+ static listPlaybookCaseExecutions(options) {
3918
+ return (options.client ?? client).get({
3919
+ url: "/api/v1/playbook-cases/{case_id}/executions",
3920
+ ...options
3921
+ });
3922
+ }
3923
+ /**
3924
+ * Get an execution
3925
+ *
3926
+ * Returns one run of a case's node.
3927
+ */
3928
+ static getPlaybookCaseExecution(options) {
3929
+ return (options.client ?? client).get({
3930
+ url: "/api/v1/playbook-cases/{case_id}/executions/{execution_id}",
3931
+ ...options
3932
+ });
3933
+ }
3934
+ /**
3935
+ * Export a final node
3936
+ *
3937
+ * 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.
3938
+ *
3939
+ * 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`.
3940
+ *
3941
+ * Without `wait` every export answers `running` and settles in the background; with `wait: true` it answers once each has its file or its error.
3942
+ */
3943
+ static exportPlaybookCaseNode(options) {
3944
+ return (options.client ?? client).post({
3945
+ url: "/api/v1/playbook-cases/{case_id}/nodes/{node}/exports",
3946
+ ...options,
3947
+ headers: {
3948
+ "Content-Type": "application/json",
3949
+ ...options.headers
3950
+ }
3951
+ });
3952
+ }
3953
+ /**
3954
+ * List a case's exports
3955
+ *
3956
+ * Returns every file rendered from the case's final nodes, newest first.
3957
+ */
3958
+ static listPlaybookCaseExports(options) {
3959
+ return (options.client ?? client).get({
3960
+ url: "/api/v1/playbook-cases/{case_id}/exports",
3961
+ ...options
3962
+ });
3963
+ }
3964
+ /**
3965
+ * Get an export
3966
+ *
3967
+ * Returns one file rendered from a case's final node.
3968
+ */
3969
+ static getPlaybookCaseExport(options) {
3970
+ return (options.client ?? client).get({
3971
+ url: "/api/v1/playbook-cases/{case_id}/exports/{export_id}",
3972
+ ...options
3973
+ });
3974
+ }
3975
+ /**
3976
+ * Upgrade a case
3977
+ *
3978
+ * 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.
3979
+ *
3980
+ * 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`.
3981
+ */
3982
+ static upgradePlaybookCase(options) {
3983
+ return (options.client ?? client).post({
3984
+ url: "/api/v1/playbook-cases/{case_id}/upgrade",
3985
+ ...options,
3986
+ headers: {
3987
+ "Content-Type": "application/json",
3988
+ ...options.headers
3989
+ }
3990
+ });
3991
+ }
3992
+ /**
3993
+ * List a case's upgrades
3994
+ *
3995
+ * Returns every version change of the case, newest first.
3996
+ */
3997
+ static listPlaybookCaseUpgrades(options) {
3998
+ return (options.client ?? client).get({
3999
+ url: "/api/v1/playbook-cases/{case_id}/upgrades",
4000
+ ...options
4001
+ });
4002
+ }
4003
+ /**
4004
+ * Pause a case
4005
+ *
4006
+ * 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.
4007
+ */
4008
+ static pausePlaybookCase(options) {
4009
+ return (options.client ?? client).post({
4010
+ url: "/api/v1/playbook-cases/{case_id}/pause",
4011
+ ...options
4012
+ });
4013
+ }
4014
+ /**
4015
+ * Resume a case
4016
+ *
4017
+ * 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`.
4018
+ */
4019
+ static resumePlaybookCase(options) {
4020
+ return (options.client ?? client).post({
4021
+ url: "/api/v1/playbook-cases/{case_id}/resume",
4022
+ ...options
4023
+ });
4024
+ }
4025
+ /**
4026
+ * Confirm a node of a case
4027
+ *
4028
+ * 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.
4029
+ *
4030
+ * 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`.
4031
+ */
4032
+ static confirmPlaybookCaseNode(options) {
4033
+ return (options.client ?? client).post({
4034
+ url: "/api/v1/playbook-cases/{case_id}/nodes/{node}/confirmation",
4035
+ ...options,
4036
+ headers: {
4037
+ "Content-Type": "application/json",
4038
+ ...options.headers
4039
+ }
4040
+ });
4041
+ }
4042
+ };
3688
4043
  var Policies = class {
3689
4044
  /**
3690
4045
  * List all policies
@@ -5269,6 +5624,7 @@ var SoatClient = class {
5269
5624
  metadataSchemas;
5270
5625
  modelRoutes;
5271
5626
  orchestrations;
5627
+ playbooks;
5272
5628
  policies;
5273
5629
  projects;
5274
5630
  quotas;
@@ -5320,6 +5676,7 @@ var SoatClient = class {
5320
5676
  this.metadataSchemas = bindResource(MetadataSchemas, httpClient);
5321
5677
  this.modelRoutes = bindResource(ModelRoutes, httpClient);
5322
5678
  this.orchestrations = bindResource(Orchestrations, httpClient);
5679
+ this.playbooks = bindResource(Playbooks, httpClient);
5323
5680
  this.policies = bindResource(Policies, httpClient);
5324
5681
  this.projects = bindResource(Projects, httpClient);
5325
5682
  this.quotas = bindResource(Quotas, httpClient);
@@ -5337,4 +5694,4 @@ var SoatClient = class {
5337
5694
  }
5338
5695
  };
5339
5696
  //#endregion
5340
- export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Orchestrations, Policies, Projects, Quotas, Secrets, Sessions, Shares, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
5697
+ export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Orchestrations, Playbooks, Policies, Projects, Quotas, Secrets, Sessions, Shares, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.77.1",
3
+ "version": "0.79.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",