@endge/core 7.1.0 → 8.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 (61) hide show
  1. package/dist/core.js +25945 -24550
  2. package/dist/features/core/kernel/config/modules.config.d.ts +4 -4
  3. package/dist/features/core/kernel/endge.d.ts +3 -3
  4. package/dist/features/core/kernel/types/bootstrap.types.d.ts +7 -0
  5. package/dist/features/core/modules/EndgeVocabs_Module.d.ts +15 -4
  6. package/dist/features/core/modules/actions/EndgeActions_Module.d.ts +2 -0
  7. package/dist/features/core/modules/actions/services/ActionProgramExecutor.d.ts +9 -2
  8. package/dist/features/core/modules/auth/services/AuthSessionManager.d.ts +7 -1
  9. package/dist/features/core/modules/bridge/EndgeBridge_Module.d.ts +55 -0
  10. package/dist/features/core/modules/bridge/adapters/BrowserBridge_Adapter.d.ts +15 -0
  11. package/dist/features/core/modules/bridge/config/bridge.config.d.ts +14 -0
  12. package/dist/features/core/modules/bridge/configurator/EndgeBridgeConfigurator_Module.d.ts +26 -0
  13. package/dist/features/core/modules/bridge/debug/EndgeBridgeDebug_Module.d.ts +69 -0
  14. package/dist/features/core/modules/bridge/domain/bridge.type.d.ts +82 -0
  15. package/dist/features/core/modules/bridge/services/BridgeConnection_Service.d.ts +31 -0
  16. package/dist/features/core/modules/compiler/EndgeCompiler_Module.d.ts +13 -0
  17. package/dist/features/core/modules/computations/model/ComputationResourceRegistry.d.ts +2 -0
  18. package/dist/features/core/modules/context/EndgeContext_Module.d.ts +2 -0
  19. package/dist/features/core/modules/document-import/EndgeDocumentImport_Module.d.ts +1 -1
  20. package/dist/features/core/modules/domain/EndgeDomain_Module.d.ts +13 -0
  21. package/dist/features/core/modules/domain/documents/domain-document-descriptors.d.ts +3 -1
  22. package/dist/features/core/modules/domain/documents/service-document-serializer.d.ts +0 -1
  23. package/dist/features/core/modules/domain/entities/RComposition.d.ts +1 -1
  24. package/dist/features/core/modules/domain/entities/RProject.d.ts +3 -2
  25. package/dist/features/core/modules/domain/entities/RSimulation.d.ts +8 -0
  26. package/dist/features/core/modules/domain/types/document/document.types.d.ts +4 -2
  27. package/dist/features/core/modules/domain/types/document/domain-export.type.d.ts +2 -0
  28. package/dist/features/core/modules/domain/types/document/domain-provider.type.d.ts +1 -1
  29. package/dist/features/core/modules/domain-repository/EndgeDomainRepository_Module.d.ts +7 -0
  30. package/dist/features/core/modules/i18n/services/composition-i18n-catalog-projection.d.ts +2 -0
  31. package/dist/features/core/modules/program/EndgeProgram_Module.d.ts +7 -1
  32. package/dist/features/core/modules/program/domain/types/program.types.d.ts +1 -1
  33. package/dist/features/core/modules/runtime/EndgeRuntimeScopes_Module.d.ts +1 -0
  34. package/dist/features/core/modules/runtime/EndgeRuntime_Module.d.ts +8 -2
  35. package/dist/features/core/modules/runtime/RuntimeAppScope.d.ts +3 -0
  36. package/dist/features/core/modules/runtime/RuntimeHostFactory.d.ts +2 -1
  37. package/dist/features/core/modules/runtime/RuntimeScope.d.ts +2 -0
  38. package/dist/features/core/modules/runtime/domain/runtime-project-session.types.d.ts +1 -6
  39. package/dist/features/core/modules/runtime/domain/runtime-scope.types.d.ts +1 -1
  40. package/dist/features/core/modules/runtime/execution/endge-project.d.ts +2 -2
  41. package/dist/features/core/modules/runtime/hosts/ComponentSFCRuntimeHost.d.ts +2 -0
  42. package/dist/features/core/modules/runtime/hosts/CompositionRuntimeHost.d.ts +19 -4
  43. package/dist/features/core/modules/runtime/hosts/FilterViewRuntimeHost.d.ts +1 -0
  44. package/dist/features/core/modules/runtime/hosts/ProjectRuntimeHost.d.ts +9 -10
  45. package/dist/features/core/modules/runtime/hosts/StreamRuntimeHost.d.ts +8 -0
  46. package/dist/features/core/modules/runtime/operation/operation-history.d.ts +8 -1
  47. package/dist/features/core/modules/runtime/services/strategies/CompositionRuntimeStrategy.d.ts +1 -1
  48. package/dist/features/core/modules/runtime/services/strategies/ProjectRuntimeStrategy.d.ts +2 -1
  49. package/dist/features/core/modules/source/EndgeSource_Module.d.ts +2 -0
  50. package/dist/features/core/modules/source/domain/types/composition-source.types.d.ts +1 -1
  51. package/dist/features/core/modules/source/domain/types/simulation-source.types.d.ts +53 -0
  52. package/dist/features/core/modules/source/domain/types/source-engine.types.d.ts +2 -2
  53. package/dist/features/core/modules/source/services/SimulationSourceResolver.d.ts +33 -0
  54. package/dist/features/core/modules/source/services/compilers/simulation-source-compile.d.ts +3 -0
  55. package/dist/features/core/modules/source/services/strategies/SimulationSourceEngineStrategy.d.ts +10 -0
  56. package/dist/features/core/modules/source/services/strategies/SimulationSourceLanguageStrategy.d.ts +14 -0
  57. package/dist/features/core/modules/source/templates/project.default.source.d.ts +2 -0
  58. package/dist/features/core/modules/source/templates/simulation.default.source.d.ts +2 -0
  59. package/dist/main.d.ts +5 -0
  60. package/package.json +5 -4
  61. package/dist/features/core/modules/EndgeRuntimeDebugger_Module.d.ts +0 -86
@@ -1,5 +1,6 @@
1
1
  import { EndgeActions_Module } from '../../modules/actions/EndgeActions_Module';
2
2
  import { EndgeAuth_Module } from '../../modules/auth/EndgeAuth_Module';
3
+ import { EndgeBridge_Module } from '../../modules/bridge/EndgeBridge_Module';
3
4
  import { EndgeCompiler_Module } from '../../modules/compiler/EndgeCompiler_Module';
4
5
  import { EndgeComputations_Module } from '../../modules/computations/EndgeComputations_Module';
5
6
  import { EndgeConfiguration_Module } from '../../modules/configuration/EndgeConfiguration_Module';
@@ -10,7 +11,6 @@ import { EndgeDiagnostics_Module } from '../../modules/diagnostics/EndgeDiagnost
10
11
  import { EndgeDocumentImport_Module } from '../../modules/document-import/EndgeDocumentImport_Module';
11
12
  import { EndgeDomainRepository_Module } from '../../modules/domain-repository/EndgeDomainRepository_Module';
12
13
  import { EndgeDomain_Module } from '../../modules/domain/EndgeDomain_Module';
13
- import { EndgeRuntimeDebugger_Module } from '../../modules/EndgeRuntimeDebugger_Module';
14
14
  import { EndgeTypes_Module } from '../../modules/EndgeTypes_Module';
15
15
  import { EndgeVocabs_Module } from '../../modules/EndgeVocabs_Module';
16
16
  import { EndgeEvents_Module } from '../../modules/events/EndgeEvents_Module';
@@ -126,9 +126,9 @@ export declare const ENDGE_CORE_MODULES: readonly [{
126
126
  readonly create: () => EndgeUIRegistry_Module;
127
127
  readonly after: "ui";
128
128
  }, {
129
- readonly key: "runtimeDebugger";
130
- readonly create: () => EndgeRuntimeDebugger_Module;
131
- readonly after: readonly ["diagnostics", "runtime"];
129
+ readonly key: "bridge";
130
+ readonly create: ({ getModule }: import('../../../federation/types/endge-modules.types').EndgeModuleFactoryContext) => EndgeBridge_Module;
131
+ readonly after: readonly ["diagnostics", "runtime", "domain"];
132
132
  }, {
133
133
  readonly key: "styles";
134
134
  readonly create: () => EndgeStyles_Module;
@@ -102,9 +102,9 @@ declare const EndgeCore: import('../../federation/EndgeFederation').DefinedEndge
102
102
  readonly create: () => import('../modules/ui/EndgeUIRegistry_Module').EndgeUIRegistry_Module;
103
103
  readonly after: "ui";
104
104
  }, {
105
- readonly key: "runtimeDebugger";
106
- readonly create: () => import('../modules/EndgeRuntimeDebugger_Module').EndgeRuntimeDebugger_Module;
107
- readonly after: readonly ["diagnostics", "runtime"];
105
+ readonly key: "bridge";
106
+ readonly create: ({ getModule }: import('../../../main').EndgeModuleFactoryContext) => import('../modules/bridge/EndgeBridge_Module').EndgeBridge_Module;
107
+ readonly after: readonly ["diagnostics", "runtime", "domain"];
108
108
  }, {
109
109
  readonly key: "styles";
110
110
  readonly create: () => import('../modules/styles/EndgeStyles_Module').EndgeStyles_Module;
@@ -1,4 +1,5 @@
1
1
  import { EndgeAuthBootOptions } from '../../modules/auth/domain/types/auth-profile.types';
2
+ import { EndgeBridgeBootOptions } from '../../modules/bridge/domain/bridge.type';
2
3
  import { EndgeDomainBundle } from '../../modules/domain/types/document/domain-export.type';
3
4
  import { EndgeDomainProvider } from '../../modules/domain/types/document/domain-provider.type';
4
5
  import { EndgeExecutionContext } from '../../modules/runtime/domain/execution-context.types';
@@ -19,6 +20,10 @@ export interface EndgeLoadScope {
19
20
  workspaceIdentity?: string;
20
21
  }
21
22
  export interface EndgeUIBootOptions {
23
+ /** Локаль host при отсутствии сохранённого выбора, если она доступна в Workspace. */
24
+ defaultLocale?: string;
25
+ /** Тема host при отсутствии сохранённого выбора, если она доступна в Workspace. */
26
+ defaultTheme?: string;
22
27
  /** Локальный для host порядок fallback, когда настроенная реализация адаптера недоступна. */
23
28
  adapterFallbackIds?: readonly string[];
24
29
  }
@@ -41,6 +46,8 @@ export interface EndgeBootContext extends EndgeFederationContext {
41
46
  ui?: EndgeUIBootOptions;
42
47
  /** Пространство имён браузерной сессии, принадлежащее host. */
43
48
  auth?: EndgeAuthBootOptions;
49
+ /** Optional host-owned bridge policy; отсутствие отключает соединения. */
50
+ bridge?: EndgeBridgeBootOptions;
44
51
  /**
45
52
  * Для plain provider.
46
53
  */
@@ -2,6 +2,7 @@ import { VocabCacheOperationResult, VocabLoadPolicy, VocabReference } from './ru
2
2
  import { EndgeModule } from '../../federation/EndgeModule';
3
3
  export interface VocabAcquireOptions {
4
4
  dataMode?: 'live' | 'mock';
5
+ signal?: AbortSignal;
5
6
  }
6
7
  /**
7
8
  * Модуль загрузки и чтения external vocabs в Raph cache.
@@ -15,11 +16,17 @@ export declare class EndgeVocabs_Module extends EndgeModule {
15
16
  private _byIdCache;
16
17
  private readonly _loadedIdentities;
17
18
  private readonly _loadedAtByIdentity;
18
- private readonly _loadedModeByIdentity;
19
19
  private readonly _inFlight;
20
20
  private readonly _cacheVersions;
21
+ private readonly _loadVersions;
22
+ private readonly _ownedCachePaths;
23
+ private _abortController;
21
24
  private _loadingRequests;
22
25
  loading: boolean;
26
+ /** Освобождает кэш и запрещает ответы предыдущего lifecycle поколения. */
27
+ reset(): void;
28
+ /** Возвращает отдельный реактивный путь для выбранного режима данных. */
29
+ getPath(identity: string, options?: Pick<VocabAcquireOptions, 'dataMode'>): string;
23
30
  /**
24
31
  * Строит индекс collectionSlug -> vocab identity из доменных документов vocabs.
25
32
  */
@@ -44,7 +51,7 @@ export declare class EndgeVocabs_Module extends EndgeModule {
44
51
  *
45
52
  * Индекс больше не обязателен для чтения - оставлен только для других сценариев.
46
53
  */
47
- getValues(vocabs: string): Array<any>;
54
+ getValues(vocabs: string, options?: Pick<VocabAcquireOptions, 'dataMode'>): Array<any>;
48
55
  /**
49
56
  * Загружает до limit сущностей словаря по API (для инспектора и превью).
50
57
  * Если данные уже в Raph - не дергает сеть.
@@ -109,6 +116,10 @@ export declare class EndgeVocabs_Module extends EndgeModule {
109
116
  private _normalizeReferences;
110
117
  private _requireVocabConfig;
111
118
  private _loadShared;
119
+ /** Прямые загрузки одного cache key используют latest-wins; acquire разделяет один запуск. */
120
+ private _beginCacheWrite;
121
+ /** Проверяет актуальность загрузки до первой записи в observable cache. */
122
+ private _assertCacheRequest;
112
123
  private _bumpCacheVersion;
113
124
  private _normalizePolicy;
114
125
  private _isFresh;
@@ -117,9 +128,9 @@ export declare class EndgeVocabs_Module extends EndgeModule {
117
128
  * Устанавливает By Identity Cache.
118
129
  */
119
130
  private _setByIdentityCache;
120
- /** Пишет canonical identity cache и переходный alias provider.collection. */
131
+ /** Пишет кэш только по identity; имя коллекции разрешается отдельным индексом. */
121
132
  private _setCache;
122
- /** Читает canonical identity cache с переходным fallback на collection alias. */
133
+ /** Читает кэш только выбранной identity и режима без данных другого справочника. */
123
134
  private _getCache;
124
135
  /**
125
136
  * Разрешает Vocab Config By Id.
@@ -76,6 +76,8 @@ export declare class EndgeActions_Module extends EndgeModule {
76
76
  private _defaultProviderKey;
77
77
  private _contractOf;
78
78
  private _describe;
79
+ /** Запоминает поколение владельца, чтобы пауза с последующим resume не оживляла старый Action. */
80
+ private _captureExecutionGuard;
79
81
  private _registerCoreProviders;
80
82
  private _registerTableActions;
81
83
  /** Связывает типизированный вызов Action с legacy-адаптером контекстного меню на время миграции. */
@@ -6,21 +6,28 @@ import { OperationHistory } from '../../runtime/operation/operation-history';
6
6
  export interface ActionProgramExecutorDependencies {
7
7
  resolveQuery: (identity: string) => RQuery | null;
8
8
  runQuery: (query: RQuery, input: Record<string, unknown>, parent: RuntimeHost<any, any> | null) => Promise<unknown>;
9
- executeAction: (identity: string, input: unknown, parentRuntimeId?: string) => Promise<unknown>;
9
+ executeAction: (identity: string, input: unknown, parentRuntimeId?: string, execution?: ActionProgramExecutionOptions) => Promise<unknown>;
10
+ captureExecutionGuard?: (parent: RuntimeHost<any, any> | null) => () => void;
10
11
  runComputation: (identity: string, input: unknown) => Promise<unknown>;
11
12
  executeSandbox: (request: ComputationSandboxRequest) => Promise<unknown>;
12
13
  resolveOperationHistory: (parent: RuntimeHost<any, any> | null) => OperationHistory | null;
13
14
  runDataView: (identity: string, input: unknown, props?: Record<string, unknown>) => unknown;
14
15
  executeConverter: (identity: string, input: unknown, options?: Record<string, unknown>) => unknown;
15
16
  }
17
+ /** Контекст одного вызова сохраняется через вложенные Source Actions. */
18
+ export interface ActionProgramExecutionOptions {
19
+ recordHistory?: boolean;
20
+ assertActive?: () => void;
21
+ }
16
22
  /** Выполняет созданный компилятором IR Action без интерпретации Source. */
17
23
  export declare class ActionProgramExecutor {
18
24
  private readonly _dependencies;
19
25
  constructor(_dependencies: ActionProgramExecutorDependencies);
20
- run(payload: ActionProgramPayload, input: unknown, parent: RuntimeHost<any, any> | null): Promise<unknown>;
26
+ run(payload: ActionProgramPayload, input: unknown, parent: RuntimeHost<any, any> | null, execution?: ActionProgramExecutionOptions): Promise<unknown>;
21
27
  private _runBlock;
22
28
  private _runStep;
23
29
  private _runOperation;
30
+ private _captureExecutionGuard;
24
31
  private _evaluate;
25
32
  private _findComposition;
26
33
  private _requireObject;
@@ -16,6 +16,9 @@ export declare class AuthSessionManager {
16
16
  private readonly _states;
17
17
  private readonly _operations;
18
18
  private readonly _sources;
19
+ private readonly _sessionVersions;
20
+ private readonly _loggingOut;
21
+ private _generation;
19
22
  private readonly _now;
20
23
  private _defaultProfile;
21
24
  constructor(_profiles: AuthProfileRegistry, _adapters: AuthAdapterRegistry, _store: AuthSessionStore, _dependencies: AuthSessionManagerDependencies);
@@ -45,7 +48,6 @@ export declare class AuthSessionManager {
45
48
  toResolvedSession(profile: AuthProfileSchema, token: AuthTokenSet): AuthResolvedSession;
46
49
  /** Сбрасывает runtime state, сохраняя local/sessionStorage snapshots. */
47
50
  resetRuntime(): void;
48
- private _authenticateWhenAllowed;
49
51
  private _authenticate;
50
52
  private _setState;
51
53
  private _clearState;
@@ -57,5 +59,9 @@ export declare class AuthSessionManager {
57
59
  private _isRefreshExpired;
58
60
  private _workspaceIdentity;
59
61
  private _singleFlight;
62
+ /** Отсоединяет старую operation до изменения session owner. */
63
+ private _invalidateSession;
64
+ /** Поздний ответ не должен менять новую сессию или другой workspace. */
65
+ private _sessionGuard;
60
66
  }
61
67
  export {};
@@ -0,0 +1,55 @@
1
+ import { EndgeBootContext } from '../../kernel/types/bootstrap.types';
2
+ import { BridgeConnectionState, BridgeDebugProviders } from './domain/bridge.type';
3
+ import { BrowserBridge_Adapter } from './adapters/BrowserBridge_Adapter';
4
+ import { EndgeBridgeConfigurator_Module } from './configurator/EndgeBridgeConfigurator_Module';
5
+ import { EndgeBridgeDebug_Module } from './debug/EndgeBridgeDebug_Module';
6
+ import { EndgeModule } from '../../../federation/EndgeModule';
7
+ /** Владелец bridge транспорта, host policy и lifecycle обоих подмодулей. */
8
+ export declare class EndgeBridge_Module extends EndgeModule<EndgeBootContext> {
9
+ private readonly _adapter;
10
+ readonly debug: EndgeBridgeDebug_Module;
11
+ readonly configurator: EndgeBridgeConfigurator_Module;
12
+ private _options;
13
+ private _workspaceIdentity;
14
+ private _started;
15
+ private _suspended;
16
+ private _unsubscribePage;
17
+ private readonly _allowed;
18
+ private readonly _connections;
19
+ private readonly _states;
20
+ /**
21
+ * ----------------------------------------
22
+ * PUBLIC
23
+ * ----------------------------------------
24
+ */
25
+ /** Создаёт owner и его явные зависимости без запуска транспорта. */
26
+ constructor(providers: BridgeDebugProviders, _adapter?: BrowserBridge_Adapter);
27
+ /** Принимает optional host policy без network/DOM side effects. */
28
+ setup(ctx: EndgeBootContext): void;
29
+ /** Запускает live transports после загрузки Domain и diagnostics. */
30
+ start(): void;
31
+ /** Подключается только к адресу из неизменяемой host policy текущего boot. */
32
+ connect(rawServerUrl: string): void;
33
+ /** Отключение пользователем прекращает reconnect до следующего connect/boot. */
34
+ disconnect(rawServerUrl: string): void;
35
+ /** Отзывает текущий lifecycle и освобождает принадлежащее модулю состояние. */
36
+ reset(): void;
37
+ /** Только безопасные metadata; без pending payloads и снимков других клиентов. */
38
+ createDiagnosticsSnapshot(): unknown;
39
+ /**
40
+ * ----------------------------------------
41
+ * PRIVATE
42
+ * ----------------------------------------
43
+ */
44
+ /** Разрешает только существующее соединение из host allowlist. */
45
+ private _connection;
46
+ /** Направляет сообщение в подмодуль и отзывает канал при ошибке обработки. */
47
+ private _receive;
48
+ /**
49
+ * ----------------------------------------
50
+ * ACCESS
51
+ * ----------------------------------------
52
+ */
53
+ /** Возвращает текущие подключения без доступа к внутреннему mutable state. */
54
+ get connections(): readonly BridgeConnectionState[];
55
+ }
@@ -0,0 +1,15 @@
1
+ import { DebugConnectionRequest } from '../domain/bridge.type';
2
+ /** Browser boundary bridge. Не владеет сессиями или политикой доступа. */
3
+ export declare class BrowserBridge_Adapter {
4
+ /** Открывает стандартный WebSocket; cookie authentication выполняет браузер. */
5
+ open(url: string): WebSocket;
6
+ /** Показывает встроенное подтверждение. Отсутствие browser API означает отказ. */
7
+ confirmDebugConnection(request: DebugConnectionRequest): Promise<boolean>;
8
+ /** SHA-256 точного sourceVersion/source tuple, без имени и локального document id. */
9
+ hashSimulation(source: {
10
+ sourceVersion: number;
11
+ source: string;
12
+ }): Promise<string>;
13
+ /** Подписывает owner на уход/восстановление страницы и возвращает cleanup. */
14
+ subscribePage(onHide: () => void, onShow: () => void): () => void;
15
+ }
@@ -0,0 +1,14 @@
1
+ /** Ограничения протокола и ресурсов bridge v1. */
2
+ export declare const BRIDGE_CONFIG: {
3
+ readonly protocol: 1;
4
+ readonly registrationTimeoutMs: 10000;
5
+ readonly serverSilenceTimeoutMs: 75000;
6
+ readonly requestTimeoutMs: 60000;
7
+ readonly reconnectMaxMs: 30000;
8
+ readonly maxMessageBytes: number;
9
+ readonly maxPendingRequests: 16;
10
+ };
11
+ /** Нормализует точный backend URL без credentials, query и fragment. */
12
+ export declare function normalizeBridgeServer(raw: string): string;
13
+ /** Разбирает CSV environment value на стороне host до передачи массива в boot. */
14
+ export declare function parseBridgeAllowedServers(value: string | undefined): string[];
@@ -0,0 +1,26 @@
1
+ import { ConfiguratorConnection, ConfiguratorParticipant } from '../domain/bridge.type';
2
+ import { EndgeModule } from '../../../../federation/EndgeModule';
3
+ /** Проекция авторизованных конфигураторов workspace, без page/UI state. */
4
+ export declare class EndgeBridgeConfigurator_Module extends EndgeModule {
5
+ private readonly _byServer;
6
+ /**
7
+ * ----------------------------------------
8
+ * PUBLIC
9
+ * ----------------------------------------
10
+ */
11
+ /** Родитель заменяет authoritative server roster целиком, включая пустой. */
12
+ update(serverUrl: string, connections: readonly Omit<ConfiguratorConnection, 'serverUrl'>[]): void;
13
+ /** Удаляет устаревшую проекцию при потере backend. */
14
+ disconnect(serverUrl: string): void;
15
+ /** Отзывает текущий lifecycle и освобождает принадлежащее модулю состояние. */
16
+ reset(): void;
17
+ /**
18
+ * ----------------------------------------
19
+ * ACCESS
20
+ * ----------------------------------------
21
+ */
22
+ /** Возвращает текущие подключения без доступа к внутреннему mutable state. */
23
+ get connections(): readonly ConfiguratorConnection[];
24
+ /** Объединяет вкладки пользователя отдельно для каждого backend. */
25
+ get participants(): readonly ConfiguratorParticipant[];
26
+ }
@@ -0,0 +1,69 @@
1
+ import { BrowserBridge_Adapter } from '../adapters/BrowserBridge_Adapter';
2
+ import { BridgeCommands, BridgeDebugClient, BridgeDebugProviders, BridgeDebugSession, BridgeMessage, SimulationRunResult } from '../domain/bridge.type';
3
+ import { DiagnosticsSnapshot } from '../../diagnostics/domain/types/diagnostics.types';
4
+ import { EndgeModule } from '../../../../federation/EndgeModule';
5
+ /** Debug policy и единственная client reservation сразу для всех backend. */
6
+ export declare class EndgeBridgeDebug_Module extends EndgeModule {
7
+ private readonly _commands;
8
+ private readonly _providers;
9
+ private readonly _adapter;
10
+ private _role;
11
+ private _enabled;
12
+ private _reservation;
13
+ private readonly _requests;
14
+ private readonly _clients;
15
+ private readonly _sessions;
16
+ /**
17
+ * ----------------------------------------
18
+ * PUBLIC
19
+ * ----------------------------------------
20
+ */
21
+ /** Создаёт owner и его явные зависимости без запуска транспорта. */
22
+ constructor(_commands: BridgeCommands, _providers: BridgeDebugProviders, _adapter: BrowserBridge_Adapter);
23
+ /** Настраивается только родителем из host boot options. */
24
+ configure(role: 'client' | 'configurator', enabled: boolean): void;
25
+ /** Запрашивает сессию; Promise завершается после подтверждения в приложении. */
26
+ requestSession(input: {
27
+ serverUrl: string;
28
+ instanceId: string;
29
+ }): Promise<BridgeDebugSession>;
30
+ /** Завершает выбранную сессию с любой её стороны. */
31
+ endSession(sessionId: string): Promise<void>;
32
+ /** Запрашивает snapshot существующего diagnostics collector без скачивания файла. */
33
+ getSnapshot(sessionId: string): Promise<DiagnosticsSnapshot>;
34
+ /** Пока выполняет только existence/hash check и console mock на стороне клиента. */
35
+ runSimulation(sessionId: string, input: {
36
+ identity: string;
37
+ expectedHash: string;
38
+ }): Promise<SimulationRunResult>;
39
+ /** Вычисляет hash локальной симуляции для передачи expectedHash. */
40
+ getSimulationHash(identity: string): Promise<string>;
41
+ /** Применяет сообщение только из принадлежащего родителю соединения. */
42
+ receive(serverUrl: string, message: BridgeMessage): Promise<void>;
43
+ /** Потеря транспорта окончательно отзывает сессию и согласие. */
44
+ disconnect(serverUrl: string): void;
45
+ /** Отзывает текущий lifecycle и освобождает принадлежащее модулю состояние. */
46
+ reset(): void;
47
+ /**
48
+ * ----------------------------------------
49
+ * PRIVATE
50
+ * ----------------------------------------
51
+ */
52
+ /** Резервирует единственное согласие и проверяет его актуальность после диалога. */
53
+ private _confirm;
54
+ /** Проверяет активную сессию и выполняет только snapshot либо simulation mock. */
55
+ private _execute;
56
+ /** Проверяет локальную роль и явное разрешение отладки. */
57
+ private _requireConfigurator;
58
+ /** Разрешает только существующую активную сессию. */
59
+ private _requireSession;
60
+ /**
61
+ * ----------------------------------------
62
+ * ACCESS
63
+ * ----------------------------------------
64
+ */
65
+ /** Возвращает доступные приложения из актуальных server rosters. */
66
+ get clients(): readonly BridgeDebugClient[];
67
+ /** Возвращает копии активных согласованных сессий. */
68
+ get sessions(): readonly BridgeDebugSession[];
69
+ }
@@ -0,0 +1,82 @@
1
+ import { DiagnosticsSnapshot } from '../../diagnostics/domain/types/diagnostics.types';
2
+ /** Локальная политика host, не сохраняемая в Domain. URL включает backend base path. */
3
+ export type EndgeBridgeBootOptions = {
4
+ role: 'client';
5
+ allowedServers: readonly string[];
6
+ debug?: boolean;
7
+ label?: string;
8
+ } | {
9
+ role: 'configurator';
10
+ serverUrl: string;
11
+ debug?: boolean;
12
+ label?: string;
13
+ };
14
+ export interface BridgeConnectionState {
15
+ serverUrl: string;
16
+ status: 'connecting' | 'connected' | 'reconnecting' | 'disconnected';
17
+ instanceId?: string;
18
+ error?: string;
19
+ }
20
+ export interface ConfiguratorConnection {
21
+ serverUrl: string;
22
+ instanceId: string;
23
+ userId: string;
24
+ displayName: string;
25
+ label: string;
26
+ }
27
+ export interface ConfiguratorParticipant {
28
+ serverUrl: string;
29
+ userId: string;
30
+ displayName: string;
31
+ connectionCount: number;
32
+ }
33
+ export interface BridgeDebugClient {
34
+ serverUrl: string;
35
+ instanceId: string;
36
+ label: string;
37
+ }
38
+ export interface BridgeDebugSession {
39
+ serverUrl: string;
40
+ sessionId: string;
41
+ clientId: string;
42
+ configuratorId: string;
43
+ }
44
+ export interface DebugConnectionRequest {
45
+ serverUrl: string;
46
+ sessionId: string;
47
+ workspaceIdentity: string;
48
+ displayName: string;
49
+ expiresAt: number;
50
+ }
51
+ export type SimulationRunResult = {
52
+ status: 'mocked';
53
+ identity: string;
54
+ hash: string;
55
+ } | {
56
+ status: 'rejected';
57
+ reason: 'not-found' | 'hash-mismatch';
58
+ };
59
+ /** Закрытый набор сообщений bridge v1; это не произвольный RPC над Core. */
60
+ export interface BridgeMessage {
61
+ type: string;
62
+ id?: string;
63
+ sessionId?: string;
64
+ targetId?: string;
65
+ identity?: string;
66
+ expectedHash?: string;
67
+ accepted?: boolean;
68
+ data?: unknown;
69
+ error?: string;
70
+ }
71
+ export interface BridgeDebugProviders {
72
+ getSimulation: (identity: string) => {
73
+ source: string;
74
+ sourceVersion: number;
75
+ } | null;
76
+ snapshot: () => DiagnosticsSnapshot;
77
+ }
78
+ /** Внутренний порт подмодулей к единственному владельцу соединений. */
79
+ export interface BridgeCommands {
80
+ request: (serverUrl: string, message: BridgeMessage) => Promise<unknown>;
81
+ send: (serverUrl: string, message: BridgeMessage) => void;
82
+ }
@@ -0,0 +1,31 @@
1
+ import { BrowserBridge_Adapter } from '../adapters/BrowserBridge_Adapter';
2
+ import { BridgeConnectionState, BridgeMessage } from '../domain/bridge.type';
3
+ /** Один socket generation, bounded requests и reconnect одного backend. */
4
+ export declare class BridgeConnection_Service {
5
+ private readonly _serverUrl;
6
+ private readonly _role;
7
+ private readonly _hello;
8
+ private readonly _adapter;
9
+ private readonly _onState;
10
+ private readonly _onMessage;
11
+ private _socket;
12
+ private _retry;
13
+ private _registration;
14
+ private _watchdog;
15
+ private _attempt;
16
+ private _active;
17
+ private _ready;
18
+ private readonly _pending;
19
+ constructor(_serverUrl: string, _role: 'client' | 'configurator', _hello: unknown, _adapter: BrowserBridge_Adapter, _onState: (state: BridgeConnectionState) => void, _onMessage: (message: BridgeMessage) => void);
20
+ /** Запускает одну попытку. Повторный вызов не создаёт второй socket. */
21
+ start(): void;
22
+ /** Отменяет всю работу; запоздалые callbacks старого socket игнорируются. */
23
+ stop(): void;
24
+ /** Отправляет конечную команду с correlation id и deadline. */
25
+ request(message: BridgeMessage): Promise<unknown>;
26
+ /** Отправляет сообщение без очереди для offline-соединения. */
27
+ send(message: BridgeMessage): void;
28
+ private _open;
29
+ private _closed;
30
+ private _disposeSocket;
31
+ }
@@ -1,4 +1,5 @@
1
1
  import { EndgeBootContext } from '../../kernel/types/bootstrap.types';
2
+ import { RSimulation } from '../domain/entities/RSimulation';
2
3
  import { RStore } from '../domain/entities/RStore';
3
4
  import { RStream } from '../domain/entities/RStream';
4
5
  import { RStyle } from '../domain/entities/RStyle';
@@ -8,6 +9,7 @@ import { RVocabs } from '../domain/entities/RVocabs';
8
9
  import { ActionProgramPayload, ComponentSFCProgramPayload, ComputationProgramPayload, DataViewProgramPayload, EndgeStyleProgramPayload, ProgramArtifact, ProgramEntityType, QueryProgramPayload } from '../program/domain/types/program.types';
9
10
  import { CompositionProgramPayload } from '../source/domain/types/composition-source.types';
10
11
  import { FilterProgramPayload } from '../source/domain/types/filter-source.types';
12
+ import { SimulationSourceArtifact } from '../source/domain/types/simulation-source.types';
11
13
  import { StoreSourceArtifact } from '../source/domain/types/store-source.types';
12
14
  import { StreamSourceArtifact } from '../source/domain/types/stream-source.types';
13
15
  import { TypeProgramPayload } from '../source/domain/types/type-source.types';
@@ -19,6 +21,7 @@ import { RComposition } from '../domain/entities/RComposition';
19
21
  import { RComputation } from '../domain/entities/RComputation';
20
22
  import { RDataView } from '../domain/entities/RDataView';
21
23
  import { RFilter } from '../domain/entities/RFilter';
24
+ import { RProject } from '../domain/entities/RProject';
22
25
  import { RQuery } from '../domain/entities/RQuery';
23
26
  import { EndgeModule } from '../../../federation/EndgeModule';
24
27
  /**
@@ -72,12 +75,18 @@ export declare class EndgeCompiler_Module extends EndgeModule<EndgeBootContext>
72
75
  buildStore(entity: RStore): ProgramArtifact<StoreSourceArtifact>;
73
76
  /** Компилирует один Stream source в Endge.program. */
74
77
  buildStream(entity: RStream): ProgramArtifact<StreamSourceArtifact>;
78
+ /** Компилирует один Simulation source в Endge.program. */
79
+ buildSimulation(entity: RSimulation): ProgramArtifact<SimulationSourceArtifact>;
75
80
  /** Компилирует один дочерний Update source в Endge.program. */
76
81
  buildUpdate(entity: RUpdate): ProgramArtifact<UpdateSourceArtifact>;
77
82
  /** Компилирует один Filter source в Endge.program. */
78
83
  buildFilter(entity: RFilter): ProgramArtifact<FilterProgramPayload>;
79
84
  /** Компилирует один Composition source в Endge.program. */
80
85
  buildComposition(entity: RComposition): ProgramArtifact<CompositionProgramPayload>;
86
+ /** Компилирует корневой граф проекта под собственной project identity. */
87
+ buildProject(entity: RProject): ProgramArtifact<CompositionProgramPayload>;
88
+ /** Создаёт isolated project artifact для Preview без публикации в общей program. */
89
+ compileProjectArtifact(entity: RProject): ProgramArtifact<CompositionProgramPayload>;
81
90
  /**
82
91
  * Компилирует transient Composition artifact без публикации в Endge.program.
83
92
  * Используется runtime session overlays, которым нельзя менять общий build.
@@ -114,6 +123,10 @@ export declare class EndgeCompiler_Module extends EndgeModule<EndgeBootContext>
114
123
  * конкретного `ProgramEntityType`.
115
124
  */
116
125
  private _compileEntity;
126
+ /** Сравнивает inputs без повторного parser/compiler вызова и hash большого Source на каждой строке UI. */
127
+ private _createFreshnessCheck;
128
+ /** Читает текущую Domain-сущность, включая замену объекта ответом persistence. */
129
+ private _resolveArtifactEntity;
117
130
  /** Стабильный порядок исходников: сначала системные документы, затем авторские по identity. */
118
131
  private _orderedStyles;
119
132
  /** Возвращает static artifact dependencies внешних computation calls. */
@@ -7,5 +7,7 @@ export declare class ComputationResourceRegistry {
7
7
  /** Входы ресурсов, запрошенные текущим активным проходом renderer. */
8
8
  private readonly _updatingInputs;
9
9
  getOrCreate(key: string, input: unknown, create: () => ComputationResourceState, onChange?: VoidFunction): ComputationResourceContract;
10
+ /** Renderer освобождает завершившихся consumers, не затрагивая соседние scopes. */
11
+ releaseScope(scope: string, keep?: (key: string) => boolean): void;
10
12
  dispose(): void;
11
13
  }
@@ -23,8 +23,10 @@ export declare class EndgeContext_Module extends EndgeModule<EndgeBootContext> {
23
23
  private _currentUser;
24
24
  private _currentLocale;
25
25
  private _pendingLocale;
26
+ private _hasLocalePreference;
26
27
  private _currentTheme;
27
28
  private _themePreference;
29
+ private _hostDefaultTheme;
28
30
  private _currentTimezone;
29
31
  private _pendingTimezone;
30
32
  private _workspaceDataMode;
@@ -7,7 +7,7 @@ export declare class EndgeDocumentImport_Module extends EndgeModule {
7
7
  private readonly _openAPIParser;
8
8
  private _activePlan;
9
9
  private _planSequence;
10
- private _applying;
10
+ private _applyingPlan;
11
11
  /**
12
12
  * ----------------------------------------
13
13
  * PUBLIC
@@ -19,6 +19,7 @@ import { RParameter } from './entities/RParameter';
19
19
  import { RPolicy } from './entities/RPolicy';
20
20
  import { RProject } from './entities/RProject';
21
21
  import { RQuery } from './entities/RQuery';
22
+ import { RSimulation } from './entities/RSimulation';
22
23
  import { RStore } from './entities/RStore';
23
24
  import { RStream } from './entities/RStream';
24
25
  import { RStyle } from './entities/RStyle';
@@ -54,6 +55,7 @@ export interface EndgeDomainParsed {
54
55
  compositions: RComposition[];
55
56
  stores: RStore[];
56
57
  streams: RStream[];
58
+ simulations: RSimulation[];
57
59
  updates: RUpdate[];
58
60
  mocks: RMock[];
59
61
  computations: RComputation[];
@@ -92,7 +94,9 @@ export declare class EndgeDomain_Module extends EndgeModule<EndgeBootContext> {
92
94
  private _storesById;
93
95
  private _storesByIdentity;
94
96
  private _streamsById;
97
+ private _simulationsById;
95
98
  private _streamsByIdentity;
99
+ private _simulationsByIdentity;
96
100
  private _updatesById;
97
101
  private _updatesByIdentity;
98
102
  private _updatesByStoreIdentity;
@@ -364,6 +368,15 @@ export declare class EndgeDomain_Module extends EndgeModule<EndgeBootContext> {
364
368
  removeStreamById(id: string | number): void;
365
369
  removeStreamByIdentity(identity: string): void;
366
370
  removeStream(idOrIdentity: string | number): void;
371
+ /** Возвращает все Simulation-документы. */
372
+ getSimulations(): RSimulation[];
373
+ getSimulationById(id: string | number): RSimulation | null;
374
+ getSimulationByIdentity(identity: string): RSimulation | null;
375
+ getSimulation(idOrIdentity: string | number): RSimulation | null;
376
+ addSimulation(simulation: RSimulation): void;
377
+ removeSimulationById(id: string | number): void;
378
+ removeSimulationByIdentity(identity: string): void;
379
+ removeSimulation(idOrIdentity: string | number): void;
367
380
  /** Возвращает все Update-документы независимо от Store-owner. */
368
381
  getUpdates(): RUpdate[];
369
382
  getUpdatesByStoreIdentity(storeIdentity: string): RUpdate[];