@soat/cli 0.18.6 → 0.19.1
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 +84 -33
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { load } from "js-yaml";
|
|
|
13
13
|
import * as os from "node:os";
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
|
-
var version = "0.
|
|
16
|
+
var version = "0.19.1";
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/cli-wrappers/wrappers/formations.ts
|
|
@@ -254,6 +254,51 @@ var extractPositionalArgs = args => {
|
|
|
254
254
|
}
|
|
255
255
|
return positional;
|
|
256
256
|
};
|
|
257
|
+
/**
|
|
258
|
+
* Coerce a raw flag value to the JSON type the spec declares for it.
|
|
259
|
+
*
|
|
260
|
+
* `declaredType` comes from the generated route manifest. A flag the spec
|
|
261
|
+
* declares as `string` is passed through untouched — its content is data, not
|
|
262
|
+
* syntax, so a value that merely *looks* like JSON (a GCP service account key
|
|
263
|
+
* file in `create-secret --value`) or like a number (an account number) must
|
|
264
|
+
* still arrive as a string. Coercing it produced a body the server rejects,
|
|
265
|
+
* with no way to escape it from the shell.
|
|
266
|
+
*
|
|
267
|
+
* The one value a string flag still coerces is the literal `null`: "set it to
|
|
268
|
+
* null to clear" is the documented way to detach a nullable reference
|
|
269
|
+
* (`--default_model_route_id null`, `--ai_provider_id null`), and the shell has
|
|
270
|
+
* no other way to spell JSON null. The cost is that a string whose entire value
|
|
271
|
+
* is `null` cannot be sent — a far rarer need than clearing a field.
|
|
272
|
+
*
|
|
273
|
+
* Every other flag keeps the permissive behavior: an undeclared type (a flag
|
|
274
|
+
* the manifest has no entry for) is still sniffed, since that is the only
|
|
275
|
+
* signal available.
|
|
276
|
+
*/
|
|
277
|
+
var parseFlagValue = (value, declaredType) => {
|
|
278
|
+
if (declaredType === "string") return value.trim() === "null" ? null : value;
|
|
279
|
+
const trimmed = value.trim();
|
|
280
|
+
if (trimmed.startsWith("{") || trimmed.startsWith("[") || trimmed === "true" || trimmed === "false" || trimmed === "null" || /^-?\d+(\.\d+)?$/.test(trimmed)) try {
|
|
281
|
+
return JSON.parse(trimmed);
|
|
282
|
+
} catch {
|
|
283
|
+
return value;
|
|
284
|
+
}
|
|
285
|
+
return value;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Build the value for an array-typed flag. Collects repeated occurrences
|
|
289
|
+
* (`--document_paths /a/ --document_paths /b/`) into a list, coercing each
|
|
290
|
+
* element with `parseFlagValue`. A single JSON-array literal
|
|
291
|
+
* (`--document_ids '["doc_1","doc_2"]'`) is passed through as-is rather than
|
|
292
|
+
* being wrapped again, and a single scalar (`--document_paths /playbooks/`)
|
|
293
|
+
* becomes a one-element array.
|
|
294
|
+
*/
|
|
295
|
+
var buildArrayFlagValue = rawValues => {
|
|
296
|
+
const parsed = rawValues.map(v => {
|
|
297
|
+
return parseFlagValue(v);
|
|
298
|
+
});
|
|
299
|
+
if (parsed.length === 1 && Array.isArray(parsed[0])) return parsed[0];
|
|
300
|
+
return parsed;
|
|
301
|
+
};
|
|
257
302
|
|
|
258
303
|
//#endregion
|
|
259
304
|
//#region src/cli-wrappers/index.ts
|
|
@@ -772,7 +817,7 @@ var routes = {
|
|
|
772
817
|
"in": "body"
|
|
773
818
|
}, {
|
|
774
819
|
"name": "output_schema",
|
|
775
|
-
"description": "JSON Schema describing the structured object the model must return. When set, non-streaming generations
|
|
820
|
+
"description": "JSON Schema describing the structured object the model must return. When set, non-streaming generations constrain output to this schema and the parsed value is returned as `output.object`. The schema is enforced on the way back, not just sent to the model: an object that violates it fails the generation with 502 `OUTPUT_SCHEMA_VALIDATION_FAILED`, naming the violated field. Constraints beyond `required`/`type` (`minLength`, `enum`, `pattern`, `minItems`) are honored and are what reject a structurally valid but degenerate answer. See the Structured Output section in the Agents module docs.",
|
|
776
821
|
"required": false,
|
|
777
822
|
"type": "object",
|
|
778
823
|
"in": "body"
|
|
@@ -788,6 +833,12 @@ var routes = {
|
|
|
788
833
|
"required": false,
|
|
789
834
|
"type": "boolean",
|
|
790
835
|
"in": "body"
|
|
836
|
+
}, {
|
|
837
|
+
"name": "trace_content_mode",
|
|
838
|
+
"description": "Zero-retention opt-in for this agent. `null` inherits the project's setting; `none` means trace and generation content is never written. Setting `full` under a project whose own mode is `none` is refused with 400 — the project is a floor an agent may only tighten.",
|
|
839
|
+
"required": false,
|
|
840
|
+
"type": "string",
|
|
841
|
+
"in": "body"
|
|
791
842
|
}, {
|
|
792
843
|
"name": "version_label",
|
|
793
844
|
"description": "Optional tag for the config version this write archives (e.g. `initial`). Annotates the version only — it is not stored on the agent and is not part of the config, so labelling a change is never itself a change.",
|
|
@@ -930,7 +981,7 @@ var routes = {
|
|
|
930
981
|
"in": "body"
|
|
931
982
|
}, {
|
|
932
983
|
"name": "output_schema",
|
|
933
|
-
"description": "JSON Schema describing the structured object the model must return. When set, non-streaming generations
|
|
984
|
+
"description": "JSON Schema describing the structured object the model must return. When set, non-streaming generations constrain output to this schema and the parsed value is returned as `output.object`. The schema is enforced on the way back, not just sent to the model: an object that violates it fails the generation with 502 `OUTPUT_SCHEMA_VALIDATION_FAILED`, naming the violated field. Constraints beyond `required`/`type` (`minLength`, `enum`, `pattern`, `minItems`) are honored and are what reject a structurally valid but degenerate answer. See the Structured Output section in the Agents module docs.",
|
|
934
985
|
"required": false,
|
|
935
986
|
"type": "object",
|
|
936
987
|
"in": "body"
|
|
@@ -946,6 +997,12 @@ var routes = {
|
|
|
946
997
|
"required": false,
|
|
947
998
|
"type": "boolean",
|
|
948
999
|
"in": "body"
|
|
1000
|
+
}, {
|
|
1001
|
+
"name": "trace_content_mode",
|
|
1002
|
+
"description": "Zero-retention opt-in for this agent. `null` inherits the project's setting; `none` means trace and generation content is never written. Setting `full` under a project whose own mode is `none` is refused with 400.",
|
|
1003
|
+
"required": false,
|
|
1004
|
+
"type": "string",
|
|
1005
|
+
"in": "body"
|
|
949
1006
|
}, {
|
|
950
1007
|
"name": "version_label",
|
|
951
1008
|
"description": "Optional tag for the config version this write archives (e.g. `pre-tone-change`). Annotates the version only — it is not stored on the agent and is not part of the config, so labelling a change is never itself a change. Ignored when the write changes nothing, since no version is created.",
|
|
@@ -1072,7 +1129,7 @@ var routes = {
|
|
|
1072
1129
|
"in": "body"
|
|
1073
1130
|
}, {
|
|
1074
1131
|
"name": "output_schema",
|
|
1075
|
-
"description": "JSON Schema describing the structured object the model must return. When set, non-streaming generations
|
|
1132
|
+
"description": "JSON Schema describing the structured object the model must return. When set, non-streaming generations constrain output to this schema and the parsed value is returned as `output.object`. The schema is enforced on the way back, not just sent to the model: an object that violates it fails the generation with 502 `OUTPUT_SCHEMA_VALIDATION_FAILED`, naming the violated field. Constraints beyond `required`/`type` (`minLength`, `enum`, `pattern`, `minItems`) are honored and are what reject a structurally valid but degenerate answer. See the Structured Output section in the Agents module docs.",
|
|
1076
1133
|
"required": false,
|
|
1077
1134
|
"type": "object",
|
|
1078
1135
|
"in": "body"
|
|
@@ -1088,6 +1145,12 @@ var routes = {
|
|
|
1088
1145
|
"required": false,
|
|
1089
1146
|
"type": "boolean",
|
|
1090
1147
|
"in": "body"
|
|
1148
|
+
}, {
|
|
1149
|
+
"name": "trace_content_mode",
|
|
1150
|
+
"description": "Zero-retention opt-in for this agent. `null` inherits the project's setting; `none` means trace and generation content is never written. Setting `full` under a project whose own mode is `none` is refused with 400.",
|
|
1151
|
+
"required": false,
|
|
1152
|
+
"type": "string",
|
|
1153
|
+
"in": "body"
|
|
1091
1154
|
}, {
|
|
1092
1155
|
"name": "version_label",
|
|
1093
1156
|
"description": "Optional tag for the config version this write archives (e.g. `pre-tone-change`). Annotates the version only — it is not stored on the agent and is not part of the config, so labelling a change is never itself a change. Ignored when the write changes nothing, since no version is created.",
|
|
@@ -4268,7 +4331,7 @@ var routes = {
|
|
|
4268
4331
|
"in": "body"
|
|
4269
4332
|
}, {
|
|
4270
4333
|
"name": "chunk_strategy",
|
|
4271
|
-
"description": "",
|
|
4334
|
+
"description": "Send `null` to clear the rule's override and fall back to the per-request default.",
|
|
4272
4335
|
"required": false,
|
|
4273
4336
|
"type": "string",
|
|
4274
4337
|
"in": "body"
|
|
@@ -5311,7 +5374,7 @@ var routes = {
|
|
|
5311
5374
|
"update-project": {
|
|
5312
5375
|
serviceClass: "Projects",
|
|
5313
5376
|
operationId: "updateProject",
|
|
5314
|
-
description: "Updates a project's name, its attached guardrails (`guardrail_ids` — the project-scope baseline governing every tool call by every agent in the project), its orchestration concurrency limit (`max_concurrent_runs`), its inherited model route (`default_model_route_id`),
|
|
5377
|
+
description: "Updates a project's name, its attached guardrails (`guardrail_ids` — the project-scope baseline governing every tool call by every agent in the project), its orchestration concurrency limit (`max_concurrent_runs`), its inherited model route (`default_model_route_id`), its read-auditing opt-in (`audit_reads_enabled`), its trace-content retention window (`trace_content_retention_days`), and/or its zero-retention setting (`trace_content_mode`). At least one field is required. Requires admin role. Detaching a guardrail (removing an id) additionally requires guardrails:DetachGuardrail.",
|
|
5315
5378
|
moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/projects",
|
|
5316
5379
|
httpMethod: "patch",
|
|
5317
5380
|
pathParams: ["project_id"],
|
|
@@ -5352,6 +5415,18 @@ var routes = {
|
|
|
5352
5415
|
"required": false,
|
|
5353
5416
|
"type": "boolean",
|
|
5354
5417
|
"in": "body"
|
|
5418
|
+
}, {
|
|
5419
|
+
"name": "trace_content_retention_days",
|
|
5420
|
+
"description": "How long trace and generation content is kept before the daily retention sweep content-purges it. `null` (the default) disables retention; otherwise an integer >= 1. The sweep uses the same purge path as `DELETE /traces/{trace_id}/content`, so the row survives as an auditable skeleton with `content_redacted_at` set.",
|
|
5421
|
+
"required": false,
|
|
5422
|
+
"type": "integer",
|
|
5423
|
+
"in": "body"
|
|
5424
|
+
}, {
|
|
5425
|
+
"name": "trace_content_mode",
|
|
5426
|
+
"description": "Whether trace and generation content is persisted at all. `full` (the default) stores it; `none` is zero-retention — content is never written, for every agent in the project. An agent may tighten this to `none` on its own but cannot loosen a `none` project back to `full`.",
|
|
5427
|
+
"required": false,
|
|
5428
|
+
"type": "string",
|
|
5429
|
+
"in": "body"
|
|
5355
5430
|
}]
|
|
5356
5431
|
},
|
|
5357
5432
|
"delete-project": {
|
|
@@ -7683,31 +7758,6 @@ var formatResultData = async data => {
|
|
|
7683
7758
|
if (data instanceof Blob) return data.text();
|
|
7684
7759
|
return JSON.stringify(data, null, 2);
|
|
7685
7760
|
};
|
|
7686
|
-
var parseFlagValue = value => {
|
|
7687
|
-
const trimmed = value.trim();
|
|
7688
|
-
if (trimmed.startsWith("{") || trimmed.startsWith("[") || trimmed === "true" || trimmed === "false" || trimmed === "null" || /^-?\d+(\.\d+)?$/.test(trimmed)) try {
|
|
7689
|
-
return JSON.parse(trimmed);
|
|
7690
|
-
} catch {
|
|
7691
|
-
return value;
|
|
7692
|
-
}
|
|
7693
|
-
return value;
|
|
7694
|
-
};
|
|
7695
|
-
/**
|
|
7696
|
-
* Build the value for an array-typed flag. Collects repeated occurrences
|
|
7697
|
-
* (`--document_paths /a/ --document_paths /b/`) into a list, coercing each
|
|
7698
|
-
* element with `parseFlagValue`. A single JSON-array literal
|
|
7699
|
-
* (`--document_ids '["doc_1","doc_2"]'`) is passed through as-is rather than
|
|
7700
|
-
* being wrapped again, and a single scalar (`--document_paths /playbooks/`)
|
|
7701
|
-
* becomes a one-element array.
|
|
7702
|
-
*/
|
|
7703
|
-
var buildArrayFlagValue = rawValues => {
|
|
7704
|
-
const parsed = rawValues.map(v => {
|
|
7705
|
-
return parseFlagValue(v);
|
|
7706
|
-
});
|
|
7707
|
-
if (parsed.length === 1 && Array.isArray(parsed[0])) return parsed[0];
|
|
7708
|
-
return parsed;
|
|
7709
|
-
};
|
|
7710
|
-
/** Normalize symbol names to compare exports across acronym casing differences. */
|
|
7711
7761
|
var normalizeSymbol = name => {
|
|
7712
7762
|
return name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
7713
7763
|
};
|
|
@@ -7896,7 +7946,8 @@ program.argument("[command]", "API command in kebab-case (e.g. list-actors)").ar
|
|
|
7896
7946
|
for (const [flagKey, val] of Object.entries(flags)) {
|
|
7897
7947
|
if (flagKey === "profile" || flagKey === "id") continue;
|
|
7898
7948
|
const canonical = toCanonical(flagKey);
|
|
7899
|
-
const
|
|
7949
|
+
const declaredType = flagTypeByCanonical.get(canonical);
|
|
7950
|
+
const parsedValue = declaredType === "array" ? buildArrayFlagValue(repeatedFlags[flagKey] ?? [val]) : parseFlagValue(val, declaredType);
|
|
7900
7951
|
const pathParam = route.pathParams.find(p => {
|
|
7901
7952
|
return toCanonical(p) === canonical;
|
|
7902
7953
|
});
|
|
@@ -7910,7 +7961,7 @@ program.argument("[command]", "API command in kebab-case (e.g. list-actors)").ar
|
|
|
7910
7961
|
});
|
|
7911
7962
|
const idAlias = flags["id"] ?? positionalArgs[0];
|
|
7912
7963
|
const solePathParam = route.pathParams.length === 1 && route.pathParams[0];
|
|
7913
|
-
if (idAlias !== void 0 && solePathParam && !(solePathParam in pathArgs)) pathArgs[solePathParam] = parseFlagValue(idAlias);
|
|
7964
|
+
if (idAlias !== void 0 && solePathParam && !(solePathParam in pathArgs)) pathArgs[solePathParam] = parseFlagValue(idAlias, flagTypeByCanonical.get(toCanonical(solePathParam)));
|
|
7914
7965
|
const missingPathParams = route.pathParams.filter(p => {
|
|
7915
7966
|
return !(p in pathArgs);
|
|
7916
7967
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soat/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@inquirer/input": "^5.1.2",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@ttoss/logger": "^0.8.19",
|
|
9
9
|
"commander": "^15.0.0",
|
|
10
10
|
"js-yaml": "^5.2.1",
|
|
11
|
-
"@soat/sdk": "0.
|
|
11
|
+
"@soat/sdk": "0.19.1"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@ttoss/config": "^1.37.17",
|