@cldmv/slothlet 3.2.3 → 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 (138) hide show
  1. package/README.md +22 -9
  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 -1155
  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 -2513
  12. package/dist/lib/handlers/context-async.mjs +1 -168
  13. package/dist/lib/handlers/context-live.mjs +1 -168
  14. package/dist/lib/handlers/hook-manager.mjs +1 -773
  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 +17 -0
  21. package/dist/lib/handlers/unified-wrapper.mjs +1 -3042
  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 -355
  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 +17 -0
  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/languages/de-de.json +21 -1
  33. package/dist/lib/i18n/languages/en-gb.json +21 -1
  34. package/dist/lib/i18n/languages/en-us.json +21 -1
  35. package/dist/lib/i18n/languages/es-mx.json +21 -1
  36. package/dist/lib/i18n/languages/fr-fr.json +21 -1
  37. package/dist/lib/i18n/languages/hi-in.json +21 -1
  38. package/dist/lib/i18n/languages/ja-jp.json +21 -1
  39. package/dist/lib/i18n/languages/ko-kr.json +21 -1
  40. package/dist/lib/i18n/languages/pt-br.json +21 -1
  41. package/dist/lib/i18n/languages/ru-ru.json +21 -1
  42. package/dist/lib/i18n/languages/zh-cn.json +21 -1
  43. package/dist/lib/i18n/translations.mjs +1 -126
  44. package/dist/lib/modes/eager.mjs +1 -59
  45. package/dist/lib/modes/lazy.mjs +1 -81
  46. package/dist/lib/processors/flatten.mjs +1 -437
  47. package/dist/lib/processors/loader.mjs +1 -339
  48. package/dist/lib/processors/type-generator.mjs +1 -275
  49. package/dist/lib/processors/typescript.mjs +1 -172
  50. package/dist/lib/runtime/runtime-asynclocalstorage.mjs +1 -113
  51. package/dist/lib/runtime/runtime-livebindings.mjs +1 -78
  52. package/dist/lib/runtime/runtime.mjs +1 -102
  53. package/dist/slothlet.mjs +1 -808
  54. package/package.json +37 -31
  55. package/types/dist/lib/builders/api-assignment.d.mts +3 -92
  56. package/types/dist/lib/builders/api-assignment.d.mts.map +1 -1
  57. package/types/dist/lib/builders/api_builder.d.mts +102 -91
  58. package/types/dist/lib/builders/api_builder.d.mts.map +1 -1
  59. package/types/dist/lib/builders/builder.d.mts +1 -55
  60. package/types/dist/lib/builders/builder.d.mts.map +1 -1
  61. package/types/dist/lib/builders/modes-processor.d.mts +3 -27
  62. package/types/dist/lib/builders/modes-processor.d.mts.map +1 -1
  63. package/types/dist/lib/errors.d.mts +19 -109
  64. package/types/dist/lib/errors.d.mts.map +1 -1
  65. package/types/dist/lib/factories/component-base.d.mts +7 -177
  66. package/types/dist/lib/factories/component-base.d.mts.map +1 -1
  67. package/types/dist/lib/factories/context.d.mts +4 -22
  68. package/types/dist/lib/factories/context.d.mts.map +1 -1
  69. package/types/dist/lib/handlers/api-cache-manager.d.mts +20 -203
  70. package/types/dist/lib/handlers/api-cache-manager.d.mts.map +1 -1
  71. package/types/dist/lib/handlers/api-manager.d.mts +33 -408
  72. package/types/dist/lib/handlers/api-manager.d.mts.map +1 -1
  73. package/types/dist/lib/handlers/context-async.d.mts +23 -61
  74. package/types/dist/lib/handlers/context-async.d.mts.map +1 -1
  75. package/types/dist/lib/handlers/context-live.d.mts +22 -59
  76. package/types/dist/lib/handlers/context-live.d.mts.map +1 -1
  77. package/types/dist/lib/handlers/hook-manager.d.mts +46 -185
  78. package/types/dist/lib/handlers/hook-manager.d.mts.map +1 -1
  79. package/types/dist/lib/handlers/lifecycle-token.d.mts +3 -48
  80. package/types/dist/lib/handlers/lifecycle-token.d.mts.map +1 -1
  81. package/types/dist/lib/handlers/lifecycle.d.mts +5 -82
  82. package/types/dist/lib/handlers/lifecycle.d.mts.map +1 -1
  83. package/types/dist/lib/handlers/materialize-manager.d.mts +8 -70
  84. package/types/dist/lib/handlers/materialize-manager.d.mts.map +1 -1
  85. package/types/dist/lib/handlers/metadata.d.mts +17 -221
  86. package/types/dist/lib/handlers/metadata.d.mts.map +1 -1
  87. package/types/dist/lib/handlers/ownership.d.mts +44 -160
  88. package/types/dist/lib/handlers/ownership.d.mts.map +1 -1
  89. package/types/dist/lib/handlers/permission-manager.d.mts +47 -0
  90. package/types/dist/lib/handlers/permission-manager.d.mts.map +1 -0
  91. package/types/dist/lib/handlers/unified-wrapper.d.mts +26 -239
  92. package/types/dist/lib/handlers/unified-wrapper.d.mts.map +1 -1
  93. package/types/dist/lib/handlers/version-manager.d.mts +28 -225
  94. package/types/dist/lib/handlers/version-manager.d.mts.map +1 -1
  95. package/types/dist/lib/helpers/class-instance-wrapper.d.mts +2 -52
  96. package/types/dist/lib/helpers/class-instance-wrapper.d.mts.map +1 -1
  97. package/types/dist/lib/helpers/config.d.mts +125 -123
  98. package/types/dist/lib/helpers/config.d.mts.map +1 -1
  99. package/types/dist/lib/helpers/eventemitter-context.d.mts +3 -29
  100. package/types/dist/lib/helpers/eventemitter-context.d.mts.map +1 -1
  101. package/types/dist/lib/helpers/hint-detector.d.mts +2 -15
  102. package/types/dist/lib/helpers/hint-detector.d.mts.map +1 -1
  103. package/types/dist/lib/helpers/modes-utils.d.mts +3 -30
  104. package/types/dist/lib/helpers/modes-utils.d.mts.map +1 -1
  105. package/types/dist/lib/helpers/pattern-matcher.d.mts +4 -0
  106. package/types/dist/lib/helpers/pattern-matcher.d.mts.map +1 -0
  107. package/types/dist/lib/helpers/resolve-from-caller.d.mts +3 -27
  108. package/types/dist/lib/helpers/resolve-from-caller.d.mts.map +1 -1
  109. package/types/dist/lib/helpers/sanitize.d.mts +4 -92
  110. package/types/dist/lib/helpers/sanitize.d.mts.map +1 -1
  111. package/types/dist/lib/helpers/utilities.d.mts +4 -52
  112. package/types/dist/lib/helpers/utilities.d.mts.map +1 -1
  113. package/types/dist/lib/i18n/translations.d.mts +4 -37
  114. package/types/dist/lib/i18n/translations.d.mts.map +1 -1
  115. package/types/dist/lib/modes/eager.d.mts +8 -30
  116. package/types/dist/lib/modes/eager.d.mts.map +1 -1
  117. package/types/dist/lib/modes/lazy.d.mts +10 -43
  118. package/types/dist/lib/modes/lazy.d.mts.map +1 -1
  119. package/types/dist/lib/processors/flatten.d.mts +56 -107
  120. package/types/dist/lib/processors/flatten.d.mts.map +1 -1
  121. package/types/dist/lib/processors/loader.d.mts +6 -41
  122. package/types/dist/lib/processors/loader.d.mts.map +1 -1
  123. package/types/dist/lib/processors/type-generator.d.mts +2 -16
  124. package/types/dist/lib/processors/type-generator.d.mts.map +1 -1
  125. package/types/dist/lib/processors/typescript.d.mts +6 -53
  126. package/types/dist/lib/processors/typescript.d.mts.map +1 -1
  127. package/types/dist/lib/runtime/runtime-asynclocalstorage.d.mts +3 -71
  128. package/types/dist/lib/runtime/runtime-asynclocalstorage.d.mts.map +1 -1
  129. package/types/dist/lib/runtime/runtime-livebindings.d.mts +2 -37
  130. package/types/dist/lib/runtime/runtime-livebindings.d.mts.map +1 -1
  131. package/types/dist/lib/runtime/runtime.d.mts +3 -39
  132. package/types/dist/lib/runtime/runtime.d.mts.map +1 -1
  133. package/types/dist/slothlet.d.mts +3 -249
  134. package/types/dist/slothlet.d.mts.map +1 -1
  135. package/types/index.d.mts +36 -16
  136. package/types/index.d.mts.map +1 -0
  137. package/AGENT-USAGE.md +0 -736
  138. package/docs/API-RULES.md +0 -712
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.mts","sourceRoot":"","sources":["../../../../dist/lib/i18n/translations.mjs"],"names":[],"mappings":"AAuFA;;;;;GAKG;AACH,kCAHW,MAAM,QAsBhB;AAED;;;;GAIG;AACH,+BAHa,MAAM,CAKlB;AAED;;;;;;GAMG;AACH,qCALW,MAAM,iBAEJ,MAAM,CAyBlB;AAED;;;;;GAKG;AACH,mCAHG;IAAyB,QAAQ,GAAzB,MAAM;CACd,QAiBF;AApDD;;;;;;GAMG;AACH,6BALW,MAAM,iBAEJ,MAAM,CAyBlB"}
1
+ {"version":3,"file":"translations.d.mts","sourceRoot":"","sources":["../../../../dist/lib/i18n/translations.mjs"],"names":[],"mappings":"AAA4wC,sCAA8C;AAAmc,6CAAgU;AAA/rC,6CAA8Y;AAA8C,oDAAmc;AAAnc,4DAAmc"}
@@ -1,35 +1,13 @@
1
- /**
2
- * Eager mode component - builds APIs by loading all modules immediately.
3
- * @class EagerMode
4
- * @extends ComponentBase
5
- * @package
6
- */
7
1
  export class EagerMode extends ComponentBase {
8
2
  static slothletProperty: string;
9
- /**
10
- * Build API in eager mode (load all modules immediately).
11
- * @param {Object} options - Build options
12
- * @param {string} options.dir - Directory path to load from
13
- * @param {string} [options.apiPathPrefix=""] - Prefix for API paths
14
- * @param {string} [options.collisionContext="initial"] - Collision context
15
- * @param {string} [options.moduleID] - Module ID
16
- * @param {number} [options.apiDepth=Infinity] - Maximum directory depth
17
- * @param {string|null} [options.cacheBust=null] - Cache-busting value
18
- * @param {Function|null} [options.fileFilter=null] - Optional filter (fileName) => boolean
19
- * @returns {Promise<Object>} Built API object
20
- * @public
21
- *
22
- * @example
23
- * const api = await slothlet.modes.eager.buildAPI({ dir: "./api", moduleID: "base" });
24
- */
25
- public buildAPI({ dir, apiPathPrefix, collisionContext, moduleID, apiDepth, cacheBust, fileFilter }: {
26
- dir: string;
27
- apiPathPrefix?: string;
28
- collisionContext?: string;
29
- moduleID?: string;
30
- apiDepth?: number;
31
- cacheBust?: string | null;
32
- fileFilter?: Function | null;
3
+ buildAPI({ dir, apiPathPrefix, collisionContext, moduleID, apiDepth, cacheBust, fileFilter }: {
4
+ dir: any;
5
+ apiPathPrefix?: string | undefined;
6
+ collisionContext?: string | undefined;
7
+ moduleID: any;
8
+ apiDepth?: number | undefined;
9
+ cacheBust?: null | undefined;
10
+ fileFilter?: null | undefined;
33
11
  }): Promise<any>;
34
12
  }
35
13
  import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
@@ -1 +1 @@
1
- {"version":3,"file":"eager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/eager.mjs"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH;IACC,gCAAkC;IAWlC;;;;;;;;;;;;;;;OAeG;IACH,qGAbG;QAAwB,GAAG,EAAnB,MAAM;QACW,aAAa,GAA9B,MAAM;QACW,gBAAgB,GAAjC,MAAM;QACW,QAAQ,GAAzB,MAAM;QACW,QAAQ,GAAzB,MAAM;QACgB,SAAS,GAA/B,MAAM,GAAC,IAAI;QACa,UAAU,GAAlC,WAAS,IAAI;KACrB,GAAU,OAAO,KAAQ,CAgD3B;CACD;8BA/E6B,0CAA0C"}
1
+ {"version":3,"file":"eager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/eager.mjs"],"names":[],"mappings":"AAAoE;IAAsC,gCAAgC;IAAsC;;;;;;;;qBAAkpB;CAAC;8BAA1yB,0CAA0C"}
@@ -1,48 +1,15 @@
1
- /**
2
- * Lazy mode component - builds APIs with deferred (on-demand) loading.
3
- * @class LazyMode
4
- * @extends ComponentBase
5
- * @package
6
- */
7
1
  export class LazyMode extends ComponentBase {
8
2
  static slothletProperty: string;
9
- /**
10
- * Create a named async materialization function for lazy subdirectories.
11
- * @param {string} apiPath - API path to derive the function name from.
12
- * @param {Function} handler - Async handler that performs materialization.
13
- * @returns {Function} Named async materialization function.
14
- * @public
15
- *
16
- * @example
17
- * const fn = lazyMode.createNamedMaterializeFunc('api.math', async () => ({ add: (a,b) => a+b }));
18
- */
19
- public createNamedMaterializeFunc(apiPath: string, handler: Function): Function;
20
- /**
21
- * Build API in lazy mode (proxy-based deferred loading).
22
- * @param {Object} options - Build options
23
- * @param {string} options.dir - Directory to build from
24
- * @param {string} [options.apiPathPrefix=""] - Prefix for API paths
25
- * @param {string} [options.collisionContext="initial"] - Collision context
26
- * @param {string|null} [options.collisionMode=null] - Collision mode override from api.add()
27
- * @param {string} [options.moduleID] - Module ID
28
- * @param {number} [options.apiDepth=Infinity] - Maximum directory depth
29
- * @param {string|null} [options.cacheBust=null] - Cache-busting value
30
- * @param {Function|null} [options.fileFilter=null] - Optional filter (fileName) => boolean
31
- * @returns {Promise<Object>} Built API object with lazy proxies
32
- * @public
33
- *
34
- * @example
35
- * const api = await slothlet.modes.lazy.buildAPI({ dir: "./api", moduleID: "base" });
36
- */
37
- public buildAPI({ dir, apiPathPrefix, collisionContext, collisionMode, moduleID, apiDepth, cacheBust, fileFilter }: {
38
- dir: string;
39
- apiPathPrefix?: string;
40
- collisionContext?: string;
41
- collisionMode?: string | null;
42
- moduleID?: string;
43
- apiDepth?: number;
44
- cacheBust?: string | null;
45
- fileFilter?: Function | null;
3
+ createNamedMaterializeFunc(apiPath: any, handler: any): (...args: any[]) => Promise<any>;
4
+ buildAPI({ dir, apiPathPrefix, collisionContext, collisionMode, moduleID, apiDepth, cacheBust, fileFilter }: {
5
+ dir: any;
6
+ apiPathPrefix?: string | undefined;
7
+ collisionContext?: string | undefined;
8
+ collisionMode?: null | undefined;
9
+ moduleID: any;
10
+ apiDepth?: number | undefined;
11
+ cacheBust?: null | undefined;
12
+ fileFilter?: null | undefined;
46
13
  }): Promise<any>;
47
14
  }
48
15
  import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/lazy.mjs"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH;IACC,gCAAiC;IAWjC;;;;;;;;;OASG;IACH,2CARW,MAAM,+BAmBhB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,oHAdG;QAAwB,GAAG,EAAnB,MAAM;QACW,aAAa,GAA9B,MAAM;QACW,gBAAgB,GAAjC,MAAM;QACgB,aAAa,GAAnC,MAAM,GAAC,IAAI;QACM,QAAQ,GAAzB,MAAM;QACW,QAAQ,GAAzB,MAAM;QACgB,SAAS,GAA/B,MAAM,GAAC,IAAI;QACa,UAAU,GAAlC,WAAS,IAAI;KACrB,GAAU,OAAO,KAAQ,CAwD3B;CACD;8BA/G6B,0CAA0C"}
1
+ {"version":3,"file":"lazy.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/lazy.mjs"],"names":[],"mappings":"AAAoE;IAAqC,gCAA+B;IAAsC,yFAAiV;IAAA;;;;;;;;;qBAAqyB;CAAC;8BAA5wC,0CAA0C"}
@@ -1,113 +1,62 @@
1
- /**
2
- * Flattening decision processor
3
- * @class Flatten
4
- * @extends ComponentBase
5
- * @package
6
- */
7
1
  export class Flatten extends ComponentBase {
8
2
  static slothletProperty: string;
9
- /**
10
- * Core flattening decision function.
11
- * Implements conditions C01-C07 from getFlatteningDecision().
12
- * @param {object} options - Decision options
13
- * @param {object} options.mod - Module exports
14
- * @param {string} options.moduleName - Sanitized module name
15
- * @param {string} options.categoryName - Category/folder name
16
- * @param {object} options.analysis - Export analysis
17
- * @param {boolean} options.hasMultipleDefaults - Multiple defaults in folder
18
- * @param {array} options.moduleKeys - Keys from module
19
- * @param {function} options.t - Translation function
20
- * @returns {Promise<object>} Flattening decision
21
- * @public
22
- */
23
- public getFlatteningDecision(options: {
24
- mod: object;
25
- moduleName: string;
26
- categoryName: string;
27
- analysis: object;
28
- hasMultipleDefaults: boolean;
29
- moduleKeys: any[];
30
- t: Function;
31
- }): Promise<object>;
32
- /**
33
- * Build module content for API assignment.
34
- *
35
- * Canonical implementation of the C08-C09b content-building rules, including
36
- * AddApi detection and collision handling. Previously this logic was inlined
37
- * inside modes-processor.mjs; it now lives here so the processor stays focused
38
- * on wrapping and assignment concerns only.
39
- *
40
- * Collision config, modesUtils helpers, and SlothletWarning are accessed
41
- * directly through {@link this.slothlet} / {@link this.slothlet.config} — no caller
42
- * plumbing required.
43
- *
44
- * @param {object} options - Processing options.
45
- * @param {object} options.mod - Module exports.
46
- * @param {object} options.decision - Flattening decision from getFlatteningDecision.
47
- * @param {string} options.moduleName - Sanitized module name (used for C08 auto-flatten key lookup).
48
- * @param {string} options.propertyName - Resolved preferred name (decision.preferredName || moduleName).
49
- * @param {string[]} options.moduleKeys - Named export keys (excluding "default").
50
- * @param {object} options.analysis - { hasDefault, hasNamed, defaultExportType }.
51
- * @param {object} [options.file=null] - File descriptor for AddApi detection via file.name / file.fullName.
52
- * @param {string} [options.collisionContext="initial"] - Collision context ("initial" | "api").
53
- * @param {string} [options.apiPathPrefix=""] - API path prefix for collision error messages.
54
- * @returns {{ moduleContent: object|Function }} Built module content ready for wrapping/assignment.
55
- * @public
56
- */
57
- public processModuleForAPI(options: {
58
- mod: object;
59
- decision: object;
60
- moduleName: string;
61
- propertyName: string;
62
- moduleKeys: string[];
63
- analysis: object;
64
- file?: object;
65
- collisionContext?: string;
66
- apiPathPrefix?: string;
67
- }): {
68
- moduleContent: object | Function;
3
+ getFlatteningDecision(options: any): Promise<{
4
+ preserveAsNamespace: boolean;
5
+ reason: any;
6
+ flattenToRoot?: undefined;
7
+ } | {
8
+ flattenToRoot: boolean;
9
+ reason: any;
10
+ preserveAsNamespace?: undefined;
11
+ } | {
12
+ flattenToCategory: boolean;
13
+ flattenType: string;
14
+ reason: any;
15
+ useAutoFlattening?: undefined;
16
+ preserveAsNamespace?: undefined;
17
+ preferredName?: undefined;
18
+ } | {
19
+ useAutoFlattening: boolean;
20
+ reason: any;
21
+ flattenToCategory?: undefined;
22
+ flattenType?: undefined;
23
+ preserveAsNamespace?: undefined;
24
+ preferredName?: undefined;
25
+ } | {
26
+ flattenToCategory: boolean;
27
+ reason: any;
28
+ flattenType?: undefined;
29
+ useAutoFlattening?: undefined;
30
+ preserveAsNamespace?: undefined;
31
+ preferredName?: undefined;
32
+ } | {
33
+ preserveAsNamespace: boolean;
34
+ preferredName: any;
35
+ reason: any;
36
+ flattenToCategory?: undefined;
37
+ flattenType?: undefined;
38
+ useAutoFlattening?: undefined;
39
+ }>;
40
+ processModuleForAPI(options: any): {
41
+ moduleContent: any;
69
42
  };
70
- /**
71
- * Build category-level flattening decisions.
72
- * Implements conditions C10-C33 from buildCategoryDecisions().
73
- * @param {object} options - Category options
74
- * @param {string} options.categoryName - Category name
75
- * @param {object} options.mod - Module exports
76
- * @param {string} options.moduleName - Module name
77
- * @param {string} options.fileBaseName - File base name
78
- * @param {object} options.analysis - Export analysis
79
- * @param {array} options.moduleKeys - Module keys
80
- * @param {number} options.currentDepth - Current depth
81
- * @param {array} options.moduleFiles - Files in category
82
- * @param {function} options.t - Translation function
83
- * @returns {Promise<object>} Category decision
84
- * @public
85
- */
86
- public buildCategoryDecisions(options: {
87
- categoryName: string;
88
- mod: object;
89
- moduleName: string;
90
- fileBaseName: string;
91
- analysis: object;
92
- moduleKeys: any[];
93
- currentDepth: number;
94
- moduleFiles: any[];
95
- t: Function;
96
- }): Promise<object>;
97
- /**
98
- * Decide whether a named export should be attached to a callable default export.
99
- *
100
- * Returns false when the named export is the same reference as the default (re-export
101
- * pattern), or when the export key matches the function name (self-referential export).
102
- *
103
- * @param {string} key - Named export key.
104
- * @param {unknown} value - Named export value.
105
- * @param {Function} defaultFunc - Wrapped callable default export.
106
- * @param {Function} originalDefault - Original default export.
107
- * @returns {boolean} True if the export should be attached.
108
- * @public
109
- */
110
- public shouldAttachNamedExport(key: string, value: unknown, defaultFunc: Function, originalDefault: Function): boolean;
43
+ buildCategoryDecisions(options: any): Promise<{
44
+ shouldFlatten: boolean;
45
+ flattenType: string;
46
+ reason: any;
47
+ preferredName?: undefined;
48
+ } | {
49
+ shouldFlatten: boolean;
50
+ flattenType: string;
51
+ preferredName: any;
52
+ reason: any;
53
+ } | {
54
+ shouldFlatten: boolean;
55
+ preferredName: any;
56
+ reason: any;
57
+ flattenType?: undefined;
58
+ }>;
59
+ shouldAttachNamedExport(key: any, value: any, defaultFunc: any, originalDefault: any): boolean;
111
60
  #private;
112
61
  }
113
62
  import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
@@ -1 +1 @@
1
- {"version":3,"file":"flatten.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/flatten.mjs"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH;IACC,gCAAoC;IAgEpC;;;;;;;;;;;;;OAaG;IACH,sCAVG;QAAwB,GAAG,EAAnB,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,YAAY,EAA5B,MAAM;QACU,QAAQ,EAAxB,MAAM;QACW,mBAAmB,EAApC,OAAO;QACQ,UAAU;QACP,CAAC;KAC3B,GAAU,OAAO,CAAC,MAAM,CAAC,CAiG3B;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,oCAZG;QAA0B,GAAG,EAArB,MAAM;QACY,QAAQ,EAA1B,MAAM;QACY,UAAU,EAA5B,MAAM;QACY,YAAY,EAA9B,MAAM;QACY,UAAU,EAA5B,MAAM,EAAE;QACU,QAAQ,EAA1B,MAAM;QACa,IAAI,GAAvB,MAAM;QACa,gBAAgB,GAAnC,MAAM;QACa,aAAa,GAAhC,MAAM;KACd,GAAU;QAAE,aAAa,EAAE,MAAM,WAAS,CAAA;KAAE,CAqI9C;IAED;;;;;;;;;;;;;;;OAeG;IACH,uCAZG;QAAwB,YAAY,EAA5B,MAAM;QACU,GAAG,EAAnB,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,YAAY,EAA5B,MAAM;QACU,QAAQ,EAAxB,MAAM;QACS,UAAU;QACT,YAAY,EAA5B,MAAM;QACS,WAAW;QACR,CAAC;KAC3B,GAAU,OAAO,CAAC,MAAM,CAAC,CAiJ3B;IAED;;;;;;;;;;;;OAYG;IACH,oCAPW,MAAM,SACN,OAAO,qDAGL,OAAO,CAiBnB;;CACD;8BAhhB6B,0CAA0C"}
1
+ {"version":3,"file":"flatten.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/flatten.mjs"],"names":[],"mappings":"AAAoE;IAAoC,gCAAkC;IAAqjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA8pE;IAAA;;MAA+yF;IAAA;;;;;;;;;;;;;;;OAAk7G;IAAA,+FAA0U;;CAAC;8BAAh3S,0CAA0C"}
@@ -1,46 +1,11 @@
1
- /**
2
- * Loader component for module loading, directory scanning, and API merging
3
- * @class Loader
4
- * @extends ComponentBase
5
- * @package
6
- */
7
1
  export class Loader extends ComponentBase {
8
2
  static slothletProperty: string;
9
- constructor(slothlet: any);
10
- /**
11
- * Load a single module
12
- * @param {string} filePath - Path to module file
13
- * @param {string} [instanceID] - Slothlet instance ID for cache busting
14
- * @param {string} [moduleID] - Module ID for additional cache busting (used in api.slothlet.api.add)
15
- * @param {number|null} [cacheBust=null] - Timestamp for reload cache busting (forces fresh import)
16
- * @returns {Promise<Object>} Loaded module
17
- * @public
18
- */
19
- public loadModule(filePath: string, instanceID?: string, moduleID?: string, cacheBust?: number | null): Promise<any>;
20
- /**
21
- * Scan directory for module files
22
- * @param {string} dir - Directory to scan
23
- * @param {Object} [options={}] - Scan options
24
- * @param {boolean} [options.isRootScan=true] - Whether this is the root directory scan (shows empty dir warning)
25
- * @param {number} [options.currentDepth=0] - Current traversal depth
26
- * @param {number} [options.maxDepth=Infinity] - Maximum traversal depth
27
- * @param {Function|null} [options.fileFilter=null] - Optional filter function (fileName) => boolean to load specific files only
28
- * @returns {Promise<Object>} Directory structure
29
- * @public
30
- */
31
- public scanDirectory(dir: string, options?: {
32
- isRootScan?: boolean;
33
- currentDepth?: number;
34
- maxDepth?: number;
35
- fileFilter?: Function | null;
36
- }): Promise<any>;
37
- /**
38
- * Extract exports from module
39
- * @param {Object} module - Loaded module
40
- * @returns {Object} Extracted exports
41
- * @public
42
- */
43
- public extractExports(module: any): any;
3
+ loadModule(filePath: any, instanceID: any, moduleID: any, cacheBust?: null): Promise<any>;
4
+ scanDirectory(dir: any, options?: {}): Promise<{
5
+ files: never[];
6
+ directories: never[];
7
+ }>;
8
+ extractExports(module: any): {};
44
9
  #private;
45
10
  }
46
11
  import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/loader.mjs"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH;IACC,gCAAmC;IAEnC,2BAEC;IAED;;;;;;;;OAQG;IACH,4BAPW,MAAM,eACN,MAAM,aACN,MAAM,cACN,MAAM,GAAC,IAAI,GACT,OAAO,KAAQ,CAwK3B;IAuCD;;;;;;;;;;OAUG;IACH,0BATW,MAAM,YAEd;QAA0B,UAAU,GAA5B,OAAO;QACU,YAAY,GAA7B,MAAM;QACW,QAAQ,GAAzB,MAAM;QACkB,UAAU,GAAlC,WAAS,IAAI;KACrB,GAAU,OAAO,KAAQ,CA0F3B;IAED;;;;;OAKG;IACH,wCAoCC;;CACD;8BAnX6B,0CAA0C"}
1
+ {"version":3,"file":"loader.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/loader.mjs"],"names":[],"mappings":"AAA+O;IAAmC,gCAAiC;IAAsC,0FAA2nG;IAA4Y;;;OAA+7C;IAAA,gCAAipB;;CAAC;8BAA7uL,0CAA0C"}
@@ -1,19 +1,5 @@
1
- /**
2
- * Generate TypeScript declaration file for a Slothlet API
3
- * @param {object} api - The loaded Slothlet API
4
- * @param {object} options - Generation options
5
- * @param {string} options.output - Output file path for .d.ts
6
- * @param {string} options.interfaceName - Name of the interface to generate
7
- * @param {boolean} [options.includeDocumentation=true] - Include JSDoc comments
8
- * @returns {Promise<{output: string, filePath: string}>} Generated declaration and output path
9
- * @public
10
- */
11
- export function generateTypes(api: object, options: {
1
+ export function generateTypes(api: any, options: any): Promise<{
12
2
  output: string;
13
- interfaceName: string;
14
- includeDocumentation?: boolean;
15
- }): Promise<{
16
- output: string;
17
- filePath: string;
3
+ filePath: any;
18
4
  }>;
19
5
  //# sourceMappingURL=type-generator.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-generator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/type-generator.mjs"],"names":[],"mappings":"AA8CA;;;;;;;;;GASG;AACH,mCARW,MAAM,WAEd;IAAwB,MAAM,EAAtB,MAAM;IACU,aAAa,EAA7B,MAAM;IACY,oBAAoB,GAAtC,OAAO;CACf,GAAU,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAAC,CAqDvD"}
1
+ {"version":3,"file":"type-generator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/type-generator.mjs"],"names":[],"mappings":"AAA+V;;;GAAwiC"}
@@ -1,55 +1,8 @@
1
- /**
2
- * Transform TypeScript code to JavaScript using esbuild
3
- * @param {string} filePath - Path to the TypeScript file
4
- * @param {object} [options={}] - esbuild transform options
5
- * @param {string} [options.target] - ECMAScript target version (default: "es2020")
6
- * @param {string} [options.format] - Module format (default: "esm")
7
- * @param {boolean} [options.sourcemap] - Generate source maps (default: false)
8
- * @returns {Promise<string>} Transformed JavaScript code
9
- * @throws {SlothletError} If transformation fails
10
- * @public
11
- */
12
- export function transformTypeScript(filePath: string, options?: {
13
- target?: string;
14
- format?: string;
15
- sourcemap?: boolean;
16
- }): Promise<string>;
17
- /**
18
- * Create a data URL for dynamic import with cache busting
19
- * @param {string} code - JavaScript code to encode
20
- * @returns {string} Data URL suitable for dynamic import
21
- * @public
22
- */
23
- export function createDataUrl(code: string): string;
24
- /**
25
- * Transform TypeScript code to JavaScript using tsc with type checking
26
- * @param {string} filePath - Path to the TypeScript file
27
- * @param {object} [options={}] - TypeScript compiler options
28
- * @param {string} [options.target] - ECMAScript target version (default: "ES2020")
29
- * @param {string} [options.module] - Module format (default: "ESNext")
30
- * @param {boolean} [options.strict] - Enable strict type checking (default: true)
31
- * @param {boolean} [options.skipTypeCheck] - Skip type checking and only transform (default: false)
32
- * @param {string} [options.typeDefinitionPath] - Path to .d.ts file for type checking
33
- * @returns {Promise<{code: string, diagnostics: object[]}>} Transformed code and type diagnostics
34
- * @throws {SlothletError} If transformation fails
35
- * @public
36
- */
37
- export function transformTypeScriptStrict(filePath: string, options?: {
38
- target?: string;
39
- module?: string;
40
- strict?: boolean;
41
- skipTypeCheck?: boolean;
42
- typeDefinitionPath?: string;
43
- }): Promise<{
44
- code: string;
45
- diagnostics: object[];
1
+ export function createDataUrl(code: any): string;
2
+ export function formatDiagnostics(diagnostics: any, ts: any): any;
3
+ export function transformTypeScript(filePath: any, options?: {}): Promise<any>;
4
+ export function transformTypeScriptStrict(filePath: any, options?: {}): Promise<{
5
+ code: any;
6
+ diagnostics: any[];
46
7
  }>;
47
- /**
48
- * Format TypeScript diagnostics into readable error messages
49
- * @param {object[]} diagnostics - TypeScript diagnostic objects
50
- * @param {object} ts - TypeScript module instance
51
- * @returns {string[]} Array of formatted error messages
52
- * @private
53
- */
54
- export function formatDiagnostics(diagnostics: object[], ts: object): string[];
55
8
  //# sourceMappingURL=typescript.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/typescript.mjs"],"names":[],"mappings":"AAqEA;;;;;;;;;;GAUG;AACH,8CATW,MAAM,YAEd;IAAyB,MAAM,GAAvB,MAAM;IACW,MAAM,GAAvB,MAAM;IACY,SAAS,GAA3B,OAAO;CACf,GAAU,OAAO,CAAC,MAAM,CAAC,CAiB3B;AAED;;;;;GAKG;AACH,oCAJW,MAAM,GACJ,MAAM,CAQlB;AAED;;;;;;;;;;;;GAYG;AACH,oDAXW,MAAM,YAEd;IAAyB,MAAM,GAAvB,MAAM;IACW,MAAM,GAAvB,MAAM;IACY,MAAM,GAAxB,OAAO;IACW,aAAa,GAA/B,OAAO;IACU,kBAAkB,GAAnC,MAAM;CACd,GAAU,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAC,CAAC,CA6F1D;AAED;;;;;;GAMG;AACH,+CALW,MAAM,EAAE,MACR,MAAM,GACJ,MAAM,EAAE,CAapB"}
1
+ {"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/typescript.mjs"],"names":[],"mappings":"AAA83B,iDAAoK;AAAm6D,kEAAkZ;AAArxF,+EAA4T;AAAoK;;;GAAm6D"}
@@ -1,72 +1,4 @@
1
- /**
2
- * Live binding to the current API (self-reference)
3
- * @type {Proxy}
4
- * @public
5
- *
6
- * @description
7
- * A proxy that provides access to the full API object within the current context.
8
- * Automatically resolves to the correct instance's API in AsyncLocalStorage context.
9
- *
10
- * @example
11
- * import { self } from "@cldmv/slothlet/runtime/async";
12
- *
13
- * export function callOtherFunction() {
14
- * // Call another function in the same API
15
- * return self.otherFunction();
16
- * }
17
- */
18
- export const self: ProxyConstructor;
19
- /**
20
- * User-provided context object
21
- * @type {Proxy}
22
- * @public
23
- *
24
- * @description
25
- * A proxy that provides access to user-provided context data (e.g., request data, user info).
26
- * Can be set via `slothlet.run()` or `slothlet.scope()`.
27
- *
28
- * @example
29
- * import { context } from "@cldmv/slothlet/runtime/async";
30
- *
31
- * export function getUserInfo() {
32
- * // Access user-provided context
33
- * return {
34
- * userId: context.userId,
35
- * userName: context.userName
36
- * };
37
- * }
38
- */
39
- export const context: ProxyConstructor;
40
- /**
41
- * Reference to initialization reference object
42
- * @type {Proxy}
43
- * @public
44
- *
45
- * @description
46
- * The reference object is merged directly into the API at initialization using the add API system.
47
- * It is NOT available as a runtime export. Access it directly from the API or via api.slothlet.diag.reference().
48
- *
49
- * @example
50
- * // Reference merged into API - access directly:
51
- * export function useReferenceData() {
52
- * return self.myData; // if reference had myData property
53
- * }
54
- */
55
- /**
56
- * Current instance ID
57
- * @type {Proxy}
58
- * @public
59
- *
60
- * @description
61
- * A proxy that provides access to the current slothlet instance ID.
62
- * Useful for debugging and tracking which instance is handling a request.
63
- *
64
- * @example
65
- * import { instanceID } from "@cldmv/slothlet/runtime/async";
66
- *
67
- * export function getInstanceInfo() {
68
- * return { instanceID };
69
- * }
70
- */
71
- export const instanceID: ProxyConstructor;
1
+ export const context: {};
2
+ export const instanceID: {};
3
+ export const self: {};
72
4
  //# sourceMappingURL=runtime-asynclocalstorage.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-asynclocalstorage.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-asynclocalstorage.mjs"],"names":[],"mappings":"AA4DA;;;;;;;;;;;;;;;;GAgBG;AACH,oCAgCE;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,uCAkCE;AAEF;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,0CAqBE"}
1
+ {"version":3,"file":"runtime-asynclocalstorage.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-asynclocalstorage.mjs"],"names":[],"mappings":"AAA2xB,yBAAmrB;AAAA,4BAA6V;AAA3mD,sBAA2lB"}
@@ -1,38 +1,3 @@
1
- /**
2
- * Live binding to the current API (self-reference)
3
- * @type {Proxy}
4
- * @public
5
- *
6
- * @description
7
- * A proxy that provides direct access to the current instance's API.
8
- * In live mode, this directly references the active instance without AsyncLocalStorage.
9
- *
10
- * @example
11
- * import { self } from "@cldmv/slothlet/runtime/live";
12
- *
13
- * export function callOtherFunction() {
14
- * return self.otherFunction();
15
- * }
16
- */
17
- export const self: ProxyConstructor;
18
- /**
19
- * User-provided context object
20
- * @type {Proxy}
21
- * @public
22
- *
23
- * @description
24
- * A proxy that provides access to user-provided context data.
25
- * In live mode, this directly accesses the current instance's context.
26
- *
27
- * @example
28
- * import { context } from "@cldmv/slothlet/runtime/live";
29
- *
30
- * export function getUserInfo() {
31
- * return {
32
- * userId: context.userId,
33
- * userName: context.userName
34
- * };
35
- * }
36
- */
37
- export const context: ProxyConstructor;
1
+ export const context: {};
2
+ export const self: {};
38
3
  //# sourceMappingURL=runtime-livebindings.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-livebindings.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-livebindings.mjs"],"names":[],"mappings":"AA2CA;;;;;;;;;;;;;;;GAeG;AACH,oCAgCE;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,uCAkCE"}
1
+ {"version":3,"file":"runtime-livebindings.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-livebindings.mjs"],"names":[],"mappings":"AAAwuB,yBAA2tB;AAAt1C,sBAA2nB"}
@@ -1,40 +1,4 @@
1
- /**
2
- * Live binding to the current API instance. Resolves to the running Slothlet proxy,
3
- * giving API modules access to all other API methods without import cycles.
4
- *
5
- * @memberof module:@cldmv/slothlet/runtime
6
- * @type {object}
7
- * @example
8
- * import { self } from "@cldmv/slothlet/runtime";
9
- * // Inside an API function:
10
- * const result = await self.math.add(1, 2);
11
- */
12
- export const self: object;
13
- /**
14
- * The current ambient context object. Seeded at instance startup via `config.context` and
15
- * persists for the lifetime of the instance. `api.slothlet.context.run()` and `.scope()` can
16
- * temporarily override it for the duration of a single call, after which the previous context
17
- * is restored. Readable and writable.
18
- *
19
- * @memberof module:@cldmv/slothlet/runtime
20
- * @type {object}
21
- * @example
22
- * import { context } from "@cldmv/slothlet/runtime";
23
- * // Read the ambient context set via config.context or written by a previous call:
24
- * const userId = context.userId;
25
- * // context.run() overrides it only for the duration of that one call:
26
- * await api.slothlet.context.run({ userId: 42 }, myFn);
27
- */
28
- export const context: object;
29
- /**
30
- * Current Slothlet instance identifier. Unique per `slothlet()` call; useful when
31
- * multiple Slothlet instances coexist and you need to identify which one is active.
32
- *
33
- * @memberof module:@cldmv/slothlet/runtime
34
- * @type {string}
35
- * @example
36
- * import { instanceID } from "@cldmv/slothlet/runtime";
37
- * console.log(instanceID); // e.g. "slothlet-1"
38
- */
39
- export const instanceID: string;
1
+ export const context: {};
2
+ export const instanceID: {};
3
+ export const self: {};
40
4
  //# sourceMappingURL=runtime.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime.mjs"],"names":[],"mappings":"AAkEA;;;;;;;;;;GAUG;AACH,mBANU,MAAM,CAgCd;AAEF;;;;;;;;;;;;;;GAcG;AACH,sBARU,MAAM,CAiCd;AAEF;;;;;;;;;GASG;AACH,yBALU,MAAM,CAiBd"}
1
+ {"version":3,"file":"runtime.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime.mjs"],"names":[],"mappings":"AAA02B,yBAA4e;AAAA,4BAAoP;AAA7pC,sBAA6b"}