@endge/core 9.0.0 → 10.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 (77) hide show
  1. package/dist/core.js +25862 -24331
  2. package/dist/features/core/kernel/config/debugger.config.d.ts +3 -0
  3. package/dist/features/core/kernel/config/modules.config.d.ts +6 -1
  4. package/dist/features/core/kernel/endge.d.ts +20 -6
  5. package/dist/features/core/kernel/errors/EndgeDebuggerReadOnlyError.d.ts +5 -0
  6. package/dist/features/core/kernel/tools/debugger-snapshot.d.ts +13 -0
  7. package/dist/features/core/kernel/tools/read-only-document.d.ts +2 -0
  8. package/dist/features/core/kernel/types/bootstrap.types.d.ts +7 -1
  9. package/dist/features/core/modules/bridge/adapters/BrowserBridge_Adapter.d.ts +0 -3
  10. package/dist/features/core/modules/bridge/config/bridge.config.d.ts +5 -0
  11. package/dist/features/core/modules/bridge/debug/EndgeBridgeDebug_Module.d.ts +56 -4
  12. package/dist/features/core/modules/bridge/domain/bridge-sync.type.d.ts +30 -0
  13. package/dist/features/core/modules/bridge/tools/bridge-sync.d.ts +16 -0
  14. package/dist/features/core/modules/commands/EndgeCommands_Module.d.ts +17 -0
  15. package/dist/features/core/modules/commands/config/commands.config.d.ts +9 -0
  16. package/dist/features/core/modules/commands/domain/commands.types.d.ts +43 -0
  17. package/dist/features/core/modules/commands/services/LocalCommandExecutor.d.ts +9 -0
  18. package/dist/features/core/modules/commands/services/RemoteCommandExecutor.d.ts +9 -0
  19. package/dist/features/core/modules/commands/services/context/SetDataModeCommand.d.ts +9 -0
  20. package/dist/features/core/modules/commands/services/context/SetEnvironmentCommand.d.ts +9 -0
  21. package/dist/features/core/modules/commands/services/context/SetLocaleCommand.d.ts +9 -0
  22. package/dist/features/core/modules/commands/services/context/SetProjectCommand.d.ts +9 -0
  23. package/dist/features/core/modules/commands/services/context/SetTenantCommand.d.ts +9 -0
  24. package/dist/features/core/modules/commands/services/context/SetThemeCommand.d.ts +9 -0
  25. package/dist/features/core/modules/commands/services/context/SetTimezoneCommand.d.ts +9 -0
  26. package/dist/features/core/modules/commands/services/context/SetUserCommand.d.ts +9 -0
  27. package/dist/features/core/modules/commands/services/context/SetWorkspaceCommand.d.ts +9 -0
  28. package/dist/features/core/modules/commands/services/runtime/PauseRuntimeCommand.d.ts +9 -0
  29. package/dist/features/core/modules/commands/services/runtime/ResumeRuntimeCommand.d.ts +9 -0
  30. package/dist/features/core/modules/commands/services/runtime/StopRuntimeCommand.d.ts +9 -0
  31. package/dist/features/core/modules/commands/tools/command-payload.d.ts +4 -0
  32. package/dist/features/core/modules/commands/types/command-executor.type.d.ts +19 -0
  33. package/dist/features/core/modules/commands/types/context-command-target.type.d.ts +14 -0
  34. package/dist/features/core/modules/commands/types/runtime-command-target.type.d.ts +5 -0
  35. package/dist/features/core/modules/compiler/EndgeCompiler_Module.d.ts +4 -0
  36. package/dist/features/core/modules/computations/model/ComputationResource.d.ts +11 -1
  37. package/dist/features/core/modules/computations/model/ComputationResourceRegistry.d.ts +9 -0
  38. package/dist/features/core/modules/configuration/EndgeConfiguration_Module.d.ts +2 -0
  39. package/dist/features/core/modules/context/EndgeContext_Module.d.ts +18 -1
  40. package/dist/features/core/modules/context/domain/context-events.types.d.ts +8 -0
  41. package/dist/features/core/modules/domain/EndgeDomain_Module.d.ts +2 -0
  42. package/dist/features/core/modules/domain/entities/RSimulation.d.ts +1 -1
  43. package/dist/features/core/modules/events/EndgeEvents_Module.d.ts +13 -63
  44. package/dist/features/core/modules/events/domain/events.types.d.ts +36 -22
  45. package/dist/features/core/modules/i18n/tools/resolve-runtime-translation.d.ts +3 -0
  46. package/dist/features/core/modules/runtime/ComponentSFCEventBoundary.d.ts +1 -1
  47. package/dist/features/core/modules/runtime/EndgeRuntimeScopes_Module.d.ts +5 -0
  48. package/dist/features/core/modules/runtime/EndgeRuntime_Module.d.ts +43 -2
  49. package/dist/features/core/modules/runtime/domain/component-sfc-render-port.types.d.ts +8 -0
  50. package/dist/features/core/modules/runtime/domain/runtime-entity-map.types.d.ts +3 -0
  51. package/dist/features/core/modules/runtime/domain/runtime-host.types.d.ts +3 -0
  52. package/dist/features/core/modules/runtime/domain/runtime-inspection.types.d.ts +28 -0
  53. package/dist/features/core/modules/runtime/domain/runtime-render-inspection.types.d.ts +27 -0
  54. package/dist/features/core/modules/runtime/domain/runtime.types.d.ts +4 -2
  55. package/dist/features/core/modules/runtime/domain/simulation-runtime.types.d.ts +25 -0
  56. package/dist/features/core/modules/runtime/domain/stream-runtime.types.d.ts +3 -1
  57. package/dist/features/core/modules/runtime/execution/endge-simulation.d.ts +5 -0
  58. package/dist/features/core/modules/runtime/hosts/ComponentSFCRuntimeHost.d.ts +3 -0
  59. package/dist/features/core/modules/runtime/hosts/FilterViewRuntimeHost.d.ts +5 -0
  60. package/dist/features/core/modules/runtime/hosts/SimulationRuntimeHost.d.ts +52 -0
  61. package/dist/features/core/modules/runtime/hosts/StreamRuntimeHost.d.ts +7 -4
  62. package/dist/features/core/modules/runtime/services/simulation/create-simulation-schema.d.ts +5 -0
  63. package/dist/features/core/modules/runtime/services/simulation/find-simulation-runtime.d.ts +4 -0
  64. package/dist/features/core/modules/runtime/services/simulation/prepare-simulation-overrides.d.ts +14 -0
  65. package/dist/features/core/modules/runtime/services/strategies/SimulationRuntimeStrategy.d.ts +9 -0
  66. package/dist/features/core/modules/runtime/tools/runtime-inspection.d.ts +10 -0
  67. package/dist/features/core/modules/runtime/tools/runtime-render-inspection.d.ts +6 -0
  68. package/dist/features/core/modules/runtime/tools/runtime-render-values.d.ts +4 -0
  69. package/dist/features/core/modules/source/domain/types/simulation-source.types.d.ts +21 -1
  70. package/dist/features/core/modules/source/services/SimulationSourceResolver.d.ts +1 -1
  71. package/dist/features/core/modules/source/templates/simulation.default.source.d.ts +1 -1
  72. package/dist/features/core/modules/workspace/EndgeWorkspace_Module.d.ts +2 -0
  73. package/dist/features/federation/EndgeFederation.d.ts +3 -0
  74. package/dist/features/federation/types/federation.types.d.ts +5 -0
  75. package/dist/main.d.ts +18 -0
  76. package/package.json +3 -3
  77. package/dist/features/core/modules/events/domain/EndgeEvent.d.ts +0 -33
@@ -5,6 +5,7 @@ type SyncRunner<T> = (input: unknown) => T;
5
5
  export declare class ComputationResourceState<T = unknown> implements ComputationResourceContract<T> {
6
6
  private readonly _asyncRunner;
7
7
  private readonly _syncRunner;
8
+ private readonly _identity;
8
9
  private _status;
9
10
  private _value;
10
11
  private _error;
@@ -12,11 +13,20 @@ export declare class ComputationResourceState<T = unknown> implements Computatio
12
13
  private _revision;
13
14
  private _disposed;
14
15
  private _input;
15
- constructor(input: unknown, _asyncRunner: AsyncRunner<T>, _syncRunner?: SyncRunner<T> | null);
16
+ constructor(input: unknown, _asyncRunner: AsyncRunner<T>, _syncRunner?: SyncRunner<T> | null, _identity?: string);
16
17
  get status(): import('../../domain/types/computation/computation-runtime.types').ComputationResourceStatus;
17
18
  get loading(): boolean;
18
19
  get value(): T | undefined;
19
20
  get error(): ComputationRuntimeErrorShape | null;
21
+ /** Снимок фактического результата для пассивного renderer debugger. */
22
+ snapshot(): {
23
+ identity: string;
24
+ input: unknown;
25
+ status: import('../../domain/types/computation/computation-runtime.types').ComputationResourceStatus;
26
+ loading: boolean;
27
+ value: T | undefined;
28
+ error: ComputationRuntimeErrorShape | null;
29
+ };
20
30
  updateInput(input: unknown): void;
21
31
  refresh(): Promise<void>;
22
32
  subscribe(listener: VoidFunction): VoidFunction;
@@ -10,4 +10,13 @@ export declare class ComputationResourceRegistry {
10
10
  /** Renderer освобождает завершившихся consumers, не затрагивая соседние scopes. */
11
11
  releaseScope(scope: string, keep?: (key: string) => boolean): void;
12
12
  dispose(): void;
13
+ /** Считывает ресурсы существующих consumers; новые вычисления не создаются. */
14
+ snapshot(): {
15
+ identity: string;
16
+ input: unknown;
17
+ status: import('../../domain/types/computation/computation-runtime.types').ComputationResourceStatus;
18
+ loading: boolean;
19
+ value: unknown;
20
+ error: import('../../domain/types/computation/computation-runtime.types').ComputationRuntimeErrorShape | null;
21
+ }[];
13
22
  }
@@ -9,6 +9,8 @@ export declare class EndgeConfiguration_Module extends EndgeModule<EndgeBootCont
9
9
  build(ctx: EndgeBootContext): void;
10
10
  /** Очищает effective configuration перед следующим boot. */
11
11
  reset(): void;
12
+ /** Принимает уже разрешённую конфигурацию клиента без build, команд и запуска приложения. */
13
+ applyInspection(configuration: EndgeConfiguration): void;
12
14
  /** Включает effective configuration текущего build в диагностическое дерево. */
13
15
  createDiagnosticsSnapshot(): EndgeConfiguration;
14
16
  /** Возвращает effective configuration текущего build. */
@@ -1,5 +1,6 @@
1
- import { EndgeBootContext } from '../../kernel/types/bootstrap.types';
1
+ import { EndgeBootContext, EndgeBootMode } from '../../kernel/types/bootstrap.types';
2
2
  import { EndgeConfiguration } from '../configuration/domain/types/configuration.type';
3
+ import { ContextEvent } from './domain/context-events.types';
3
4
  import { EndgeContextPersistenceConfig, EndgeContextSnapshot, EndgeKeyboardContextSnapshot, EndgePersistenceScope, EndgeRuntimeContextSnapshot, EndgeSessionIdentityProvider, EndgeStorageAdapter } from './domain/context-persistence.types';
4
5
  import { EndgeContextStateListener, EndgeContextStateTransform } from './domain/context-state.types';
5
6
  import { EndgePersistenceInput } from './persistence/EndgeStorageAdapterRegistry';
@@ -33,7 +34,12 @@ export declare class EndgeContext_Module extends EndgeModule<EndgeBootContext> {
33
34
  private _dataModeOverride;
34
35
  private _sessionProvider;
35
36
  private _isHydrating;
37
+ private _eventContext;
38
+ private _publishingContextChanges;
36
39
  private _executionContextLocked;
40
+ private _bootMode;
41
+ private _beforeInspection;
42
+ get bootMode(): EndgeBootMode;
37
43
  /** Создаёт контекст, регистрирует storage adapters и восстанавливает snapshot. */
38
44
  constructor();
39
45
  /** Применяет explicit structural context до load/build остальных модулей. */
@@ -61,8 +67,14 @@ export declare class EndgeContext_Module extends EndgeModule<EndgeBootContext> {
61
67
  setKeyboardState(input: EndgeKeyboardContextSnapshot): void;
62
68
  /** Сохраняет подписчиков legacy-модуля и проецирует постоянные поля контекста в Raph. */
63
69
  notify(): void;
70
+ /** Применяет типизированное событие через setters, сохраняя их проверки и side effects. */
71
+ applyEvent(event: ContextEvent): void;
64
72
  /** Восстанавливает execution scope из snapshot с безопасными defaults. */
65
73
  deserialize(payload: Partial<EndgeContextSnapshot> | undefined): void;
74
+ /** Adopts observed scope only in memory; developer authorization stays with the host session. */
75
+ applyInspection(snapshot: EndgeContextSnapshot & {
76
+ dataMode?: EndgeDataMode;
77
+ }): void;
66
78
  /** Сохраняет текущий context snapshot через выбранный adapter. */
67
79
  saveToStorage(): void;
68
80
  /** Загружает context snapshot из нового или legacy storage key. */
@@ -158,6 +170,11 @@ export declare class EndgeContext_Module extends EndgeModule<EndgeBootContext> {
158
170
  private _resolveAdapter;
159
171
  private _notifyState;
160
172
  private _warnStateFailure;
173
+ /** Снимок фактических значений: session identities и effective data mode включены. */
174
+ private _readEventContext;
175
+ /** Constructor hydration задаёт baseline; последующие commits публикуют только изменения. */
176
+ private _publishContextChanges;
177
+ private _emitContextChange;
161
178
  private _syncPersistentContextToRaph;
162
179
  private _setRaphValueIfChanged;
163
180
  /** Возвращает identity активного workspace для persistence scope. */
@@ -0,0 +1,8 @@
1
+ import { EndgeCoreEventMap } from '../../events/domain/events.types';
2
+ /** Событие для applyEvent с согласованными именем и типом payload. */
3
+ export type ContextEvent = {
4
+ [K in keyof EndgeCoreEventMap & `context:${string}`]: {
5
+ readonly name: K;
6
+ readonly payload: EndgeCoreEventMap[K];
7
+ };
8
+ }[keyof EndgeCoreEventMap & `context:${string}`];
@@ -166,6 +166,8 @@ export declare class EndgeDomain_Module extends EndgeModule<EndgeBootContext> {
166
166
  * Объединяет доменные данные из JSON.
167
167
  */
168
168
  merge(json: any): void;
169
+ /** Atomically replaces all collections after complete materialization; never compiles or executes Source. */
170
+ replaceFromPlain(json: unknown): void;
169
171
  /** Заменяет сохранённую сущность, не меняя её позицию в коллекции домена. */
170
172
  replacePersistedEntity(currentEntity: object, nextEntity: object): void;
171
173
  private _entityIndexes;
@@ -1,5 +1,5 @@
1
1
  import { DuplicateOptions, REntity } from './REntity';
2
- /** Сохранённое source-first определение симуляции без runtime execution. */
2
+ /** Сохранённое source-first определение отдельного запуска Simulation. */
3
3
  export declare class RSimulation extends REntity {
4
4
  readonly type: "simulation";
5
5
  source: string;
@@ -1,72 +1,22 @@
1
1
  import { EventCallback, OneOrMany } from '@endge/utils';
2
- import { CachedEvent, EndgeCoreEventMap, EndgeCustomEventMap, EndgeEmitOptions, EndgeEvent } from './domain/events.types';
2
+ import { EndgeCoreEventMap, EndgeCustomEventMap, EndgeEvent, EndgePublishedEvent } from './domain/events.types';
3
3
  import { EndgeModule } from '../../../federation/EndgeModule';
4
- /**
5
- * Модуль событий Endge.
6
- * Инкапсулирует core/custom event bus и небольшой runtime-кеш последних событий.
7
- */
4
+ /** Синхронная шина Core: только подписки, без кеша событий и очереди доставки. */
8
5
  export declare class EndgeEvents_Module extends EndgeModule {
9
- static EVENTS_CACHE_SIZE: number;
10
6
  private readonly _bus;
11
- private _cache;
12
- /**
13
- * Создает event bus с заранее известными core-событиями.
14
- */
15
- constructor(predefinedEvents?: (keyof EndgeCoreEventMap & string)[]);
16
- /**
17
- * Изменяет размер кеша последних событий для текущего экземпляра.
18
- */
19
- setCacheSize(next: number): void;
20
- /**
21
- * Внутренний helper модуля: make Cache.
22
- */
23
- private _makeCache;
24
- /**
25
- * Возвращает текущую емкость кеша событий.
26
- */
27
- get cacheSize(): number;
28
- /**
29
- * Возвращает количество событий, сохраненных в кеше.
30
- */
31
- get cachedCount(): number;
32
- /**
33
- * Возвращает снимок кеша событий от старых к новым.
34
- */
35
- get lastEvents(): CachedEvent[];
36
- /**
37
- * Очищает кеш последних событий.
38
- */
39
- clearCache(): void;
40
- /**
41
- * Подписывает обработчик на типизированные core-события Endge.
42
- */
43
- onEvent<K extends keyof EndgeCoreEventMap & string>(events: OneOrMany<K>, callback: (e: EndgeEvent<EndgeCoreEventMap[K]>) => void): () => void;
44
- /**
45
- * Публикует типизированное core-событие Endge.
46
- */
47
- emitEvent<K extends keyof EndgeCoreEventMap & string>(event: K, payload: EndgeCoreEventMap[K], opts?: EndgeEmitOptions): EndgeEvent<EndgeCoreEventMap[K]>;
48
- /**
49
- * Подписывает обработчик на динамические пользовательские события.
50
- */
51
- onDynamic<K extends keyof EndgeCustomEventMap & string>(events: OneOrMany<K>, callback: (e: EndgeEvent<EndgeCustomEventMap[K]>) => void): () => void;
52
- /**
53
- * Публикует динамическое пользовательское событие.
54
- */
55
- emitDynamic<K extends keyof EndgeCustomEventMap & string>(event: K, payload: EndgeCustomEventMap[K], opts?: EndgeEmitOptions): EndgeEvent<EndgeCustomEventMap[K]>;
56
- /**
57
- * Подписывает raw-callback на core-события без обертки EndgeEvent.
58
- */
7
+ private readonly _observers;
8
+ private _sequence;
9
+ /** Подписывает наблюдателя на все последующие публикации. */
10
+ onAny(callback: (event: EndgePublishedEvent) => void): () => void;
11
+ onEvent<K extends keyof EndgeCoreEventMap & string>(events: OneOrMany<K>, callback: (event: EndgeEvent<EndgeCoreEventMap[K]>) => void): () => void;
12
+ emitEvent<K extends keyof EndgeCoreEventMap & string>(name: K, payload: EndgeCoreEventMap[K]): EndgePublishedEvent<EndgeCoreEventMap[K]>;
13
+ onDynamic<K extends keyof EndgeCustomEventMap & string>(events: OneOrMany<K>, callback: (event: EndgeEvent<EndgeCustomEventMap[K]>) => void): () => void;
14
+ emitDynamic<K extends keyof EndgeCustomEventMap & string>(name: K, payload: EndgeCustomEventMap[K]): EndgePublishedEvent<EndgeCustomEventMap[K]>;
59
15
  on<K extends keyof EndgeCoreEventMap & string>(events: OneOrMany<K>, callback: EventCallback<EndgeCoreEventMap[K]>): void;
60
- /**
61
- * Снимает raw-callback с core-событий.
62
- */
63
16
  off<K extends keyof EndgeCoreEventMap & string>(events: OneOrMany<K>, callback: EventCallback<EndgeCoreEventMap[K]>): void;
64
- /**
65
- * Подписывает raw-callback на пользовательские события.
66
- */
67
17
  onCustom<K extends keyof EndgeCustomEventMap & string>(events: OneOrMany<K>, callback: EventCallback<EndgeCustomEventMap[K]>): void;
68
- /**
69
- * Снимает raw-callback с пользовательских событий.
70
- */
71
18
  offCustom<K extends keyof EndgeCustomEventMap & string>(events: OneOrMany<K>, callback: EventCallback<EndgeCustomEventMap[K]>): void;
19
+ reset(): void;
20
+ private _publish;
21
+ private _reportListenerError;
72
22
  }
@@ -1,22 +1,35 @@
1
- /**
2
- * Связка события и id Действия из домена
3
- */
1
+ import { RuntimeHostStatus } from '../../runtime/domain/runtime-host.types';
2
+ import { EndgeDataMode } from '../../workspace/domain/workspace.types';
3
+ /** Связка события и identity действия из Domain. */
4
4
  export interface EndgeEventBinding {
5
5
  event: string;
6
6
  actionId: string | null;
7
7
  }
8
- export type AnyEventName = string;
9
- export type AnyPayload = unknown;
10
- export interface CachedEvent {
11
- name: AnyEventName;
12
- payload: AnyPayload;
13
- at: number;
8
+ export interface ContextValueChange<T> {
9
+ readonly previous: T;
10
+ readonly value: T;
14
11
  }
15
- export interface EndgeCustomEventMap {
16
- [event: string]: unknown;
17
- }
18
- /** Статические события Endge Core. */
12
+ /** Статические события Endge Core о фактически произошедших изменениях. */
19
13
  export interface EndgeCoreEventMap {
14
+ 'context:workspace-changed': ContextValueChange<string | null>;
15
+ 'context:tenant-changed': ContextValueChange<string>;
16
+ 'context:project-changed': ContextValueChange<string>;
17
+ 'context:environment-changed': ContextValueChange<string>;
18
+ 'context:user-changed': ContextValueChange<string>;
19
+ 'context:locale-changed': ContextValueChange<string>;
20
+ 'context:theme-changed': ContextValueChange<string>;
21
+ 'context:timezone-changed': ContextValueChange<string>;
22
+ 'context:data-mode-changed': ContextValueChange<EndgeDataMode>;
23
+ 'runtime:data-changed': {
24
+ readonly revision: number;
25
+ };
26
+ 'runtime:registry-changed': Record<string, never>;
27
+ 'runtime:scopes-changed': Record<string, never>;
28
+ 'runtime:host-status-changed': {
29
+ readonly id: string;
30
+ readonly previous: RuntimeHostStatus;
31
+ readonly value: RuntimeHostStatus;
32
+ };
20
33
  'updates:message': {
21
34
  type: string;
22
35
  message: unknown;
@@ -26,15 +39,16 @@ export interface EndgeCoreEventMap {
26
39
  count: number;
27
40
  };
28
41
  }
29
- export interface EndgeEmitOptions {
30
- stopOnCancel?: boolean;
42
+ export interface EndgeCustomEventMap {
43
+ [event: string]: unknown;
31
44
  }
32
- /**
33
- * Envelope-событие с возможностью cancel()
34
- */
35
- export declare class EndgeEvent<T> {
45
+ /** Уведомление о свершившемся факте не отменяет операцию owner-а. */
46
+ export interface EndgeEvent<T> {
36
47
  readonly payload: T;
37
- isCanceled: boolean;
38
- constructor(payload: T);
39
- cancel(): void;
48
+ }
49
+ /** Метаданные одной публикации. Историю хранит потребитель, а не шина. */
50
+ export interface EndgePublishedEvent<T = unknown> extends EndgeEvent<T> {
51
+ readonly name: string;
52
+ readonly at: number;
53
+ readonly sequence: number;
40
54
  }
@@ -0,0 +1,3 @@
1
+ import { I18nRuntimeCatalog } from '../domain/i18n.types';
2
+ /** Одно разрешение translation catalog для живого и наблюдаемого renderer. */
3
+ export declare function resolveRuntimeTranslation(catalog: I18nRuntimeCatalog, key: string, locale: string, fallbackLocale: string, fallback?: string): string;
@@ -12,7 +12,7 @@ export declare class ComponentSFCEventBoundary {
12
12
  private readonly _parentEventTransform?;
13
13
  private readonly _requiredPortBindings;
14
14
  private readonly _consumedLocalOnce;
15
- constructor(_host: ComponentSFCRuntimeHost | null, componentIdentity: string, _manifest: ComponentSFCPortManifest, _parent?: ComponentSFCEventBoundary | null, _parentSource?: ComponentSFCEventRuntimeSource | undefined, _parentBindings?: readonly RComponentSFC_IR_EventBinding[], _parentEventTransform?: ((event: string, payload: unknown) => {
15
+ constructor(_host: Pick<ComponentSFCRuntimeHost, 'executeEventPortAction' | 'publishEventPort' | 'emit'> | null, componentIdentity: string, _manifest: ComponentSFCPortManifest, _parent?: ComponentSFCEventBoundary | null, _parentSource?: ComponentSFCEventRuntimeSource | undefined, _parentBindings?: readonly RComponentSFC_IR_EventBinding[], _parentEventTransform?: ((event: string, payload: unknown) => {
16
16
  event: string;
17
17
  payload: unknown;
18
18
  } | null) | undefined, _requiredPortBindings?: readonly ComponentSFCRequiredPortBinding[]);
@@ -3,6 +3,7 @@ import { RuntimeScope } from './RuntimeScope';
3
3
  import { EndgeModule } from '../../../federation/EndgeModule';
4
4
  /** Индексирует runtime scopes и membership RuntimeHost. */
5
5
  export declare class EndgeRuntimeScopes_Module extends EndgeModule {
6
+ private readonly _onChange;
6
7
  private readonly _scopes;
7
8
  private readonly _scopeByRuntime;
8
9
  private readonly _scopeDisposers;
@@ -13,6 +14,10 @@ export declare class EndgeRuntimeScopes_Module extends EndgeModule {
13
14
  * PUBLIC
14
15
  * ----------------------------------------
15
16
  */
17
+ /** Получает уведомление владельца Runtime без обращения к Core при создании. */
18
+ constructor(_onChange?: () => void);
19
+ /** Публикует завершённое изменение scopes; состояние остаётся у их owners. */
20
+ notify(): void;
16
21
  register(scope: RuntimeScope): RuntimeScope;
17
22
  transaction<T>(operation: () => T): T;
18
23
  get(id: string): RuntimeScope | null;
@@ -1,6 +1,9 @@
1
+ import { EndgeBootContext } from '../../kernel/types/bootstrap.types';
1
2
  import { RuntimeEntityType } from './domain/runtime-entity-map.types';
2
3
  import { RuntimeExecuteOptions } from './domain/runtime-execute.type';
3
4
  import { DestroyedRuntimeHostSnapshot, RuntimeHost, RuntimeInspectionLease } from './domain/runtime-host.types';
5
+ import { RuntimeControlOperation, RuntimeControlTarget, RuntimeInspectionSnapshot, RuntimeStatusChange } from './domain/runtime-inspection.types';
6
+ import { RuntimeRenderInspection } from './domain/runtime-render-inspection.types';
4
7
  import { AnyRuntimeHost, AnyRuntimeStrategy } from './domain/runtime-strategy.types';
5
8
  import { EndgeRuntimeRaphSnapshot, EndgeRuntimeSnapshot, RuntimeExecutableModel } from './domain/runtime.types';
6
9
  import { RuntimeAppScopeOptions, RuntimeAppScope } from './RuntimeAppScope';
@@ -10,17 +13,27 @@ import { EndgeComposition } from './execution/endge-composition';
10
13
  import { EndgeDataView } from './execution/endge-data-view';
11
14
  import { EndgeProject } from './execution/endge-project';
12
15
  import { EndgeQuery } from './execution/endge-query';
16
+ import { EndgeSimulation } from './execution/endge-simulation';
13
17
  import { EndgeOperations_Module } from './operation/EndgeOperations_Module';
14
18
  import { RuntimeScope } from './RuntimeScope';
15
19
  import { EndgeModule } from '../../../federation/EndgeModule';
16
20
  /** Модуль создания, регистрации и уничтожения runtime hosts и app scopes. */
17
- export declare class EndgeRuntime_Module extends EndgeModule {
21
+ export declare class EndgeRuntime_Module extends EndgeModule<EndgeBootContext> {
18
22
  readonly query: EndgeQuery;
19
23
  readonly dataView: EndgeDataView;
20
24
  readonly composition: EndgeComposition;
21
25
  readonly project: EndgeProject;
26
+ readonly simulation: EndgeSimulation;
22
27
  readonly operations: EndgeOperations_Module;
23
28
  readonly scopes: EndgeRuntimeScopes_Module;
29
+ private readonly _onHostStatusChanged;
30
+ private readonly _onRenderChanged;
31
+ private _inspectionMode;
32
+ private _inspection;
33
+ private readonly _dataLeases;
34
+ private _unsubscribeData;
35
+ private _dataRevision;
36
+ private readonly _renderDataOff;
24
37
  private _hosts;
25
38
  private _strategies;
26
39
  private _inited;
@@ -39,10 +52,12 @@ export declare class EndgeRuntime_Module extends EndgeModule {
39
52
  acquireDestroyedHostSnapshots(limit: number): RuntimeInspectionLease;
40
53
  /** Создаёт default app scope и регистрирует runtime strategies. */
41
54
  constructor();
55
+ /** Уведомляет consumers об изменении реестра без передачи runtime data. */
56
+ notify(): void;
42
57
  /**
43
58
  * Настраивает Raph runtime до загрузки и сборки домена.
44
59
  */
45
- setup(): void;
60
+ setup(ctx: EndgeBootContext): void;
46
61
  /**
47
62
  * Регистрирует runtime-фазы в Raph один раз.
48
63
  */
@@ -61,6 +76,7 @@ export declare class EndgeRuntime_Module extends EndgeModule {
61
76
  registerStrategy(strategy: AnyRuntimeStrategy): void;
62
77
  /** Создаёт или возвращает именованный root runtime scope приложения. */
63
78
  createAppScope(options: RuntimeAppScopeOptions): RuntimeAppScope;
79
+ private _createAppScope;
64
80
  /** Возвращает lifecycle scope, которому принадлежит RuntimeHost. */
65
81
  getRuntimeScopeByHost(runtimeId: string): RuntimeScope | null;
66
82
  /** Возвращает корневой scope обычного запуска приложения. */
@@ -110,6 +126,31 @@ export declare class EndgeRuntime_Module extends EndgeModule {
110
126
  includeData: boolean;
111
127
  includeGraph: boolean;
112
128
  }): EndgeRuntimeRaphSnapshot;
129
+ /** JSON-safe проекция owner-а; Bridge задаёт частоту и набор передаваемых частей. */
130
+ captureInspection(includeData?: boolean): RuntimeInspectionSnapshot;
131
+ /** Прямой импорт факта: не создаёт hosts, не пишет Raph и не выполняет Commands. */
132
+ applyInspectionSnapshot(value: unknown): void;
133
+ /** Событие обновляет только известный экземпляр; новую структуру приносит следующий snapshot. */
134
+ applyInspectionEvent(change: RuntimeStatusChange): void;
135
+ /** Данные остаются снимком для чтения, даже когда локальный Raph уже существует. */
136
+ applyInspectionData(data: unknown, generatedAt: number, render?: RuntimeRenderInspection): void;
137
+ /** Ошибка передачи не маскируется под свежий или пустой снимок данных. */
138
+ applyInspectionDataError(message: string): void;
139
+ /** JSON-safe снимок только данных, без пересборки структуры и Raph graph. */
140
+ captureInspectionData(): {
141
+ data: unknown;
142
+ render?: RuntimeRenderInspection;
143
+ generatedAt: number;
144
+ };
145
+ /** Смена debug session удаляет прошлые данные, не затрагивая локальный runtime. */
146
+ clearInspection(): void;
147
+ get inspection(): Readonly<RuntimeInspectionSnapshot>;
148
+ /** Наблюдение Raph существует только пока у Runtime есть явный consumer. */
149
+ acquireDataChanges(): RuntimeInspectionLease;
150
+ /** Локальная операция над конкретным экземпляром; удалённый вызов идёт через Commands. */
151
+ control(operation: RuntimeControlOperation, input: RuntimeControlTarget): Promise<void>;
152
+ private _requireInspection;
153
+ private _observeRenderChanges;
113
154
  /**
114
155
  * Корректно разрушает runtime-host по runtime-id.
115
156
  */
@@ -0,0 +1,8 @@
1
+ import { ComponentSFCRuntimeHost } from '../hosts/ComponentSFCRuntimeHost';
2
+ import { EndgeStyleSheetArtifact } from '../../styles/domain/types/style.types';
3
+ /** Renderer потребляет этот порт. Его реализация не обязана быть исполняемым RuntimeHost. */
4
+ export type ComponentSFCRenderPort = Pick<ComponentSFCRuntimeHost, 'id' | 'entityIdentity' | 'runtimeState' | 'getIr' | 'getArtifact' | 'getArtifactReader' | 'getComputationResource' | 'releaseComputationResources' | 'readDataMeta' | 'translate' | 'resolveVocabOptions' | 'getEditSession' | 'beginEditSession' | 'updateEditDraft' | 'commitEditSession' | 'cancelEditSession' | 'executeEventPortAction' | 'publishEventPort' | 'setInputSource' | 'on' | 'off' | 'emit'> & {
5
+ readonly readonly?: boolean;
6
+ readonly styleArtifacts?: readonly EndgeStyleSheetArtifact[];
7
+ readonly runtimeScopeIds?: readonly string[];
8
+ };
@@ -5,12 +5,15 @@ import { RFilter } from '../../domain/entities/RFilter';
5
5
  import { RPage } from '../../domain/entities/RPage';
6
6
  import { RProject } from '../../domain/entities/RProject';
7
7
  import { RQuery } from '../../domain/entities/RQuery';
8
+ import { RSimulation } from '../../domain/entities/RSimulation';
8
9
  import { RStore } from '../../domain/entities/RStore';
9
10
  import { RStream } from '../../domain/entities/RStream';
10
11
  /**
11
12
  * Канонический перечень сущностей, для которых может существовать runtime-host.
12
13
  */
13
14
  export interface RuntimeEntityModelMap {
15
+ /** Владелец отдельного запуска target с локальными подменами. */
16
+ 'simulation': RSimulation;
14
17
  /** Доменная модель проекта. */
15
18
  'project': RProject;
16
19
  /** Доменная модель страницы. */
@@ -80,6 +80,7 @@ export interface ProjectRuntimeHostContext extends RuntimeHostContextBase {
80
80
  lastRefreshAt: string | null;
81
81
  }
82
82
  export interface RuntimeHostContextMap {
83
+ 'simulation': RuntimeHostContextBase;
83
84
  'action': ActionRuntimeHostContext;
84
85
  'query': QueryRuntimeHostContext;
85
86
  'filter': FilterRuntimeHostContext;
@@ -383,4 +384,6 @@ export interface RuntimeHost<TType extends RuntimeEntityType = RuntimeEntityType
383
384
  update: (ctx: RuntimeHostUpdateContext) => Promise<void> | void;
384
385
  /** Сериализовать host в снимок для UI/диагностики. */
385
386
  snapshot: () => RuntimeHostSnapshot;
387
+ /** Чистый снимок привязок renderer, без запуска или изменения host. */
388
+ captureRenderInspection?: () => import('./runtime-render-inspection.types').RuntimeRenderableInspection;
386
389
  }
@@ -0,0 +1,28 @@
1
+ import { RuntimeHostStatus } from './runtime-host.types';
2
+ import { RuntimeRenderInspection } from './runtime-render-inspection.types';
3
+ import { EndgeRuntimeSnapshot } from './runtime.types';
4
+ /** Наблюдаемое состояние Runtime. Данные никогда не исполняются при импорте. */
5
+ export interface RuntimeInspectionSnapshot {
6
+ version: 1;
7
+ runtime: EndgeRuntimeSnapshot;
8
+ data?: unknown;
9
+ render?: RuntimeRenderInspection;
10
+ dataGeneratedAt?: number;
11
+ dataError?: string;
12
+ }
13
+ /** Клиентский идентификатор экземпляра и его поколение защищают от повторного использования id. */
14
+ export type RuntimeControlTarget = {
15
+ kind: 'host';
16
+ id: string;
17
+ createdAt: number;
18
+ } | {
19
+ kind: 'scope';
20
+ id: string;
21
+ generation: number;
22
+ };
23
+ export type RuntimeControlOperation = 'pause' | 'resume' | 'stop';
24
+ export interface RuntimeStatusChange {
25
+ readonly id: string;
26
+ readonly previous: RuntimeHostStatus;
27
+ readonly value: RuntimeHostStatus;
28
+ }
@@ -0,0 +1,27 @@
1
+ import { ComputationRuntimeErrorShape } from '../../domain/types/computation/computation-runtime.types';
2
+ import { RuntimeHostInputSource } from './runtime-host.types';
3
+ import { FilterViewRenderModel } from '../../source/domain/types/filter-view.type';
4
+ import { EndgeStyleSheetArtifact } from '../../styles/domain/types/style.types';
5
+ /** Готовое состояние вычисления клиента; observer не исполняет computation повторно. */
6
+ export interface RuntimeComputationInspection {
7
+ identity: string;
8
+ input: unknown;
9
+ status: 'idle' | 'pending' | 'success' | 'error';
10
+ loading: boolean;
11
+ value: unknown;
12
+ error: ComputationRuntimeErrorShape | null;
13
+ }
14
+ export type RuntimeRenderableInspection = {
15
+ kind: 'component-sfc';
16
+ input: RuntimeHostInputSource | null;
17
+ computations: RuntimeComputationInspection[];
18
+ dataMeta: Record<string, unknown>;
19
+ } | {
20
+ kind: 'filter-view';
21
+ model: FilterViewRenderModel;
22
+ };
23
+ /** Дополнение к данным Raph: фактические привязки и presentation state экземпляров. */
24
+ export interface RuntimeRenderInspection {
25
+ hosts: Record<string, RuntimeRenderableInspection>;
26
+ styles: readonly EndgeStyleSheetArtifact[];
27
+ }
@@ -5,14 +5,15 @@ import { RFilter } from '../../domain/entities/RFilter';
5
5
  import { RPage } from '../../domain/entities/RPage';
6
6
  import { RProject } from '../../domain/entities/RProject';
7
7
  import { RQuery } from '../../domain/entities/RQuery';
8
+ import { RSimulation } from '../../domain/entities/RSimulation';
8
9
  import { RStore } from '../../domain/entities/RStore';
9
10
  import { RStream } from '../../domain/entities/RStream';
10
11
  import { RuntimeHostRegistrySnapshot } from './runtime-registry.types';
11
12
  /**
12
13
  * Виды runtime
13
14
  */
14
- export type RuntimeKind = 'query' | 'filter' | 'composition' | 'store' | 'stream' | 'action' | 'runtime';
15
- export type RuntimeExecutableModel = RQuery | RAction | RProject | RPage | RComponentSFC | RFilter | RComposition | RStore | RStream;
15
+ export type RuntimeKind = 'query' | 'filter' | 'composition' | 'store' | 'stream' | 'action' | 'simulation' | 'runtime';
16
+ export type RuntimeExecutableModel = RQuery | RAction | RProject | RPage | RComponentSFC | RFilter | RComposition | RStore | RStream | RSimulation;
16
17
  export interface EndgeRuntimeSnapshot extends RuntimeHostRegistrySnapshot {
17
18
  generatedAt: number;
18
19
  scopes: import('./runtime-scope.types').RuntimeScopeSnapshot[];
@@ -20,6 +21,7 @@ export interface EndgeRuntimeSnapshot extends RuntimeHostRegistrySnapshot {
20
21
  /** Опциональные данные и graph-состояние Raph для диагностического snapshot. */
21
22
  export interface EndgeRuntimeRaphSnapshot {
22
23
  data?: unknown;
24
+ render?: import('./runtime-render-inspection.types').RuntimeRenderInspection;
23
25
  graph?: {
24
26
  runtimeId: string;
25
27
  loopEnabled: boolean;
@@ -0,0 +1,25 @@
1
+ import { RuntimeArtifactReader } from './runtime-host.types';
2
+ import { StreamTransportConnection, StreamTransportFactory } from './stream-runtime.types';
3
+ import { SimulationRuntimeHost } from '../hosts/SimulationRuntimeHost';
4
+ import { SimulationMockStream } from '../../source/domain/types/simulation-source.types';
5
+ /** Host adapter выполняет только transport; schema compilation/PRNG принадлежат сервису. */
6
+ export interface SimulationGenerator {
7
+ generate: (schema: Record<string, unknown>, seed: string, signal: AbortSignal) => Promise<unknown>;
8
+ openStream: (schema: Record<string, unknown>, options: SimulationMockStream, callbacks: Parameters<StreamTransportFactory['open']>[1]) => StreamTransportConnection;
9
+ }
10
+ export interface SimulationMountOptions {
11
+ generator?: SimulationGenerator;
12
+ /** Preview может передать draft artifact без изменения общей Program. */
13
+ artifactReader?: RuntimeArtifactReader;
14
+ /** Принудительный МОК поверхности запуска имеет приоритет над Simulation dataMode. */
15
+ forceMock?: boolean;
16
+ /** Явные входы target; Core не подставляет preview fixtures самостоятельно. */
17
+ props?: Record<string, unknown>;
18
+ }
19
+ export interface SimulationRuntimeSession {
20
+ readonly id: string;
21
+ readonly host: SimulationRuntimeHost;
22
+ pause: () => Promise<void>;
23
+ resume: () => Promise<void>;
24
+ unmount: () => Promise<void>;
25
+ }
@@ -5,7 +5,9 @@ export interface StreamTransportMessage {
5
5
  data: unknown;
6
6
  }
7
7
  export interface StreamTransportConnection {
8
- close: () => void;
8
+ close: () => void | Promise<void>;
9
+ pause?: () => Promise<void>;
10
+ resume?: () => Promise<void>;
9
11
  }
10
12
  /** Нейтральный к браузеру порт, используемый StreamRuntimeHost. */
11
13
  export interface StreamTransportFactory {
@@ -0,0 +1,5 @@
1
+ import { SimulationMountOptions, SimulationRuntimeSession } from '../domain/simulation-runtime.types';
2
+ /** Запускает Simulation через тот же registry и lifecycle, что Project и Composition. */
3
+ export declare class EndgeSimulation {
4
+ mount(identity: string, options?: SimulationMountOptions): Promise<SimulationRuntimeSession>;
5
+ }
@@ -8,6 +8,7 @@ import { RComponentSFCSource_Parts } from '../../domain/types/component/sfc/sour
8
8
  import { ComputationResource } from '../../domain/types/computation/computation-runtime.types';
9
9
  import { ComponentSFCPreviewOptions, ComponentSFCProgramPayload, ProgramDiagnostic } from '../../program/domain/types/program.types';
10
10
  import { RuntimeArtifactReader, RuntimeHost, RuntimeHostContext, RuntimeHostInputSource, RuntimeHostUpdateContext } from '../domain/runtime-host.types';
11
+ import { RuntimeRenderableInspection } from '../domain/runtime-render-inspection.types';
11
12
  import { VocabOptionMapping } from '../domain/vocab-cache.types';
12
13
  import { SourceFieldOption } from '../../source/domain/types/source-expression.types';
13
14
  import { RuntimeHostBase } from '../RuntimeHostBase';
@@ -102,6 +103,8 @@ export declare class ComponentSFCRuntimeHost extends RuntimeHostBase<'component-
102
103
  setInputSource(input: RuntimeHostInputSource | null | undefined): void;
103
104
  /** Возвращает текущий input source host-а. */
104
105
  getInputSource(): RuntimeHostInputSource | null;
106
+ /** Наблюдение сохраняет входы и уже вычисленное состояние; compilation и execution не запускаются. */
107
+ captureRenderInspection(): RuntimeRenderableInspection;
105
108
  /** Читает Meta-plane по compiler-known ссылке, не раскрывая SFC физический DataPath. */
106
109
  readDataMeta(reference: RComponentSFC_IR_DataMetaReference & {
107
110
  boundaryId?: string;
@@ -34,6 +34,11 @@ export declare class FilterViewRuntimeHost extends RuntimeHostBase<'filter', Run
34
34
  getRenderModel(): FilterViewRenderModel;
35
35
  /** Возвращает snapshot пользовательских presentation props. */
36
36
  getProps(): Readonly<Record<string, unknown>>;
37
+ /** Включает фактические controls, props и значения именно этого view, а не только Filter document. */
38
+ captureRenderInspection(): {
39
+ kind: "filter-view";
40
+ model: FilterViewRenderModel;
41
+ };
37
42
  /** Атомарно обновляет presentation props и invalidates renderer. */
38
43
  setProps(patch: Record<string, unknown>): void;
39
44
  /** Меняет одно поле через state-владельца Filter runtime. */