@soat/cli 0.15.14 → 0.16.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.
Files changed (2) hide show
  1. package/dist/index.mjs +120 -6
  2. 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.15.14";
16
+ var version = "0.16.1";
17
17
 
18
18
  //#endregion
19
19
  //#region src/cli-wrappers/wrappers/formations.ts
@@ -1528,6 +1528,46 @@ var routes = {
1528
1528
  "in": "query"
1529
1529
  }]
1530
1530
  },
1531
+ "list-approval-recurrences": {
1532
+ serviceClass: "Approvals",
1533
+ operationId: "listApprovalRecurrences",
1534
+ description: "Read-only rollup answering \"what keeps coming back?\" — groups items by `dedup_key` and returns those recurring at least `min_count` times, most-recurrent first. Each group carries the ordered item chain (via `previous_item_id`) and the resolution reasons in order, so a human can read recurring rejections side by side and graduate the pattern into a guardrail `deny`. Exact-key grouping only; no cluster state is stored.",
1535
+ moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/approvals",
1536
+ httpMethod: "get",
1537
+ pathParams: [],
1538
+ queryParams: ["project_id", "status", "min_count", "limit", "offset"],
1539
+ flags: [{
1540
+ "name": "project_id",
1541
+ "description": "Project ID (required if not using project key auth)",
1542
+ "required": false,
1543
+ "type": "string",
1544
+ "in": "query"
1545
+ }, {
1546
+ "name": "status",
1547
+ "description": "Lifecycle status the groups are built from (default `rejected`)",
1548
+ "required": false,
1549
+ "type": "string",
1550
+ "in": "query"
1551
+ }, {
1552
+ "name": "min_count",
1553
+ "description": "Minimum items in a group for it to be returned",
1554
+ "required": false,
1555
+ "type": "integer",
1556
+ "in": "query"
1557
+ }, {
1558
+ "name": "limit",
1559
+ "description": "Maximum number of groups to return",
1560
+ "required": false,
1561
+ "type": "integer",
1562
+ "in": "query"
1563
+ }, {
1564
+ "name": "offset",
1565
+ "description": "Number of groups to skip",
1566
+ "required": false,
1567
+ "type": "integer",
1568
+ "in": "query"
1569
+ }]
1570
+ },
1531
1571
  "get-approval": {
1532
1572
  serviceClass: "Approvals",
1533
1573
  operationId: "getApproval",
@@ -1595,7 +1635,7 @@ var routes = {
1595
1635
  moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/audit-log",
1596
1636
  httpMethod: "get",
1597
1637
  pathParams: [],
1598
- queryParams: ["project_id", "action", "actor_id", "resource_public_id", "resource_srn", "from", "to", "limit", "offset"],
1638
+ queryParams: ["project_id", "action", "principal_id", "resource_public_id", "resource_srn", "from", "to", "limit", "offset"],
1599
1639
  flags: [{
1600
1640
  "name": "project_id",
1601
1641
  "description": "Project ID (scopes results; required if not using project key auth for a specific project)",
@@ -1609,7 +1649,7 @@ var routes = {
1609
1649
  "type": "string",
1610
1650
  "in": "query"
1611
1651
  }, {
1612
- "name": "actor_id",
1652
+ "name": "principal_id",
1613
1653
  "description": "Public id of the principal (`user_…` or `key_…`)",
1614
1654
  "required": false,
1615
1655
  "type": "string",
@@ -1652,6 +1692,58 @@ var routes = {
1652
1692
  "in": "query"
1653
1693
  }]
1654
1694
  },
1695
+ "export-audit-entries": {
1696
+ serviceClass: "AuditLog",
1697
+ operationId: "exportAuditEntries",
1698
+ description: "Streams a project's audit-log entries as newline-delimited JSON — one entry object per line, oldest first — for archival before the retention window expires, or for shipping into an external system. `project_id` is required: the export is per-project by design. Filters behave exactly as they do on the list endpoint.",
1699
+ moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/audit-log",
1700
+ httpMethod: "get",
1701
+ pathParams: [],
1702
+ queryParams: ["project_id", "action", "principal_id", "resource_public_id", "resource_srn", "from", "to"],
1703
+ flags: [{
1704
+ "name": "project_id",
1705
+ "description": "Project whose entries are exported",
1706
+ "required": true,
1707
+ "type": "string",
1708
+ "in": "query"
1709
+ }, {
1710
+ "name": "action",
1711
+ "description": "Exact permission-action string, e.g. `secrets:DeleteSecret`",
1712
+ "required": false,
1713
+ "type": "string",
1714
+ "in": "query"
1715
+ }, {
1716
+ "name": "principal_id",
1717
+ "description": "Public id of the principal (`user_…` or `key_…`)",
1718
+ "required": false,
1719
+ "type": "string",
1720
+ "in": "query"
1721
+ }, {
1722
+ "name": "resource_public_id",
1723
+ "description": "Exact target resource public id, e.g. `sec_…`",
1724
+ "required": false,
1725
+ "type": "string",
1726
+ "in": "query"
1727
+ }, {
1728
+ "name": "resource_srn",
1729
+ "description": "SRN prefix match, e.g. `soat:{project}:secret:`",
1730
+ "required": false,
1731
+ "type": "string",
1732
+ "in": "query"
1733
+ }, {
1734
+ "name": "from",
1735
+ "description": "Only entries created at or after this timestamp (ISO 8601)",
1736
+ "required": false,
1737
+ "type": "string",
1738
+ "in": "query"
1739
+ }, {
1740
+ "name": "to",
1741
+ "description": "Only entries created at or before this timestamp (ISO 8601)",
1742
+ "required": false,
1743
+ "type": "string",
1744
+ "in": "query"
1745
+ }]
1746
+ },
1655
1747
  "get-audit-entry": {
1656
1748
  serviceClass: "AuditLog",
1657
1749
  operationId: "getAuditEntry",
@@ -4831,7 +4923,7 @@ var routes = {
4831
4923
  "update-project": {
4832
4924
  serviceClass: "Projects",
4833
4925
  operationId: "updateProject",
4834
- description: "Updates a project's name and/or its attached guardrails (`guardrail_ids` — the project-scope baseline governing every tool call by every agent in the project). Requires admin role. Detaching a guardrail (removing an id) additionally requires guardrails:DetachGuardrail.",
4926
+ 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`), and/or its read-auditing opt-in (`audit_reads_enabled`). At least one field is required. Requires admin role. Detaching a guardrail (removing an id) additionally requires guardrails:DetachGuardrail.",
4835
4927
  moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/projects",
4836
4928
  httpMethod: "patch",
4837
4929
  pathParams: ["project_id"],
@@ -4860,6 +4952,12 @@ var routes = {
4860
4952
  "required": false,
4861
4953
  "type": "integer",
4862
4954
  "in": "body"
4955
+ }, {
4956
+ "name": "audit_reads_enabled",
4957
+ "description": "Opt the project into read auditing. When true, `GET` requests that name this project are recorded in the audit log alongside mutations. Defaults to `false`.",
4958
+ "required": false,
4959
+ "type": "boolean",
4960
+ "in": "body"
4863
4961
  }]
4864
4962
  },
4865
4963
  "delete-project": {
@@ -4996,7 +5094,7 @@ var routes = {
4996
5094
  "in": "body"
4997
5095
  }, {
4998
5096
  "name": "mode",
4999
- "description": "enforce blocks with 429 (requests at the middleware, tokens/cost_usd at the pre-generation check); monitor is a pass-through no-op until the webhook phase ships.",
5097
+ "description": "enforce blocks with 429 (requests at the middleware, tokens/cost_usd at the pre-generation check); monitor observes without blocking — a breach fires the quota.exceeded webhook and writes a quotas:MonitorBreach audit entry, but the request is let through.",
5000
5098
  "required": false,
5001
5099
  "type": "string",
5002
5100
  "in": "body"
@@ -7153,6 +7251,22 @@ var kebabToSnake = s => {
7153
7251
  var toKebab = s => {
7154
7252
  return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
7155
7253
  };
7254
+ /**
7255
+ * Renders a command's payload for stdout.
7256
+ *
7257
+ * A response the SDK could not parse as JSON (the NDJSON audit export, a file
7258
+ * download) arrives as a Blob, which `JSON.stringify` collapses to `{}` — those
7259
+ * are printed as their own bytes instead.
7260
+ *
7261
+ * Everything else keeps going through `JSON.stringify`, **including a plain
7262
+ * string**: a JSON body may legitimately *be* a bare string (a `call-tool`
7263
+ * response whose output mapping yields a scalar), and callers pipe that into
7264
+ * `jq`, which needs the quotes to parse it.
7265
+ */
7266
+ var formatResultData = async data => {
7267
+ if (data instanceof Blob) return data.text();
7268
+ return JSON.stringify(data, null, 2);
7269
+ };
7156
7270
  var parseFlagValue = value => {
7157
7271
  const trimmed = value.trim();
7158
7272
  if (trimmed.startsWith("{") || trimmed.startsWith("[") || trimmed === "true" || trimmed === "false" || trimmed === "null" || /^-?\d+(\.\d+)?$/.test(trimmed)) try {
@@ -7426,7 +7540,7 @@ program.argument("[command]", "API command in kebab-case (e.g. list-actors)").ar
7426
7540
  console.error(JSON.stringify(errorOutput, null, 2));
7427
7541
  process.exit(1);
7428
7542
  }
7429
- console.log(JSON.stringify(result.data, null, 2));
7543
+ console.log(await formatResultData(result.data));
7430
7544
  });
7431
7545
  var runCli = async args => {
7432
7546
  const previousArgv = process.argv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/cli",
3
- "version": "0.15.14",
3
+ "version": "0.16.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.15.14"
11
+ "@soat/sdk": "0.16.1"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@ttoss/config": "^1.37.17",