@iam-protocol/pulse-sdk 0.3.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iam-protocol/pulse-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Client-side SDK for IAM Protocol — sensor capture, TBH generation, ZK proof construction",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/pulse.ts CHANGED
@@ -93,6 +93,15 @@ async function processSensorData(
93
93
  // Extract features
94
94
  const features = await extractFeatures(sensorData);
95
95
 
96
+ // Diagnostic: log feature vector composition
97
+ const nonZero = features.filter((v) => v !== 0).length;
98
+ console.log(
99
+ `[IAM SDK] Feature vector: ${features.length} dimensions, ${nonZero} non-zero. ` +
100
+ `Audio[0..43]: ${features.slice(0, 44).filter((v) => v !== 0).length} non-zero. ` +
101
+ `Motion/Mouse[44..97]: ${features.slice(44, 98).filter((v) => v !== 0).length} non-zero. ` +
102
+ `Touch[98..133]: ${features.slice(98, 134).filter((v) => v !== 0).length} non-zero.`
103
+ );
104
+
96
105
  // Generate fingerprint via SimHash
97
106
  const fingerprint = simhash(features);
98
107
 
@@ -38,11 +38,13 @@ export function captureTouch(
38
38
  clearTimeout(maxTimer);
39
39
  element.removeEventListener("pointermove", handler);
40
40
  element.removeEventListener("pointerdown", handler);
41
+ console.log(`[IAM SDK] Touch capture stopped: ${samples.length} samples collected`);
41
42
  resolve(samples);
42
43
  }
43
44
 
44
45
  element.addEventListener("pointermove", handler);
45
46
  element.addEventListener("pointerdown", handler);
47
+ console.log(`[IAM SDK] Touch capture started on <${element.tagName}>, listening for pointer events`);
46
48
 
47
49
  const maxTimer = setTimeout(stopCapture, maxDurationMs);
48
50