@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/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/pulse.ts +9 -0
- package/src/sensor/touch.ts +2 -0
package/package.json
CHANGED
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
|
|
package/src/sensor/touch.ts
CHANGED
|
@@ -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
|
|