@cldmv/slothlet 3.15.3 → 3.16.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.
Files changed (58) hide show
  1. package/README.md +7 -5
  2. package/dist/lib/builders/api-assignment.mjs +1 -1
  3. package/dist/lib/builders/api_builder.mjs +1 -1
  4. package/dist/lib/builders/builder.mjs +1 -1
  5. package/dist/lib/builders/modes-processor.mjs +1 -1
  6. package/dist/lib/handlers/api-cache-manager.mjs +1 -1
  7. package/dist/lib/handlers/api-manager.mjs +1 -1
  8. package/dist/lib/handlers/module-manager.mjs +1 -1
  9. package/dist/lib/handlers/ownership.mjs +1 -1
  10. package/dist/lib/handlers/routine-manager.mjs +17 -0
  11. package/dist/lib/handlers/unified-wrapper.mjs +1 -1
  12. package/dist/lib/helpers/config.mjs +1 -1
  13. package/dist/lib/helpers/defaults.mjs +1 -1
  14. package/dist/lib/helpers/eventtarget-property-context.mjs +17 -0
  15. package/dist/lib/helpers/observer-context.mjs +17 -0
  16. package/dist/lib/helpers/scheduler-context.mjs +1 -1
  17. package/dist/lib/i18n/languages/en-us.json +2 -0
  18. package/dist/lib/modes/eager.mjs +1 -1
  19. package/dist/lib/processors/flatten.mjs +1 -1
  20. package/dist/slothlet.mjs +1 -1
  21. package/index.cjs +20 -0
  22. package/index.mjs +14 -0
  23. package/package.json +8 -7
  24. package/types/stub/devcheck.d.mts +1 -1
  25. package/types/stub/lib/builders/api-assignment.d.mts +130 -2
  26. package/types/stub/lib/builders/api_builder.d.mts +109 -2
  27. package/types/stub/lib/builders/builder.d.mts +87 -2
  28. package/types/stub/lib/builders/modes-processor.d.mts +71 -2
  29. package/types/stub/lib/factories/component-base.d.mts +177 -0
  30. package/types/stub/lib/helpers/caller-pinning.d.mts +22 -2
  31. package/types/stub/lib/helpers/class-instance-wrapper.d.mts +58 -2
  32. package/types/stub/lib/helpers/config.d.mts +321 -2
  33. package/types/stub/lib/helpers/defaults.d.mts +41 -2
  34. package/types/stub/lib/helpers/eventemitter-context.d.mts +31 -2
  35. package/types/stub/lib/helpers/eventtarget-context.d.mts +21 -2
  36. package/types/stub/lib/helpers/eventtarget-property-context.d.mts +23 -0
  37. package/types/stub/lib/helpers/generate-manifest.d.mts +180 -2
  38. package/types/stub/lib/helpers/hint-detector.d.mts +27 -2
  39. package/types/stub/lib/helpers/manifest-resolver.d.mts +101 -2
  40. package/types/stub/lib/helpers/modes-utils.d.mts +35 -2
  41. package/types/stub/lib/helpers/module-discovery.d.mts +81 -2
  42. package/types/stub/lib/helpers/module-manifest-validator.d.mts +37 -2
  43. package/types/stub/lib/helpers/module-sort.d.mts +65 -2
  44. package/types/stub/lib/helpers/observer-context.d.mts +23 -0
  45. package/types/stub/lib/helpers/pattern-matcher.d.mts +44 -2
  46. package/types/stub/lib/helpers/platform.d.mts +111 -2
  47. package/types/stub/lib/helpers/resolve-from-caller.d.mts +33 -2
  48. package/types/stub/lib/helpers/scheduler-context.d.mts +23 -2
  49. package/types/stub/lib/helpers/utilities.d.mts +57 -2
  50. package/types/stub/lib/i18n/translations.d.mts +52 -2
  51. package/types/stub/lib/modes/eager.d.mts +56 -2
  52. package/types/stub/lib/modes/lazy.d.mts +67 -2
  53. package/types/stub/lib/processors/flatten.d.mts +123 -2
  54. package/types/stub/lib/processors/loader.d.mts +83 -2
  55. package/types/stub/lib/processors/type-generator.d.mts +19 -2
  56. package/types/stub/lib/processors/typescript.d.mts +174 -2
  57. package/types/stub/lib/runtime/runtime-asynclocalstorage.d.mts +72 -2
  58. package/types/stub/lib/runtime/runtime-livebindings.d.mts +38 -2
@@ -1,3 +1,73 @@
1
1
  // AUTO-GENERATED by tools/build/build-typestubs.mjs — do not edit.
2
- // Re-exports the real declarations from @cldmv/slothlet-types (install it for TypeScript support).
3
- export * from "@cldmv/slothlet-types/runtime/async";
2
+ // Self-contained copy: this subpath is internal and not published by @cldmv/slothlet-types.
3
+ /**
4
+ * Live binding to the current API (self-reference)
5
+ * @type {Proxy}
6
+ * @public
7
+ *
8
+ * @description
9
+ * A proxy that provides access to the full API object within the current context.
10
+ * Automatically resolves to the correct instance's API in AsyncLocalStorage context.
11
+ *
12
+ * @example
13
+ * import { self } from "@cldmv/slothlet/runtime/async";
14
+ *
15
+ * export function callOtherFunction() {
16
+ * // Call another function in the same API
17
+ * return self.otherFunction();
18
+ * }
19
+ */
20
+ export const self: ProxyConstructor;
21
+ /**
22
+ * User-provided context object
23
+ * @type {Proxy}
24
+ * @public
25
+ *
26
+ * @description
27
+ * A proxy that provides access to user-provided context data (e.g., request data, user info).
28
+ * Can be set via `slothlet.run()` or `slothlet.scope()`.
29
+ *
30
+ * @example
31
+ * import { context } from "@cldmv/slothlet/runtime/async";
32
+ *
33
+ * export function getUserInfo() {
34
+ * // Access user-provided context
35
+ * return {
36
+ * userId: context.userId,
37
+ * userName: context.userName
38
+ * };
39
+ * }
40
+ */
41
+ export const context: ProxyConstructor;
42
+ /**
43
+ * Reference to initialization reference object
44
+ * @type {Proxy}
45
+ * @public
46
+ *
47
+ * @description
48
+ * The reference object is merged directly into the API at initialization using the add API system.
49
+ * It is NOT available as a runtime export. Access it directly from the API or via api.slothlet.diag.reference().
50
+ *
51
+ * @example
52
+ * // Reference merged into API - access directly:
53
+ * export function useReferenceData() {
54
+ * return self.myData; // if reference had myData property
55
+ * }
56
+ */
57
+ /**
58
+ * Current instance ID
59
+ * @type {Proxy}
60
+ * @public
61
+ *
62
+ * @description
63
+ * A proxy that provides access to the current slothlet instance ID.
64
+ * Useful for debugging and tracking which instance is handling a request.
65
+ *
66
+ * @example
67
+ * import { instanceID } from "@cldmv/slothlet/runtime/async";
68
+ *
69
+ * export function getInstanceInfo() {
70
+ * return { instanceID };
71
+ * }
72
+ */
73
+ export const instanceID: ProxyConstructor;
@@ -1,3 +1,39 @@
1
1
  // AUTO-GENERATED by tools/build/build-typestubs.mjs — do not edit.
2
- // Re-exports the real declarations from @cldmv/slothlet-types (install it for TypeScript support).
3
- export * from "@cldmv/slothlet-types/runtime/live";
2
+ // Self-contained copy: this subpath is internal and not published by @cldmv/slothlet-types.
3
+ /**
4
+ * Live binding to the current API (self-reference)
5
+ * @type {Proxy}
6
+ * @public
7
+ *
8
+ * @description
9
+ * A proxy that provides direct access to the current instance's API.
10
+ * In live mode, this directly references the active instance without AsyncLocalStorage.
11
+ *
12
+ * @example
13
+ * import { self } from "@cldmv/slothlet/runtime/live";
14
+ *
15
+ * export function callOtherFunction() {
16
+ * return self.otherFunction();
17
+ * }
18
+ */
19
+ export const self: ProxyConstructor;
20
+ /**
21
+ * User-provided context object
22
+ * @type {Proxy}
23
+ * @public
24
+ *
25
+ * @description
26
+ * A proxy that provides access to user-provided context data.
27
+ * In live mode, this directly accesses the current instance's context.
28
+ *
29
+ * @example
30
+ * import { context } from "@cldmv/slothlet/runtime/live";
31
+ *
32
+ * export function getUserInfo() {
33
+ * return {
34
+ * userId: context.userId,
35
+ * userName: context.userName
36
+ * };
37
+ * }
38
+ */
39
+ export const context: ProxyConstructor;