@manifesto-ai/sdk 3.4.0 → 3.5.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.
@@ -1,747 +0,0 @@
1
- // src/errors.ts
2
- var ManifestoError = class extends Error {
3
- code;
4
- constructor(code, message, options) {
5
- super(message, options);
6
- this.name = "ManifestoError";
7
- this.code = code;
8
- }
9
- };
10
- var ReservedEffectError = class extends ManifestoError {
11
- effectType;
12
- constructor(effectType) {
13
- super(
14
- "RESERVED_EFFECT",
15
- `Effect type "${effectType}" is reserved and cannot be overridden`
16
- );
17
- this.name = "ReservedEffectError";
18
- this.effectType = effectType;
19
- }
20
- };
21
- var CompileError = class extends ManifestoError {
22
- diagnostics;
23
- constructor(diagnostics, formattedMessage) {
24
- super("COMPILE_ERROR", formattedMessage);
25
- this.name = "CompileError";
26
- this.diagnostics = diagnostics;
27
- }
28
- };
29
- var DisposedError = class extends ManifestoError {
30
- constructor() {
31
- super("DISPOSED", "Cannot use a disposed Manifesto runtime");
32
- this.name = "DisposedError";
33
- }
34
- };
35
- var AlreadyActivatedError = class extends ManifestoError {
36
- constructor() {
37
- super("ALREADY_ACTIVATED", "ComposableManifesto.activate() may only be called once");
38
- this.name = "AlreadyActivatedError";
39
- }
40
- };
41
-
42
- // src/internal.ts
43
- import {
44
- getAvailableActions as queryAvailableActions,
45
- isActionAvailable as queryActionAvailable
46
- } from "@manifesto-ai/core";
47
-
48
- // src/snapshot-projection.ts
49
- var COLLECTION_CONTEXT_ROOTS = /* @__PURE__ */ new Set(["$item", "$index", "$array"]);
50
- function buildSnapshotProjectionPlan(schema) {
51
- const computedFields = schema.computed.fields;
52
- const memo = /* @__PURE__ */ new Map();
53
- function isVisibleComputed(name, visiting) {
54
- const cached = memo.get(name);
55
- if (cached !== void 0) {
56
- return cached;
57
- }
58
- if (visiting.has(name)) {
59
- return false;
60
- }
61
- visiting.add(name);
62
- const field = computedFields[name];
63
- if (!field) {
64
- visiting.delete(name);
65
- memo.set(name, true);
66
- return true;
67
- }
68
- for (const path of collectExprGetPaths(field.expr)) {
69
- if (isPlatformDependency(path)) {
70
- visiting.delete(name);
71
- memo.set(name, false);
72
- return false;
73
- }
74
- const computedDependency = resolveComputedDependency(path, computedFields);
75
- if (computedDependency !== null && !isVisibleComputed(computedDependency, visiting)) {
76
- visiting.delete(name);
77
- memo.set(name, false);
78
- return false;
79
- }
80
- }
81
- visiting.delete(name);
82
- memo.set(name, true);
83
- return true;
84
- }
85
- const visibleComputedKeys = Object.keys(computedFields).filter((name) => isVisibleComputed(name, /* @__PURE__ */ new Set()));
86
- return {
87
- visibleComputedKeys
88
- };
89
- }
90
- function projectCanonicalSnapshot(snapshot, plan) {
91
- return {
92
- data: projectData(snapshot.data),
93
- computed: projectComputed(snapshot.computed, plan),
94
- system: {
95
- status: snapshot.system.status,
96
- lastError: snapshot.system.lastError
97
- },
98
- meta: {
99
- schemaHash: snapshot.meta.schemaHash
100
- }
101
- };
102
- }
103
- function projectEffectContextSnapshot(snapshot, plan) {
104
- return projectCanonicalSnapshot(snapshot, plan);
105
- }
106
- function cloneAndDeepFreeze(value) {
107
- return deepFreeze(structuredClone(value));
108
- }
109
- function projectedSnapshotsEqual(left, right) {
110
- return cycleSafeEqual(left, right);
111
- }
112
- function projectData(data) {
113
- if (data === null || data === void 0) {
114
- return data;
115
- }
116
- if (Array.isArray(data) || typeof data !== "object") {
117
- return structuredClone(data);
118
- }
119
- const projected = {};
120
- for (const [key, value] of Object.entries(data)) {
121
- if (!key.startsWith("$")) {
122
- projected[key] = value;
123
- }
124
- }
125
- return structuredClone(projected);
126
- }
127
- function projectComputed(computed, plan) {
128
- const projected = {};
129
- for (const key of plan.visibleComputedKeys) {
130
- if (Object.prototype.hasOwnProperty.call(computed, key)) {
131
- projected[key] = computed[key];
132
- }
133
- }
134
- return structuredClone(projected);
135
- }
136
- function resolveComputedDependency(dep, computedFields) {
137
- if (Object.prototype.hasOwnProperty.call(computedFields, dep)) {
138
- return dep;
139
- }
140
- if (!dep.startsWith("computed.")) {
141
- return null;
142
- }
143
- const candidate = dep.slice("computed.".length);
144
- return Object.prototype.hasOwnProperty.call(computedFields, candidate) ? candidate : null;
145
- }
146
- function isPlatformDependency(dep) {
147
- const normalized = dep.startsWith("data.") ? dep.slice("data.".length) : dep;
148
- const root = normalized.split(".")[0] ?? "";
149
- if (!root.startsWith("$")) {
150
- return false;
151
- }
152
- return !COLLECTION_CONTEXT_ROOTS.has(root);
153
- }
154
- function collectExprGetPaths(expr) {
155
- const paths = [];
156
- const seen = /* @__PURE__ */ new WeakSet();
157
- const visit = (node) => {
158
- if (node === null || node === void 0) {
159
- return;
160
- }
161
- if (Array.isArray(node)) {
162
- node.forEach(visit);
163
- return;
164
- }
165
- if (typeof node !== "object") {
166
- return;
167
- }
168
- const objectNode = node;
169
- if (seen.has(objectNode)) {
170
- return;
171
- }
172
- seen.add(objectNode);
173
- if (objectNode.kind === "lit") {
174
- return;
175
- }
176
- if (objectNode.kind === "get" && typeof objectNode.path === "string") {
177
- paths.push(objectNode.path);
178
- return;
179
- }
180
- for (const value of Object.values(objectNode)) {
181
- visit(value);
182
- }
183
- };
184
- visit(expr);
185
- return paths;
186
- }
187
- function cycleSafeEqual(left, right) {
188
- return cycleSafeEqualInternal(left, right, /* @__PURE__ */ new WeakMap());
189
- }
190
- function cycleSafeEqualInternal(left, right, seen) {
191
- if (Object.is(left, right)) {
192
- return true;
193
- }
194
- if (typeof left !== typeof right) {
195
- return false;
196
- }
197
- if (left === null || right === null) {
198
- return left === right;
199
- }
200
- if (typeof left !== "object" || typeof right !== "object") {
201
- return false;
202
- }
203
- const leftObject = left;
204
- const rightObject = right;
205
- const leftTag = Object.prototype.toString.call(leftObject);
206
- const rightTag = Object.prototype.toString.call(rightObject);
207
- if (leftTag !== rightTag) {
208
- return false;
209
- }
210
- let seenRight = seen.get(leftObject);
211
- if (seenRight?.has(rightObject)) {
212
- return true;
213
- }
214
- if (!seenRight) {
215
- seenRight = /* @__PURE__ */ new WeakSet();
216
- seen.set(leftObject, seenRight);
217
- }
218
- seenRight.add(rightObject);
219
- if (Array.isArray(leftObject) && Array.isArray(rightObject)) {
220
- if (leftObject.length !== rightObject.length) {
221
- return false;
222
- }
223
- for (let index = 0; index < leftObject.length; index += 1) {
224
- const leftHasValue = Object.prototype.hasOwnProperty.call(leftObject, index);
225
- const rightHasValue = Object.prototype.hasOwnProperty.call(rightObject, index);
226
- if (leftHasValue !== rightHasValue) {
227
- return false;
228
- }
229
- if (leftHasValue && !cycleSafeEqualInternal(leftObject[index], rightObject[index], seen)) {
230
- return false;
231
- }
232
- }
233
- return true;
234
- }
235
- if (leftObject instanceof Date && rightObject instanceof Date) {
236
- return leftObject.getTime() === rightObject.getTime();
237
- }
238
- if (leftObject instanceof RegExp && rightObject instanceof RegExp) {
239
- return leftObject.source === rightObject.source && leftObject.flags === rightObject.flags;
240
- }
241
- if (ArrayBuffer.isView(leftObject) && ArrayBuffer.isView(rightObject)) {
242
- if (leftObject.constructor !== rightObject.constructor) {
243
- return false;
244
- }
245
- if (leftObject.byteLength !== rightObject.byteLength) {
246
- return false;
247
- }
248
- const leftBytes = new Uint8Array(
249
- leftObject.buffer,
250
- leftObject.byteOffset,
251
- leftObject.byteLength
252
- );
253
- const rightBytes = new Uint8Array(
254
- rightObject.buffer,
255
- rightObject.byteOffset,
256
- rightObject.byteLength
257
- );
258
- return leftBytes.every((value, index) => value === rightBytes[index]);
259
- }
260
- if (leftObject instanceof ArrayBuffer && rightObject instanceof ArrayBuffer) {
261
- if (leftObject.byteLength !== rightObject.byteLength) {
262
- return false;
263
- }
264
- const leftBytes = new Uint8Array(leftObject);
265
- const rightBytes = new Uint8Array(rightObject);
266
- return leftBytes.every((value, index) => value === rightBytes[index]);
267
- }
268
- if (leftObject instanceof Map && rightObject instanceof Map) {
269
- if (leftObject.size !== rightObject.size) {
270
- return false;
271
- }
272
- const leftEntries = Array.from(leftObject.entries());
273
- const rightEntries = Array.from(rightObject.entries());
274
- return leftEntries.every(([leftKey, leftValue], index) => {
275
- const rightEntry = rightEntries[index];
276
- if (!rightEntry) {
277
- return false;
278
- }
279
- const [rightKey, rightValue] = rightEntry;
280
- return cycleSafeEqualInternal(leftKey, rightKey, seen) && cycleSafeEqualInternal(leftValue, rightValue, seen);
281
- });
282
- }
283
- if (leftObject instanceof Set && rightObject instanceof Set) {
284
- if (leftObject.size !== rightObject.size) {
285
- return false;
286
- }
287
- const leftValues = Array.from(leftObject.values());
288
- const rightValues = Array.from(rightObject.values());
289
- return leftValues.every((value, index) => cycleSafeEqualInternal(value, rightValues[index], seen));
290
- }
291
- const leftKeys = getComparableObjectKeys(leftObject);
292
- const rightKeys = getComparableObjectKeys(rightObject);
293
- if (leftKeys.length !== rightKeys.length) {
294
- return false;
295
- }
296
- for (let index = 0; index < leftKeys.length; index += 1) {
297
- const leftKey = leftKeys[index];
298
- const rightKey = rightKeys[index];
299
- if (leftKey !== rightKey) {
300
- return false;
301
- }
302
- const leftValue = leftObject[leftKey];
303
- const rightValue = rightObject[rightKey];
304
- if (!cycleSafeEqualInternal(leftValue, rightValue, seen)) {
305
- return false;
306
- }
307
- }
308
- return true;
309
- }
310
- function getComparableObjectKeys(value) {
311
- return Object.keys(value).filter((key) => value[key] !== void 0).sort();
312
- }
313
- function deepFreeze(value, seen = /* @__PURE__ */ new WeakSet()) {
314
- if (value === null || value === void 0 || typeof value !== "object") {
315
- return value;
316
- }
317
- if (isBinaryValue(value)) {
318
- return cloneBinaryValue(value);
319
- }
320
- const objectValue = value;
321
- if (seen.has(objectValue)) {
322
- return value;
323
- }
324
- if (Object.isFrozen(value)) {
325
- return value;
326
- }
327
- seen.add(objectValue);
328
- for (const key of Reflect.ownKeys(objectValue)) {
329
- const child = objectValue[key];
330
- if (isBinaryValue(child)) {
331
- defineReadOnlyBinaryProperty(objectValue, key, child);
332
- continue;
333
- }
334
- deepFreeze(child, seen);
335
- }
336
- return Object.freeze(value);
337
- }
338
- function isBinaryValue(value) {
339
- return value instanceof ArrayBuffer || ArrayBuffer.isView(value);
340
- }
341
- function cloneBinaryValue(value) {
342
- return structuredClone(value);
343
- }
344
- function defineReadOnlyBinaryProperty(target, key, value) {
345
- const descriptor = Object.getOwnPropertyDescriptor(target, key);
346
- if (!descriptor || !("value" in descriptor)) {
347
- return;
348
- }
349
- Object.defineProperty(target, key, {
350
- enumerable: descriptor.enumerable ?? true,
351
- configurable: false,
352
- get() {
353
- return cloneBinaryValue(value);
354
- }
355
- });
356
- }
357
-
358
- // src/internal.ts
359
- var ACTION_PARAM_NAMES = /* @__PURE__ */ Symbol("manifesto-sdk.action-param-names");
360
- var RUNTIME_KERNEL_FACTORY = /* @__PURE__ */ Symbol("manifesto-sdk.runtime-kernel-factory");
361
- var ACTIVATION_STATE = /* @__PURE__ */ Symbol("manifesto-sdk.activation-state");
362
- function attachRuntimeKernelFactory(manifesto, factory, activationState) {
363
- Object.defineProperty(manifesto, RUNTIME_KERNEL_FACTORY, {
364
- enumerable: false,
365
- configurable: false,
366
- writable: false,
367
- value: factory
368
- });
369
- const state = activationState ?? getExistingActivationState(manifesto) ?? {
370
- activated: false
371
- };
372
- if (!getExistingActivationState(manifesto)) {
373
- Object.defineProperty(manifesto, ACTIVATION_STATE, {
374
- enumerable: false,
375
- configurable: false,
376
- writable: false,
377
- value: state
378
- });
379
- }
380
- return manifesto;
381
- }
382
- function getRuntimeKernelFactory(manifesto) {
383
- const internal = manifesto;
384
- const factory = internal[RUNTIME_KERNEL_FACTORY];
385
- if (typeof factory !== "function") {
386
- throw new ManifestoError(
387
- "SCHEMA_ERROR",
388
- "ComposableManifesto is missing its runtime kernel factory"
389
- );
390
- }
391
- return factory;
392
- }
393
- function getActivationState(manifesto) {
394
- const internal = manifesto;
395
- const state = internal[ACTIVATION_STATE];
396
- if (!state) {
397
- throw new ManifestoError(
398
- "SCHEMA_ERROR",
399
- "ComposableManifesto is missing its activation state"
400
- );
401
- }
402
- return state;
403
- }
404
- function assertComposableNotActivated(manifesto) {
405
- if (getActivationState(manifesto).activated) {
406
- throw new AlreadyActivatedError();
407
- }
408
- }
409
- function activateComposable(manifesto) {
410
- const state = getActivationState(manifesto);
411
- if (state.activated) {
412
- throw new AlreadyActivatedError();
413
- }
414
- state.activated = true;
415
- }
416
- function getExistingActivationState(manifesto) {
417
- const internal = manifesto;
418
- return internal[ACTIVATION_STATE] ?? null;
419
- }
420
- function getActionInputFieldNames(input) {
421
- if (!input || input.type !== "object" || !input.fields) {
422
- return [];
423
- }
424
- return Object.keys(input.fields);
425
- }
426
- function createRuntimeKernel({
427
- schema,
428
- projectionPlan,
429
- host,
430
- MEL,
431
- createIntent
432
- }) {
433
- const initialCanonicalSnapshot = host.getSnapshot();
434
- if (!initialCanonicalSnapshot) {
435
- throw new ManifestoError("SCHEMA_ERROR", "Host failed to initialize its genesis snapshot");
436
- }
437
- let visibleCanonicalSnapshot = structuredClone(initialCanonicalSnapshot);
438
- let visibleProjectedSnapshot = cloneAndDeepFreeze(
439
- projectCanonicalSnapshot(
440
- visibleCanonicalSnapshot,
441
- projectionPlan
442
- )
443
- );
444
- let visibleCanonicalReadSnapshot = cloneAndDeepFreeze(
445
- visibleCanonicalSnapshot
446
- );
447
- let dispatchQueue = Promise.resolve();
448
- let disposed = false;
449
- const actionNames = Object.keys(schema.actions);
450
- const actionMetadataByName = Object.freeze(
451
- Object.fromEntries(
452
- actionNames.map((name) => {
453
- const action = schema.actions[name];
454
- const actionRef = MEL.actions[name];
455
- const rawParams = actionRef?.[ACTION_PARAM_NAMES];
456
- const params = Object.freeze(
457
- Array.isArray(rawParams) ? [...rawParams] : getActionInputFieldNames(action.input)
458
- );
459
- return [name, Object.freeze({
460
- name,
461
- params,
462
- input: action.input,
463
- description: action.description
464
- })];
465
- })
466
- )
467
- );
468
- const actionMetadata = Object.freeze(
469
- actionNames.map((name) => actionMetadataByName[name])
470
- );
471
- const subscribers = /* @__PURE__ */ new Set();
472
- const eventListeners = /* @__PURE__ */ new Map();
473
- function subscribe(selector, listener) {
474
- if (disposed) {
475
- return () => {
476
- };
477
- }
478
- let lastValue;
479
- let initialized = false;
480
- try {
481
- lastValue = selector(visibleProjectedSnapshot);
482
- initialized = true;
483
- } catch {
484
- lastValue = void 0;
485
- initialized = false;
486
- }
487
- const subscriber = {
488
- selector,
489
- listener,
490
- lastValue,
491
- initialized
492
- };
493
- subscribers.add(subscriber);
494
- return () => {
495
- subscribers.delete(subscriber);
496
- };
497
- }
498
- function on(event, handler) {
499
- if (disposed) {
500
- return () => {
501
- };
502
- }
503
- let listeners = eventListeners.get(event);
504
- if (!listeners) {
505
- listeners = /* @__PURE__ */ new Set();
506
- eventListeners.set(
507
- event,
508
- listeners
509
- );
510
- }
511
- listeners.add(handler);
512
- return () => {
513
- listeners?.delete(handler);
514
- };
515
- }
516
- function getSnapshot() {
517
- return visibleProjectedSnapshot;
518
- }
519
- function getCanonicalSnapshot() {
520
- return visibleCanonicalReadSnapshot;
521
- }
522
- function getAvailableActions() {
523
- return queryAvailableActions(
524
- schema,
525
- visibleCanonicalSnapshot
526
- );
527
- }
528
- const getActionMetadata = ((name) => {
529
- if (name !== void 0) {
530
- return actionMetadataByName[String(name)];
531
- }
532
- return actionMetadata;
533
- });
534
- function isActionAvailable(name) {
535
- return queryActionAvailable(schema, visibleCanonicalSnapshot, String(name));
536
- }
537
- function dispose() {
538
- if (disposed) {
539
- return;
540
- }
541
- disposed = true;
542
- subscribers.clear();
543
- eventListeners.clear();
544
- }
545
- function setVisibleSnapshot(snapshot, options) {
546
- visibleCanonicalSnapshot = structuredClone(snapshot);
547
- host.reset(structuredClone(visibleCanonicalSnapshot));
548
- visibleCanonicalReadSnapshot = cloneAndDeepFreeze(
549
- visibleCanonicalSnapshot
550
- );
551
- const nextProjectedSnapshot = projectCanonicalSnapshot(
552
- visibleCanonicalSnapshot,
553
- projectionPlan
554
- );
555
- const projectedChanged = !projectedSnapshotsEqual(
556
- nextProjectedSnapshot,
557
- visibleProjectedSnapshot
558
- );
559
- if (projectedChanged) {
560
- visibleProjectedSnapshot = cloneAndDeepFreeze(nextProjectedSnapshot);
561
- }
562
- if (options?.notify !== false && projectedChanged) {
563
- notifySubscribers(visibleProjectedSnapshot);
564
- }
565
- return visibleProjectedSnapshot;
566
- }
567
- function restoreVisibleSnapshot() {
568
- host.reset(structuredClone(visibleCanonicalSnapshot));
569
- }
570
- function emitEvent(event, payload) {
571
- const listeners = eventListeners.get(event);
572
- if (!listeners) {
573
- return;
574
- }
575
- for (const handler of listeners) {
576
- try {
577
- handler(payload);
578
- } catch {
579
- }
580
- }
581
- }
582
- function enqueue(task) {
583
- const result = dispatchQueue.catch(() => {
584
- }).then(task);
585
- dispatchQueue = result.then(() => void 0, () => void 0);
586
- return result;
587
- }
588
- function ensureIntentId(intent) {
589
- if (intent.intentId && intent.intentId.length > 0) {
590
- return intent;
591
- }
592
- return {
593
- ...intent,
594
- intentId: generateUUID()
595
- };
596
- }
597
- async function executeHost(intent, options) {
598
- return host.dispatch(intent, options);
599
- }
600
- function rejectUnavailable(intent) {
601
- const error = new ManifestoError(
602
- "ACTION_UNAVAILABLE",
603
- `Action "${intent.type}" is unavailable against the current visible snapshot`
604
- );
605
- emitEvent("dispatch:rejected", {
606
- intentId: intent.intentId ?? "",
607
- intent,
608
- reason: error.message
609
- });
610
- throw error;
611
- }
612
- function notifySubscribers(snapshot) {
613
- for (const subscriber of subscribers) {
614
- let selected;
615
- try {
616
- selected = subscriber.selector(snapshot);
617
- } catch {
618
- continue;
619
- }
620
- if (subscriber.initialized && Object.is(subscriber.lastValue, selected)) {
621
- continue;
622
- }
623
- subscriber.lastValue = selected;
624
- subscriber.initialized = true;
625
- try {
626
- subscriber.listener(selected);
627
- } catch {
628
- }
629
- }
630
- }
631
- return {
632
- schema,
633
- MEL,
634
- createIntent,
635
- subscribe,
636
- on,
637
- getSnapshot,
638
- getAvailableActions,
639
- getActionMetadata,
640
- isActionAvailable,
641
- dispose,
642
- isDisposed: () => disposed,
643
- getCanonicalSnapshot,
644
- getVisibleCoreSnapshot: () => structuredClone(visibleCanonicalSnapshot),
645
- setVisibleSnapshot,
646
- restoreVisibleSnapshot,
647
- emitEvent,
648
- enqueue,
649
- ensureIntentId,
650
- executeHost,
651
- rejectUnavailable
652
- };
653
- }
654
- function createBaseRuntimeInstance(kernel) {
655
- async function processIntent(intent) {
656
- if (kernel.isDisposed()) {
657
- throw new DisposedError();
658
- }
659
- if (!kernel.isActionAvailable(intent.type)) {
660
- return kernel.rejectUnavailable(intent);
661
- }
662
- let result;
663
- try {
664
- result = await kernel.executeHost(intent);
665
- } catch (error) {
666
- const failure = toError(error);
667
- kernel.emitEvent("dispatch:failed", {
668
- intentId: intent.intentId ?? "",
669
- intent,
670
- error: failure
671
- });
672
- throw failure;
673
- }
674
- if (result.status === "error") {
675
- const publishedSnapshot2 = kernel.setVisibleSnapshot(result.snapshot);
676
- const failure = result.error ?? new ManifestoError("HOST_ERROR", "Host dispatch failed");
677
- kernel.emitEvent("dispatch:failed", {
678
- intentId: intent.intentId ?? "",
679
- intent,
680
- error: failure,
681
- snapshot: publishedSnapshot2
682
- });
683
- throw failure;
684
- }
685
- const publishedSnapshot = kernel.setVisibleSnapshot(result.snapshot);
686
- kernel.emitEvent("dispatch:completed", {
687
- intentId: intent.intentId ?? "",
688
- intent,
689
- snapshot: publishedSnapshot
690
- });
691
- return publishedSnapshot;
692
- }
693
- function dispatchAsync(intent) {
694
- if (kernel.isDisposed()) {
695
- return Promise.reject(new DisposedError());
696
- }
697
- const enrichedIntent = kernel.ensureIntentId(intent);
698
- return kernel.enqueue(() => processIntent(enrichedIntent));
699
- }
700
- return {
701
- createIntent: kernel.createIntent,
702
- dispatchAsync,
703
- subscribe: kernel.subscribe,
704
- on: kernel.on,
705
- getSnapshot: kernel.getSnapshot,
706
- getCanonicalSnapshot: kernel.getCanonicalSnapshot,
707
- getAvailableActions: kernel.getAvailableActions,
708
- getActionMetadata: kernel.getActionMetadata,
709
- isActionAvailable: kernel.isActionAvailable,
710
- MEL: kernel.MEL,
711
- schema: kernel.schema,
712
- dispose: kernel.dispose
713
- };
714
- }
715
- function toError(error) {
716
- return error instanceof Error ? error : new Error(String(error));
717
- }
718
- function generateUUID() {
719
- if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
720
- return crypto.randomUUID();
721
- }
722
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (char) => {
723
- const random = Math.random() * 16 | 0;
724
- const value = char === "x" ? random : random & 3 | 8;
725
- return value.toString(16);
726
- });
727
- }
728
-
729
- export {
730
- ManifestoError,
731
- ReservedEffectError,
732
- CompileError,
733
- DisposedError,
734
- AlreadyActivatedError,
735
- buildSnapshotProjectionPlan,
736
- projectEffectContextSnapshot,
737
- cloneAndDeepFreeze,
738
- ACTION_PARAM_NAMES,
739
- attachRuntimeKernelFactory,
740
- getRuntimeKernelFactory,
741
- getActivationState,
742
- assertComposableNotActivated,
743
- activateComposable,
744
- createRuntimeKernel,
745
- createBaseRuntimeInstance
746
- };
747
- //# sourceMappingURL=chunk-2YBJP5JT.js.map