@soat/cli 0.14.0 → 0.14.2
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 +310 -17
- package/package.json +9 -10
package/dist/index.mjs
CHANGED
|
@@ -7,11 +7,11 @@ import * as sdk from "@soat/sdk";
|
|
|
7
7
|
import { createClient, createConfig } from "@soat/sdk";
|
|
8
8
|
import { program } from "commander";
|
|
9
9
|
import * as fs from "node:fs";
|
|
10
|
-
import
|
|
10
|
+
import { load } from "js-yaml";
|
|
11
11
|
import * as os from "node:os";
|
|
12
12
|
|
|
13
13
|
//#region package.json
|
|
14
|
-
var version = "0.14.
|
|
14
|
+
var version = "0.14.2";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/cli-wrappers/wrappers/formations.ts
|
|
@@ -62,11 +62,12 @@ var readTemplateFromPath = args => {
|
|
|
62
62
|
return JSON.parse(trimmed);
|
|
63
63
|
} catch {}
|
|
64
64
|
try {
|
|
65
|
-
return
|
|
65
|
+
return load(trimmed);
|
|
66
66
|
} catch {
|
|
67
67
|
throw new Error(`Template file must contain valid JSON or YAML: ${templatePath}`);
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
+
var OMIT_PARAMETER = Symbol("omit-parameter");
|
|
70
71
|
var resolveEnvRef = args => {
|
|
71
72
|
const {
|
|
72
73
|
value,
|
|
@@ -75,8 +76,7 @@ var resolveEnvRef = args => {
|
|
|
75
76
|
const atRef = /^@([A-Za-z_][A-Za-z0-9_]*)$/.exec(value);
|
|
76
77
|
if (atRef) {
|
|
77
78
|
const resolved = env[atRef[1]];
|
|
78
|
-
|
|
79
|
-
return resolved;
|
|
79
|
+
return resolved === void 0 ? OMIT_PARAMETER : resolved;
|
|
80
80
|
}
|
|
81
81
|
const simple = /^\$([A-Za-z_][A-Za-z0-9_]*)$/.exec(value);
|
|
82
82
|
if (simple) {
|
|
@@ -103,10 +103,9 @@ var resolveParameterPair = args => {
|
|
|
103
103
|
const key = pair.trim();
|
|
104
104
|
if (!key) throw new Error(`Invalid --${PARAMETER_FLAG} value "${pair}". Parameter key cannot be empty.`);
|
|
105
105
|
const resolved = env[key];
|
|
106
|
-
if (resolved === void 0) throw new Error(`Missing environment variable: ${key}`);
|
|
107
106
|
return {
|
|
108
107
|
key,
|
|
109
|
-
value: resolved
|
|
108
|
+
value: resolved === void 0 ? OMIT_PARAMETER : resolved
|
|
110
109
|
};
|
|
111
110
|
}
|
|
112
111
|
const key = pair.slice(0, eqIdx).trim();
|
|
@@ -130,7 +129,7 @@ var formationsWrapper = {
|
|
|
130
129
|
type: "string"
|
|
131
130
|
}, {
|
|
132
131
|
name: "parameter",
|
|
133
|
-
description: "Template parameter in key=value format (repeatable). Values support env var references: $VAR, ${VAR}, or @VAR_NAME (shell-safe). Omit the value entirely (--parameter KEY) to auto-read KEY from the merged env.",
|
|
132
|
+
description: "Template parameter in key=value format (repeatable). Values support env var references: $VAR, ${VAR}, or @VAR_NAME (shell-safe). Omit the value entirely (--parameter KEY) to auto-read KEY from the merged env. For @VAR_NAME and bare KEY, an unset env var omits the parameter instead of failing, so the server reuses a previous value (formation parameters declared `use_previous_value`) or errors if none exists.",
|
|
134
133
|
required: false,
|
|
135
134
|
type: "string"
|
|
136
135
|
}, {
|
|
@@ -182,7 +181,7 @@ var formationsWrapper = {
|
|
|
182
181
|
pair,
|
|
183
182
|
env: mergedEnv
|
|
184
183
|
});
|
|
185
|
-
resolvedParameters[key] = value;
|
|
184
|
+
if (value !== OMIT_PARAMETER) resolvedParameters[key] = value;
|
|
186
185
|
}
|
|
187
186
|
forcedBody[PARAMETERS_FIELD] = resolvedParameters;
|
|
188
187
|
}
|
|
@@ -4192,7 +4191,7 @@ var routes = {
|
|
|
4192
4191
|
"delete-session": {
|
|
4193
4192
|
serviceClass: "Sessions",
|
|
4194
4193
|
operationId: "deleteSession",
|
|
4195
|
-
description: "Deletes the session and its underlying conversation and
|
|
4194
|
+
description: "Deletes the session and its underlying conversation and messages. The session's actor is not deleted. Generations and traces produced by the session are not deleted either, since they are not linked to the session or conversation.",
|
|
4196
4195
|
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/sessions",
|
|
4197
4196
|
pathParams: ["session_id"],
|
|
4198
4197
|
queryParams: [],
|
|
@@ -4431,10 +4430,10 @@ var routes = {
|
|
|
4431
4430
|
"type": "object",
|
|
4432
4431
|
"in": "body"
|
|
4433
4432
|
}, {
|
|
4434
|
-
"name": "
|
|
4435
|
-
"description": "
|
|
4433
|
+
"name": "discussion_id",
|
|
4434
|
+
"description": "For `discussion` tools: the ID of the discussion to invoke.",
|
|
4436
4435
|
"required": false,
|
|
4437
|
-
"type": "
|
|
4436
|
+
"type": "string",
|
|
4438
4437
|
"in": "body"
|
|
4439
4438
|
}, {
|
|
4440
4439
|
"name": "output_mapping",
|
|
@@ -4527,10 +4526,10 @@ var routes = {
|
|
|
4527
4526
|
"type": "object",
|
|
4528
4527
|
"in": "body"
|
|
4529
4528
|
}, {
|
|
4530
|
-
"name": "
|
|
4531
|
-
"description": "
|
|
4529
|
+
"name": "discussion_id",
|
|
4530
|
+
"description": "For `discussion` tools: the ID of the discussion to invoke.",
|
|
4532
4531
|
"required": false,
|
|
4533
|
-
"type": "
|
|
4532
|
+
"type": "string",
|
|
4534
4533
|
"in": "body"
|
|
4535
4534
|
}, {
|
|
4536
4535
|
"name": "output_mapping",
|
|
@@ -4645,6 +4644,300 @@ var routes = {
|
|
|
4645
4644
|
"in": "query"
|
|
4646
4645
|
}]
|
|
4647
4646
|
},
|
|
4647
|
+
"list-triggers": {
|
|
4648
|
+
serviceClass: "Triggers",
|
|
4649
|
+
operationId: "listTriggers",
|
|
4650
|
+
description: "Lists triggers. Filter by project, starter type, or target type.",
|
|
4651
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4652
|
+
pathParams: [],
|
|
4653
|
+
queryParams: ["project_id", "type", "target_type"],
|
|
4654
|
+
flags: [{
|
|
4655
|
+
"name": "project_id",
|
|
4656
|
+
"description": "",
|
|
4657
|
+
"required": false,
|
|
4658
|
+
"type": "string",
|
|
4659
|
+
"in": "query"
|
|
4660
|
+
}, {
|
|
4661
|
+
"name": "type",
|
|
4662
|
+
"description": "",
|
|
4663
|
+
"required": false,
|
|
4664
|
+
"type": "string",
|
|
4665
|
+
"in": "query"
|
|
4666
|
+
}, {
|
|
4667
|
+
"name": "target_type",
|
|
4668
|
+
"description": "",
|
|
4669
|
+
"required": false,
|
|
4670
|
+
"type": "string",
|
|
4671
|
+
"in": "query"
|
|
4672
|
+
}]
|
|
4673
|
+
},
|
|
4674
|
+
"create-trigger": {
|
|
4675
|
+
serviceClass: "Triggers",
|
|
4676
|
+
operationId: "createTrigger",
|
|
4677
|
+
description: "Creates a new trigger for a project",
|
|
4678
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4679
|
+
pathParams: [],
|
|
4680
|
+
queryParams: [],
|
|
4681
|
+
flags: [{
|
|
4682
|
+
"name": "project_id",
|
|
4683
|
+
"description": "Public ID of the project. Optional when authenticating with a project-scoped API key, which defaults to the key's project; required otherwise.",
|
|
4684
|
+
"required": false,
|
|
4685
|
+
"type": "string",
|
|
4686
|
+
"in": "body"
|
|
4687
|
+
}, {
|
|
4688
|
+
"name": "name",
|
|
4689
|
+
"description": "",
|
|
4690
|
+
"required": true,
|
|
4691
|
+
"type": "string",
|
|
4692
|
+
"in": "body"
|
|
4693
|
+
}, {
|
|
4694
|
+
"name": "description",
|
|
4695
|
+
"description": "",
|
|
4696
|
+
"required": false,
|
|
4697
|
+
"type": "string",
|
|
4698
|
+
"in": "body"
|
|
4699
|
+
}, {
|
|
4700
|
+
"name": "type",
|
|
4701
|
+
"description": "",
|
|
4702
|
+
"required": true,
|
|
4703
|
+
"type": "string",
|
|
4704
|
+
"in": "body"
|
|
4705
|
+
}, {
|
|
4706
|
+
"name": "target_type",
|
|
4707
|
+
"description": "",
|
|
4708
|
+
"required": true,
|
|
4709
|
+
"type": "string",
|
|
4710
|
+
"in": "body"
|
|
4711
|
+
}, {
|
|
4712
|
+
"name": "target_id",
|
|
4713
|
+
"description": "",
|
|
4714
|
+
"required": true,
|
|
4715
|
+
"type": "string",
|
|
4716
|
+
"in": "body"
|
|
4717
|
+
}, {
|
|
4718
|
+
"name": "action",
|
|
4719
|
+
"description": "Tool targets only — the action for soat/mcp tools",
|
|
4720
|
+
"required": false,
|
|
4721
|
+
"type": "string",
|
|
4722
|
+
"in": "body"
|
|
4723
|
+
}, {
|
|
4724
|
+
"name": "input",
|
|
4725
|
+
"description": "",
|
|
4726
|
+
"required": false,
|
|
4727
|
+
"type": "object",
|
|
4728
|
+
"in": "body"
|
|
4729
|
+
}, {
|
|
4730
|
+
"name": "cron",
|
|
4731
|
+
"description": "5-field cron expression (UTC). Required when type is schedule",
|
|
4732
|
+
"required": false,
|
|
4733
|
+
"type": "string",
|
|
4734
|
+
"in": "body"
|
|
4735
|
+
}, {
|
|
4736
|
+
"name": "active",
|
|
4737
|
+
"description": "",
|
|
4738
|
+
"required": false,
|
|
4739
|
+
"type": "boolean",
|
|
4740
|
+
"in": "body"
|
|
4741
|
+
}, {
|
|
4742
|
+
"name": "policy_id",
|
|
4743
|
+
"description": "",
|
|
4744
|
+
"required": false,
|
|
4745
|
+
"type": "string",
|
|
4746
|
+
"in": "body"
|
|
4747
|
+
}]
|
|
4748
|
+
},
|
|
4749
|
+
"get-trigger": {
|
|
4750
|
+
serviceClass: "Triggers",
|
|
4751
|
+
operationId: "getTrigger",
|
|
4752
|
+
description: "Retrieves the details of a specific trigger",
|
|
4753
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4754
|
+
pathParams: ["trigger_id"],
|
|
4755
|
+
queryParams: [],
|
|
4756
|
+
flags: [{
|
|
4757
|
+
"name": "trigger_id",
|
|
4758
|
+
"description": "",
|
|
4759
|
+
"required": true,
|
|
4760
|
+
"type": "string",
|
|
4761
|
+
"in": "path"
|
|
4762
|
+
}]
|
|
4763
|
+
},
|
|
4764
|
+
"update-trigger": {
|
|
4765
|
+
serviceClass: "Triggers",
|
|
4766
|
+
operationId: "updateTrigger",
|
|
4767
|
+
description: "Updates an existing trigger's configuration. The type is immutable.",
|
|
4768
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4769
|
+
pathParams: ["trigger_id"],
|
|
4770
|
+
queryParams: [],
|
|
4771
|
+
flags: [{
|
|
4772
|
+
"name": "trigger_id",
|
|
4773
|
+
"description": "",
|
|
4774
|
+
"required": true,
|
|
4775
|
+
"type": "string",
|
|
4776
|
+
"in": "path"
|
|
4777
|
+
}, {
|
|
4778
|
+
"name": "name",
|
|
4779
|
+
"description": "",
|
|
4780
|
+
"required": false,
|
|
4781
|
+
"type": "string",
|
|
4782
|
+
"in": "body"
|
|
4783
|
+
}, {
|
|
4784
|
+
"name": "description",
|
|
4785
|
+
"description": "",
|
|
4786
|
+
"required": false,
|
|
4787
|
+
"type": "string",
|
|
4788
|
+
"in": "body"
|
|
4789
|
+
}, {
|
|
4790
|
+
"name": "target_type",
|
|
4791
|
+
"description": "",
|
|
4792
|
+
"required": false,
|
|
4793
|
+
"type": "string",
|
|
4794
|
+
"in": "body"
|
|
4795
|
+
}, {
|
|
4796
|
+
"name": "target_id",
|
|
4797
|
+
"description": "",
|
|
4798
|
+
"required": false,
|
|
4799
|
+
"type": "string",
|
|
4800
|
+
"in": "body"
|
|
4801
|
+
}, {
|
|
4802
|
+
"name": "action",
|
|
4803
|
+
"description": "",
|
|
4804
|
+
"required": false,
|
|
4805
|
+
"type": "string",
|
|
4806
|
+
"in": "body"
|
|
4807
|
+
}, {
|
|
4808
|
+
"name": "input",
|
|
4809
|
+
"description": "",
|
|
4810
|
+
"required": false,
|
|
4811
|
+
"type": "object",
|
|
4812
|
+
"in": "body"
|
|
4813
|
+
}, {
|
|
4814
|
+
"name": "cron",
|
|
4815
|
+
"description": "",
|
|
4816
|
+
"required": false,
|
|
4817
|
+
"type": "string",
|
|
4818
|
+
"in": "body"
|
|
4819
|
+
}, {
|
|
4820
|
+
"name": "active",
|
|
4821
|
+
"description": "",
|
|
4822
|
+
"required": false,
|
|
4823
|
+
"type": "boolean",
|
|
4824
|
+
"in": "body"
|
|
4825
|
+
}, {
|
|
4826
|
+
"name": "policy_id",
|
|
4827
|
+
"description": "",
|
|
4828
|
+
"required": false,
|
|
4829
|
+
"type": "string",
|
|
4830
|
+
"in": "body"
|
|
4831
|
+
}]
|
|
4832
|
+
},
|
|
4833
|
+
"delete-trigger": {
|
|
4834
|
+
serviceClass: "Triggers",
|
|
4835
|
+
operationId: "deleteTrigger",
|
|
4836
|
+
description: "Deletes a trigger",
|
|
4837
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4838
|
+
pathParams: ["trigger_id"],
|
|
4839
|
+
queryParams: [],
|
|
4840
|
+
flags: [{
|
|
4841
|
+
"name": "trigger_id",
|
|
4842
|
+
"description": "",
|
|
4843
|
+
"required": true,
|
|
4844
|
+
"type": "string",
|
|
4845
|
+
"in": "path"
|
|
4846
|
+
}]
|
|
4847
|
+
},
|
|
4848
|
+
"fire-trigger": {
|
|
4849
|
+
serviceClass: "Triggers",
|
|
4850
|
+
operationId: "fireTrigger",
|
|
4851
|
+
description: "Fires a trigger synchronously and returns the terminal firing record.",
|
|
4852
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4853
|
+
pathParams: ["trigger_id"],
|
|
4854
|
+
queryParams: [],
|
|
4855
|
+
flags: [{
|
|
4856
|
+
"name": "trigger_id",
|
|
4857
|
+
"description": "",
|
|
4858
|
+
"required": true,
|
|
4859
|
+
"type": "string",
|
|
4860
|
+
"in": "path"
|
|
4861
|
+
}, {
|
|
4862
|
+
"name": "input",
|
|
4863
|
+
"description": "Fire-time input, shallow-merged over the trigger's static input",
|
|
4864
|
+
"required": false,
|
|
4865
|
+
"type": "object",
|
|
4866
|
+
"in": "body"
|
|
4867
|
+
}]
|
|
4868
|
+
},
|
|
4869
|
+
"get-trigger-secret": {
|
|
4870
|
+
serviceClass: "Triggers",
|
|
4871
|
+
operationId: "getTriggerSecret",
|
|
4872
|
+
description: "Retrieves the signing secret for a webhook trigger",
|
|
4873
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4874
|
+
pathParams: ["trigger_id"],
|
|
4875
|
+
queryParams: [],
|
|
4876
|
+
flags: [{
|
|
4877
|
+
"name": "trigger_id",
|
|
4878
|
+
"description": "",
|
|
4879
|
+
"required": true,
|
|
4880
|
+
"type": "string",
|
|
4881
|
+
"in": "path"
|
|
4882
|
+
}]
|
|
4883
|
+
},
|
|
4884
|
+
"rotate-trigger-secret": {
|
|
4885
|
+
serviceClass: "Triggers",
|
|
4886
|
+
operationId: "rotateTriggerSecret",
|
|
4887
|
+
description: "Rotates the signing secret for a webhook trigger",
|
|
4888
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4889
|
+
pathParams: ["trigger_id"],
|
|
4890
|
+
queryParams: [],
|
|
4891
|
+
flags: [{
|
|
4892
|
+
"name": "trigger_id",
|
|
4893
|
+
"description": "",
|
|
4894
|
+
"required": true,
|
|
4895
|
+
"type": "string",
|
|
4896
|
+
"in": "path"
|
|
4897
|
+
}]
|
|
4898
|
+
},
|
|
4899
|
+
"list-trigger-firings": {
|
|
4900
|
+
serviceClass: "Triggers",
|
|
4901
|
+
operationId: "listTriggerFirings",
|
|
4902
|
+
description: "Lists firings for a trigger (trigger_id is required).",
|
|
4903
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4904
|
+
pathParams: [],
|
|
4905
|
+
queryParams: ["trigger_id", "limit", "offset"],
|
|
4906
|
+
flags: [{
|
|
4907
|
+
"name": "trigger_id",
|
|
4908
|
+
"description": "Trigger to list firings for (trg_...)",
|
|
4909
|
+
"required": true,
|
|
4910
|
+
"type": "string",
|
|
4911
|
+
"in": "query"
|
|
4912
|
+
}, {
|
|
4913
|
+
"name": "limit",
|
|
4914
|
+
"description": "",
|
|
4915
|
+
"required": false,
|
|
4916
|
+
"type": "integer",
|
|
4917
|
+
"in": "query"
|
|
4918
|
+
}, {
|
|
4919
|
+
"name": "offset",
|
|
4920
|
+
"description": "",
|
|
4921
|
+
"required": false,
|
|
4922
|
+
"type": "integer",
|
|
4923
|
+
"in": "query"
|
|
4924
|
+
}]
|
|
4925
|
+
},
|
|
4926
|
+
"get-trigger-firing": {
|
|
4927
|
+
serviceClass: "Triggers",
|
|
4928
|
+
operationId: "getTriggerFiring",
|
|
4929
|
+
description: "Retrieves the details of a specific trigger firing",
|
|
4930
|
+
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/triggers",
|
|
4931
|
+
pathParams: ["firing_id"],
|
|
4932
|
+
queryParams: [],
|
|
4933
|
+
flags: [{
|
|
4934
|
+
"name": "firing_id",
|
|
4935
|
+
"description": "",
|
|
4936
|
+
"required": true,
|
|
4937
|
+
"type": "string",
|
|
4938
|
+
"in": "path"
|
|
4939
|
+
}]
|
|
4940
|
+
},
|
|
4648
4941
|
"get-current-user": {
|
|
4649
4942
|
serviceClass: "Users",
|
|
4650
4943
|
operationId: "getCurrentUser",
|
|
@@ -4771,7 +5064,7 @@ var routes = {
|
|
|
4771
5064
|
queryParams: [],
|
|
4772
5065
|
flags: [{
|
|
4773
5066
|
"name": "user_id",
|
|
4774
|
-
"description": "User public ID (
|
|
5067
|
+
"description": "User public ID (user_ prefix)",
|
|
4775
5068
|
"required": true,
|
|
4776
5069
|
"type": "string",
|
|
4777
5070
|
"in": "path"
|
package/package.json
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soat/cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@inquirer/input": "^5.1.2",
|
|
7
7
|
"@inquirer/password": "^5.1.1",
|
|
8
|
-
"@ttoss/logger": "^0.8.
|
|
8
|
+
"@ttoss/logger": "^0.8.19",
|
|
9
9
|
"commander": "^15.0.0",
|
|
10
|
-
"js-yaml": "^
|
|
11
|
-
"@soat/sdk": "0.14.
|
|
10
|
+
"js-yaml": "^5.2.1",
|
|
11
|
+
"@soat/sdk": "0.14.2"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@ttoss/config": "^1.37.
|
|
15
|
-
"@ttoss/test-utils": "^4.2.
|
|
14
|
+
"@ttoss/config": "^1.37.17",
|
|
15
|
+
"@ttoss/test-utils": "^4.2.18",
|
|
16
16
|
"@types/jest": "^30.0.0",
|
|
17
|
-
"@types/
|
|
18
|
-
"@types/node": "^24",
|
|
17
|
+
"@types/node": "^24.13.2",
|
|
19
18
|
"jest": "^30.4.2",
|
|
20
|
-
"tsdown": "^0.22.
|
|
21
|
-
"tsx": "^4.
|
|
19
|
+
"tsdown": "^0.22.3",
|
|
20
|
+
"tsx": "^4.23.0"
|
|
22
21
|
},
|
|
23
22
|
"files": [
|
|
24
23
|
"dist",
|