@cldmv/slothlet 3.3.0 → 3.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.
Files changed (127) hide show
  1. package/README.md +6 -8
  2. package/REFERENCE.md +23 -0
  3. package/dist/lib/builders/api-assignment.mjs +1 -589
  4. package/dist/lib/builders/api_builder.mjs +1 -1385
  5. package/dist/lib/builders/builder.mjs +1 -78
  6. package/dist/lib/builders/modes-processor.mjs +1 -1800
  7. package/dist/lib/errors.mjs +9 -211
  8. package/dist/lib/factories/component-base.mjs +1 -80
  9. package/dist/lib/factories/context.mjs +1 -22
  10. package/dist/lib/handlers/api-cache-manager.mjs +1 -200
  11. package/dist/lib/handlers/api-manager.mjs +1 -2536
  12. package/dist/lib/handlers/context-async.mjs +1 -172
  13. package/dist/lib/handlers/context-live.mjs +1 -173
  14. package/dist/lib/handlers/hook-manager.mjs +1 -667
  15. package/dist/lib/handlers/lifecycle-token.mjs +1 -28
  16. package/dist/lib/handlers/lifecycle.mjs +1 -115
  17. package/dist/lib/handlers/materialize-manager.mjs +1 -48
  18. package/dist/lib/handlers/metadata.mjs +1 -501
  19. package/dist/lib/handlers/ownership.mjs +1 -322
  20. package/dist/lib/handlers/permission-manager.mjs +1 -392
  21. package/dist/lib/handlers/unified-wrapper.mjs +1 -3110
  22. package/dist/lib/handlers/version-manager.mjs +1 -885
  23. package/dist/lib/helpers/class-instance-wrapper.mjs +1 -109
  24. package/dist/lib/helpers/config.mjs +1 -439
  25. package/dist/lib/helpers/eventemitter-context.mjs +1 -349
  26. package/dist/lib/helpers/hint-detector.mjs +1 -47
  27. package/dist/lib/helpers/modes-utils.mjs +1 -37
  28. package/dist/lib/helpers/pattern-matcher.mjs +1 -125
  29. package/dist/lib/helpers/resolve-from-caller.mjs +1 -169
  30. package/dist/lib/helpers/sanitize.mjs +1 -340
  31. package/dist/lib/helpers/utilities.mjs +1 -70
  32. package/dist/lib/i18n/translations.mjs +1 -126
  33. package/dist/lib/modes/eager.mjs +1 -59
  34. package/dist/lib/modes/lazy.mjs +1 -81
  35. package/dist/lib/processors/flatten.mjs +1 -437
  36. package/dist/lib/processors/loader.mjs +1 -339
  37. package/dist/lib/processors/type-generator.mjs +1 -275
  38. package/dist/lib/processors/typescript.mjs +1 -172
  39. package/dist/lib/runtime/runtime-asynclocalstorage.mjs +1 -113
  40. package/dist/lib/runtime/runtime-livebindings.mjs +1 -78
  41. package/dist/lib/runtime/runtime.mjs +1 -102
  42. package/dist/slothlet.mjs +1 -817
  43. package/package.json +34 -31
  44. package/types/dist/lib/builders/api-assignment.d.mts +3 -92
  45. package/types/dist/lib/builders/api-assignment.d.mts.map +1 -1
  46. package/types/dist/lib/builders/api_builder.d.mts +102 -91
  47. package/types/dist/lib/builders/api_builder.d.mts.map +1 -1
  48. package/types/dist/lib/builders/builder.d.mts +1 -55
  49. package/types/dist/lib/builders/builder.d.mts.map +1 -1
  50. package/types/dist/lib/builders/modes-processor.d.mts +3 -27
  51. package/types/dist/lib/builders/modes-processor.d.mts.map +1 -1
  52. package/types/dist/lib/errors.d.mts +19 -109
  53. package/types/dist/lib/errors.d.mts.map +1 -1
  54. package/types/dist/lib/factories/component-base.d.mts +7 -177
  55. package/types/dist/lib/factories/component-base.d.mts.map +1 -1
  56. package/types/dist/lib/factories/context.d.mts +4 -22
  57. package/types/dist/lib/factories/context.d.mts.map +1 -1
  58. package/types/dist/lib/handlers/api-cache-manager.d.mts +20 -203
  59. package/types/dist/lib/handlers/api-cache-manager.d.mts.map +1 -1
  60. package/types/dist/lib/handlers/api-manager.d.mts +33 -408
  61. package/types/dist/lib/handlers/api-manager.d.mts.map +1 -1
  62. package/types/dist/lib/handlers/context-async.d.mts +23 -61
  63. package/types/dist/lib/handlers/context-async.d.mts.map +1 -1
  64. package/types/dist/lib/handlers/context-live.d.mts +22 -59
  65. package/types/dist/lib/handlers/context-live.d.mts.map +1 -1
  66. package/types/dist/lib/handlers/hook-manager.d.mts +46 -185
  67. package/types/dist/lib/handlers/hook-manager.d.mts.map +1 -1
  68. package/types/dist/lib/handlers/lifecycle-token.d.mts +3 -48
  69. package/types/dist/lib/handlers/lifecycle-token.d.mts.map +1 -1
  70. package/types/dist/lib/handlers/lifecycle.d.mts +5 -82
  71. package/types/dist/lib/handlers/lifecycle.d.mts.map +1 -1
  72. package/types/dist/lib/handlers/materialize-manager.d.mts +8 -70
  73. package/types/dist/lib/handlers/materialize-manager.d.mts.map +1 -1
  74. package/types/dist/lib/handlers/metadata.d.mts +17 -221
  75. package/types/dist/lib/handlers/metadata.d.mts.map +1 -1
  76. package/types/dist/lib/handlers/ownership.d.mts +44 -160
  77. package/types/dist/lib/handlers/ownership.d.mts.map +1 -1
  78. package/types/dist/lib/handlers/permission-manager.d.mts +37 -141
  79. package/types/dist/lib/handlers/permission-manager.d.mts.map +1 -1
  80. package/types/dist/lib/handlers/unified-wrapper.d.mts +26 -239
  81. package/types/dist/lib/handlers/unified-wrapper.d.mts.map +1 -1
  82. package/types/dist/lib/handlers/version-manager.d.mts +28 -225
  83. package/types/dist/lib/handlers/version-manager.d.mts.map +1 -1
  84. package/types/dist/lib/helpers/class-instance-wrapper.d.mts +2 -52
  85. package/types/dist/lib/helpers/class-instance-wrapper.d.mts.map +1 -1
  86. package/types/dist/lib/helpers/config.d.mts +125 -139
  87. package/types/dist/lib/helpers/config.d.mts.map +1 -1
  88. package/types/dist/lib/helpers/eventemitter-context.d.mts +3 -29
  89. package/types/dist/lib/helpers/eventemitter-context.d.mts.map +1 -1
  90. package/types/dist/lib/helpers/hint-detector.d.mts +2 -15
  91. package/types/dist/lib/helpers/hint-detector.d.mts.map +1 -1
  92. package/types/dist/lib/helpers/modes-utils.d.mts +3 -30
  93. package/types/dist/lib/helpers/modes-utils.d.mts.map +1 -1
  94. package/types/dist/lib/helpers/pattern-matcher.d.mts +3 -43
  95. package/types/dist/lib/helpers/pattern-matcher.d.mts.map +1 -1
  96. package/types/dist/lib/helpers/resolve-from-caller.d.mts +3 -27
  97. package/types/dist/lib/helpers/resolve-from-caller.d.mts.map +1 -1
  98. package/types/dist/lib/helpers/sanitize.d.mts +4 -92
  99. package/types/dist/lib/helpers/sanitize.d.mts.map +1 -1
  100. package/types/dist/lib/helpers/utilities.d.mts +4 -52
  101. package/types/dist/lib/helpers/utilities.d.mts.map +1 -1
  102. package/types/dist/lib/i18n/translations.d.mts +4 -37
  103. package/types/dist/lib/i18n/translations.d.mts.map +1 -1
  104. package/types/dist/lib/modes/eager.d.mts +8 -30
  105. package/types/dist/lib/modes/eager.d.mts.map +1 -1
  106. package/types/dist/lib/modes/lazy.d.mts +10 -43
  107. package/types/dist/lib/modes/lazy.d.mts.map +1 -1
  108. package/types/dist/lib/processors/flatten.d.mts +56 -107
  109. package/types/dist/lib/processors/flatten.d.mts.map +1 -1
  110. package/types/dist/lib/processors/loader.d.mts +6 -41
  111. package/types/dist/lib/processors/loader.d.mts.map +1 -1
  112. package/types/dist/lib/processors/type-generator.d.mts +2 -16
  113. package/types/dist/lib/processors/type-generator.d.mts.map +1 -1
  114. package/types/dist/lib/processors/typescript.d.mts +6 -53
  115. package/types/dist/lib/processors/typescript.d.mts.map +1 -1
  116. package/types/dist/lib/runtime/runtime-asynclocalstorage.d.mts +3 -71
  117. package/types/dist/lib/runtime/runtime-asynclocalstorage.d.mts.map +1 -1
  118. package/types/dist/lib/runtime/runtime-livebindings.d.mts +2 -37
  119. package/types/dist/lib/runtime/runtime-livebindings.d.mts.map +1 -1
  120. package/types/dist/lib/runtime/runtime.d.mts +3 -39
  121. package/types/dist/lib/runtime/runtime.d.mts.map +1 -1
  122. package/types/dist/slothlet.d.mts +3 -249
  123. package/types/dist/slothlet.d.mts.map +1 -1
  124. package/types/index.d.mts +36 -16
  125. package/types/index.d.mts.map +1 -0
  126. package/AGENT-USAGE.md +0 -736
  127. package/docs/API-RULES.md +0 -712
@@ -1,118 +1,28 @@
1
- /**
2
- * Custom error class for Slothlet-specific errors with context and i18n
3
- * @public
4
- */
1
+ export class SlothletDebug {
2
+ constructor(config?: {});
3
+ config: {};
4
+ debugFlags: any;
5
+ log(code: any, context?: {}): void;
6
+ toString(): string;
7
+ }
5
8
  export class SlothletError extends Error {
6
- /**
7
- * Create a new SlothletError with automatic translation and hint detection
8
- * @param {string} code - Error code identifier
9
- * @param {Object} context - Additional context about the error
10
- * @param {boolean} [context.validationError] - Mark as validation error (no originalError needed)
11
- * @param {boolean} [context.stub] - Mark as stub error (not-yet-implemented feature)
12
- * @param {Error} [originalError] - The original error that caused this SlothletError
13
- * @param {Object} [options] - Additional options (alternative to embedding flags in context)
14
- * @param {boolean} [options.validationError] - Mark as validation error (no originalError needed)
15
- * @param {boolean} [options.stub] - Mark as stub error (not-yet-implemented feature)
16
- * @public
17
- */
18
- constructor(code: string, context?: {
19
- validationError?: boolean;
20
- stub?: boolean;
21
- }, originalError?: Error, options?: {
22
- validationError?: boolean;
23
- stub?: boolean;
24
- });
25
- /**
26
- * Prevent JSON serialization of context (cleaner error display)
27
- * @returns {Object} Simplified error object
28
- */
29
- toJSON(): any;
9
+ constructor(code: any, context?: {}, originalError?: null, options?: {});
10
+ toJSON(): {
11
+ name: string;
12
+ code: any;
13
+ message: string;
14
+ hint: any;
15
+ };
30
16
  }
31
- /**
32
- * Warning class for non-fatal issues with i18n support
33
- * @public
34
- */
35
17
  export class SlothletWarning {
36
18
  static captured: any[];
37
19
  static suppressConsole: boolean;
38
- /**
39
- * Clear captured warnings (for testing)
40
- * @public
41
- */
42
- public static clearCaptured(): void;
43
- /**
44
- * Create and emit a warning with automatic translation
45
- * @param {string} code - Warning code identifier
46
- * @param {Object} context - Additional context about the warning
47
- * @param {string} [context.key] - Optional translation key override. When provided, this key
48
- * is used for translation instead of `code`. All other context properties are used as
49
- * interpolation params. Allows sub-key variants without changing the warning code.
50
- * @public
51
- */
52
- constructor(code: string, context?: {
53
- key?: string;
54
- });
20
+ static clearCaptured(): void;
21
+ constructor(code: any, context?: {});
55
22
  name: string;
56
- code: string;
57
- message: string;
58
- context: {
59
- key?: string;
60
- };
61
- /**
62
- * Custom string representation
63
- * @returns {string} Formatted warning string
64
- */
65
- toString(): string;
66
- }
67
- /**
68
- * Debug utility class for centralized conditional console output with i18n
69
- * @public
70
- */
71
- export class SlothletDebug {
72
- /**
73
- * Create a debug logger instance bound to a config
74
- * @param {Object} config - Configuration object (typically slothlet.config)
75
- * @public
76
- */
77
- constructor(config?: any);
78
- config: any;
79
- debugFlags: any;
80
- /**
81
- * Log a debug message if the code's debug flag is enabled
82
- * @param {string} code - Debug code/category (e.g., "modes", "wrapper", "api")
83
- * @param {Object} context - Contextual information to display
84
- * @param {string} [context.key] - Translation key for the message (e.g. "DEBUG_MODE_FLATTENING").
85
- * When provided, translates via i18n using the remaining context properties as interpolation
86
- * params - no `await t()` needed at the call site. Falls back to `DEBUG_{CODE}` category key
87
- * if omitted, then to `context.message` for backwards compatibility.
88
- * @param {string} [context.message] - Raw message string (backwards-compat fallback).
89
- * Prefer `context.key` for new call sites so messages are translatable.
90
- * @public
91
- *
92
- * @description
93
- * Centralized debug logging that respects debug configuration flags.
94
- * Only outputs when the specified code matches a truthy debug flag.
95
- * Translates messages using i18n system with the following key resolution order:
96
- * 1. `context.key` - explicit per-message translation key (preferred)
97
- * 2. `DEBUG_{CODE}` - category-level key (e.g. DEBUG_MODES)
98
- * 3. `context.message` - raw string fallback for backwards compatibility
99
- *
100
- * @example
101
- * // Preferred: pass translation key directly - no await needed
102
- * this.debug("modes", { key: "DEBUG_MODE_FLATTENING", mode, categoryName });
103
- *
104
- * @example
105
- * // Legacy: raw message string (still works, but not translatable)
106
- * this.debug("wrapper", { message: "Category reuse - using existing wrapper", apiPath });
107
- */
108
- public log(code: string, context?: {
109
- key?: string;
110
- message?: string;
111
- }): void;
112
- /**
113
- * Custom string representation
114
- * @returns {string} Debug info
115
- */
23
+ code: any;
24
+ message: any;
25
+ context: {};
116
26
  toString(): string;
117
27
  }
118
28
  //# sourceMappingURL=errors.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../../../dist/lib/errors.mjs"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IACC;;;;;;;;;;;OAWG;IACH,kBAVW,MAAM,YAEd;QAA0B,eAAe,GAAjC,OAAO;QACW,IAAI,GAAtB,OAAO;KACf,kBAAQ,KAAK,YAEb;QAA0B,eAAe,GAAjC,OAAO;QACW,IAAI,GAAtB,OAAO;KACf,EAkEF;IAoCD;;;OAGG;IACH,cAOC;CACD;AAED;;;GAGG;AACH;IAEC,uBAAqB;IACrB,gCAA+B;IA8C/B;;;OAGG;IACH,oCAEC;IAlDD;;;;;;;;OAQG;IACH,kBAPW,MAAM,YAEd;QAAyB,GAAG,GAApB,MAAM;KAGd,EA2BF;IAjBA,aAA6B;IAC7B,aAAgB;IAChB,gBAAgC;IAChC;cAhBU,MAAM;MAgBM;IAgBvB;;;OAGG;IACH,YAFa,MAAM,CAIlB;CASD;AAED;;;GAGG;AACH;IACC;;;;OAIG;IACH,0BAGC;IAFA,YAAoB;IACpB,gBAAoC;IAGrC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,iBA1BW,MAAM,YAEd;QAAyB,GAAG,GAApB,MAAM;QAIW,OAAO,GAAxB,MAAM;KAEd,QAoDF;IAED;;;OAGG;IACH,YAFa,MAAM,CAMlB;CACD"}
1
+ {"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../../../dist/lib/errors.mjs"],"names":[],"mappings":"AAQ4P;IAAoB,yBAA2E;IAApD,WAAkB;IAAC,gBAAgC;IAAC,mCAAgoB;IAAA,mBAAmH;CAAC;AARr+B;IAAkC,yEAAiyC;IAM95C;;;;;MAA2F;CAAC;AAAA;IAAsB,uBAAmB;IAAA,gCAA6B;IAEuB,6BAAmD;IAF1E,qCAEzC;IAF+M,aAA2B;IAAC,UAAc;IAAC,aAA8B;IAAC,YAAoB;IAE7S,mBAAgE;CAAoD"}
@@ -1,182 +1,12 @@
1
- /**
2
- * @Project: @cldmv/slothlet
3
- * @Filename: /src/lib/factories/component-base.mjs
4
- * @Date: 2026-01-24 09:30:16 -08:00 (1737735016)
5
- * @Author: Nate Corcoran <CLDMV>
6
- * @Email: <Shinrai@users.noreply.github.com>
7
- * -----
8
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
- * @Last modified time: 2026-03-01 20:21:36 -08:00 (1772425296)
10
- * -----
11
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
- */
13
- /**
14
- * @fileoverview Base class for Slothlet component classes providing common Slothlet access.
15
- * @module @cldmv/slothlet/factories/component-base
16
- * @internal
17
- * @package
18
- *
19
- * @description
20
- * Provides common getters for all Slothlet component classes (handlers, builders, processors).
21
- * All components extend this class to access the Slothlet instance's configuration and API
22
- * references without passing them through function parameters. Components become modular
23
- * extensions of the Slothlet class itself.
24
- *
25
- * @example
26
- * // ESM
27
- * import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
28
- * class MyHandler extends ComponentBase {
29
- * doSomething() {
30
- * if (this.debug?.api) {
31
- * console.log("Debug mode enabled");
32
- * }
33
- * throw new this.SlothletError("ERROR_CODE", { details: "info" });
34
- * }
35
- * }
36
- *
37
- * @example
38
- * // CJS
39
- * const { ComponentBase } = require("@cldmv/slothlet/factories/component-base");
40
- * class MyHandler extends ComponentBase {
41
- * doSomething() {
42
- * return this.____config.mode;
43
- * }
44
- * }
45
- */
46
- /**
47
- * Base class for Slothlet component classes.
48
- * @class ComponentBase
49
- * @package
50
- *
51
- * @description
52
- * Provides common Slothlet property access for handlers, builders, and processors.
53
- * All component classes should extend this to gain consistent access to the Slothlet
54
- * instance's configuration, API references, and error classes. Components are instantiated
55
- * with a reference to the Slothlet class itself, making them modular extensions.
56
- *
57
- * @example
58
- * class ApiManager extends ComponentBase {
59
- * constructor(slothlet) {
60
- * super(slothlet);
61
- * this.state = { addHistory: [] };
62
- * }
63
- *
64
- * someMethod() {
65
- * if (this.debug?.api) {
66
- * console.log(`Slothlet: ${this.instanceID}`);
67
- * }
68
- * throw new this.SlothletError("INVALID_CONFIG", { reason: "bad input" });
69
- * }
70
- * }
71
- */
72
1
  export class ComponentBase {
73
- /**
74
- * Complete set of property names reserved by the slothlet framework.
75
- *
76
- * @description
77
- * These keys are either private wrapper internals, read-only info props exposed
78
- * through the proxy, write-blocked lifecycle keys, or builtin namespace keys
79
- * injected at the API root level. Used by all components to distinguish framework
80
- * internals from user-defined properties when:
81
- * - Collecting user-set custom properties for preservation across reload
82
- * (`_collectCustomProperties` in api-manager.mjs)
83
- * - Extracting child keys for impl reconstruction (`_extractFullImpl`)
84
- * - Determining whether a set(trap) write should be silently absorbed (`setTrap`)
85
- * - Filtering what getTrap exposes externally on wrapper proxies
86
- *
87
- * Note: `_materialize` is included here (skip for collection/extraction) but
88
- * setTrap exempts it since the framework needs to write it directly.
89
- *
90
- * @type {Set<string>}
91
- * @static
92
- */
93
2
  static INTERNAL_KEYS: Set<string>;
94
- /**
95
- * Create a component base instance.
96
- * @param {object} slothlet - Slothlet class instance.
97
- * @package
98
- *
99
- * @description
100
- * Stores the Slothlet reference for access via getters. The Slothlet class itself
101
- * is passed (not a separate "instance" object), making components modular extensions
102
- * of Slothlet.
103
- *
104
- * @example
105
- * super(slothlet);
106
- */
107
- constructor(slothlet: object);
108
- /**
109
- * Get Slothlet instance via the canonical internal accessor name.
110
- * @returns {object} Slothlet instance.
111
- * @package
112
- *
113
- * @description
114
- * Prototype getter — NOT an own property — so the JS Proxy invariant for
115
- * non-configurable own properties never applies. UnifiedWrapper's getTrap blocks
116
- * this name via the underscore-filter before it can reach the getter.
117
- *
118
- * @example
119
- * const s = this.____slothlet;
120
- */
121
- get ____slothlet(): object;
122
- /**
123
- * Get Slothlet instance (internal access).
124
- * @returns {object} Slothlet instance.
125
- * @package
126
- *
127
- * @description
128
- * Provides direct access to the Slothlet instance for legacy code compatibility.
129
- * Prefer using specific getters (config, helpers, handlers) when possible.
130
- *
131
- * @example
132
- * this.slothlet.debug("api", { action: "assigned" });
133
- */
134
- get slothlet(): object;
135
- /**
136
- * Get Slothlet configuration.
137
- * @returns {object} Slothlet configuration object.
138
- * @package
139
- *
140
- * @description
141
- * Provides access to the Slothlet config for collision modes, debug settings, etc.
142
- * Named with ____ prefix to avoid shadowing user API names like 'config'.
143
- *
144
- * @example
145
- * const collisionMode = this.____config.collision.api;
146
- */
147
- get ____config(): object;
148
- /**
149
- * Get Slothlet instance ID.
150
- * @returns {string} Slothlet instance identifier.
151
- * @package
152
- */
153
- get instanceID(): string;
154
- /**
155
- * Get SlothletError class.
156
- * @returns {Function} SlothletError constructor.
157
- * @package
158
- *
159
- * @description
160
- * Provides access to SlothletError without importing in every file.
161
- * Components can throw errors via `new this.SlothletError(...)`.
162
- *
163
- * @example
164
- * throw new this.SlothletError("INVALID_CONFIG", { reason: "missing dir" });
165
- */
166
- get SlothletError(): Function;
167
- /**
168
- * Get SlothletWarning class.
169
- * @returns {Function} SlothletWarning constructor.
170
- * @package
171
- *
172
- * @description
173
- * Provides access to SlothletWarning without importing in every file.
174
- * Components can issue warnings via `new this.SlothletWarning(...)`.
175
- *
176
- * @example
177
- * new this.SlothletWarning("WARNING_DEPRECATED", { feature: "oldApi" });
178
- */
179
- get SlothletWarning(): Function;
3
+ constructor(slothlet: any);
4
+ get ____slothlet(): any;
5
+ get slothlet(): any;
6
+ get ____config(): any;
7
+ get instanceID(): any;
8
+ get SlothletError(): any;
9
+ get SlothletWarning(): any;
180
10
  #private;
181
11
  }
182
12
  //# sourceMappingURL=component-base.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-base.d.mts","sourceRoot":"","sources":["../../../../dist/lib/factories/component-base.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IAuHC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,sBAHU,GAAG,CAAC,MAAM,CAAC,CAoClB;IAhKH;;;;;;;;;;;;OAYG;IACH,sBAXW,MAAM,EAahB;IAED;;;;;;;;;;;;OAYG;IACH,oBAXa,MAAM,CAalB;IAED;;;;;;;;;;;OAWG;IACH,gBAVa,MAAM,CAYlB;IAED;;;;;;;;;;;OAWG;IACH,kBAVa,MAAM,CAYlB;IAED;;;;OAIG;IACH,kBAHa,MAAM,CAKlB;IAED;;;;;;;;;;;OAWG;IACH,8BAEC;IAED;;;;;;;;;;;OAWG;IACH,gCAEC;;CAwDD"}
1
+ {"version":3,"file":"component-base.d.mts","sourceRoot":"","sources":["../../../../dist/lib/factories/component-base.mjs"],"names":[],"mappings":"AAAA;IAA0X,kCAAiZ;IAA7uB,2BAA8C;IAAA,wBAAyC;IAAA,oBAAqC;IAAA,sBAAiD;IAAA,sBAAqD;IAAA,yBAA2D;IAAA,2BAA+D;;CAAkZ"}
@@ -1,26 +1,8 @@
1
- /**
2
- * Get context manager for specified runtime type
3
- * @param {string} runtime - Runtime type ("async" or "live")
4
- * @returns {Object} Context manager instance
5
- * @public
6
- */
7
- export function getContextManager(runtime?: string): any;
8
- /**
9
- * Default context manager (async)
10
- * @public
11
- */
12
- export const contextManager: import("@cldmv/slothlet/handlers/context-async").AsyncContextManager;
13
- /**
14
- * Async runtime for runtime exports
15
- * @public
16
- */
17
- export const asyncRuntime: import("@cldmv/slothlet/handlers/context-async").AsyncContextManager;
18
- /**
19
- * Live runtime for runtime exports
20
- * @public
21
- */
22
- export const liveRuntime: import("@cldmv/slothlet/handlers/context-live").LiveContextManager;
23
1
  import { asyncContextManager } from "@cldmv/slothlet/handlers/context-async";
2
+ export const asyncRuntime: import("@cldmv/slothlet/handlers/context-async").AsyncContextManager;
3
+ export const contextManager: import("@cldmv/slothlet/handlers/context-async").AsyncContextManager;
4
+ export function getContextManager(runtime?: string): import("@cldmv/slothlet/handlers/context-async").AsyncContextManager | import("@cldmv/slothlet/handlers/context-live").LiveContextManager;
24
5
  import { liveContextManager } from "@cldmv/slothlet/handlers/context-live";
6
+ export const liveRuntime: import("@cldmv/slothlet/handlers/context-live").LiveContextManager;
25
7
  export { asyncContextManager, liveContextManager };
26
8
  //# sourceMappingURL=context.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.mts","sourceRoot":"","sources":["../../../../dist/lib/factories/context.mjs"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,4CAJW,MAAM,OAMhB;AAED;;;GAGG;AACH,kGAAkD;AAElD;;;GAGG;AACH,gGAAgD;AAEhD;;;GAGG;AACH,6FAA8C;oCA7BV,wCAAwC;mCACzC,uCAAuC"}
1
+ {"version":3,"file":"context.d.mts","sourceRoot":"","sources":["../../../../dist/lib/factories/context.mjs"],"names":[],"mappings":"oCAA+B,wCAAwC;AAA2N,gGAAuC;AAAhF,kGAAyC;AAApJ,+LAA2G;mCAAnJ,uCAAuC;AAA4L,6FAAqC"}
@@ -1,208 +1,25 @@
1
- /**
2
- * Cache entry structure for API tree storage and rebuild parameters.
3
- * @typedef {Object} CacheEntry
4
- * @property {string} endpoint - API path endpoint (e.g., ".", "plugins")
5
- * @property {string} moduleID - Module identifier
6
- * @property {Object} api - Complete buildAPI result tree (primary storage)
7
- * @property {string} folderPath - Source folder path
8
- * @property {string} mode - Loading mode: 'lazy' or 'eager'
9
- * @property {Object} sanitizeOptions - Sanitization configuration
10
- * @property {string} collisionMode - Collision handling mode
11
- * @property {Object} config - Config snapshot at add time
12
- * @property {number} timestamp - Cache creation time (Unix ms)
13
- */
14
- /**
15
- * Manages API caches - complete buildAPI results per moduleID
16
- * @class ApiCacheManager
17
- * @extends ComponentBase
18
- * @public
19
- *
20
- * @description
21
- * Stores complete API trees for each moduleID with all rebuild parameters.
22
- * The cache is the PRIMARY storage - live API references cached trees.
23
- * Enables hot reload by rebuilding caches from disk and updating live references.
24
- *
25
- * @example
26
- * const cacheManager = new ApiCacheManager(slothlet);
27
- * cacheManager.set("module_abc", { api: tree, folderPath: "./plugins", ... });
28
- */
29
1
  export class ApiCacheManager extends ComponentBase {
30
2
  static slothletProperty: string;
31
- /**
32
- * Cache storage - moduleID → CacheEntry
33
- * @type {Map<string, CacheEntry>}
34
- * @private
35
- */
36
- private caches;
37
- /**
38
- * Store cache entry for moduleID
39
- * @param {string} moduleID - Module identifier
40
- * @param {CacheEntry} entry - Cache entry with api tree and rebuild parameters
41
- * @returns {void}
42
- * @public
43
- *
44
- * @description
45
- * Stores complete buildAPI result. The cached API tree becomes the source of truth.
46
- * Existing references should point to entry.api, not copy it.
47
- *
48
- * @example
49
- * cache.set("base_abc123", {
50
- * endpoint: ".",
51
- * moduleID: "base_abc123",
52
- * api: apiTree,
53
- * folderPath: this.____config.dir,
54
- * mode: "lazy",
55
- * sanitizeOptions: {},
56
- * collisionMode: "merge",
57
- * config: {...this.____config},
58
- * timestamp: Date.now()
59
- * });
60
- */
61
- public set(moduleID: string, entry: CacheEntry): void;
62
- /**
63
- * Get cache entry by moduleID
64
- * @param {string} moduleID - Module identifier
65
- * @returns {CacheEntry|undefined} Cache entry or undefined if not found
66
- * @public
67
- *
68
- * @example
69
- * const cache = cacheManager.get("base_abc123");
70
- * if (cache) {
71
- * const api = cache.api; // Get API tree from cache
72
- * }
73
- */
74
- public get(moduleID: string): CacheEntry | undefined;
75
- /**
76
- * Check if cache exists for moduleID
77
- * @param {string} moduleID - Module identifier
78
- * @returns {boolean} True if cache exists
79
- * @public
80
- *
81
- * @example
82
- * if (cacheManager.has("base_abc123")) {
83
- * // Cache exists
84
- * }
85
- */
86
- public has(moduleID: string): boolean;
87
- /**
88
- * Delete cache entry by moduleID
89
- * @param {string} moduleID - Module identifier
90
- * @returns {boolean} True if cache was deleted
91
- * @public
92
- *
93
- * @description
94
- * Removes cache entry. Should be called when module is removed via api.remove(moduleID).
95
- *
96
- * @example
97
- * cacheManager.delete("plugins_abc123");
98
- */
99
- public delete(moduleID: string): boolean;
100
- /**
101
- * Get all moduleIDs in cache
102
- * @returns {string[]} Array of moduleIDs
103
- * @public
104
- *
105
- * @example
106
- * const moduleIDs = cacheManager.getAllModuleIDs();
107
- * // ["base_abc123", "plugins_xyz789", ...]
108
- */
109
- public getAllModuleIDs(): string[];
110
- /**
111
- * Get cache diagnostics
112
- * @returns {object} Diagnostic information
113
- * @public
114
- *
115
- * @description
116
- * Returns diagnostic data about cached modules. Available under api.slothlet.diag.caches
117
- * when config.debug.diagnostics is enabled.
118
- *
119
- * @example
120
- * const diag = cacheManager.getCacheDiagnostics();
121
- * // {
122
- * // totalCaches: 3,
123
- * // caches: [
124
- * // { moduleID: "base_abc123", endpoint: ".", pathCount: 42, timestamp: ... },
125
- * // ...
126
- * // ]
127
- * // }
128
- */
129
- public getCacheDiagnostics(): object;
130
- /**
131
- * Count API paths in a tree
132
- * @param {object} api - API tree
133
- * @param {WeakSet} [visited] - Visited objects (prevent circular refs)
134
- * @returns {number} Number of paths
135
- * @private
136
- */
137
- private _countPaths;
138
- /**
139
- * Clear all caches
140
- * @returns {void}
141
- * @public
142
- *
143
- * @description
144
- * Removes all cache entries. Used during shutdown or full reload.
145
- *
146
- * @example
147
- * cacheManager.clear();
148
- */
149
- public clear(): void;
150
- /**
151
- * Rebuild cache from disk by calling buildAPI with stored parameters
152
- * @param {string} moduleID - Module identifier to rebuild
153
- * @returns {Promise<object>} Fresh API tree from buildAPI
154
- * @public
155
- *
156
- * @description
157
- * Reloads module source files and rebuilds API tree. Does NOT update cache -
158
- * caller must call set() with fresh tree. Returns the new API tree.
159
- *
160
- * @example
161
- * const freshApi = await cacheManager.rebuildCache("plugins_abc123");
162
- * cacheManager.set("plugins_abc123", { ...existingEntry, api: freshApi, timestamp: Date.now() });
163
- */
164
- public rebuildCache(moduleID: string): Promise<object>;
3
+ caches: Map<any, any>;
4
+ set(moduleID: any, entry: any): void;
5
+ get(moduleID: any): any;
6
+ has(moduleID: any): boolean;
7
+ delete(moduleID: any): boolean;
8
+ getAllModuleIDs(): any[];
9
+ getCacheDiagnostics(): {
10
+ totalCaches: number;
11
+ caches: {
12
+ moduleID: any;
13
+ endpoint: any;
14
+ folderPath: any;
15
+ mode: any;
16
+ pathCount: number;
17
+ timestamp: any;
18
+ }[];
19
+ };
20
+ _countPaths(api: any, visited?: WeakSet<object>): number;
21
+ clear(): void;
22
+ rebuildCache(moduleID: any): Promise<any>;
165
23
  }
166
- /**
167
- * Cache entry structure for API tree storage and rebuild parameters.
168
- */
169
- export type CacheEntry = {
170
- /**
171
- * - API path endpoint (e.g., ".", "plugins")
172
- */
173
- endpoint: string;
174
- /**
175
- * - Module identifier
176
- */
177
- moduleID: string;
178
- /**
179
- * - Complete buildAPI result tree (primary storage)
180
- */
181
- api: any;
182
- /**
183
- * - Source folder path
184
- */
185
- folderPath: string;
186
- /**
187
- * - Loading mode: 'lazy' or 'eager'
188
- */
189
- mode: string;
190
- /**
191
- * - Sanitization configuration
192
- */
193
- sanitizeOptions: any;
194
- /**
195
- * - Collision handling mode
196
- */
197
- collisionMode: string;
198
- /**
199
- * - Config snapshot at add time
200
- */
201
- config: any;
202
- /**
203
- * - Cache creation time (Unix ms)
204
- */
205
- timestamp: number;
206
- };
207
24
  import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
208
25
  //# sourceMappingURL=api-cache-manager.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-cache-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/api-cache-manager.mjs"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;GAcG;AACH;IACC,gCAA4C;IAU3C;;;;OAIG;IACH,eAAuB;IAGxB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,qBAtBW,MAAM,SACN,UAAU,GACR,IAAI,CAyDhB;IAED;;;;;;;;;;;OAWG;IACH,qBAVW,MAAM,GACJ,UAAU,GAAC,SAAS,CAWhC;IAED;;;;;;;;;;OAUG;IACH,qBATW,MAAM,GACJ,OAAO,CAUnB;IAED;;;;;;;;;;;OAWG;IACH,wBAVW,MAAM,GACJ,OAAO,CAoBnB;IAED;;;;;;;;OAQG;IACH,0BAPa,MAAM,EAAE,CASpB;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,8BAjBa,MAAM,CAsClB;IAED;;;;;;OAMG;IACH,oBAsBC;IAED;;;;;;;;;;OAUG;IACH,gBATa,IAAI,CAehB;IAED;;;;;;;;;;;;;OAaG;IACH,8BAZW,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CA8D3B;CACD;;;;;;;;cA/Ua,MAAM;;;;cACN,MAAM;;;;;;;;gBAEN,MAAM;;;;UACN,MAAM;;;;;;;;mBAEN,MAAM;;;;;;;;eAEN,MAAM;;8BAbU,0CAA0C"}
1
+ {"version":3,"file":"api-cache-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/api-cache-manager.mjs"],"names":[],"mappings":"AAAoE;IAA4C,gCAA0C;IAAsC,sBAAmB;IAAC,qCAAmtB;IAAA,wBAA+C;IAAA,4BAA+C;IAAA,+BAAoK;IAAA,yBAAwD;IAAA;;;;;;;;;;MAAiT;IAAA,yDAAiU;IAAA,cAA+F;IAAA,0CAAstB;CAAC;8BAAhnF,0CAA0C"}