@cldmv/slothlet 2.5.5 → 2.6.0
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/README.md +59 -5
- package/dist/lib/helpers/als-eventemitter.mjs +5 -4
- package/dist/lib/helpers/api_builder.mjs +27 -13
- package/dist/lib/helpers/auto-wrap.mjs +4 -2
- package/dist/lib/helpers/instance-manager.mjs +111 -0
- package/dist/lib/helpers/multidefault.mjs +12 -2
- package/dist/lib/modes/slothlet_eager.mjs +1 -1
- package/dist/lib/modes/slothlet_lazy.mjs +48 -5
- package/dist/lib/runtime/runtime-asynclocalstorage.mjs +435 -0
- package/dist/lib/runtime/runtime-livebindings.mjs +298 -0
- package/dist/lib/runtime/runtime.mjs +152 -349
- package/dist/slothlet.mjs +97 -11
- package/index.cjs +30 -39
- package/index.mjs +45 -15
- package/package.json +17 -1
- package/types/dist/lib/helpers/als-eventemitter.d.mts +3 -3
- package/types/dist/lib/helpers/als-eventemitter.d.mts.map +1 -1
- package/types/dist/lib/helpers/api_builder.d.mts.map +1 -1
- package/types/dist/lib/helpers/auto-wrap.d.mts.map +1 -1
- package/types/dist/lib/helpers/instance-manager.d.mts +41 -0
- package/types/dist/lib/helpers/instance-manager.d.mts.map +1 -0
- package/types/dist/lib/helpers/multidefault.d.mts +8 -3
- package/types/dist/lib/helpers/multidefault.d.mts.map +1 -1
- package/types/dist/lib/modes/slothlet_lazy.d.mts.map +1 -1
- package/types/dist/lib/runtime/runtime-asynclocalstorage.d.mts +58 -0
- package/types/dist/lib/runtime/runtime-asynclocalstorage.d.mts.map +1 -0
- package/types/dist/lib/runtime/runtime-livebindings.d.mts +58 -0
- package/types/dist/lib/runtime/runtime-livebindings.d.mts.map +1 -0
- package/types/dist/lib/runtime/runtime.d.mts +8 -57
- package/types/dist/lib/runtime/runtime.d.mts.map +1 -1
- package/types/dist/slothlet.d.mts +17 -9
- package/types/dist/slothlet.d.mts.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-livebindings.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-livebindings.mjs"],"names":[],"mappings":"AA2RA;;;;;;;;;GASG;AACH,gCANW,MAAM,yBAEN,GAAG,gBAED,GAAG,CAkBf;AAED;;;;;GAKG;AACH,8CAMC;AAID;;;GAGG;AAEH,kCAEC;AAED,kDASC;AArQD;;;;;GAKG;AACH,mBAHU,MAAM,CAmDd;AAEF;;;;;GAKG;AACH,sBAHU,MAAM,CA+Cd;AAEF;;;;;GAKG;AACH,wBAHU,MAAM,CA+Cd;AAEF;;;;;GAKG;AACH,yBAHU,MAAM,CAkCd"}
|
|
@@ -1,58 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const
|
|
8
|
-
export
|
|
9
|
-
export function getCtx(): object | null;
|
|
10
|
-
export function makeWrapper(ctx: object): Function;
|
|
11
|
-
/**
|
|
12
|
-
* @constant self
|
|
13
|
-
* @memberof module:@cldmv/slothlet/runtime
|
|
14
|
-
* @export module:@cldmv/slothlet/runtime
|
|
15
|
-
* @public
|
|
16
|
-
* @type {function|object}
|
|
17
|
-
*
|
|
18
|
-
* @description
|
|
19
|
-
* Live binding to the current instance's 'self' reference from AsyncLocalStorage context.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // Access current instance self
|
|
23
|
-
* console.log(self); // Current slothlet instance
|
|
24
|
-
*/
|
|
25
|
-
export const self: Function | object;
|
|
26
|
-
/**
|
|
27
|
-
* @constant context
|
|
28
|
-
* @memberof module:@cldmv/slothlet/runtime
|
|
29
|
-
* @export module:@cldmv/slothlet/runtime
|
|
30
|
-
* @public
|
|
31
|
-
* @type {object}
|
|
32
|
-
*
|
|
33
|
-
* @description
|
|
34
|
-
* Live binding to the current instance's 'context' data from AsyncLocalStorage context.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* // Access current context data
|
|
38
|
-
* console.log(context); // Current context object
|
|
39
|
-
*/
|
|
40
|
-
export const context: object;
|
|
41
|
-
/**
|
|
42
|
-
* @constant reference
|
|
43
|
-
* @memberof module:@cldmv/slothlet/runtime
|
|
44
|
-
* @export module:@cldmv/slothlet/runtime
|
|
45
|
-
* @public
|
|
46
|
-
* @type {object}
|
|
47
|
-
*
|
|
48
|
-
* @description
|
|
49
|
-
* Live binding to the current instance's 'reference' object from AsyncLocalStorage context.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* // Access current reference object
|
|
53
|
-
* console.log(reference); // Current reference data
|
|
54
|
-
*/
|
|
55
|
-
export const reference: object;
|
|
56
|
-
export type AsyncLocalStorageType = AsyncLocalStorage<any>;
|
|
57
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
1
|
+
export function runWithCtx(ctx: any, fn: any, thisArg: any, args: any): any;
|
|
2
|
+
export function makeWrapper(ctx: any): Function;
|
|
3
|
+
export function getCtx(): any;
|
|
4
|
+
export function self(): void;
|
|
5
|
+
export const context: {};
|
|
6
|
+
export const reference: {};
|
|
7
|
+
export const instanceId: any;
|
|
8
|
+
export const sharedALS: any;
|
|
58
9
|
//# sourceMappingURL=runtime.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime.mjs"],"names":[],"mappings":"AAoMA,4EAGC;AAED,gDAGC;AAED,8BAGC;AArKA,6BAA+B;AAkDhC,yBAiDE;AAEF,2BAiDE;AAiBF,6BAOK;AAEL,4BAAuD"}
|
|
@@ -42,11 +42,27 @@ export type SlothletOptions = {
|
|
|
42
42
|
*/
|
|
43
43
|
dir?: string;
|
|
44
44
|
/**
|
|
45
|
-
* - Loading strategy:
|
|
45
|
+
* - Loading strategy (legacy option):
|
|
46
46
|
* - `true`: Lazy loading - modules loaded on-demand when accessed (lower initial load, proxy overhead)
|
|
47
47
|
* - `false`: Eager loading - all modules loaded immediately (default, higher initial load, direct access)
|
|
48
48
|
*/
|
|
49
49
|
lazy?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* - Loading mode (alternative to lazy option):
|
|
52
|
+
* - `"lazy"`: Lazy loading - modules loaded on-demand when accessed (same as lazy: true)
|
|
53
|
+
* - `"eager"`: Eager loading - all modules loaded immediately (same as lazy: false)
|
|
54
|
+
* - `"singleton"`, `"vm"`, `"worker"`, `"fork"`: Execution engine mode (legacy, use engine option instead)
|
|
55
|
+
* - Takes precedence over lazy option when both are provided
|
|
56
|
+
*/
|
|
57
|
+
mode?: string;
|
|
58
|
+
/**
|
|
59
|
+
* - Execution environment mode:
|
|
60
|
+
* - `"singleton"`: Single shared instance within current process (default, fastest)
|
|
61
|
+
* - `"vm"`: Isolated VM context for security/isolation
|
|
62
|
+
* - `"worker"`: Web Worker or Worker Thread execution
|
|
63
|
+
* - `"fork"`: Child process execution for complete isolation
|
|
64
|
+
*/
|
|
65
|
+
engine?: string;
|
|
50
66
|
/**
|
|
51
67
|
* - Directory traversal depth control:
|
|
52
68
|
* - `Infinity`: Traverse all subdirectories recursively (default)
|
|
@@ -62,14 +78,6 @@ export type SlothletOptions = {
|
|
|
62
78
|
* - Command line and environment settings become the default for all instances unless overridden
|
|
63
79
|
*/
|
|
64
80
|
debug?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* - Execution environment mode:
|
|
67
|
-
* - `"singleton"`: Single shared instance within current process (default, fastest)
|
|
68
|
-
* - `"vm"`: Isolated VM context for security/isolation
|
|
69
|
-
* - `"worker"`: Web Worker or Worker Thread execution
|
|
70
|
-
* - `"fork"`: Child process execution for complete isolation
|
|
71
|
-
*/
|
|
72
|
-
mode?: string;
|
|
73
81
|
/**
|
|
74
82
|
* - API structure and calling convention:
|
|
75
83
|
* - `"auto"`: Auto-detect based on root module exports (function vs object) - recommended (default)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slothlet.d.mts","sourceRoot":"","sources":["../../dist/slothlet.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slothlet.d.mts","sourceRoot":"","sources":["../../dist/slothlet.mjs"],"names":[],"mappings":"AA++CA;;;;;;;;;GASG;AACH,kDARW,WAAS,MAAM,UACf,WAAS,MAAM,QAwCzB;AAr2CD;;;;;;;GAOG;AACH,mBAJU,MAAM,CAIO;AAEvB;;;;;GAKG;AACH,sBAJU,MAAM,CAIU;AAE1B;;;;;GAKG;AACH,wBAJU,MAAM,CAIY;;;;;;;;;UAw1Cd,MAAM;;;;;;WAIN,OAAO;;;;;;;;WAGP,MAAM;;;;;;;;aAKN,MAAM;;;;;;;eAKN,MAAM;;;;;;;;YAIN,OAAO;;;;;;;eAKP,MAAM;;;;;;cAIN,MAAM;;;;;;gBAGN,MAAM;;;;;;eAMjB;QAA8B,UAAU,GAA7B,OAAO;QACY,gBAAgB,GAAnC,OAAO;QACY,gBAAgB,GAAnC,OAAO;QACW,KAAK,GAClC;YAAqC,KAAK,GAA/B,MAAM,EAAE;YACkB,gBAAgB,GAA1C,MAAM,EAAE;YACkB,KAAK,GAA/B,MAAM,EAAE;YACkB,KAAK,GAA/B,MAAM,EAAE;SACrB;KAAA;;AAr4CD;;;;;;;;GAQG;AACH,mCAJW,eAAe,GACb,OAAO,CAAC,WAAS,MAAM,CAAC,CAiCpC"}
|