@cldmv/slothlet 3.7.0 → 3.9.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 +6 -5
- package/REFERENCE.md +2 -0
- package/dist/lib/builders/api_builder.mjs +1 -1
- package/dist/lib/builders/modes-processor.mjs +1 -1
- package/dist/lib/handlers/api-manager.mjs +1 -1
- package/dist/lib/handlers/module-manager.mjs +17 -0
- package/dist/lib/helpers/config.mjs +1 -1
- package/dist/lib/helpers/eventemitter-context.mjs +1 -1
- package/dist/lib/helpers/generate-manifest.mjs +17 -0
- package/dist/lib/helpers/manifest-resolver.mjs +17 -0
- package/dist/lib/helpers/module-discovery.mjs +17 -0
- package/dist/lib/helpers/module-manifest-validator.mjs +17 -0
- package/dist/lib/helpers/module-sort.mjs +17 -0
- package/dist/lib/helpers/resolve-from-caller.mjs +1 -1
- package/dist/lib/i18n/languages/de-de.json +76 -47
- package/dist/lib/i18n/languages/en-gb.json +76 -47
- package/dist/lib/i18n/languages/en-us.json +76 -47
- package/dist/lib/i18n/languages/es-es.json +76 -47
- package/dist/lib/i18n/languages/es-mx.json +76 -47
- package/dist/lib/i18n/languages/fr-fr.json +30 -1
- package/dist/lib/i18n/languages/hi-in.json +72 -43
- package/dist/lib/i18n/languages/ja-jp.json +32 -3
- package/dist/lib/i18n/languages/ko-kr.json +32 -3
- package/dist/lib/i18n/languages/pt-br.json +76 -47
- package/dist/lib/i18n/languages/ru-ru.json +68 -39
- package/dist/lib/i18n/languages/zh-cn.json +37 -8
- package/dist/lib/processors/loader.mjs +1 -1
- package/dist/lib/processors/type-generator.mjs +1 -1
- package/dist/lib/processors/typescript.mjs +1 -1
- package/dist/lib/typegen/typegen.mjs +1 -1
- package/dist/slothlet.mjs +1 -1
- package/index.cjs +4 -14
- package/index.mjs +2 -12
- package/package.json +5 -9
- package/schemas/slothlet.module.schema.json +98 -0
- package/types/dist/lib/builders/api_builder.d.mts.map +1 -1
- package/types/dist/lib/builders/modes-processor.d.mts.map +1 -1
- package/types/dist/lib/handlers/api-manager.d.mts.map +1 -1
- package/types/dist/lib/handlers/module-manager.d.mts +29 -0
- package/types/dist/lib/handlers/module-manager.d.mts.map +1 -0
- package/types/dist/lib/helpers/config.d.mts +7 -0
- package/types/dist/lib/helpers/config.d.mts.map +1 -1
- package/types/dist/lib/helpers/eventemitter-context.d.mts.map +1 -1
- package/types/dist/lib/helpers/generate-manifest.d.mts +2 -0
- package/types/dist/lib/helpers/generate-manifest.d.mts.map +1 -0
- package/types/dist/lib/helpers/manifest-resolver.d.mts +2 -0
- package/types/dist/lib/helpers/manifest-resolver.d.mts.map +1 -0
- package/types/dist/lib/helpers/module-discovery.d.mts +8 -0
- package/types/dist/lib/helpers/module-discovery.d.mts.map +1 -0
- package/types/dist/lib/helpers/module-manifest-validator.d.mts +14 -0
- package/types/dist/lib/helpers/module-manifest-validator.d.mts.map +1 -0
- package/types/dist/lib/helpers/module-sort.d.mts +2 -0
- package/types/dist/lib/helpers/module-sort.d.mts.map +1 -0
- package/types/dist/lib/helpers/resolve-from-caller.d.mts.map +1 -1
- package/types/dist/lib/processors/loader.d.mts.map +1 -1
- package/types/dist/lib/processors/type-generator.d.mts.map +1 -1
- package/types/dist/lib/processors/typescript.d.mts.map +1 -1
- package/types/dist/lib/typegen/typegen.d.mts.map +1 -1
- package/types/dist/slothlet.d.mts.map +1 -1
- package/types/index.d.mts +3 -24
- package/types/index.d.mts.map +1 -1
package/index.cjs
CHANGED
|
@@ -22,31 +22,21 @@
|
|
|
22
22
|
* Eliminates code duplication between entry points and ensures consistent behavior.
|
|
23
23
|
* @public
|
|
24
24
|
* @async
|
|
25
|
-
* @param {
|
|
26
|
-
* @param {string} [options.dir="api"] - Directory to load API modules from
|
|
27
|
-
* @param {boolean} [options.lazy=false] - Use lazy loading (true) or eager loading (false)
|
|
28
|
-
* @param {number} [options.apiDepth=Infinity] - Maximum directory depth to scan
|
|
29
|
-
* @param {boolean} [options.debug=false] - Enable debug logging
|
|
30
|
-
* @param {string} [options.mode="singleton"] - Execution mode (singleton, vm, worker, fork)
|
|
31
|
-
* @param {string} [options.api_mode="auto"] - API structure mode (auto, function, object)
|
|
32
|
-
* @param {string} [options.runtime] - Runtime type ("async", "asynclocalstorage", "live", "livebindings", "experimental")
|
|
33
|
-
* @param {boolean} [options.allowApiOverwrite=true] - Allow addApi to overwrite existing API endpoints
|
|
34
|
-
* @param {object} [options.context={}] - Context data for live bindings
|
|
35
|
-
* @param {object} [options.reference={}] - Reference objects to merge into API root
|
|
25
|
+
* @param {import("./src/slothlet.mjs").SlothletOptions} [options={}] - Configuration options for the slothlet instance. See {@link SlothletOptions} for the full set.
|
|
36
26
|
* @returns {Promise<import("./src/slothlet.mjs").SlothletAPI>} The bound API object with management methods
|
|
37
27
|
*
|
|
38
28
|
* @example // CJS usage
|
|
39
29
|
* const slothlet = require("@cldmv/slothlet");
|
|
40
|
-
* const api = await slothlet({
|
|
30
|
+
* const api = await slothlet({ base: "./api", context: { user: "alice" } });
|
|
41
31
|
* console.log(api.config.username); // Access configuration
|
|
42
32
|
*
|
|
43
33
|
* @example // CJS usage with runtime selection
|
|
44
34
|
* const slothlet = require("@cldmv/slothlet");
|
|
45
|
-
* const api = await slothlet({
|
|
35
|
+
* const api = await slothlet({ base: "./api", runtime: "live" });
|
|
46
36
|
*
|
|
47
37
|
* @example // CJS named destructuring
|
|
48
38
|
* const { slothlet } = require("@cldmv/slothlet");
|
|
49
|
-
* const api = await slothlet({
|
|
39
|
+
* const api = await slothlet({ base: "./api" });
|
|
50
40
|
*/
|
|
51
41
|
async function slothlet(options = {}) {
|
|
52
42
|
// Dynamic import of ESM entry point - single source of truth
|
package/index.mjs
CHANGED
|
@@ -99,22 +99,12 @@ const devcheckPromise = (async () => {
|
|
|
99
99
|
* @public
|
|
100
100
|
* @async
|
|
101
101
|
*
|
|
102
|
-
* @param {
|
|
103
|
-
* @param {string} [options.dir="api"] - Directory to load API modules from
|
|
104
|
-
* @param {boolean} [options.lazy=false] - Use lazy loading (true) or eager loading (false) - legacy option
|
|
105
|
-
* @param {string} [options.mode] - Loading mode ("lazy", "eager") or execution mode ("singleton", "vm", "worker", "fork") - takes precedence over lazy option
|
|
106
|
-
* @param {string} [options.engine="singleton"] - Execution mode (singleton, vm, worker, fork)
|
|
107
|
-
* @param {number} [options.apiDepth=Infinity] - Maximum directory depth to scan
|
|
108
|
-
* @param {boolean} [options.debug=false] - Enable debug logging
|
|
109
|
-
* @param {string} [options.api_mode="auto"] - API structure mode (auto, function, object)
|
|
110
|
-
* @param {boolean} [options.allowApiOverwrite=true] - Allow addApi to overwrite existing API endpoints
|
|
111
|
-
* @param {object} [options.context={}] - Context data for live bindings
|
|
112
|
-
* @param {object} [options.reference={}] - Reference objects to merge into API root
|
|
102
|
+
* @param {import("./src/slothlet.mjs").SlothletOptions} [options={}] - Configuration options for the slothlet instance. See {@link SlothletOptions} for the full set.
|
|
113
103
|
* @returns {Promise<import("./src/slothlet.mjs").SlothletAPI>} The bound API object with management methods
|
|
114
104
|
*
|
|
115
105
|
* @example // ESM
|
|
116
106
|
* import slothlet from "@cldmv/slothlet";
|
|
117
|
-
* const api = await slothlet({
|
|
107
|
+
* const api = await slothlet({ base: './api', mode: 'lazy' });
|
|
118
108
|
* const result = await api.math.add(2, 3); // 5
|
|
119
109
|
*
|
|
120
110
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cldmv/slothlet",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"moduleVersions": {
|
|
5
5
|
"lazy": "3.0.0",
|
|
6
6
|
"eager": "3.0.0",
|
|
@@ -126,7 +126,8 @@
|
|
|
126
126
|
},
|
|
127
127
|
"types": "./types/dist/lib/i18n/translations.d.mts",
|
|
128
128
|
"import": "./dist/lib/i18n/translations.mjs"
|
|
129
|
-
}
|
|
129
|
+
},
|
|
130
|
+
"./schemas/slothlet.module.schema.json": "./schemas/slothlet.module.schema.json"
|
|
130
131
|
},
|
|
131
132
|
"types": "./types/index.d.mts",
|
|
132
133
|
"scripts": {
|
|
@@ -281,7 +282,6 @@
|
|
|
281
282
|
"@eslint/js": "^10.0.1",
|
|
282
283
|
"@eslint/json": "^1.2.0",
|
|
283
284
|
"@eslint/markdown": "^8.0.1",
|
|
284
|
-
"@html-eslint/parser": "^0.59.0",
|
|
285
285
|
"@types/node": "^25.6.0",
|
|
286
286
|
"@vitest/coverage-v8": "^4.1.5",
|
|
287
287
|
"acorn": "^8.16.0",
|
|
@@ -304,11 +304,6 @@
|
|
|
304
304
|
"optionalDependencies": {
|
|
305
305
|
"@rolldown/binding-linux-x64-gnu": "1.0.0-rc.17"
|
|
306
306
|
},
|
|
307
|
-
"overrides": {
|
|
308
|
-
"minimatch": "^10.2.3",
|
|
309
|
-
"rollup": "^4.59.0",
|
|
310
|
-
"rolldown": "1.0.0-rc.17"
|
|
311
|
-
},
|
|
312
307
|
"repository": {
|
|
313
308
|
"type": "git",
|
|
314
309
|
"url": "git+https://github.com/CLDMV/slothlet.git"
|
|
@@ -331,7 +326,8 @@
|
|
|
331
326
|
"types/index.d.mts",
|
|
332
327
|
"types/index.d.mts.map",
|
|
333
328
|
"dist/",
|
|
334
|
-
"bin/"
|
|
329
|
+
"bin/",
|
|
330
|
+
"schemas/"
|
|
335
331
|
],
|
|
336
332
|
"sideEffects": false
|
|
337
333
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://cldmv.github.io/slothlet/schemas/slothlet.module.schema.json",
|
|
4
|
+
"title": "Slothlet Module Manifest",
|
|
5
|
+
"description": "Manifest shipped by a slothlet module package at `slothlet.module.json` (default) or via an override locator. Describes how the module mounts into a host slothlet api tree.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "mountPath", "apiDir"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"description": "Manifest schema version. Only `1` is supported in this release.",
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"const": 1
|
|
14
|
+
},
|
|
15
|
+
"name": {
|
|
16
|
+
"description": "Package identity. Optional in the manifest — slothlet always reads this from package.json. If present, MUST match package.json's `name` exactly; mismatch throws MODULE_MANIFEST_NAME_MISMATCH and the module does not load.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1
|
|
19
|
+
},
|
|
20
|
+
"version": {
|
|
21
|
+
"description": "Semver. Optional in the manifest — slothlet always reads this from package.json (and uses it for multi-version mounting via versionConfig). If present, MUST match package.json's `version` exactly; mismatch throws MODULE_MANIFEST_VERSION_MISMATCH.",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1
|
|
24
|
+
},
|
|
25
|
+
"description": {
|
|
26
|
+
"description": "Free-form human-readable description. Optional. Falls back to package.json's `description` if absent. If present, overrides package.json silently (no mismatch error, unlike `name` and `version`).",
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"mountPath": {
|
|
30
|
+
"description": "Where the module mounts in the api tree. Same shape `api.add()` accepts. Reserved roots (`slothlet`, `shutdown`, `destroy`) are rejected with MODULE_RESERVED_MOUNTPATH.",
|
|
31
|
+
"oneOf": [
|
|
32
|
+
{
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1
|
|
41
|
+
},
|
|
42
|
+
"minItems": 1
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"apiDir": {
|
|
47
|
+
"description": "Path inside the package to the slothlet folder. Resolved relative to the package root. Path traversal (resolving outside the package root) is rejected with MODULE_PATH_TRAVERSAL.",
|
|
48
|
+
"type": "string",
|
|
49
|
+
"minLength": 1
|
|
50
|
+
},
|
|
51
|
+
"kind": {
|
|
52
|
+
"description": "Free-form category (driver, reranker, model-provider, etc.). Slothlet stores it but does not interpret it. Hosts use it via `discover()`'s `filter` callback.",
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"priority": {
|
|
56
|
+
"description": "Default-comparator key for `sort()`. Higher first. Defaults to 0. Ties broken alphabetically by `packageName` (from `package.json` / `DiscoverResult.packageName`).",
|
|
57
|
+
"type": "number",
|
|
58
|
+
"default": 0
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"description": "Other slothlet modules this module expects to be mounted. Slothlet does NOT enforce semver — values are passed through to metadata for the host to consume (e.g., a custom topological-sort comparator).",
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"permissions": {
|
|
68
|
+
"description": "Module's declared access expectations. Integrates with slothlet's permission system (see permission-system docs). The discovery + mount pipeline reads these entries into per-module metadata under `_module.manifest.permissions` (retrievable via `api.slothlet.metadata.getFor(mountPath)._module.manifest.permissions`); the host applies them to the live permission system by passing each entry to `api.slothlet.permissions.addRule()` manually.",
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"required": ["caller", "target", "effect"],
|
|
74
|
+
"properties": {
|
|
75
|
+
"caller": {
|
|
76
|
+
"description": "Glob pattern matching caller api path.",
|
|
77
|
+
"type": "string",
|
|
78
|
+
"minLength": 1
|
|
79
|
+
},
|
|
80
|
+
"target": {
|
|
81
|
+
"description": "Glob pattern matching target api path.",
|
|
82
|
+
"type": "string",
|
|
83
|
+
"minLength": 1
|
|
84
|
+
},
|
|
85
|
+
"effect": {
|
|
86
|
+
"description": "Rule effect.",
|
|
87
|
+
"type": "string",
|
|
88
|
+
"enum": ["allow", "deny"]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"metadata": {
|
|
94
|
+
"description": "Dedicated opt-in block for developer-defined extras. The only place arbitrary project-specific data goes — unknown top-level fields are NOT auto-passed through (they throw MODULE_MANIFEST_UNKNOWN_FIELD). Round-tripped via metadata.getFor(mountPath)._module.manifest.metadata.",
|
|
95
|
+
"type": "object"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_builder.d.mts","sourceRoot":"","sources":["../../../../dist/lib/builders/api_builder.mjs"],"names":[],"mappings":"AAAm/C;IAAuC,gCAAqC;IAAsC,0CAA66C;IAAA,
|
|
1
|
+
{"version":3,"file":"api_builder.d.mts","sourceRoot":"","sources":["../../../../dist/lib/builders/api_builder.mjs"],"names":[],"mappings":"AAAm/C;IAAuC,gCAAqC;IAAsC,0CAA66C;IAAA,oDAAys6B;IAAA,6CAAqR;IAAA,uFAA0vB;IAAA,sDAA8sJ;IAAA,qDAAmkB;IAAA,kDAA2Z;CAAC;8BAAl1tC,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modes-processor.d.mts","sourceRoot":"","sources":["../../../../dist/lib/builders/modes-processor.mjs"],"names":[],"mappings":"AAAmQ;IAA2C,gCAAyC;IAAsC,
|
|
1
|
+
{"version":3,"file":"modes-processor.d.mts","sourceRoot":"","sources":["../../../../dist/lib/builders/modes-processor.mjs"],"names":[],"mappings":"AAAmQ;IAA2C,gCAAyC;IAAsC,iSAA+p8B;IAAA,2KAAq3M;IAAA,2EAAwS;CAAC;8BAAjqqC,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/api-manager.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/api-manager.mjs"],"names":[],"mappings":"AAA6Z;IAAuC,gCAAqC;IAAsC;;;;MAAmF;IAAC;;;MAAwwD;IAAA;;;;OAAusB;IAAA,iDAAwmB;IAAA,wEAAiL;IAAA,2CAA6L;IAAA,2DAAqxB;IAAA,qEAA+6D;IAAA,oCAA0H;IAAA,wHAAsyI;IAAA,4FAA4vE;IAAA,kFAAivE;IAAA,oDAAsjE;IAAA,2DAA+zC;IAAgrB,kCAA85S;IAAA;;;;sBAAshB;IAAkb,wEAAu8Q;IAAA,+CAA2e;IAAA;;sBAAkwC;IAAA,4DAA0mD;IAAA,yCAAi3C;IAAA,gEAAynB;IAAA,6DAA6L;IAAA,wHAAquM;;CAAC;8BAA1kkD,0CAA0C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export class ModuleManager extends ComponentBase {
|
|
2
|
+
static slothletProperty: string;
|
|
3
|
+
discover(options?: {}): Promise<Readonly<{
|
|
4
|
+
packageName: any;
|
|
5
|
+
packageRoot: any;
|
|
6
|
+
mountPath: readonly any[];
|
|
7
|
+
apiDir: any;
|
|
8
|
+
manifest: any;
|
|
9
|
+
}>[]>;
|
|
10
|
+
sort(results: any, comparator: any): any[];
|
|
11
|
+
getDiscoveryCache(): any[];
|
|
12
|
+
clearDiscoveryCache(): void;
|
|
13
|
+
getStaleMounts(): any[];
|
|
14
|
+
addModule(nameOrResult: any, options?: {}): Promise<{
|
|
15
|
+
packageName: any;
|
|
16
|
+
mountPath: any;
|
|
17
|
+
moduleID: any;
|
|
18
|
+
discoverResult: any;
|
|
19
|
+
versionConfig: any;
|
|
20
|
+
}>;
|
|
21
|
+
addModules(items: any, options?: {}): Promise<any[] | {
|
|
22
|
+
mounted: any[];
|
|
23
|
+
failed: any[];
|
|
24
|
+
}>;
|
|
25
|
+
removeModule(name: any, opts?: {}): Promise<boolean>;
|
|
26
|
+
#private;
|
|
27
|
+
}
|
|
28
|
+
import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
|
|
29
|
+
//# sourceMappingURL=module-manager.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/module-manager.mjs"],"names":[],"mappings":"AAA+N;IAA0C,gCAAwC;IAAsE;;;;;;UAA4c;IAAA,2CAAgE;IAAA,2BAAoD;IAAA,4BAA0C;IAAA,wBAA4I;IAAA;;;;;;OAAma;IAAA;;;OAAosC;IAAA,qDAAuc;;CAA43J;8BAA9/P,0CAA0C"}
|
|
@@ -25,8 +25,13 @@ export class Config extends ComponentBase {
|
|
|
25
25
|
versioning: any;
|
|
26
26
|
permissions: any;
|
|
27
27
|
};
|
|
28
|
+
normalizeEnvTarget(platform: any, hasManifest?: boolean): "browser" | "node";
|
|
28
29
|
transformConfig(config?: {}): {
|
|
30
|
+
base: any;
|
|
29
31
|
dir: any;
|
|
32
|
+
manifest: any;
|
|
33
|
+
resolveModuleSpecifier: any;
|
|
34
|
+
envTarget: string;
|
|
30
35
|
mode: string;
|
|
31
36
|
runtime: string;
|
|
32
37
|
apiDepth: any;
|
|
@@ -104,7 +109,9 @@ export class Config extends ComponentBase {
|
|
|
104
109
|
readGating: boolean;
|
|
105
110
|
rules: any;
|
|
106
111
|
} | null;
|
|
112
|
+
suppressFixes: Set<any>;
|
|
107
113
|
};
|
|
114
|
+
normalizeSuppressFixes(suppressFixes: any, silent: any): Set<any>;
|
|
108
115
|
normalizeTypeScript(typescript: any): {
|
|
109
116
|
enabled: boolean;
|
|
110
117
|
mode: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/config.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/config.mjs"],"names":[],"mappings":"AAA2M;IAAmC,gCAAiC;IAAA;;;MAA2mB;IAAA,iDAA+U;IAAA,2CAA0S;IAAA;;;;;MAAqV;IAAA;;;;;;;;;;;;MAA46B;IAAA,6EAAwL;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA+0J;IAAA,kEAA0gB;IAAA;;;;;;;;;;;;aAAyf;IAAA;;aAAiN;IAAA;;;;;;aAAymD;CAAC;8BAAhiV,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventemitter-context.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/eventemitter-context.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eventemitter-context.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/eventemitter-context.mjs"],"names":[],"mappings":"AAA24P,qDAAmL;AAAtjB,oDAAmY;AAAroB,mDAAkQ;AAA95O,yDAA8D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-manifest.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/generate-manifest.mjs"],"names":[],"mappings":"AAAmtC,yDAAoc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-resolver.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/manifest-resolver.mjs"],"names":[],"mappings":"AAAA,oDAAoW,UAAK,YAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-discovery.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/module-discovery.mjs"],"names":[],"mappings":"AAAqa;;;;;;MAA0nE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function validateModuleManifest(manifest: any, packageContext: any): {
|
|
2
|
+
schemaVersion: number;
|
|
3
|
+
name: any;
|
|
4
|
+
version: any;
|
|
5
|
+
description: any;
|
|
6
|
+
mountPath: any[];
|
|
7
|
+
apiDir: any;
|
|
8
|
+
kind: any;
|
|
9
|
+
priority: any;
|
|
10
|
+
dependencies: any;
|
|
11
|
+
permissions: any;
|
|
12
|
+
metadata: any;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=module-manifest-validator.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-manifest-validator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/module-manifest-validator.mjs"],"names":[],"mappings":"AAAkhB;;;;;;;;;;;;EAA0mJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-sort.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/module-sort.mjs"],"names":[],"mappings":"AAAA,kEAAkJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-from-caller.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/resolve-from-caller.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-from-caller.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/resolve-from-caller.mjs"],"names":[],"mappings":"AAA4rB;IAAqC,gCAAmC;IAAA,0CAA2N;IAA0L,sBAA0G;IAAs7B,qCAAkgB;;CAAC;8BAAnqF,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/loader.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/loader.mjs"],"names":[],"mappings":"AAAitB;IAAmC,gCAAiC;IAAsC,0FAA+nH;IAAozB;;;OAAshD;IAA6pF,gCAAipB;;CAAC;8BAA1hU,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-generator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/type-generator.mjs"],"names":[],"mappings":"AAA+V;;;
|
|
1
|
+
{"version":3,"file":"type-generator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/type-generator.mjs"],"names":[],"mappings":"AAA+V;;;GAA0gC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/typescript.mjs"],"names":[],"mappings":"AAA2hC,iDAAoK;
|
|
1
|
+
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/typescript.mjs"],"names":[],"mappings":"AAA2hC,iDAAoK;AAA64Q,kEAAkZ;AAAluN,mEAA+kC;AAA55D;;;EAA8iB;AAAqwD,yFAA68B;AAAh9J,+EAA4T;AAA8oN;;;GAAm6D;AAA75H;;;GAA0/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typegen.d.mts","sourceRoot":"","sources":["../../../../dist/lib/typegen/typegen.mjs"],"names":[],"mappings":"AAAiN;;;
|
|
1
|
+
{"version":3,"file":"typegen.d.mts","sourceRoot":"","sources":["../../../../dist/lib/typegen/typegen.mjs"],"names":[],"mappings":"AAAiN;;;GAA61B"}
|
|
@@ -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":"AAAi9d,yDAA6G;AAA7G,mDAA6G"}
|
package/types/index.d.mts
CHANGED
|
@@ -5,35 +5,14 @@ export default slothlet;
|
|
|
5
5
|
* @public
|
|
6
6
|
* @async
|
|
7
7
|
*
|
|
8
|
-
* @param {
|
|
9
|
-
* @param {string} [options.dir="api"] - Directory to load API modules from
|
|
10
|
-
* @param {boolean} [options.lazy=false] - Use lazy loading (true) or eager loading (false) - legacy option
|
|
11
|
-
* @param {string} [options.mode] - Loading mode ("lazy", "eager") or execution mode ("singleton", "vm", "worker", "fork") - takes precedence over lazy option
|
|
12
|
-
* @param {string} [options.engine="singleton"] - Execution mode (singleton, vm, worker, fork)
|
|
13
|
-
* @param {number} [options.apiDepth=Infinity] - Maximum directory depth to scan
|
|
14
|
-
* @param {boolean} [options.debug=false] - Enable debug logging
|
|
15
|
-
* @param {string} [options.api_mode="auto"] - API structure mode (auto, function, object)
|
|
16
|
-
* @param {boolean} [options.allowApiOverwrite=true] - Allow addApi to overwrite existing API endpoints
|
|
17
|
-
* @param {object} [options.context={}] - Context data for live bindings
|
|
18
|
-
* @param {object} [options.reference={}] - Reference objects to merge into API root
|
|
8
|
+
* @param {import("./src/slothlet.mjs").SlothletOptions} [options={}] - Configuration options for the slothlet instance. See {@link SlothletOptions} for the full set.
|
|
19
9
|
* @returns {Promise<import("./src/slothlet.mjs").SlothletAPI>} The bound API object with management methods
|
|
20
10
|
*
|
|
21
11
|
* @example // ESM
|
|
22
12
|
* import slothlet from "@cldmv/slothlet";
|
|
23
|
-
* const api = await slothlet({
|
|
13
|
+
* const api = await slothlet({ base: './api', mode: 'lazy' });
|
|
24
14
|
* const result = await api.math.add(2, 3); // 5
|
|
25
15
|
*
|
|
26
16
|
*/
|
|
27
|
-
export function slothlet(options?:
|
|
28
|
-
dir?: string | undefined;
|
|
29
|
-
lazy?: boolean | undefined;
|
|
30
|
-
mode?: string | undefined;
|
|
31
|
-
engine?: string | undefined;
|
|
32
|
-
apiDepth?: number | undefined;
|
|
33
|
-
debug?: boolean | undefined;
|
|
34
|
-
api_mode?: string | undefined;
|
|
35
|
-
allowApiOverwrite?: boolean | undefined;
|
|
36
|
-
context?: object | undefined;
|
|
37
|
-
reference?: object | undefined;
|
|
38
|
-
}): Promise<import("./src/slothlet.mjs").SlothletAPI>;
|
|
17
|
+
export function slothlet(options?: import("./src/slothlet.mjs").SlothletOptions): Promise<import("./src/slothlet.mjs").SlothletAPI>;
|
|
39
18
|
//# sourceMappingURL=index.d.mts.map
|
package/types/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../index.mjs"],"names":[],"mappings":";AA+FA
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../index.mjs"],"names":[],"mappings":";AA+FA;;;;;;;;;;;;;;GAcG;AACH,mCATW,OAAO,oBAAoB,EAAE,eAAe,GAC1C,OAAO,CAAC,OAAO,oBAAoB,EAAE,WAAW,CAAC,CAkB7D"}
|