@primafuture/contrib-kit-react 1.0.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 (128) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +294 -0
  3. package/dist/contribution-component.d.ts +82 -0
  4. package/dist/contribution-component.d.ts.map +1 -0
  5. package/dist/contribution-component.js +12 -0
  6. package/dist/contribution-component.js.map +1 -0
  7. package/dist/extension-outlet.d.ts +155 -0
  8. package/dist/extension-outlet.d.ts.map +1 -0
  9. package/dist/extension-outlet.js +229 -0
  10. package/dist/extension-outlet.js.map +1 -0
  11. package/dist/extension-registry-provider.d.ts +26 -0
  12. package/dist/extension-registry-provider.d.ts.map +1 -0
  13. package/dist/extension-registry-provider.js +82 -0
  14. package/dist/extension-registry-provider.js.map +1 -0
  15. package/dist/index.d.ts +22 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +14 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/internal/adapter-configuration.d.ts +54 -0
  20. package/dist/internal/adapter-configuration.d.ts.map +1 -0
  21. package/dist/internal/adapter-configuration.js +89 -0
  22. package/dist/internal/adapter-configuration.js.map +1 -0
  23. package/dist/internal/adapter-context.d.ts +24 -0
  24. package/dist/internal/adapter-context.d.ts.map +1 -0
  25. package/dist/internal/adapter-context.js +23 -0
  26. package/dist/internal/adapter-context.js.map +1 -0
  27. package/dist/internal/adapter-registry-bridge.d.ts +58 -0
  28. package/dist/internal/adapter-registry-bridge.d.ts.map +1 -0
  29. package/dist/internal/adapter-registry-bridge.js +494 -0
  30. package/dist/internal/adapter-registry-bridge.js.map +1 -0
  31. package/dist/internal/adapter-registry-protocol.d.ts +53 -0
  32. package/dist/internal/adapter-registry-protocol.d.ts.map +1 -0
  33. package/dist/internal/adapter-registry-protocol.js +182 -0
  34. package/dist/internal/adapter-registry-protocol.js.map +1 -0
  35. package/dist/internal/adapter-scope.d.ts +87 -0
  36. package/dist/internal/adapter-scope.d.ts.map +1 -0
  37. package/dist/internal/adapter-scope.js +346 -0
  38. package/dist/internal/adapter-scope.js.map +1 -0
  39. package/dist/internal/implementation-classifier.d.ts +21 -0
  40. package/dist/internal/implementation-classifier.d.ts.map +1 -0
  41. package/dist/internal/implementation-classifier.js +39 -0
  42. package/dist/internal/implementation-classifier.js.map +1 -0
  43. package/dist/internal/managed-lazy-generation.d.ts +100 -0
  44. package/dist/internal/managed-lazy-generation.d.ts.map +1 -0
  45. package/dist/internal/managed-lazy-generation.js +419 -0
  46. package/dist/internal/managed-lazy-generation.js.map +1 -0
  47. package/dist/internal/outlet-commit-lease.d.ts +46 -0
  48. package/dist/internal/outlet-commit-lease.d.ts.map +1 -0
  49. package/dist/internal/outlet-commit-lease.js +137 -0
  50. package/dist/internal/outlet-commit-lease.js.map +1 -0
  51. package/dist/internal/outlet-error-pipeline.d.ts +122 -0
  52. package/dist/internal/outlet-error-pipeline.d.ts.map +1 -0
  53. package/dist/internal/outlet-error-pipeline.js +214 -0
  54. package/dist/internal/outlet-error-pipeline.js.map +1 -0
  55. package/dist/internal/outlet-input.d.ts +42 -0
  56. package/dist/internal/outlet-input.d.ts.map +1 -0
  57. package/dist/internal/outlet-input.js +86 -0
  58. package/dist/internal/outlet-input.js.map +1 -0
  59. package/dist/internal/outlet-membership-boundary.d.ts +93 -0
  60. package/dist/internal/outlet-membership-boundary.d.ts.map +1 -0
  61. package/dist/internal/outlet-membership-boundary.js +710 -0
  62. package/dist/internal/outlet-membership-boundary.js.map +1 -0
  63. package/dist/internal/outlet-membership.d.ts +31 -0
  64. package/dist/internal/outlet-membership.d.ts.map +1 -0
  65. package/dist/internal/outlet-membership.js +65 -0
  66. package/dist/internal/outlet-membership.js.map +1 -0
  67. package/dist/internal/outlet-projection.d.ts +102 -0
  68. package/dist/internal/outlet-projection.d.ts.map +1 -0
  69. package/dist/internal/outlet-projection.js +228 -0
  70. package/dist/internal/outlet-projection.js.map +1 -0
  71. package/dist/internal/outlet-reporter-boundary.d.ts +42 -0
  72. package/dist/internal/outlet-reporter-boundary.d.ts.map +1 -0
  73. package/dist/internal/outlet-reporter-boundary.js +57 -0
  74. package/dist/internal/outlet-reporter-boundary.js.map +1 -0
  75. package/dist/internal/public-input-capture.d.ts +13 -0
  76. package/dist/internal/public-input-capture.d.ts.map +1 -0
  77. package/dist/internal/public-input-capture.js +34 -0
  78. package/dist/internal/public-input-capture.js.map +1 -0
  79. package/dist/internal/resolved-contributions-query.d.ts +42 -0
  80. package/dist/internal/resolved-contributions-query.d.ts.map +1 -0
  81. package/dist/internal/resolved-contributions-query.js +203 -0
  82. package/dist/internal/resolved-contributions-query.js.map +1 -0
  83. package/dist/react-adapter-diagnostics.d.ts +199 -0
  84. package/dist/react-adapter-diagnostics.d.ts.map +1 -0
  85. package/dist/react-adapter-diagnostics.js +257 -0
  86. package/dist/react-adapter-diagnostics.js.map +1 -0
  87. package/dist/react-adapter-error.d.ts +35 -0
  88. package/dist/react-adapter-error.d.ts.map +1 -0
  89. package/dist/react-adapter-error.js +37 -0
  90. package/dist/react-adapter-error.js.map +1 -0
  91. package/dist/react-extension-point.d.ts +26 -0
  92. package/dist/react-extension-point.d.ts.map +1 -0
  93. package/dist/react-extension-point.js +100 -0
  94. package/dist/react-extension-point.js.map +1 -0
  95. package/dist/react-lazy-contribution.d.ts +40 -0
  96. package/dist/react-lazy-contribution.d.ts.map +1 -0
  97. package/dist/react-lazy-contribution.js +18 -0
  98. package/dist/react-lazy-contribution.js.map +1 -0
  99. package/dist/resolved-contributions.d.ts +90 -0
  100. package/dist/resolved-contributions.d.ts.map +1 -0
  101. package/dist/resolved-contributions.js +455 -0
  102. package/dist/resolved-contributions.js.map +1 -0
  103. package/package.json +47 -0
  104. package/src/contribution-component.ts +118 -0
  105. package/src/extension-outlet.ts +590 -0
  106. package/src/extension-registry-provider.ts +179 -0
  107. package/src/index.ts +72 -0
  108. package/src/internal/adapter-configuration.ts +181 -0
  109. package/src/internal/adapter-context.ts +43 -0
  110. package/src/internal/adapter-registry-bridge.ts +723 -0
  111. package/src/internal/adapter-registry-protocol.ts +365 -0
  112. package/src/internal/adapter-scope.ts +500 -0
  113. package/src/internal/implementation-classifier.ts +59 -0
  114. package/src/internal/managed-lazy-generation.ts +540 -0
  115. package/src/internal/outlet-commit-lease.ts +216 -0
  116. package/src/internal/outlet-error-pipeline.ts +447 -0
  117. package/src/internal/outlet-input.ts +264 -0
  118. package/src/internal/outlet-membership-boundary.ts +1048 -0
  119. package/src/internal/outlet-membership.ts +125 -0
  120. package/src/internal/outlet-projection.ts +511 -0
  121. package/src/internal/outlet-reporter-boundary.ts +105 -0
  122. package/src/internal/public-input-capture.ts +55 -0
  123. package/src/internal/resolved-contributions-query.ts +318 -0
  124. package/src/react-adapter-diagnostics.ts +457 -0
  125. package/src/react-adapter-error.ts +88 -0
  126. package/src/react-extension-point.ts +181 -0
  127. package/src/react-lazy-contribution.ts +66 -0
  128. package/src/resolved-contributions.ts +895 -0
@@ -0,0 +1,182 @@
1
+ import * as reactAdapterError from "../react-adapter-error.js";
2
+ /** Sdílený checkpoint pro capture bez existující lifecycle autority. */
3
+ export function skipAdapterRegistryProtocolCheckpoint() {
4
+ // Samotná strukturální inspekce nemá adapter scope, který by mohla zneplatnit.
5
+ }
6
+ /**
7
+ * Vytvoří bezpečnou registry chybu bez vložení raw vstupu do detailů.
8
+ */
9
+ function createRegistryProtocolError(code, phase, message, field, cause, preserveCause = false) {
10
+ return new reactAdapterError.ReactAdapterError(code, message, preserveCause
11
+ ? { cause, details: { field, phase } }
12
+ : { details: { field, phase } });
13
+ }
14
+ /**
15
+ * Ověří raw registry eligibility bez přijetí callable objektu jako registry.
16
+ */
17
+ function requireRegistryObject(value) {
18
+ if (typeof value !== "object" || value === null) {
19
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", "Registry must be a non-null object.", "registry");
20
+ }
21
+ return value;
22
+ }
23
+ /**
24
+ * Načte jedno registry protocol pole právě jednou a následně ověří autoritu.
25
+ */
26
+ function readRegistryProperty(registry, property, checkpoint) {
27
+ let value;
28
+ try {
29
+ value = Reflect.get(registry, property, registry);
30
+ }
31
+ catch (cause) {
32
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", `Unable to read registry.${property}.`, `registry.${property}`, cause, true);
33
+ }
34
+ checkpoint();
35
+ return value;
36
+ }
37
+ /**
38
+ * Ověří neprázdnou primitive registry identitu.
39
+ */
40
+ function requireRegistryId(value, field) {
41
+ if (typeof value !== "string" || value.length === 0) {
42
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", "Registry ID must be a non-empty string.", field);
43
+ }
44
+ return value;
45
+ }
46
+ /**
47
+ * Ověří exact public registry state union bez rozhodnutí o dostupnosti.
48
+ */
49
+ function requireRegistryState(value, field) {
50
+ if (value !== "active" && value !== "disposing" && value !== "disposed") {
51
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", "Registry state is invalid.", field);
52
+ }
53
+ return value;
54
+ }
55
+ /**
56
+ * Oddělí validní protocol shape od lifecycle dostupnosti nové práce.
57
+ */
58
+ function requireRegistryAvailability(state, phase) {
59
+ if (state !== "active") {
60
+ throw createRegistryProtocolError("REACT_REGISTRY_UNAVAILABLE", phase, "Registry is not active.", "registry.state");
61
+ }
62
+ return state;
63
+ }
64
+ /**
65
+ * Ověří callability jedné již read-once zachycené public Core metody.
66
+ */
67
+ function requireRegistryMethod(value, field) {
68
+ if (typeof value !== "function") {
69
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", `${field} must be callable.`, field);
70
+ }
71
+ return value;
72
+ }
73
+ /**
74
+ * Zachytí úplný šestipolový registry protocol v normativním pořadí.
75
+ */
76
+ export function captureAdapterRegistryProtocol(value, checkpoint = skipAdapterRegistryProtocolCheckpoint) {
77
+ const rawRegistry = requireRegistryObject(value);
78
+ const registryId = readRegistryProperty(rawRegistry, "registryId", checkpoint);
79
+ const state = readRegistryProperty(rawRegistry, "state", checkpoint);
80
+ const subscribe = readRegistryProperty(rawRegistry, "subscribe", checkpoint);
81
+ const createSnapshot = readRegistryProperty(rawRegistry, "createSnapshot", checkpoint);
82
+ const listContributions = readRegistryProperty(rawRegistry, "listContributions", checkpoint);
83
+ const resolveContributions = readRegistryProperty(rawRegistry, "resolveContributions", checkpoint);
84
+ const validatedRegistryId = requireRegistryId(registryId, "registry.registryId");
85
+ const validatedState = requireRegistryState(state, "registry.state");
86
+ const validatedSubscribe = requireRegistryMethod(subscribe, "registry.subscribe");
87
+ const validatedCreateSnapshot = requireRegistryMethod(createSnapshot, "registry.createSnapshot");
88
+ const validatedListContributions = requireRegistryMethod(listContributions, "registry.listContributions");
89
+ const validatedResolveContributions = requireRegistryMethod(resolveContributions, "registry.resolveContributions");
90
+ const activeState = requireRegistryAvailability(validatedState, "resolve");
91
+ return Object.freeze({
92
+ rawRegistry,
93
+ registryId: validatedRegistryId,
94
+ initialState: activeState,
95
+ subscribe: validatedSubscribe,
96
+ createSnapshot: validatedCreateSnapshot,
97
+ listContributions: validatedListContributions,
98
+ resolveContributions: validatedResolveContributions,
99
+ });
100
+ }
101
+ /**
102
+ * Ověří jediný live state read existujícího protocol snapshotu.
103
+ */
104
+ export function requireAdapterRegistryAvailable(protocol, phase, checkpoint = skipAdapterRegistryProtocolCheckpoint) {
105
+ const state = readRegistryProperty(protocol.rawRegistry, "state", checkpoint);
106
+ return requireRegistryAvailability(requireRegistryState(state, "registry.state"), phase);
107
+ }
108
+ /**
109
+ * Načte jedno pole public Core snapshotu právě jednou se zachovaným receiverem.
110
+ */
111
+ function readSnapshotProperty(snapshot, property, checkpoint) {
112
+ let value;
113
+ try {
114
+ value = Reflect.get(snapshot, property, snapshot);
115
+ }
116
+ catch (cause) {
117
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", `Unable to read registry snapshot ${property}.`, `registry.createSnapshot().${property}`, cause, true);
118
+ }
119
+ checkpoint();
120
+ return value;
121
+ }
122
+ /**
123
+ * Ověří public Core snapshot objekt bez čtení dalších nebo neznámých polí.
124
+ */
125
+ function requireSnapshotObject(value) {
126
+ if (typeof value !== "object" || value === null) {
127
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", "Registry snapshot must be a non-null object.", "registry.createSnapshot()");
128
+ }
129
+ return value;
130
+ }
131
+ /**
132
+ * Ověří revision použitelnou jako stabilní external-store version.
133
+ */
134
+ function requireSnapshotRevision(value) {
135
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) {
136
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", "Registry snapshot revision must be a non-negative safe integer.", "registry.createSnapshot().revision");
137
+ }
138
+ return value;
139
+ }
140
+ /**
141
+ * Vytvoří cache-safe primitive pre-subscribe token z public Core snapshotu.
142
+ */
143
+ export function createAdapterRegistrySnapshotToken(protocol, checkpoint = skipAdapterRegistryProtocolCheckpoint) {
144
+ let candidate;
145
+ try {
146
+ candidate = Reflect.apply(protocol.createSnapshot, protocol.rawRegistry, []);
147
+ }
148
+ catch (cause) {
149
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", "Registry snapshot creation failed.", "registry.createSnapshot", cause, true);
150
+ }
151
+ checkpoint();
152
+ const snapshot = requireSnapshotObject(candidate);
153
+ const registryId = readSnapshotProperty(snapshot, "registryId", checkpoint);
154
+ const state = readSnapshotProperty(snapshot, "state", checkpoint);
155
+ const revision = readSnapshotProperty(snapshot, "revision", checkpoint);
156
+ const validatedRegistryId = requireRegistryId(registryId, "registry.createSnapshot().registryId");
157
+ const validatedState = requireRegistryState(state, "registry.createSnapshot().state");
158
+ const validatedRevision = requireSnapshotRevision(revision);
159
+ if (validatedRegistryId !== protocol.registryId) {
160
+ throw createRegistryProtocolError("REACT_REGISTRY_INVALID", "configuration", "Registry snapshot ID does not match the captured registry.", "registry.createSnapshot().registryId");
161
+ }
162
+ return `${validatedState}:${validatedRevision}`;
163
+ }
164
+ /**
165
+ * Zavolá zachycenou subscriber metodu s původní raw registry jako receiverem.
166
+ */
167
+ export function subscribeAdapterRegistry(protocol, listener) {
168
+ return Reflect.apply(protocol.subscribe, protocol.rawRegistry, [listener]);
169
+ }
170
+ /**
171
+ * Zavolá zachycený katalogový read s původní raw registry jako receiverem.
172
+ */
173
+ export function listAdapterRegistryContributions(protocol, point) {
174
+ return Reflect.apply(protocol.listContributions, protocol.rawRegistry, [point]);
175
+ }
176
+ /**
177
+ * Zavolá zachycený resolved-view read s původní raw registry jako receiverem.
178
+ */
179
+ export function resolveAdapterRegistryContributions(protocol, point, context) {
180
+ return Reflect.apply(protocol.resolveContributions, protocol.rawRegistry, [point, context]);
181
+ }
182
+ //# sourceMappingURL=adapter-registry-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-registry-protocol.js","sourceRoot":"","sources":["../../src/internal/adapter-registry-protocol.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,iBAAiB,MAAM,2BAA2B,CAAC;AA+B/D,wEAAwE;AACxE,MAAM,UAAU,qCAAqC;IACpD,+EAA+E;AAChF,CAAC;AAED;;GAEG;AACH,SAAS,2BAA2B,CACnC,IAA6D,EAC7D,KAAyD,EACzD,OAAe,EACf,KAAa,EACb,KAAe,EACf,aAAa,GAAG,KAAK;IAErB,OAAO,IAAI,iBAAiB,CAAC,iBAAiB,CAC7C,IAAI,EACJ,OAAO,EACP,aAAa;QACZ,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QACtC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAChC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,KAAc;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACjD,MAAM,2BAA2B,CAChC,wBAAwB,EACxB,eAAe,EACf,qCAAqC,EACrC,UAAU,CACV,CAAC;IACH,CAAC;I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,mBAAmB,GAAG,iBAAiB,CAC5C,UAAU,EACV,sCAAsC,CACtC,CAAC;IACF,MAAM,cAAc,GAAG,oBAAoB,CAC1C,KAAK,EACL,iCAAiC,CACjC,CAAC;IACF,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAE5D,IAAI,mBAAmB,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjD,MAAM,2BAA2B,CAChC,wBAAwB,EACxB,eAAe,EACf,4DAA4D,EAC5D,sCAAsC,CACtC,CAAC;IACH,CAAC;IAED,OAAO,GAAG,cAAc,IAAI,iBAAiB,EAAE,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACvC,QAAyC,EACzC,QAA2C;IAE3C,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAG/C,QAAyC,EACzC,KAAY;IAEZ,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACjF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mCAAmC,CAGlD,QAAyC,EACzC,KAAY,EACZ,OAAoD;IAEpD,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC"}
@@ -0,0 +1,87 @@
1
+ import type * as contribKitCore from "@primafuture/contrib-kit-core";
2
+ import * as adapterConfiguration from "./adapter-configuration.js";
3
+ import * as adapterRegistryBridge from "./adapter-registry-bridge.js";
4
+ import * as adapterRegistryProtocol from "./adapter-registry-protocol.js";
5
+ import * as outletCommitLease from "./outlet-commit-lease.js";
6
+ import * as reactAdapterError from "../react-adapter-error.js";
7
+ /** Deterministický microtask seam používaný lifecycle grace periodou. */
8
+ export type AdapterScopeMicrotaskScheduler = (callback: () => void) => void;
9
+ /** Best-effort seam pro interní lifecycle diagnostiku. */
10
+ export type AdapterScopeLifecycleReporter = (error: reactAdapterError.ReactAdapterError) => void;
11
+ /** Idempotentní fyzický cleanup spuštěný až po zneplatnění celé scope epochy. */
12
+ export type AdapterScopeAbortDispatch = () => void;
13
+ /** Synchronní invalidace jednoho epoch-owned abortable resource. */
14
+ export type AdapterScopeAbortableInvalidation = () => AdapterScopeAbortDispatch;
15
+ /** Pure konfigurace jedné provider generation bez resource ownershipu. */
16
+ export interface AdapterScopeGeneration {
17
+ /** Default registry protocol provideru; explicitní hook registry jej nepřepisuje. */
18
+ readonly defaultProtocol: adapterRegistryProtocol.AdapterRegistryProtocolSnapshot;
19
+ /** Efektivní nearest-provider konfigurace všech tří nezávislých os. */
20
+ readonly configuration: adapterConfiguration.AdapterScopeConfiguration;
21
+ }
22
+ /** Interní external-store kontrakt připravený pro budoucí React hook. */
23
+ export interface AdapterExternalStoreBinding {
24
+ /** Commit-time acquire point consumer membership. */
25
+ readonly subscribe: (listener: adapterRegistryBridge.AdapterExternalStoreListener) => contribKitCore.Unsubscribe;
26
+ /** Pure client snapshot selector bez resource creation. */
27
+ readonly getSnapshot: () => adapterRegistryBridge.AdapterExternalStoreSnapshot;
28
+ /** Package-constant server/hydration snapshot selector. */
29
+ readonly getServerSnapshot: () => typeof adapterRegistryBridge.ADAPTER_SERVER_SNAPSHOT;
30
+ /** První bridge fault pro budoucí render-time error projection. */
31
+ readonly readFault: () => reactAdapterError.ReactAdapterError | undefined;
32
+ /** Poslední známý committed registry lifecycle stav. */
33
+ readonly readRegistryState: () => contribKitCore.ExtensionRegistryState;
34
+ }
35
+ /** Volitelné interní host seams bez veřejného package kontraktu. */
36
+ export interface AdapterScopeRuntimeOptions {
37
+ /** Vlastní deterministický scheduler pro lifecycle testy. */
38
+ readonly scheduleMicrotask?: AdapterScopeMicrotaskScheduler;
39
+ /** Bezpečný lifecycle reporter; jeho failure se vždy pohltí. */
40
+ readonly reportLifecycleFailure?: AdapterScopeLifecycleReporter;
41
+ }
42
+ /**
43
+ * Pure factory provider generation; resource vzniká až committed acquire cestou.
44
+ */
45
+ export declare function createAdapterScopeGeneration(defaultProtocol: adapterRegistryProtocol.AdapterRegistryProtocolSnapshot, configuration: adapterConfiguration.AdapterScopeConfiguration): AdapterScopeGeneration;
46
+ /**
47
+ * Porovná generation podle raw host capabilities, nikoli nových wrapper referencí.
48
+ */
49
+ export declare function isSameAdapterScopeGeneration(left: AdapterScopeGeneration, right: AdapterScopeGeneration): boolean;
50
+ /**
51
+ * Stabilní provider-scope identity s oddělenými, monotonickými resource epochami.
52
+ */
53
+ export declare class AdapterScopeRuntime {
54
+ #private;
55
+ /** Vytvoří resource-free scope; žádný Core read ani subscribe zde nevzniká. */
56
+ constructor(options?: AdapterScopeRuntimeOptions);
57
+ /** Vrátí current monotonické číslo pouze pro deterministickou interní evidenci. */
58
+ readCurrentEpoch(): number | undefined;
59
+ /** Vrátí current pure provider generation bez její aktivace. */
60
+ readCurrentGeneration(): AdapterScopeGeneration | undefined;
61
+ /** Ověří, že přesná generation právě vlastní aktivní committed epochu. */
62
+ isGenerationActive(generation: AdapterScopeGeneration): boolean;
63
+ /** Atomicky přijme první committed diagnostiku jednoho opaque attempt tokenu. */
64
+ claimDiagnosticAttempt(token: object): boolean;
65
+ /** Vrátí počet scope-local owner records pouze pro interní lifecycle důkaz. */
66
+ readRetainedCommitOwnerCount(): number;
67
+ /**
68
+ * Commit-time acquire outlet nebo boundary identity v exact current epoše.
69
+ */
70
+ acquireCommitLease(generation: AdapterScopeGeneration, kind: outletCommitLease.OutletCommitOwnerKind, token: object): outletCommitLease.OutletCommitLease;
71
+ /**
72
+ * Commit-time owner acquire. Strict reacquire stejné generation zachová epochu.
73
+ */
74
+ acquireOwner(generation: AdapterScopeGeneration): contribKitCore.Unsubscribe;
75
+ /**
76
+ * Připojí committed abortable resource k právě existující scope epoše.
77
+ *
78
+ * Registrace nikdy neaktivuje novou epochu. Pokud owning epocha již zmizela,
79
+ * resource se okamžitě zneplatní a uklidí bez možnosti pozdějšího startu.
80
+ */
81
+ registerEpochAbortable(generation: AdapterScopeGeneration, invalidate: AdapterScopeAbortableInvalidation): contribKitCore.Unsubscribe;
82
+ /**
83
+ * Vytvoří pure external-store closures; žádný bridge ani cell zatím nevzniká.
84
+ */
85
+ createExternalStore(generation: AdapterScopeGeneration, protocol: adapterRegistryProtocol.AdapterRegistryProtocolSnapshot, point: contribKitCore.AnyExtensionPoint): AdapterExternalStoreBinding;
86
+ }
87
+ //# sourceMappingURL=adapter-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-scope.d.ts","sourceRoot":"","sources":["../../src/internal/adapter-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,oBAAoB,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,qBAAqB,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,uBAAuB,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,iBAAiB,MAAM,2BAA2B,CAAC;AAE/D,yEAAyE;AACzE,MAAM,MAAM,8BAA8B,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;AAE5E,0DAA0D;AAC1D,MAAM,MAAM,6BAA6B,GAAG,CAC3C,KAAK,EAAE,iBAAiB,CAAC,iBAAiB,KACtC,IAAI,CAAC;AAEV,iFAAiF;AACjF,MAAM,MAAM,yBAAyB,GAAG,MAAM,IAAI,CAAC;AAEnD,oEAAoE;AACpE,MAAM,MAAM,iCAAiC,GAAG,MAAM,yBAAyB,CAAC;AAEhF,0EAA0E;AAC1E,MAAM,W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AAgB,IAAI,MAAM,GAAG,SAAS,CAE5C;IAED,gEAAgE;IACzD,qBAAqB,IAAI,sBAAsB,GAAG,SAAS,CAEjE;IAED,0EAA0E;IACnE,kBAAkB,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO,CAKrE;IAED,iFAAiF;IAC1E,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMpD;IAED,+EAA+E;IACxE,4BAA4B,IAAI,MAAM,CAE5C;IAED;;OAEG;IACI,kBAAkB,CACxB,UAAU,EAAE,sBAAsB,EAClC,IAAI,EAAE,iBAAiB,CAAC,qBAAqB,EAC7C,KAAK,EAAE,MAAM,GACX,iBAAiB,CAAC,iBAAiB,CAarC;IAED;;OAEG;IACI,YAAY,CAAC,UAAU,EAAE,sBAAsB,GAAG,cAAc,CAAC,WAAW,CAkBlF;IAED;;;;;OAKG;IACI,sBAAsB,CAC5B,UAAU,EAAE,sBAAsB,EAClC,UAAU,EAAE,iCAAiC,GAC3C,cAAc,CAAC,WAAW,CAuB5B;IAED;;OAEG;IACI,mBAAmB,CACzB,UAAU,EAAE,sBAAsB,EAClC,QAAQ,EAAE,uBAAuB,CAAC,+BAA+B,EACjE,KAAK,EAAE,cAAc,CAAC,iBAAiB,GACrC,2BAA2B,CA6C7B;CAsLD"}
@@ -0,0 +1,346 @@
1
+ import * as adapterConfiguration from "./adapter-configuration.js";
2
+ import * as adapterRegistryBridge from "./adapter-registry-bridge.js";
3
+ import * as adapterRegistryProtocol from "./adapter-registry-protocol.js";
4
+ import * as outletCommitLease from "./outlet-commit-lease.js";
5
+ import * as reactAdapterError from "../react-adapter-error.js";
6
+ /**
7
+ * Použije platformní microtask bez importu Node nebo DOM ambient API.
8
+ */
9
+ function schedulePlatformMicrotask(callback) {
10
+ queueMicrotask(callback);
11
+ }
12
+ /**
13
+ * Vytvoří stabilní lifecycle chybu bez raw registry nebo config callbacků.
14
+ */
15
+ function createStaleScopeError() {
16
+ return new reactAdapterError.ReactAdapterError("REACT_ADAPTER_DISPOSED", "The React adapter scope epoch is no longer active.", { details: { field: "scope.epoch", phase: "lifecycle" } });
17
+ }
18
+ /**
19
+ * Pure factory provider generation; resource vzniká až committed acquire cestou.
20
+ */
21
+ export function createAdapterScopeGeneration(defaultProtocol, configuration) {
22
+ return Object.freeze({ defaultProtocol, configuration });
23
+ }
24
+ /**
25
+ * Porovná generation podle raw host capabilities, nikoli nových wrapper referencí.
26
+ */
27
+ export function isSameAdapterScopeGeneration(left, right) {
28
+ return left.defaultProtocol.rawRegistry === right.defaultProtocol.rawRegistry
29
+ && left.defaultProtocol.registryId === right.defaultProtocol.registryId
30
+ && adapterConfiguration.isSameAdapterScopeConfiguration(left.configuration, right.configuration);
31
+ }
32
+ /**
33
+ * Stabilní provider-scope identity s oddělenými, monotonickými resource epochami.
34
+ */
35
+ export class AdapterScopeRuntime {
36
+ /** Read-once scheduler používaný všemi epochami scope. */
37
+ #scheduleMicrotask;
38
+ /** Read-once best-effort lifecycle reporter. */
39
+ #reportLifecycleFailure;
40
+ /** Poslední monotonická epoch identity. */
41
+ #nextEpoch = 0;
42
+ /** Právě aktivní nebo Strict-grace resource epocha. */
43
+ #currentEpoch;
44
+ /** Opaque committed attempty již doručené diagnostickému sinku. */
45
+ #reportedDiagnosticAttempts = new WeakSet();
46
+ /** Scope-local committed owner identities bez process-global historie. */
47
+ #commitLeases;
48
+ /** Vytvoří resource-free scope; žádný Core read ani subscribe zde nevzniká. */
49
+ constructor(options = {}) {
50
+ this.#scheduleMicrotask = options.scheduleMicrotask ?? schedulePlatformMicrotask;
51
+ this.#reportLifecycleFailure = options.reportLifecycleFailure;
52
+ this.#commitLeases = new outletCommitLease.OutletCommitLeaseRegistry((callback) => {
53
+ this.#schedule(callback);
54
+ });
55
+ }
56
+ /** Vrátí current monotonické číslo pouze pro deterministickou interní evidenci. */
57
+ readCurrentEpoch() {
58
+ return this.#currentEpoch?.epoch;
59
+ }
60
+ /** Vrátí current pure provider generation bez její aktivace. */
61
+ readCurrentGeneration() {
62
+ return this.#currentEpoch?.generation;
63
+ }
64
+ /** Ověří, že přesná generation právě vlastní aktivní committed epochu. */
65
+ isGenerationActive(generation) {
66
+ const current = this.#currentEpoch;
67
+ return current !== undefined
68
+ && current.state === "active"
69
+ && isSameAdapterScopeGeneration(current.generation, generation);
70
+ }
71
+ /** Atomicky přijme první committed diagnostiku jednoho opaque attempt tokenu. */
72
+ claimDiagnosticAttempt(token) {
73
+ if (this.#reportedDiagnosticAttempts.has(token)) {
74
+ return false;
75
+ }
76
+ this.#reportedDiagnosticAttempts.add(token);
77
+ return true;
78
+ }
79
+ /** Vrátí počet scope-local owner records pouze pro interní lifecycle důkaz. */
80
+ readRetainedCommitOwnerCount() {
81
+ return this.#commitLeases.readRetainedOwnerCount();
82
+ }
83
+ /**
84
+ * Commit-time acquire outlet nebo boundary identity v exact current epoše.
85
+ */
86
+ acquireCommitLease(generation, kind, token) {
87
+ const epoch = this.#acquireEpoch(generation);
88
+ return this.#commitLeases.acquire(epoch.epoch, kind, token, (epochNumber) => {
89
+ return this.#currentEpoch === epoch
90
+ && epoch.epoch === epochNumber
91
+ && epoch.state === "active"
92
+ && isSameAdapterScopeGeneration(epoch.generation, generation);
93
+ });
94
+ }
95
+ /**
96
+ * Commit-time owner acquire. Strict reacquire stejné generation zachová epochu.
97
+ */
98
+ acquireOwner(generation) {
99
+ const epoch = this.#acquireEpoch(generation);
100
+ epoch.ownerCount += 1;
101
+ let active = true;
102
+ const scope = this;
103
+ /** Idempotentně uvolní právě jednu provider owner lease. */
104
+ function releaseOwner() {
105
+ if (!active) {
106
+ return;
107
+ }
108
+ active = false;
109
+ epoch.ownerCount -= 1;
110
+ if (epoch.ownerCount === 0 && scope.#currentEpoch === epoch) {
111
+ scope.#beginEpochGrace(epoch);
112
+ }
113
+ }
114
+ return releaseOwner;
115
+ }
116
+ /**
117
+ * Připojí committed abortable resource k právě existující scope epoše.
118
+ *
119
+ * Registrace nikdy neaktivuje novou epochu. Pokud owning epocha již zmizela,
120
+ * resource se okamžitě zneplatní a uklidí bez možnosti pozdějšího startu.
121
+ */
122
+ registerEpochAbortable(generation, invalidate) {
123
+ const epoch = this.#currentEpoch;
124
+ if (epoch === undefined
125
+ || epoch.state === "retired"
126
+ || !isSameAdapterScopeGeneration(epoch.generation, generation)) {
127
+ this.#runAbortDispatch(this.#callAbortableInvalidation(invalidate));
128
+ return () => { };
129
+ }
130
+ const owningEpoch = epoch;
131
+ const record = { active: true, invalidate };
132
+ owningEpoch.abortables.add(record);
133
+ let attached = true;
134
+ /** Odpojí settled nebo lokálně invalidovaný resource bez druhého cleanupu. */
135
+ function unregisterEpochAbortable() {
136
+ if (!attached) {
137
+ return;
138
+ }
139
+ attached = false;
140
+ record.active = false;
141
+ owningEpoch.abortables.delete(record);
142
+ }
143
+ return unregisterEpochAbortable;
144
+ }
145
+ /**
146
+ * Vytvoří pure external-store closures; žádný bridge ani cell zatím nevzniká.
147
+ */
148
+ createExternalStore(generation, protocol, point) {
149
+ const scope = this;
150
+ /** Najde bridge pouze v exact current generation bez cache mutace. */
151
+ function peekBridge() {
152
+ const epoch = scope.#currentEpoch;
153
+ if (epoch === undefined
154
+ || epoch.state === "retired"
155
+ || !isSameAdapterScopeGeneration(epoch.generation, generation)) {
156
+ return undefined;
157
+ }
158
+ return epoch.bridges.get(protocol.rawRegistry);
159
+ }
160
+ return Object.freeze({
161
+ /** Commit-time scope a bridge acquire. */
162
+ subscribe(listener) {
163
+ if (typeof listener !== "function") {
164
+ throw new reactAdapterError.ReactAdapterError("REACT_INVALID_ARGUMENT", "External-store listener must be callable.", { details: { field: "listener", phase: "lifecycle" } });
165
+ }
166
+ const epoch = scope.#acquireEpoch(generation);
167
+ const bridge = scope.#getOrCreateBridge(epoch, protocol);
168
+ return bridge.subscribe(point, listener);
169
+ },
170
+ /** Pure committed-cell lookup s global pre-subscribe fallbackem. */
171
+ getSnapshot() {
172
+ const token = peekBridge()?.peekSnapshot(point);
173
+ return token ?? adapterRegistryProtocol.createAdapterRegistrySnapshotToken(protocol);
174
+ },
175
+ /** Constant SSR/hydration sentinel bez request-local dat. */
176
+ getServerSnapshot() {
177
+ return adapterRegistryBridge.ADAPTER_SERVER_SNAPSHOT;
178
+ },
179
+ /** Pure fault lookup pro budoucí hook error mapping. */
180
+ readFault() {
181
+ return peekBridge()?.readFault();
182
+ },
183
+ /** Pure committed bridge state nebo initial protocol stav. */
184
+ readRegistryState() {
185
+ return peekBridge()?.readRegistryState() ?? protocol.initialState;
186
+ },
187
+ });
188
+ }
189
+ /** Aktivuje novou epochu nebo zruší Strict grace té current. */
190
+ #acquireEpoch(generation) {
191
+ const current = this.#currentEpoch;
192
+ if (current !== undefined
193
+ && current.state !== "retired"
194
+ && isSameAdapterScopeGeneration(current.generation, generation)) {
195
+ if (current.state === "grace") {
196
+ current.finalizeToken += 1;
197
+ current.state = "active";
198
+ for (const bridge of current.bridges.values()) {
199
+ bridge.reactivateEpoch();
200
+ }
201
+ }
202
+ return current;
203
+ }
204
+ if (current !== undefined && current.state !== "retired") {
205
+ this.#retireEpoch(current);
206
+ }
207
+ this.#nextEpoch += 1;
208
+ const created = {
209
+ epoch: this.#nextEpoch,
210
+ generation,
211
+ bridges: new Map(),
212
+ abortables: new Set(),
213
+ ownerCount: 0,
214
+ state: "active",
215
+ finalizeToken: 0,
216
+ };
217
+ this.#currentEpoch = created;
218
+ return created;
219
+ }
220
+ /** Vytvoří nejvýše jeden bridge pro exact epoch + raw registry dvojici. */
221
+ #getOrCreateBridge(epoch, protocol) {
222
+ const existing = epoch.bridges.get(protocol.rawRegistry);
223
+ if (existing !== undefined) {
224
+ return existing;
225
+ }
226
+ let created;
227
+ created = new adapterRegistryBridge.AdapterRegistryBridge(protocol, {
228
+ checkpoint: () => {
229
+ if (this.#currentEpoch !== epoch || epoch.state !== "active") {
230
+ throw createStaleScopeError();
231
+ }
232
+ },
233
+ canFinalizeDetach: () => {
234
+ return this.#currentEpoch === epoch && epoch.state === "active";
235
+ },
236
+ scheduleMicrotask: this.#scheduleMicrotask,
237
+ reportLifecycleFailure: (error) => {
238
+ this.#reportFailure(error);
239
+ },
240
+ onDetached: (bridge) => {
241
+ if (epoch.bridges.get(protocol.rawRegistry) === bridge) {
242
+ epoch.bridges.delete(protocol.rawRegistry);
243
+ }
244
+ },
245
+ });
246
+ epoch.bridges.set(protocol.rawRegistry, created);
247
+ return created;
248
+ }
249
+ /** Synchronně invaliduje epochu a poté naplánuje Strict-grace finalitu. */
250
+ #beginEpochGrace(epoch) {
251
+ if (epoch.state !== "active") {
252
+ return;
253
+ }
254
+ epoch.state = "grace";
255
+ epoch.finalizeToken += 1;
256
+ const token = epoch.finalizeToken;
257
+ this.#commitLeases.invalidateEpoch(epoch.epoch);
258
+ for (const bridge of epoch.bridges.values()) {
259
+ bridge.prepareEpochDeactivation();
260
+ }
261
+ this.#schedule(() => {
262
+ if (this.#currentEpoch !== epoch
263
+ || epoch.state !== "grace"
264
+ || token !== epoch.finalizeToken) {
265
+ return;
266
+ }
267
+ this.#retireEpoch(epoch);
268
+ });
269
+ }
270
+ /** Terminálně označí epochu stale před prvním fyzickým unsubscribe. */
271
+ #retireEpoch(epoch) {
272
+ if (epoch.state === "retired") {
273
+ return;
274
+ }
275
+ epoch.state = "retired";
276
+ epoch.finalizeToken += 1;
277
+ if (this.#currentEpoch === epoch) {
278
+ this.#currentEpoch = undefined;
279
+ }
280
+ this.#commitLeases.retireEpoch(epoch.epoch);
281
+ const abortDispatches = [];
282
+ for (const record of [...epoch.abortables]) {
283
+ if (!record.active) {
284
+ continue;
285
+ }
286
+ record.active = false;
287
+ abortDispatches.push(this.#callAbortableInvalidation(record.invalidate));
288
+ }
289
+ epoch.abortables.clear();
290
+ for (const bridge of [...epoch.bridges.values()]) {
291
+ bridge.forceDetach();
292
+ }
293
+ epoch.bridges.clear();
294
+ for (const dispatchAbort of abortDispatches) {
295
+ this.#runAbortDispatch(dispatchAbort);
296
+ }
297
+ }
298
+ /** Izoluje vadný resource invalidator a zachová retirement ostatních resources. */
299
+ #callAbortableInvalidation(invalidate) {
300
+ try {
301
+ return invalidate();
302
+ }
303
+ catch (cause) {
304
+ this.#reportFailure(new reactAdapterError.ReactAdapterError("REACT_CALLBACK_FAILED", "A React adapter lifecycle invalidation callback failed.", {
305
+ cause,
306
+ details: { field: "scope.abortable.invalidate", phase: "lifecycle" },
307
+ }));
308
+ return () => { };
309
+ }
310
+ }
311
+ /** Spustí fyzický abort bez možnosti přepsat scope retirement. */
312
+ #runAbortDispatch(dispatchAbort) {
313
+ try {
314
+ dispatchAbort();
315
+ }
316
+ catch (cause) {
317
+ this.#reportFailure(new reactAdapterError.ReactAdapterError("REACT_CALLBACK_FAILED", "A React adapter lifecycle cleanup callback failed.", {
318
+ cause,
319
+ details: { field: "scope.abortable.dispatch", phase: "lifecycle" },
320
+ }));
321
+ }
322
+ }
323
+ /** Scheduler failure dokončí lifecycle synchronně a pouze diagnostikuje seam. */
324
+ #schedule(callback) {
325
+ try {
326
+ this.#scheduleMicrotask(callback);
327
+ }
328
+ catch (cause) {
329
+ this.#reportFailure(new reactAdapterError.ReactAdapterError("REACT_CALLBACK_FAILED", "Adapter scope microtask scheduler failed.", {
330
+ cause,
331
+ details: { field: "scope.scheduleMicrotask", phase: "lifecycle" },
332
+ }));
333
+ callback();
334
+ }
335
+ }
336
+ /** Reporter failure nikdy neovlivní scope lifecycle. */
337
+ #reportFailure(error) {
338
+ try {
339
+ this.#reportLifecycleFailure?.(error);
340
+ }
341
+ catch {
342
+ // Diagnostic seam nemá lifecycle autoritu.
343
+ }
344
+ }
345
+ }
346
+ //# sourceMappingURL=adapter-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-scope.js","sourceRoot":"","sources":["../../src/internal/adapter-scope.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,qBAAqB,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,uBAAuB,MAAM,gCAA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