clawpowers 2.2.2 → 2.2.4

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/COMPATIBILITY.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  | clawpowers | Recommended consumer |
6
6
  | --- | --- |
7
- | 2.2.x (latest: 2.2.1) | capability-library consumers and `clawpowers-agent` 1.1.x |
7
+ | 2.2.x (latest: 2.2.4) | capability-library consumers and `clawpowers-agent` 1.1.x |
8
8
 
9
9
  ## Notes
10
10
 
package/README.md CHANGED
@@ -4,12 +4,13 @@
4
4
 
5
5
  **Recommended pairing:** `clawpowers` 2.2.x with `clawpowers-agent` 1.1.x.
6
6
 
7
- **More docs:** [SECURITY](./SECURITY.md) · [Compatibility](./COMPATIBILITY.md) · [Known Limitations](./KNOWN_LIMITATIONS.md) · [Licensing](./LICENSING.md) · [Releasing](./RELEASING.md) · [Demo](./DEMO.md)
7
+ **More docs:** [SECURITY](./SECURITY.md) · [Compatibility](./COMPATIBILITY.md) · [Known Limitations](./KNOWN_LIMITATIONS.md) · [Licensing](./LICENSING.md) · [Releasing](./RELEASING.md) · [Demo](./DEMO.md) · [Roadmap](./ROADMAP.md)
8
8
 
9
9
  **Skills library for AI agents — payments, memory, RSI, wallet, parallel swarm, ITP.** Drop-in capability layer for any agent framework.
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/clawpowers)](https://www.npmjs.com/package/clawpowers)
12
12
  [![License: BSL 1.1](https://img.shields.io/badge/License-BSL%201.1-blue.svg)](LICENSE)
13
+ [![CI](https://github.com/up2itnow0822/ClawPowers-Skills/actions/workflows/ci.yml/badge.svg)](https://github.com/up2itnow0822/ClawPowers-Skills/actions/workflows/ci.yml)
13
14
 
14
15
  ```bash
15
16
  npm install clawpowers
@@ -233,6 +234,7 @@ const result = ab.evaluateTest(test.testId);
233
234
  **Tier behavior:**
234
235
  - **Tier 1** (native `.node` addon, built locally with `cargo`): full secp256k1 + ECDSA + Keccak-256 via the `k256` Rust crate
235
236
  - **Tier 2** (pre-built WASM, ships in the npm package): same secp256k1 + ECDSA + Keccak-256 via `k256` compiled to WebAssembly
237
+ > **⚠️ Wallet safety:** If both Tier 1 (native) and Tier 2 (WASM) fail to load, the library falls back to Tier 3 pure-TypeScript signing, which uses a legacy SHA-256 digest and HMAC — **not standard secp256k1, not production-safe for on-chain use.** Because Tier 2 WASM ships pre-built in every npm tarball, this fallback should only occur in heavily sandboxed environments. Call `getActiveTier()` at startup to verify you are running Tier 1 or Tier 2 before sending any real funds.
236
238
  - **Tier 3** (pure TypeScript, used only if Tier 1 AND Tier 2 both fail to load): legacy SHA-256 digest and HMAC signing — **not production-safe for on-chain use**
237
239
 
238
240
  Since Tier 2 WASM artifacts ship pre-built in the npm package, **every install gets real Ethereum wallets out of the box** — no Rust toolchain required.
package/native/Cargo.lock CHANGED
@@ -134,7 +134,7 @@ dependencies = [
134
134
  "either",
135
135
  "serde",
136
136
  "serde_with",
137
- "sha2",
137
+ "sha2 0.10.9",
138
138
  ]
139
139
 
140
140
  [[package]]
@@ -756,6 +756,15 @@ dependencies = [
756
756
  "generic-array",
757
757
  ]
758
758
 
759
+ [[package]]
760
+ name = "block-buffer"
761
+ version = "0.12.0"
762
+ source = "registry+https://github.com/rust-lang/crates.io-index"
763
+ checksum = "cdd35008169921d80bc60d3d0ab416eecb028c4cd653352907921d95084790be"
764
+ dependencies = [
765
+ "hybrid-array",
766
+ ]
767
+
759
768
  [[package]]
760
769
  name = "blst"
761
770
  version = "0.3.16"
@@ -936,7 +945,7 @@ dependencies = [
936
945
  "rusqlite",
937
946
  "serde",
938
947
  "serde_json",
939
- "sha2",
948
+ "sha2 0.11.0",
940
949
  "thiserror",
941
950
  "tokio",
942
951
  "tracing",
@@ -951,7 +960,7 @@ dependencies = [
951
960
  "rand 0.9.2",
952
961
  "serde",
953
962
  "serde_json",
954
- "sha2",
963
+ "sha2 0.11.0",
955
964
  "thiserror",
956
965
  "tracing",
957
966
  ]
@@ -1084,7 +1093,7 @@ dependencies = [
1084
1093
  "rusqlite",
1085
1094
  "serde",
1086
1095
  "serde_json",
1087
- "sha2",
1096
+ "sha2 0.11.0",
1088
1097
  "thiserror",
1089
1098
  "tracing",
1090
1099
  "uuid",
@@ -1156,7 +1165,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1156
1165
  checksum = "531185e432bb31db1ecda541e9e7ab21468d4d844ad7505e0546a49b4945d49b"
1157
1166
  dependencies = [
1158
1167
  "cfg-if",
1159
- "cpufeatures",
1168
+ "cpufeatures 0.2.17",
1160
1169
  "proptest",
1161
1170
  "serde_core",
1162
1171
  ]
@@ -1167,6 +1176,12 @@ version = "0.9.6"
1167
1176
  source = "registry+https://github.com/rust-lang/crates.io-index"
1168
1177
  checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
1169
1178
 
1179
+ [[package]]
1180
+ name = "const-oid"
1181
+ version = "0.10.2"
1182
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1183
+ checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"
1184
+
1170
1185
  [[package]]
1171
1186
  name = "const_format"
1172
1187
  version = "0.2.35"
@@ -1240,6 +1255,15 @@ dependencies = [
1240
1255
  "libc",
1241
1256
  ]
1242
1257
 
1258
+ [[package]]
1259
+ name = "cpufeatures"
1260
+ version = "0.3.0"
1261
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1262
+ checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201"
1263
+ dependencies = [
1264
+ "libc",
1265
+ ]
1266
+
1243
1267
  [[package]]
1244
1268
  name = "crc"
1245
1269
  version = "3.4.0"
@@ -1344,6 +1368,15 @@ dependencies = [
1344
1368
  "typenum",
1345
1369
  ]
1346
1370
 
1371
+ [[package]]
1372
+ name = "crypto-common"
1373
+ version = "0.2.1"
1374
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1375
+ checksum = "77727bb15fa921304124b128af125e7e3b968275d1b108b379190264f4423710"
1376
+ dependencies = [
1377
+ "hybrid-array",
1378
+ ]
1379
+
1347
1380
  [[package]]
1348
1381
  name = "ctor"
1349
1382
  version = "0.8.0"
@@ -1401,7 +1434,7 @@ version = "0.7.10"
1401
1434
  source = "registry+https://github.com/rust-lang/crates.io-index"
1402
1435
  checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
1403
1436
  dependencies = [
1404
- "const-oid",
1437
+ "const-oid 0.9.6",
1405
1438
  "zeroize",
1406
1439
  ]
1407
1440
 
@@ -1464,12 +1497,23 @@ version = "0.10.7"
1464
1497
  source = "registry+https://github.com/rust-lang/crates.io-index"
1465
1498
  checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
1466
1499
  dependencies = [
1467
- "block-buffer",
1468
- "const-oid",
1469
- "crypto-common",
1500
+ "block-buffer 0.10.4",
1501
+ "const-oid 0.9.6",
1502
+ "crypto-common 0.1.6",
1470
1503
  "subtle",
1471
1504
  ]
1472
1505
 
1506
+ [[package]]
1507
+ name = "digest"
1508
+ version = "0.11.2"
1509
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1510
+ checksum = "4850db49bf08e663084f7fb5c87d202ef91a3907271aff24a94eb97ff039153c"
1511
+ dependencies = [
1512
+ "block-buffer 0.12.0",
1513
+ "const-oid 0.10.2",
1514
+ "crypto-common 0.2.1",
1515
+ ]
1516
+
1473
1517
  [[package]]
1474
1518
  name = "displaydoc"
1475
1519
  version = "0.2.5"
@@ -1606,7 +1650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1606
1650
  checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
1607
1651
  dependencies = [
1608
1652
  "libc",
1609
- "windows-sys 0.61.2",
1653
+ "windows-sys 0.52.0",
1610
1654
  ]
1611
1655
 
1612
1656
  [[package]]
@@ -2036,6 +2080,15 @@ version = "1.10.1"
2036
2080
  source = "registry+https://github.com/rust-lang/crates.io-index"
2037
2081
  checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
2038
2082
 
2083
+ [[package]]
2084
+ name = "hybrid-array"
2085
+ version = "0.4.10"
2086
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2087
+ checksum = "3944cf8cf766b40e2a1a333ee5e9b563f854d5fa49d6a8ca2764e97c6eddb214"
2088
+ dependencies = [
2089
+ "typenum",
2090
+ ]
2091
+
2039
2092
  [[package]]
2040
2093
  name = "hyper"
2041
2094
  version = "1.8.1"
@@ -2329,7 +2382,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"
2329
2382
  dependencies = [
2330
2383
  "hermit-abi",
2331
2384
  "libc",
2332
- "windows-sys 0.61.2",
2385
+ "windows-sys 0.52.0",
2333
2386
  ]
2334
2387
 
2335
2388
  [[package]]
@@ -2388,7 +2441,7 @@ dependencies = [
2388
2441
  "elliptic-curve",
2389
2442
  "once_cell",
2390
2443
  "serdect",
2391
- "sha2",
2444
+ "sha2 0.10.9",
2392
2445
  "signature",
2393
2446
  ]
2394
2447
 
@@ -2398,7 +2451,7 @@ version = "0.1.6"
2398
2451
  source = "registry+https://github.com/rust-lang/crates.io-index"
2399
2452
  checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653"
2400
2453
  dependencies = [
2401
- "cpufeatures",
2454
+ "cpufeatures 0.2.17",
2402
2455
  ]
2403
2456
 
2404
2457
  [[package]]
@@ -3392,7 +3445,7 @@ dependencies = [
3392
3445
  "errno",
3393
3446
  "libc",
3394
3447
  "linux-raw-sys",
3395
- "windows-sys 0.61.2",
3448
+ "windows-sys 0.52.0",
3396
3449
  ]
3397
3450
 
3398
3451
  [[package]]
@@ -3697,10 +3750,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
3697
3750
  checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
3698
3751
  dependencies = [
3699
3752
  "cfg-if",
3700
- "cpufeatures",
3753
+ "cpufeatures 0.2.17",
3701
3754
  "digest 0.10.7",
3702
3755
  ]
3703
3756
 
3757
+ [[package]]
3758
+ name = "sha2"
3759
+ version = "0.11.0"
3760
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3761
+ checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4"
3762
+ dependencies = [
3763
+ "cfg-if",
3764
+ "cpufeatures 0.3.0",
3765
+ "digest 0.11.2",
3766
+ ]
3767
+
3704
3768
  [[package]]
3705
3769
  name = "sha3"
3706
3770
  version = "0.10.8"
@@ -3903,7 +3967,7 @@ dependencies = [
3903
3967
  "getrandom 0.4.2",
3904
3968
  "once_cell",
3905
3969
  "rustix",
3906
- "windows-sys 0.61.2",
3970
+ "windows-sys 0.52.0",
3907
3971
  ]
3908
3972
 
3909
3973
  [[package]]
@@ -3988,9 +4052,9 @@ dependencies = [
3988
4052
 
3989
4053
  [[package]]
3990
4054
  name = "tokio"
3991
- version = "1.50.0"
4055
+ version = "1.51.1"
3992
4056
  source = "registry+https://github.com/rust-lang/crates.io-index"
3993
- checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d"
4057
+ checksum = "f66bf9585cda4b724d3e78ab34b73fb2bbaba9011b9bfdf69dc836382ea13b8c"
3994
4058
  dependencies = [
3995
4059
  "bytes",
3996
4060
  "libc",
@@ -4005,9 +4069,9 @@ dependencies = [
4005
4069
 
4006
4070
  [[package]]
4007
4071
  name = "tokio-macros"
4008
- version = "2.6.1"
4072
+ version = "2.7.0"
4009
4073
  source = "registry+https://github.com/rust-lang/crates.io-index"
4010
- checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c"
4074
+ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
4011
4075
  dependencies = [
4012
4076
  "proc-macro2",
4013
4077
  "quote",
@@ -4463,7 +4527,7 @@ version = "0.1.11"
4463
4527
  source = "registry+https://github.com/rust-lang/crates.io-index"
4464
4528
  checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
4465
4529
  dependencies = [
4466
- "windows-sys 0.61.2",
4530
+ "windows-sys 0.52.0",
4467
4531
  ]
4468
4532
 
4469
4533
  [[package]]
package/native/Cargo.toml CHANGED
@@ -43,7 +43,7 @@ serde_json = "1"
43
43
  rusqlite = { version = "0.32", features = ["bundled"] }
44
44
 
45
45
  # Crypto / Hashing
46
- sha2 = "0.10"
46
+ sha2 = "0.11"
47
47
  rand = "0.9"
48
48
  zeroize = { version = "1", features = ["derive"] }
49
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawpowers",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "Skills library for AI agents — payments, memory, RSI, wallet. Drop-in capability layer for any agent framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,7 +29,8 @@
29
29
  "SECURITY.md",
30
30
  "COMPATIBILITY.md",
31
31
  "KNOWN_LIMITATIONS.md",
32
- "LICENSING.md"
32
+ "LICENSING.md",
33
+ "scripts/"
33
34
  ],
34
35
  "scripts": {
35
36
  "build:native": "cd native && cargo build --release --workspace || echo 'Rust not installed - using WASM/TS fallback'",
@@ -78,7 +79,7 @@
78
79
  "@typescript-eslint/eslint-plugin": "^8.0.0",
79
80
  "@typescript-eslint/parser": "^8.0.0",
80
81
  "eslint": "^9.0.0",
81
- "globals": "^15.0.0",
82
+ "globals": "^17.4.0",
82
83
  "tsup": "^8.0.0",
83
84
  "typescript": "^5.5.0",
84
85
  "vitest": "^2.0.0"
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Verifies required WASM fallback artifacts are present in the npm tarball.
4
+ *
5
+ * npm pack --dry-run --json interleaves prepack build output (from tsup) on stdout
6
+ * before the JSON array. We find the LAST '[' that starts a valid JSON array.
7
+ */
8
+ import { spawnSync } from 'child_process';
9
+
10
+ const result = spawnSync('npm', ['pack', '--dry-run', '--json'], {
11
+ encoding: 'utf8',
12
+ stdio: ['ignore', 'pipe', 'inherit'], // let prepack stderr go to terminal, capture stdout
13
+ });
14
+
15
+ const stdout = result.stdout ?? '';
16
+
17
+ // Find the last '[' in stdout -- npm pack JSON array always comes after prepack output
18
+ let pack;
19
+ let pos = stdout.lastIndexOf('[');
20
+ while (pos >= 0) {
21
+ try {
22
+ pack = JSON.parse(stdout.slice(pos));
23
+ break;
24
+ } catch {
25
+ pos = stdout.lastIndexOf('[', pos - 1);
26
+ }
27
+ }
28
+
29
+ if (!pack) {
30
+ console.error('ERROR: Could not parse JSON array from npm pack --dry-run --json output');
31
+ console.error('stdout (first 400 chars):', stdout.slice(0, 400));
32
+ process.exit(1);
33
+ }
34
+
35
+ const files = (pack[0]?.files ?? []).map(f => f.path);
36
+
37
+ const required = [
38
+ 'native/wasm/pkg-node/clawpowers_wasm.js',
39
+ 'native/wasm/pkg-node/clawpowers_wasm_bg.wasm',
40
+ ];
41
+
42
+ let ok = true;
43
+ for (const req of required) {
44
+ if (!files.includes(req)) {
45
+ console.error('ERROR: Missing packaged WASM artifact:', req);
46
+ ok = false;
47
+ }
48
+ }
49
+
50
+ if (ok) {
51
+ console.log(`WASM artifacts present in tarball. Total files: ${files.length}`);
52
+ } else {
53
+ process.exit(1);
54
+ }