@soat/cli 0.52.0 → 0.53.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 +21 -10
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -13,7 +13,7 @@ import * as os from "node:os";
13
13
  import { createHmac, timingSafeEqual } from "node:crypto";
14
14
 
15
15
  //#region package.json
16
- var version = "0.52.0";
16
+ var version = "0.53.0";
17
17
 
18
18
  //#endregion
19
19
  //#region src/cli-wrappers/wrappers/formations.ts
@@ -832,7 +832,7 @@ var routes = {
832
832
  "in": "body"
833
833
  }, {
834
834
  "name": "boundary_policy",
835
- "description": "",
835
+ "description": "Restricts which SOAT actions the agent may invoke. Evaluated as the intersection with the caller's own policy, so it can only narrow.",
836
836
  "required": false,
837
837
  "type": "object",
838
838
  "in": "body"
@@ -996,7 +996,7 @@ var routes = {
996
996
  "in": "body"
997
997
  }, {
998
998
  "name": "boundary_policy",
999
- "description": "",
999
+ "description": "Restricts which SOAT actions the agent may invoke. Evaluated as the intersection with the caller's own policy, so it can only narrow.",
1000
1000
  "required": false,
1001
1001
  "type": "object",
1002
1002
  "in": "body"
@@ -1144,7 +1144,7 @@ var routes = {
1144
1144
  "in": "body"
1145
1145
  }, {
1146
1146
  "name": "boundary_policy",
1147
- "description": "",
1147
+ "description": "Restricts which SOAT actions the agent may invoke. Evaluated as the intersection with the caller's own policy, so it can only narrow.",
1148
1148
  "required": false,
1149
1149
  "type": "object",
1150
1150
  "in": "body"
@@ -9451,6 +9451,19 @@ var findUnknownFlags = args => {
9451
9451
 
9452
9452
  //#endregion
9453
9453
  //#region src/webhookSignature.ts
9454
+ /**
9455
+ * Verification of the signature on a payload the local `soat listen` listener
9456
+ * receives. The listener takes two kinds, both under `X-Soat-Signature`,
9457
+ * distinguished by the value's own prefix rather than by header name:
9458
+ *
9459
+ * - A **webhook delivery** carries `t=<unix>,v1=<hex>` — a digest over
9460
+ * `<t>.<raw body>`, so the timestamp is authenticated and a subscriber can
9461
+ * bound a replay by age.
9462
+ * - A **trigger** payload carries `sha256=<hex>`, a digest over the bare
9463
+ * body, which is the scheme a webhook-type trigger's sender signs with.
9464
+ */
9465
+ /** Only the timestamped scheme starts this way; everything else is bare-body. */
9466
+ var TIMESTAMPED_PREFIX = "t=";
9454
9467
  var digestMatches = args => {
9455
9468
  const expectedBuffer = Buffer.from(args.expected, "utf8");
9456
9469
  const actualBuffer = Buffer.from(args.actual, "utf8");
@@ -9495,10 +9508,8 @@ var headerValue = value => {
9495
9508
  * Picks the scheme a delivery used and verifies it, when a secret is supplied.
9496
9509
  */
9497
9510
  var inspectDeliverySignature = args => {
9498
- const timestamped = headerValue(args.headers["x-soat-signature-v2"]);
9499
- const bareBody = headerValue(args.headers["x-soat-signature"]);
9500
- const scheme = timestamped ? "v2" : "v1";
9501
- const signature = timestamped || bareBody;
9511
+ const signature = headerValue(args.headers["x-soat-signature"]);
9512
+ const scheme = signature.startsWith(TIMESTAMPED_PREFIX) ? "v2" : "v1";
9502
9513
  if (!args.secret) return {
9503
9514
  signature,
9504
9515
  scheme,
@@ -9510,11 +9521,11 @@ var inspectDeliverySignature = args => {
9510
9521
  valid: scheme === "v2" ? verifyTimestampedSignature({
9511
9522
  secret: args.secret,
9512
9523
  payload: args.payload,
9513
- header: timestamped
9524
+ header: signature
9514
9525
  }) : verifyBareBodySignature({
9515
9526
  secret: args.secret,
9516
9527
  payload: args.payload,
9517
- header: bareBody
9528
+ header: signature
9518
9529
  })
9519
9530
  };
9520
9531
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/cli",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "description": "CLI for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@inquirer/input": "^5.1.6",
24
24
  "@inquirer/password": "^5.2.2",
25
- "@soat/sdk": "0.52.0",
25
+ "@soat/sdk": "0.53.0",
26
26
  "@ttoss/logger": "^0.8.20",
27
27
  "commander": "^15.0.0",
28
28
  "js-yaml": "^5.4.2"