@adapt-toolkit/sdk 0.5.14 → 0.5.15
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/utilities/broker/broker.d.ts.map +1 -1
- package/dist/utilities/broker/broker.js +265 -1
- package/dist/utilities/broker/broker.js.map +1 -1
- package/dist/utilities/common/http_server.d.ts +4 -2
- package/dist/utilities/common/http_server.d.ts.map +1 -1
- package/dist/utilities/common/http_server.js +3 -0
- package/dist/utilities/common/http_server.js.map +1 -1
- package/dist/utilities/common/web_socket_connection.d.ts +4 -0
- package/dist/utilities/common/web_socket_connection.d.ts.map +1 -1
- package/dist/utilities/common/web_socket_connection.js +20 -0
- package/dist/utilities/common/web_socket_connection.js.map +1 -1
- package/dist/wasm/mufl-bindings.js +3 -47
- package/dist/wasm/mufl-bindings.js.map +1 -1
- package/dist/wasm/mufl-bindings.wasm +0 -0
- package/dist/wrapper/conversion.d.ts.map +1 -1
- package/dist/wrapper/conversion.js +12 -1
- package/dist/wrapper/conversion.js.map +1 -1
- package/package.json +3 -2
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversion.d.ts","sourceRoot":"","sources":["../../src/wrapper/conversion.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"conversion.d.ts","sourceRoot":"","sources":["../../src/wrapper/conversion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,UAAU,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGrG,KAAK,WAAW,GAAG,uBAAuB,CAAC;AAE3C,KAAK,qBAAqB,GACtB;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,qBAAqB,CAAA;CAAE,GAC5D,qBAAqB,EAAE,GACvB,WAAW,CAAC;AAehB,eAAO,MAAM,qBAAqB,GAAI,KAAK,qBAAqB,KAAG,UA4BlE,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,SAEtE,CAAC"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { AdaptEnvironment, AdaptValue } from '@adapt-toolkit/sdk/backend';
|
|
2
2
|
import { AdaptObjectBuilder } from './memory_management/adapt_builder.js';
|
|
3
|
+
// Reuse a SINGLE process-lifetime secure value-host across all conversions. object_to_adapt_value
|
|
4
|
+
// previously minted a fresh EmptyPacket(true) PER CALL to host its dictionary; since CreateDictionary's
|
|
5
|
+
// AdaptValue carries a reference to its host packet (CreateDictionary: ret.m_packet.reset_ptr(m_packet)),
|
|
6
|
+
// every converted value pinned its own packet alive — accumulating one retained packet per conversion
|
|
7
|
+
// under sustained load (unbounded native packet growth). Reusing one host bounds it to a single packet:
|
|
8
|
+
// the values are immutable and independent (NewImmutableDictionary), the host only supplies the value
|
|
9
|
+
// domain/allocator, and evaluation is single-threaded, so a shared host is safe. secure=true is preserved
|
|
10
|
+
// (forbids in-packet primitive calls). lt=undefined ⇒ a process-lifetime singleton (caller-owned, never
|
|
11
|
+
// auto-freed = exactly one packet for the process), mirroring the GetProtocolContainer singleton pattern.
|
|
12
|
+
let _value_host;
|
|
13
|
+
const value_host = () => (_value_host ??= AdaptEnvironment.EmptyPacket(undefined, true));
|
|
3
14
|
export const object_to_adapt_value = (obj) => {
|
|
4
15
|
return AdaptObjectBuilder.execute_and_collect_garbage((builder) => {
|
|
5
16
|
if (obj instanceof AdaptValue)
|
|
@@ -10,7 +21,7 @@ export const object_to_adapt_value = (obj) => {
|
|
|
10
21
|
typeof obj === 'boolean' ||
|
|
11
22
|
obj === null)
|
|
12
23
|
return builder.AdaptValue.New(obj).Detach();
|
|
13
|
-
let result =
|
|
24
|
+
let result = value_host().CreateDictionary();
|
|
14
25
|
if (Array.isArray(obj)) {
|
|
15
26
|
obj.forEach((value, index) => {
|
|
16
27
|
result = result.Mutate(index, builder.Attach(object_to_adapt_value(value)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversion.js","sourceRoot":"","sources":["../../src/wrapper/conversion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"conversion.js","sourceRoot":"","sources":["../../src/wrapper/conversion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,UAAU,EAA2B,MAAM,UAAU,CAAC;AACrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAS1E,kGAAkG;AAClG,wGAAwG;AACxG,0GAA0G;AAC1G,sGAAsG;AACtG,wGAAwG;AACxG,sGAAsG;AACtG,0GAA0G;AAC1G,wGAAwG;AACxG,0GAA0G;AAC1G,IAAI,WAA2C,CAAC;AAChD,MAAM,UAAU,GAAG,GAAuB,EAAE,CAC1C,CAAC,WAAW,KAAK,gBAAgB,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;AAElE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAA0B,EAAc,EAAE;IAC9E,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,CAAC,OAAO,EAAE,EAAE;QAChE,IAAI,GAAG,YAAY,UAAU;YAAE,OAAO,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC3D,IACE,OAAO,GAAG,KAAK,QAAQ;YACvB,OAAO,GAAG,KAAK,QAAQ;YACvB,OAAO,GAAG,KAAK,WAAW;YAC1B,OAAO,GAAG,KAAK,SAAS;YACxB,GAAG,KAAK,IAAI;YAEZ,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QAE9C,IAAI,MAAM,GAAG,UAAU,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;gBAC3B,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9E,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/C,MAAM,GAAG,MAAM,CAAC,MAAM,CACpB,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAC1C,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAC7C,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAA4C,EAAE;IACjF,OAAO,gBAAgB,CAAC,oBAAoB,EAAE,CAAC;AACjD,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adapt-toolkit/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"description": "TypeScript SDK for the ADAPT framework. One install for browser, Node, and React Native; the runtime picks a native, WASM, or platform-native backend automatically.",
|
|
@@ -107,7 +107,8 @@
|
|
|
107
107
|
"ws": "^8.16.0"
|
|
108
108
|
},
|
|
109
109
|
"optionalDependencies": {
|
|
110
|
-
"@adapt-toolkit/sdk-native": "0.5.
|
|
110
|
+
"@adapt-toolkit/sdk-native": "0.5.15",
|
|
111
|
+
"geoip-lite": "^1.4.10"
|
|
111
112
|
},
|
|
112
113
|
"peerDependencies": {
|
|
113
114
|
"@adapt-toolkit/sdk-react-native": "0.1.0"
|