@alveus-ai/core 0.1.6 → 0.1.7
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/agent.d.ts.map +1 -1
- package/dist/agent.js +28 -2
- package/dist/agent.js.map +1 -1
- package/package.json +1 -1
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAmB,MAAM,YAAY,CAAC;AAgBrF,wBAAgB,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAC9E,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,EACxD,OAAO,CAAC,EAAE,YAAY,GACrB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAwB1C;AA0CD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,MAAM,CAEjF"}
|
package/dist/agent.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import crypto from 'node:crypto';
|
|
2
1
|
export function agent$(handler, options) {
|
|
3
2
|
const handlerSource = handler.toString();
|
|
4
3
|
const hash = computeHash(handlerSource);
|
|
@@ -22,7 +21,34 @@ export function agent$(handler, options) {
|
|
|
22
21
|
};
|
|
23
22
|
}
|
|
24
23
|
function computeHash(source) {
|
|
25
|
-
|
|
24
|
+
let h1 = 0x811c9dc5;
|
|
25
|
+
let h2 = 0x01000193;
|
|
26
|
+
let h3 = 0xdeadbeef;
|
|
27
|
+
let h4 = 0xcafebabe;
|
|
28
|
+
for (let i = 0; i < source.length; i++) {
|
|
29
|
+
const c = source.charCodeAt(i);
|
|
30
|
+
h1 ^= c;
|
|
31
|
+
h1 = Math.imul(h1, 0x01000193);
|
|
32
|
+
h2 ^= c;
|
|
33
|
+
h2 = Math.imul(h2, 0x01000193);
|
|
34
|
+
h3 ^= c;
|
|
35
|
+
h3 = Math.imul(h3, 0x100001b3);
|
|
36
|
+
h4 ^= c;
|
|
37
|
+
h4 = Math.imul(h4, 0x100001b3);
|
|
38
|
+
}
|
|
39
|
+
h1 = h1 ^ (h1 >>> 16);
|
|
40
|
+
h2 = h2 ^ (h2 >>> 16);
|
|
41
|
+
h3 = h3 ^ (h3 >>> 16);
|
|
42
|
+
h4 = h4 ^ (h4 >>> 16);
|
|
43
|
+
const hex = (n) => (n >>> 0).toString(16).padStart(8, '0');
|
|
44
|
+
return (hex(h1) +
|
|
45
|
+
hex(h2) +
|
|
46
|
+
hex(h3) +
|
|
47
|
+
hex(h4) +
|
|
48
|
+
hex(h1 ^ h3) +
|
|
49
|
+
hex(h2 ^ h4) +
|
|
50
|
+
hex(h1 ^ h4) +
|
|
51
|
+
hex(h2 ^ h3));
|
|
26
52
|
}
|
|
27
53
|
export function serializeHandler(handler) {
|
|
28
54
|
return handler.toString();
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,MAAM,CACpB,OAAwD,EACxD,OAAsB;IAGtB,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;IAExC,MAAM,UAAU,GAA8C;QAC5D,IAAI;QACJ,MAAM,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