@endge/core 9.0.0 → 11.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 (131) hide show
  1. package/dist/core.js +41944 -40206
  2. package/dist/features/core/kernel/config/debugger.config.d.ts +3 -0
  3. package/dist/features/core/kernel/config/kernel.config.d.ts +2 -2
  4. package/dist/features/core/kernel/config/modules.config.d.ts +6 -1
  5. package/dist/features/core/kernel/constants/kernel.constants.d.ts +1 -3
  6. package/dist/features/core/kernel/endge.d.ts +20 -6
  7. package/dist/features/core/kernel/errors/EndgeDebuggerReadOnlyError.d.ts +5 -0
  8. package/dist/features/core/kernel/tools/debugger-snapshot.d.ts +13 -0
  9. package/dist/features/core/kernel/tools/read-only-document.d.ts +2 -0
  10. package/dist/features/core/kernel/types/bootstrap.types.d.ts +8 -2
  11. package/dist/features/core/modules/bridge/adapters/BrowserBridge_Adapter.d.ts +0 -3
  12. package/dist/features/core/modules/bridge/config/bridge.config.d.ts +17 -0
  13. package/dist/features/core/modules/bridge/debug/EndgeBridgeDebug_Module.d.ts +59 -4
  14. package/dist/features/core/modules/bridge/domain/bridge-sync.type.d.ts +30 -0
  15. package/dist/features/core/modules/bridge/tools/bridge-sync.d.ts +16 -0
  16. package/dist/features/core/modules/commands/EndgeCommands_Module.d.ts +17 -0
  17. package/dist/features/core/modules/commands/config/commands.config.d.ts +9 -0
  18. package/dist/features/core/modules/commands/domain/commands.types.d.ts +38 -0
  19. package/dist/features/core/modules/commands/services/LocalCommandExecutor.d.ts +9 -0
  20. package/dist/features/core/modules/commands/services/RemoteCommandExecutor.d.ts +9 -0
  21. package/dist/features/core/modules/commands/services/context/SetDataModeCommand.d.ts +9 -0
  22. package/dist/features/core/modules/commands/services/context/SetFacetCommand.d.ts +9 -0
  23. package/dist/features/core/modules/commands/services/context/SetLocaleCommand.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 +12 -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 +7 -6
  36. package/dist/features/core/modules/compiler/services/action/action-compile.d.ts +2 -0
  37. package/dist/features/core/modules/compiler/services/computation/computation-compile.d.ts +2 -0
  38. package/dist/features/core/modules/computations/model/ComputationResource.d.ts +11 -1
  39. package/dist/features/core/modules/computations/model/ComputationResourceRegistry.d.ts +9 -0
  40. package/dist/features/core/modules/configuration/EndgeConfiguration_Module.d.ts +4 -2
  41. package/dist/features/core/modules/configuration/domain/endge-configuration.d.ts +1 -1
  42. package/dist/features/core/modules/configuration/domain/tooltip.config.d.ts +1 -1
  43. package/dist/features/core/modules/configuration/domain/types/configuration.type.d.ts +3 -1
  44. package/dist/features/core/modules/context/EndgeContext_Module.d.ts +33 -22
  45. package/dist/features/core/modules/context/domain/context-events.types.d.ts +8 -0
  46. package/dist/features/core/modules/context/domain/context-persistence.types.d.ts +8 -8
  47. package/dist/features/core/modules/domain/EndgeDomain_Module.d.ts +20 -201
  48. package/dist/features/core/modules/domain/documents/document-metadata.d.ts +7 -0
  49. package/dist/features/core/modules/domain/documents/domain-document-descriptors.d.ts +4 -10
  50. package/dist/features/core/modules/domain/documents/service-document-serializer.d.ts +0 -1
  51. package/dist/features/core/modules/domain/entities/RComponentBase.d.ts +0 -1
  52. package/dist/features/core/modules/domain/entities/RComposition.d.ts +1 -1
  53. package/dist/features/core/modules/domain/entities/REntity.d.ts +2 -0
  54. package/dist/features/core/modules/domain/entities/RFacet.d.ts +14 -0
  55. package/dist/features/core/modules/domain/entities/RFacetDocument.d.ts +12 -0
  56. package/dist/features/core/modules/domain/entities/RFolder.d.ts +5 -0
  57. package/dist/features/core/modules/domain/entities/RSimulation.d.ts +1 -1
  58. package/dist/features/core/modules/domain/entities/RWorkspace.d.ts +3 -1
  59. package/dist/features/core/modules/domain/types/document/codegen.types.d.ts +14 -4
  60. package/dist/features/core/modules/domain/types/document/document-metadata.types.d.ts +38 -0
  61. package/dist/features/core/modules/domain/types/document/document.types.d.ts +4 -15
  62. package/dist/features/core/modules/domain/types/document/domain-export.type.d.ts +4 -7
  63. package/dist/features/core/modules/domain/types/document/domain-provider.type.d.ts +48 -1
  64. package/dist/features/core/modules/domain/types/document/domain-snapshot.type.d.ts +6 -1
  65. package/dist/features/core/modules/domain/types/document/query.types.d.ts +0 -48
  66. package/dist/features/core/modules/domain-repository/EndgeDomainRepository_Module.d.ts +25 -2
  67. package/dist/features/core/modules/events/EndgeEvents_Module.d.ts +13 -63
  68. package/dist/features/core/modules/events/domain/events.types.d.ts +34 -22
  69. package/dist/features/core/modules/i18n/services/composition-i18n-catalog-projection.d.ts +1 -3
  70. package/dist/features/core/modules/i18n/tools/resolve-runtime-translation.d.ts +3 -0
  71. package/dist/features/core/modules/program/domain/types/program.types.d.ts +1 -1
  72. package/dist/features/core/modules/runtime/ComponentSFCEventBoundary.d.ts +1 -1
  73. package/dist/features/core/modules/runtime/EndgeRuntimeScopes_Module.d.ts +5 -0
  74. package/dist/features/core/modules/runtime/EndgeRuntime_Module.d.ts +45 -8
  75. package/dist/features/core/modules/runtime/domain/component-sfc-render-port.types.d.ts +8 -0
  76. package/dist/features/core/modules/runtime/domain/execution-context.types.d.ts +5 -12
  77. package/dist/features/core/modules/runtime/domain/runtime-entity-map.types.d.ts +3 -3
  78. package/dist/features/core/modules/runtime/domain/runtime-host.types.d.ts +3 -4
  79. package/dist/features/core/modules/runtime/domain/runtime-inspection.types.d.ts +28 -0
  80. package/dist/features/core/modules/runtime/domain/runtime-render-inspection.types.d.ts +27 -0
  81. package/dist/features/core/modules/runtime/domain/runtime.types.d.ts +4 -3
  82. package/dist/features/core/modules/runtime/domain/simulation-runtime.types.d.ts +25 -0
  83. package/dist/features/core/modules/runtime/domain/stream-runtime.types.d.ts +3 -1
  84. package/dist/features/core/modules/runtime/execution/endge-simulation.d.ts +5 -0
  85. package/dist/features/core/modules/runtime/hosts/ComponentSFCRuntimeHost.d.ts +3 -0
  86. package/dist/features/core/modules/runtime/hosts/CompositionRuntimeHost.d.ts +2 -3
  87. package/dist/features/core/modules/runtime/hosts/FilterViewRuntimeHost.d.ts +5 -0
  88. package/dist/features/core/modules/runtime/hosts/SimulationRuntimeHost.d.ts +52 -0
  89. package/dist/features/core/modules/runtime/hosts/StreamRuntimeHost.d.ts +7 -4
  90. package/dist/features/core/modules/runtime/services/simulation/create-simulation-schema.d.ts +5 -0
  91. package/dist/features/core/modules/runtime/services/simulation/find-simulation-runtime.d.ts +4 -0
  92. package/dist/features/core/modules/runtime/services/simulation/prepare-simulation-overrides.d.ts +14 -0
  93. package/dist/features/core/modules/runtime/services/strategies/CompositionRuntimeStrategy.d.ts +1 -1
  94. package/dist/features/core/modules/runtime/services/strategies/SimulationRuntimeStrategy.d.ts +9 -0
  95. package/dist/features/core/modules/runtime/services/transports/BrowserWebSocketStreamTransportFactory.d.ts +6 -0
  96. package/dist/features/core/modules/runtime/tools/runtime-inspection.d.ts +10 -0
  97. package/dist/features/core/modules/runtime/tools/runtime-render-inspection.d.ts +6 -0
  98. package/dist/features/core/modules/runtime/tools/runtime-render-values.d.ts +4 -0
  99. package/dist/features/core/modules/source/EndgeSource_Module.d.ts +2 -2
  100. package/dist/features/core/modules/source/domain/types/composition-source.types.d.ts +14 -1
  101. package/dist/features/core/modules/source/domain/types/configuration-source.types.d.ts +2 -0
  102. package/dist/features/core/modules/source/domain/types/simulation-source.types.d.ts +25 -7
  103. package/dist/features/core/modules/source/domain/types/source-engine.types.d.ts +9 -4
  104. package/dist/features/core/modules/source/domain/types/store-source.types.d.ts +2 -0
  105. package/dist/features/core/modules/source/domain/types/stream-source.types.d.ts +15 -1
  106. package/dist/features/core/modules/source/domain/types/type-source.types.d.ts +2 -0
  107. package/dist/features/core/modules/source/domain/types/update-source.types.d.ts +2 -0
  108. package/dist/features/core/modules/source/services/SimulationSourceResolver.d.ts +3 -2
  109. package/dist/features/core/modules/source/services/compilers/action-source-compile.d.ts +2 -0
  110. package/dist/features/core/modules/source/services/compilers/composition-source-compile.d.ts +1 -1
  111. package/dist/features/core/modules/source/services/component-sfc/component-sfc-metadata-source-patch.d.ts +2 -2
  112. package/dist/features/core/modules/source/services/strategies/CompositionSourceEngineStrategy.d.ts +2 -2
  113. package/dist/features/core/modules/source/services/strategies/SimulationSourceEngineStrategy.d.ts +2 -2
  114. package/dist/features/core/modules/source/templates/simulation.default.source.d.ts +2 -2
  115. package/dist/features/core/modules/workspace/EndgeWorkspace_Module.d.ts +2 -0
  116. package/dist/features/core/modules/workspace/domain/workspace.types.d.ts +5 -0
  117. package/dist/features/federation/EndgeFederation.d.ts +3 -0
  118. package/dist/features/federation/types/federation.types.d.ts +5 -0
  119. package/dist/main.d.ts +22 -9
  120. package/package.json +3 -3
  121. package/dist/features/core/modules/domain/entities/REnvironment.d.ts +0 -9
  122. package/dist/features/core/modules/domain/entities/RParameter.d.ts +0 -11
  123. package/dist/features/core/modules/domain/entities/RProject.d.ts +0 -64
  124. package/dist/features/core/modules/domain/entities/RQueryFilter.d.ts +0 -12
  125. package/dist/features/core/modules/domain/entities/RTenant.d.ts +0 -10
  126. package/dist/features/core/modules/events/domain/EndgeEvent.d.ts +0 -33
  127. package/dist/features/core/modules/runtime/domain/runtime-project-session.types.d.ts +0 -31
  128. package/dist/features/core/modules/runtime/execution/endge-project.d.ts +0 -6
  129. package/dist/features/core/modules/runtime/hosts/ProjectRuntimeHost.d.ts +0 -21
  130. package/dist/features/core/modules/runtime/services/strategies/ProjectRuntimeStrategy.d.ts +0 -9
  131. package/dist/features/core/modules/source/templates/project.default.source.d.ts +0 -2
@@ -0,0 +1,3 @@
1
+ import { EndgeFederationContext, EndgeLifecycleNodeDescriptor } from '../../../federation/types/federation.types';
2
+ /** Debugger boots an empty Domain and Bridge; it never runs the inspected application. */
3
+ export declare function selectCoreLifecycleNodes(nodes: readonly EndgeLifecycleNodeDescriptor[], ctx: EndgeFederationContext): readonly EndgeLifecycleNodeDescriptor[];
@@ -1,6 +1,6 @@
1
1
  import { EndgeMockProvider } from '../../modules/mock/domain/types/mock-data.type';
2
2
  export { DEFAULT_FALLBACK_LOCALE, DEFAULT_LOCALE, DEFAULT_SCOPE, DEFAULT_THEME, DEFAULT_TIMEZONE, } from '../constants/kernel.constants';
3
- export declare const ENDGE_COMPILER_VERSION = "program-v2";
3
+ export declare const ENDGE_COMPILER_VERSION = "program-v3";
4
4
  /** Стабильные scope groups для compiler spans. */
5
5
  export declare const ENDGE_COMPILER_SPAN_GROUPS: {
6
6
  readonly COMPONENTS: "components";
@@ -13,7 +13,7 @@ export declare const ENDGE_COMPILER_SPAN_GROUPS: {
13
13
  /** Runtime fallback limits для nested computation execution. */
14
14
  export declare const ENDGE_COMPUTATION_MAX_CALL_DEPTH = 32;
15
15
  export declare const ENDGE_COMPUTATION_MAX_CALLS = 256;
16
- export declare const CONTEXT_STORAGE_KEY = "endge:context:v1";
16
+ export declare const CONTEXT_STORAGE_KEY = "endge:context:v2";
17
17
  export declare const LEGACY_CONTEXT_STORAGE_KEY = "EndgeContext_Module";
18
18
  export declare const LEGACY_THEME_STORAGE_KEY = "endge:theme";
19
19
  export declare const LEGACY_TIMEZONE_STORAGE_KEY = "endge:isLocalTime";
@@ -1,6 +1,7 @@
1
1
  import { EndgeActions_Module } from '../../modules/actions/EndgeActions_Module';
2
2
  import { EndgeAuth_Module } from '../../modules/auth/EndgeAuth_Module';
3
3
  import { EndgeBridge_Module } from '../../modules/bridge/EndgeBridge_Module';
4
+ import { EndgeCommands_Module } from '../../modules/commands/EndgeCommands_Module';
4
5
  import { EndgeCompiler_Module } from '../../modules/compiler/EndgeCompiler_Module';
5
6
  import { EndgeComputations_Module } from '../../modules/computations/EndgeComputations_Module';
6
7
  import { EndgeConfiguration_Module } from '../../modules/configuration/EndgeConfiguration_Module';
@@ -29,6 +30,11 @@ import { EndgeWorkspace_Module } from '../../modules/workspace/EndgeWorkspace_Mo
29
30
  export declare const ENDGE_CORE_MODULES: readonly [{
30
31
  readonly key: "context";
31
32
  readonly create: () => EndgeContext_Module;
33
+ readonly after: "events";
34
+ }, {
35
+ readonly key: "commands";
36
+ readonly create: ({ getModule }: import('../../../federation/types/endge-modules.types').EndgeModuleFactoryContext) => EndgeCommands_Module;
37
+ readonly after: readonly ["context", "runtime"];
32
38
  }, {
33
39
  readonly key: "mock";
34
40
  readonly create: () => EndgeMock_Module;
@@ -108,7 +114,6 @@ export declare const ENDGE_CORE_MODULES: readonly [{
108
114
  }, {
109
115
  readonly key: "events";
110
116
  readonly create: () => EndgeEvents_Module;
111
- readonly after: "context";
112
117
  }, {
113
118
  readonly key: "runtime";
114
119
  readonly create: () => EndgeRuntime_Module;
@@ -3,8 +3,6 @@ export declare const DEFAULT_FALLBACK_LOCALE = "en";
3
3
  export declare const DEFAULT_THEME = "dark";
4
4
  export declare const DEFAULT_TIMEZONE = "local";
5
5
  export declare const DEFAULT_SCOPE: {
6
- readonly tenantId: "default";
7
- readonly projectId: "default";
8
- readonly environmentId: "dev";
6
+ readonly facetSelections: readonly [];
9
7
  readonly userId: "anonymous";
10
8
  };
@@ -1,10 +1,13 @@
1
- /**
2
- * Единая статическая федерация Endge Core.
3
- * Lifecycle context и readonly accessors выводятся из деклараций её graph.
4
- */
5
- declare const EndgeCore: import('../../federation/EndgeFederation').DefinedEndgeFederation<readonly [{
1
+ import { EndgeBootMode } from './types/bootstrap.types';
2
+ import { DiagnosticsSnapshot } from '../modules/diagnostics/domain/types/diagnostics.types';
3
+ declare const EndgeCore_base: import('../../federation/EndgeFederation').DefinedEndgeFederation<readonly [{
6
4
  readonly key: "context";
7
5
  readonly create: () => import('../modules/context/EndgeContext_Module').EndgeContext_Module;
6
+ readonly after: "events";
7
+ }, {
8
+ readonly key: "commands";
9
+ readonly create: ({ getModule }: import('../../../main').EndgeModuleFactoryContext) => import('../modules/commands/EndgeCommands_Module').EndgeCommands_Module;
10
+ readonly after: readonly ["context", "runtime"];
8
11
  }, {
9
12
  readonly key: "mock";
10
13
  readonly create: () => import('../modules/mock/EndgeMock_Module').EndgeMock_Module;
@@ -84,7 +87,6 @@ declare const EndgeCore: import('../../federation/EndgeFederation').DefinedEndge
84
87
  }, {
85
88
  readonly key: "events";
86
89
  readonly create: () => import('../modules/events/EndgeEvents_Module').EndgeEvents_Module;
87
- readonly after: "context";
88
90
  }, {
89
91
  readonly key: "runtime";
90
92
  readonly create: () => import('../modules/runtime/EndgeRuntime_Module').EndgeRuntime_Module;
@@ -110,6 +112,18 @@ declare const EndgeCore: import('../../federation/EndgeFederation').DefinedEndge
110
112
  readonly create: () => import('../modules/styles/EndgeStyles_Module').EndgeStyles_Module;
111
113
  readonly after: readonly ["ui", "domain", "program", "compiler"];
112
114
  }], readonly [], import('../../../main').EndgeFederationContext & import('./types/bootstrap.types').EndgeBootContext>;
115
+ /**
116
+ * Единая статическая федерация Endge Core.
117
+ * Lifecycle context и readonly accessors выводятся из деклараций её graph.
118
+ */
119
+ declare class EndgeCore extends EndgeCore_base {
120
+ /** Active Core mode is owned by the boot context and is read-only. */
121
+ static get mode(): EndgeBootMode;
122
+ /** Replaces an inspected application's document and contextual state without activating it. */
123
+ static replaceDebuggerSnapshot(snapshot: DiagnosticsSnapshot): void;
124
+ /** Shared guard before user mutations, including editor synchronization. */
125
+ static assertWritable(): void;
126
+ }
113
127
  /** Типизированные accessors, которые внешние packages добавляют через module augmentation. */
114
128
  export interface EndgeExtensions {
115
129
  }
@@ -0,0 +1,5 @@
1
+ /** A user mutation was attempted against an inspected snapshot. */
2
+ export declare class EndgeDebuggerReadOnlyError extends Error {
3
+ readonly code = "debugger_read_only";
4
+ constructor();
5
+ }
@@ -0,0 +1,13 @@
1
+ import { EndgeContextSnapshot } from '../../modules/context/domain/context-persistence.types';
2
+ import { DiagnosticsSnapshot } from '../../modules/diagnostics/domain/types/diagnostics.types';
3
+ import { EndgeDataMode } from '../../modules/workspace/domain/workspace.types';
4
+ /** Validates captured inspection metadata before any owner changes its current state. */
5
+ export declare function prepareDebuggerSnapshot(snapshot: DiagnosticsSnapshot): {
6
+ domain: import('../../modules/diagnostics/domain/types/diagnostics.types').DiagnosticsJsonValue | undefined;
7
+ workspace: import('../../modules/workspace/domain/workspace.types').EndgeWorkspaceDefinition;
8
+ context: EndgeContextSnapshot & {
9
+ dataMode: EndgeDataMode;
10
+ };
11
+ configuration: import('../../../../main').EndgeConfiguration;
12
+ runtime: import('../../../../main').RuntimeInspectionSnapshot | null;
13
+ };
@@ -0,0 +1,2 @@
1
+ /** Protects materialized documents while preserving their entity prototypes and shared references. */
2
+ export declare function readOnlyDocument<T extends object>(value: T, mutableRootKeys?: readonly string[]): T;
@@ -1,5 +1,6 @@
1
1
  import { EndgeAuthBootOptions } from '../../modules/auth/domain/types/auth-profile.types';
2
2
  import { EndgeBridgeBootOptions } from '../../modules/bridge/domain/bridge.type';
3
+ import { EndgeCommandsBootOptions } from '../../modules/commands/types/command-executor.type';
3
4
  import { EndgeDomainBundle } from '../../modules/domain/types/document/domain-export.type';
4
5
  import { EndgeDomainProvider } from '../../modules/domain/types/document/domain-provider.type';
5
6
  import { EndgeExecutionContext } from '../../modules/runtime/domain/execution-context.types';
@@ -14,7 +15,7 @@ export type EndgeDataProvider = 'default' | 'bundle' | 'plain';
14
15
  /**
15
16
  * Конфигурация загрузки движка
16
17
  * Определяет workspace, данные которого должны быть активированы из persisted Domain.
17
- * Tenant, project и environment передаются отдельно через EndgeBootContext.context.
18
+ * Выборы динамических фасетов передаются отдельно через EndgeBootContext.context.
18
19
  */
19
20
  export interface EndgeLoadScope {
20
21
  workspaceIdentity?: string;
@@ -27,11 +28,14 @@ export interface EndgeUIBootOptions {
27
28
  /** Локальный для host порядок fallback, когда настроенная реализация адаптера недоступна. */
28
29
  adapterFallbackIds?: readonly string[];
29
30
  }
31
+ export type EndgeBootMode = 'application' | 'debugger';
30
32
  export interface EndgeBootContext extends EndgeFederationContext {
33
+ /** Immutable lifecycle profile; application is the default. */
34
+ mode?: EndgeBootMode;
31
35
  /**
32
36
  * Источник получения доменных данных
33
37
  */
34
- dataProvider: EndgeDataProvider;
38
+ dataProvider?: EndgeDataProvider;
35
39
  /**
36
40
  * Граница загружаемого persisted Domain.
37
41
  */
@@ -48,6 +52,8 @@ export interface EndgeBootContext extends EndgeFederationContext {
48
52
  auth?: EndgeAuthBootOptions;
49
53
  /** Optional host-owned bridge policy; отсутствие отключает соединения. */
50
54
  bridge?: EndgeBridgeBootOptions;
55
+ /** Host передаёт порт выбранного сеанса для удалённого исполнения команд в debugger mode. */
56
+ commands?: EndgeCommandsBootOptions;
51
57
  /**
52
58
  * Для plain provider.
53
59
  */
@@ -1,10 +1,7 @@
1
- import { DebugConnectionRequest } from '../domain/bridge.type';
2
1
  /** Browser boundary bridge. Не владеет сессиями или политикой доступа. */
3
2
  export declare class BrowserBridge_Adapter {
4
3
  /** Открывает стандартный WebSocket; cookie authentication выполняет браузер. */
5
4
  open(url: string): WebSocket;
6
- /** Показывает встроенное подтверждение. Отсутствие browser API означает отказ. */
7
- confirmDebugConnection(request: DebugConnectionRequest): Promise<boolean>;
8
5
  /** SHA-256 точного sourceVersion/source tuple, без имени и локального document id. */
9
6
  hashSimulation(source: {
10
7
  sourceVersion: number;
@@ -7,6 +7,11 @@ export declare const BRIDGE_CONFIG: {
7
7
  readonly reconnectMaxMs: 30000;
8
8
  readonly maxMessageBytes: number;
9
9
  readonly maxPendingRequests: 16;
10
+ readonly maxBufferedEvents: 256;
11
+ readonly maxBufferedBytes: number;
12
+ readonly maxInspectionBytes: number;
13
+ readonly minInspectionIntervalMs: 1000;
14
+ readonly maxInspectionIntervalMs: 60000;
10
15
  };
11
16
  /** Полный диагностический снимок для согласованной debug session. */
12
17
  export declare const BRIDGE_SNAPSHOT_OPTIONS: {
@@ -20,6 +25,18 @@ export declare const BRIDGE_SNAPSHOT_OPTIONS: {
20
25
  readonly includeRaphData: true;
21
26
  readonly includeRaphGraph: true;
22
27
  };
28
+ /** Структура Domain и Runtime без рабочих данных, render payload и графа Raph. */
29
+ export declare const BRIDGE_STRUCTURE_SNAPSHOT_OPTIONS: {
30
+ readonly includeTelemetry: false;
31
+ readonly includeProblems: false;
32
+ readonly includeProgram: false;
33
+ readonly includeRaphData: false;
34
+ readonly includeRaphGraph: false;
35
+ readonly includeConfiguration: true;
36
+ readonly includeEffectiveConfiguration: true;
37
+ readonly includeDomain: true;
38
+ readonly includeRuntime: true;
39
+ };
23
40
  /** Нормализует точный backend URL без credentials, query и fragment. */
24
41
  export declare function normalizeBridgeServer(raw: string): string;
25
42
  /** Разбирает CSV environment value на стороне host до передачи массива в boot. */
@@ -1,5 +1,7 @@
1
1
  import { BrowserBridge_Adapter } from '../adapters/BrowserBridge_Adapter';
2
- import { BridgeCommands, BridgeDebugClient, BridgeDebugSession, BridgeMessage, SimulationRunResult } from '../domain/bridge.type';
2
+ import { BridgeInspectionSnapshot } from '../domain/bridge-sync.type';
3
+ import { BridgeCommands, BridgeDebugClient, BridgeDebugSession, BridgeMessage, DebugConnectionRequest, SimulationRunResult } from '../domain/bridge.type';
4
+ import { EndgeCommand } from '../../commands/domain/commands.types';
3
5
  import { DiagnosticsSnapshot } from '../../diagnostics/domain/types/diagnostics.types';
4
6
  import { EndgeModule } from '../../../../federation/EndgeModule';
5
7
  /** Debug policy и единственная client reservation сразу для всех backend. */
@@ -9,9 +11,20 @@ export declare class EndgeBridgeDebug_Module extends EndgeModule {
9
11
  private _role;
10
12
  private _enabled;
11
13
  private _reservation;
14
+ private _pendingConsent;
15
+ private _consentTimer;
12
16
  private readonly _requests;
13
17
  private readonly _clients;
14
18
  private readonly _sessions;
19
+ private readonly _incoming;
20
+ private _outgoingSession;
21
+ private _outgoingSequence;
22
+ private _unsubscribeEvents;
23
+ private _releaseData;
24
+ private _dataTimer;
25
+ private _topologyTimer;
26
+ private _dataDirty;
27
+ private _includeData;
15
28
  /**
16
29
  * ----------------------------------------
17
30
  * PUBLIC
@@ -26,10 +39,24 @@ export declare class EndgeBridgeDebug_Module extends EndgeModule {
26
39
  serverUrl: string;
27
40
  instanceId: string;
28
41
  }): Promise<BridgeDebugSession>;
42
+ /** Принимает ответ UI только для текущего непросроченного запроса. */
43
+ respondToConsent(request: Pick<DebugConnectionRequest, 'serverUrl' | 'sessionId'>, accepted: boolean): boolean;
29
44
  /** Завершает выбранную сессию с любой её стороны. */
30
45
  endSession(sessionId: string): Promise<void>;
31
46
  /** Запрашивает snapshot существующего diagnostics collector без скачивания файла. */
32
47
  getSnapshot(sessionId: string): Promise<DiagnosticsSnapshot>;
48
+ /** Начинает буферизацию событий до импорта согласованного с ними снимка. */
49
+ startContextSync(sessionId: string, options?: {
50
+ includeData: boolean;
51
+ }): Promise<BridgeInspectionSnapshot>;
52
+ /** После прямого импорта снимка применяет только более новые события, не вызывая Commands. */
53
+ activateContextSync(sessionId: string, sequence: number): void;
54
+ /** Обновляет Runtime и данные через тот же упорядоченный поток, что и события. */
55
+ refreshInspection(sessionId: string): Promise<void>;
56
+ /** Ноль оставляет ручное обновление; положительный интервал ограничивает частоту полных данных. */
57
+ setInspectionInterval(sessionId: string, intervalMs: number): Promise<void>;
58
+ /** Отправляет запрос выбранному клиенту только после завершения первичной синхронизации. */
59
+ executeCommand(sessionId: string, command: EndgeCommand): Promise<void>;
33
60
  /** Пока выполняет только existence/hash check и console mock на стороне клиента. */
34
61
  runSimulation(sessionId: string, input: {
35
62
  identity: string;
@@ -48,10 +75,36 @@ export declare class EndgeBridgeDebug_Module extends EndgeModule {
48
75
  * PRIVATE
49
76
  * ----------------------------------------
50
77
  */
51
- /** Резервирует единственное согласие и проверяет его актуальность после диалога. */
52
- private _confirm;
53
- /** Проверяет активную сессию и выполняет только snapshot либо simulation mock. */
78
+ /** Резервирует запрос для View приложения, не вызывая browser dialog. */
79
+ private _requestConsent;
80
+ /** Снимает View-проекцию и принадлежащий запросу deadline timer. */
81
+ private _clearPendingConsent;
82
+ /** Проверяет активную сессию и выполняет только явно разрешённые операции. */
54
83
  private _execute;
84
+ /** Подписка принадлежит подтверждённому клиентскому сеансу; дебагер никогда не ретранслирует свои Events. */
85
+ private _startPublishing;
86
+ /** Принимает поток только своего клиента; буфер ограничен временем первичного запроса и размером. */
87
+ private _receiveEvent;
88
+ /** Дубликаты и события из снимка пропускаются; разрыв последовательности завершает синхронизацию. */
89
+ private _applyIncomingEvent;
90
+ /** Снимает буфер и подписку только соответствующего сеанса. */
91
+ private _releaseStream;
92
+ /** Привязывает запрос наблюдения к готовому сеансу и проверяет его после ответа. */
93
+ private _requestInspection;
94
+ /** Проверяет единый диапазон на обеих сторонах транспорта. */
95
+ private _validateInterval;
96
+ /** Coalescing топологии не зависит от включения периодических снимков данных. */
97
+ private _scheduleTopology;
98
+ /** Fixed interval не голодает при непрерывных изменениях и пропускает неизменившиеся данные. */
99
+ private _configureDataPublishing;
100
+ /** Ошибка снимка сохраняет предыдущие данные, но явно помечает их как не обновлённые. */
101
+ private _publishSafely;
102
+ /** Размер проверяется до выделения sequence: отклонённый payload не создаёт разрыв потока. */
103
+ private _publishInspection;
104
+ /** Последняя lease снимает дорогую подписку на изменения Raph. */
105
+ private _stopDataPublishing;
106
+ /** Все отложенные публикации принадлежат одному сеансу. */
107
+ private _stopInspectionPublishing;
55
108
  /** Проверяет локальную роль и явное разрешение отладки. */
56
109
  private _requireConfigurator;
57
110
  /** Разрешает только существующую активную сессию. */
@@ -61,6 +114,8 @@ export declare class EndgeBridgeDebug_Module extends EndgeModule {
61
114
  * ACCESS
62
115
  * ----------------------------------------
63
116
  */
117
+ /** Показывает приложению текущий запрос без права менять состояние Bridge. */
118
+ get pendingConsent(): Readonly<DebugConnectionRequest> | null;
64
119
  /** Возвращает доступные приложения из актуальных server rosters. */
65
120
  get clients(): readonly BridgeDebugClient[];
66
121
  /** Возвращает копии активных согласованных сессий. */
@@ -0,0 +1,30 @@
1
+ import { DiagnosticsSnapshot } from '../../diagnostics/domain/types/diagnostics.types';
2
+ import { EndgePublishedEvent } from '../../events/domain/events.types';
3
+ import { RuntimeInspectionSnapshot } from '../../runtime/domain/runtime-inspection.types';
4
+ /** Начальное состояние и граница последующих событий одного согласованного сеанса. */
5
+ export interface BridgeInspectionSnapshot {
6
+ readonly snapshot: DiagnosticsSnapshot;
7
+ readonly sequence: number;
8
+ }
9
+ /** Последовательность относится к потоку сеанса; метаданные самой публикации сохраняются в event. */
10
+ export interface BridgeStreamEvent {
11
+ readonly sequence: number;
12
+ readonly event: EndgePublishedEvent;
13
+ }
14
+ /** Объёмные снимки используют тот же sequenced session stream, но отдельный transport limit. */
15
+ export interface BridgeInspectionUpdate {
16
+ readonly sequence: number;
17
+ readonly update: {
18
+ kind: 'runtime';
19
+ snapshot: RuntimeInspectionSnapshot;
20
+ } | {
21
+ kind: 'data';
22
+ data: unknown;
23
+ render?: RuntimeInspectionSnapshot['render'];
24
+ generatedAt: number;
25
+ } | {
26
+ kind: 'data-error';
27
+ message: string;
28
+ };
29
+ }
30
+ export type BridgeInspectionMessage = BridgeStreamEvent | BridgeInspectionUpdate;
@@ -0,0 +1,16 @@
1
+ import { BridgeInspectionSnapshot, BridgeInspectionUpdate, BridgeStreamEvent } from '../domain/bridge-sync.type';
2
+ import { EndgeCommand } from '../../commands/domain/commands.types';
3
+ import { ContextEvent } from '../../context/domain/context-events.types';
4
+ import { RuntimeStatusChange } from '../../runtime/domain/runtime-inspection.types';
5
+ /** Проверяет границу снимка; сам Domain валидируется штатным импортом Core. */
6
+ export declare function readBridgeInspectionSnapshot(value: unknown): BridgeInspectionSnapshot;
7
+ /** Проверяет метаданные потока до помещения события в ограниченный буфер. */
8
+ export declare function readBridgeStreamEvent(value: unknown): BridgeStreamEvent;
9
+ /** Распознаёт только существующие Context events и проверяет оба значения перед применением. */
10
+ export declare function readBridgeContextEvent(event: BridgeStreamEvent['event']): ContextEvent | null;
11
+ /** Проверяет wire envelope; имя команды и payload дополнительно проверяет локальный реестр обработчиков. */
12
+ export declare function readBridgeCommand(value: unknown): EndgeCommand;
13
+ /** Проверяет крупный snapshot до буферизации в согласованном потоке. */
14
+ export declare function readBridgeInspectionUpdate(value: unknown): BridgeInspectionUpdate;
15
+ /** Runtime facts применяются только после проверки статусов и адреса host. */
16
+ export declare function readBridgeRuntimeEvent(event: BridgeStreamEvent['event']): RuntimeStatusChange | null;
@@ -0,0 +1,17 @@
1
+ import { EndgeBootContext } from '../../kernel/types/bootstrap.types';
2
+ import { EndgeCommand } from './domain/commands.types';
3
+ import { EndgeCommandExecutor } from './types/command-executor.type';
4
+ import { EndgeModule } from '../../../federation/EndgeModule';
5
+ /** Выбирает способ выполнения команд по boot mode, не владея изменяемым контекстом. */
6
+ export declare class EndgeCommands_Module extends EndgeModule<EndgeBootContext> {
7
+ private readonly _localExecutor;
8
+ private _remote;
9
+ private _executor;
10
+ constructor(localExecutor: EndgeCommandExecutor);
11
+ /** Клиент выполняет команды локально, дебагер передаёт их через предоставленный host транспорт. */
12
+ setup(ctx: EndgeBootContext): void;
13
+ /** Делегирует команду; состояние и публикация событий остаются у владельца операции. */
14
+ execute(command: EndgeCommand): Promise<void>;
15
+ /** Отзывает выбранного исполнителя и ссылку на транспорт перед следующим boot. */
16
+ reset(): void;
17
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandExecutor, EndgeCommandHandler } from '../types/command-executor.type';
2
+ import { EndgeContextCommandTarget } from '../types/context-command-target.type';
3
+ import { EndgeRuntimeCommandTarget } from '../types/runtime-command-target.type';
4
+ /** Создаёт явный набор локальных обработчиков; регистрация не выполняет сами команды. */
5
+ export declare function createContextCommandHandlers(context: EndgeContextCommandTarget): readonly EndgeCommandHandler[];
6
+ /** Привязывает команды к штатным операциям конкретного приложения без изменения обработчиков. */
7
+ export declare function createContextCommandExecutor(context: EndgeContextCommandTarget): EndgeCommandExecutor;
8
+ /** Runtime использует одинаковые обработчики для локальных и принятых удалённых команд. */
9
+ export declare function createRuntimeCommandHandlers(runtime: EndgeRuntimeCommandTarget): readonly EndgeCommandHandler[];
@@ -0,0 +1,38 @@
1
+ import { RuntimeControlTarget } from '../../runtime/domain/runtime-inspection.types';
2
+ import { EndgeDataMode } from '../../workspace/domain/workspace.types';
3
+ /** Параметры явных команд Core; это запросы на изменение, а не произошедшие события. */
4
+ export interface EndgeCommandMap {
5
+ 'runtime:pause': RuntimeControlTarget;
6
+ 'runtime:resume': RuntimeControlTarget;
7
+ 'runtime:stop': RuntimeControlTarget;
8
+ 'context:set-workspace': {
9
+ workspace: string | null;
10
+ };
11
+ 'context:set-facet': {
12
+ facet: string;
13
+ document: string;
14
+ };
15
+ 'context:set-user': {
16
+ user: string;
17
+ };
18
+ 'context:set-locale': {
19
+ locale: string | null;
20
+ };
21
+ 'context:set-theme': {
22
+ theme: string | null;
23
+ };
24
+ 'context:set-timezone': {
25
+ timezone: string | null;
26
+ };
27
+ 'context:set-data-mode': {
28
+ dataMode: EndgeDataMode | null;
29
+ };
30
+ }
31
+ export type EndgeCommandType = keyof EndgeCommandMap;
32
+ /** Связывает имя команды с её payload для единой точки execute(). */
33
+ export type EndgeCommand = {
34
+ [K in EndgeCommandType]: {
35
+ readonly type: K;
36
+ readonly payload: Readonly<EndgeCommandMap[K]>;
37
+ };
38
+ }[EndgeCommandType];
@@ -0,0 +1,9 @@
1
+ import { EndgeCommand } from '../domain/commands.types';
2
+ import { EndgeCommandExecutor, EndgeCommandHandler } from '../types/command-executor.type';
3
+ /** Находит явно зарегистрированный обработчик и выполняет команду локально. */
4
+ export declare class LocalCommandExecutor implements EndgeCommandExecutor {
5
+ private readonly _handlers;
6
+ constructor(handlers: readonly EndgeCommandHandler[]);
7
+ /** Неизвестная команда завершается ошибкой; fallback на произвольный метод отсутствует. */
8
+ execute(command: EndgeCommand): Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommand } from '../domain/commands.types';
2
+ import { EndgeCommandExecutor, EndgeRemoteCommandTransport } from '../types/command-executor.type';
3
+ /** Передаёт любую поддерживаемую команду удалённому клиенту без вызова локальных обработчиков. */
4
+ export declare class RemoteCommandExecutor implements EndgeCommandExecutor {
5
+ private readonly _transport;
6
+ constructor(transport?: EndgeRemoteCommandTransport);
7
+ /** Отсутствие транспорта и отказ клиента не заменяются локальным выполнением. */
8
+ execute(command: EndgeCommand): Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeContextCommandTarget } from '../../types/context-command-target.type';
3
+ /** Применяет запрос изменения режима данных через существующий метод Context. */
4
+ export declare class SetDataModeCommand implements EndgeCommandHandler {
5
+ readonly type: "context:set-data-mode";
6
+ private readonly _context;
7
+ constructor(context: Pick<EndgeContextCommandTarget, 'setDataMode' | 'clearDataModeOverride'>);
8
+ execute(payload: unknown): void | Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeContextCommandTarget } from '../../types/context-command-target.type';
3
+ /** Применяет запрос выбора документа произвольного динамического фасета. */
4
+ export declare class SetFacetCommand implements EndgeCommandHandler {
5
+ readonly type: "context:set-facet";
6
+ private readonly _context;
7
+ constructor(context: Pick<EndgeContextCommandTarget, 'setFacetSelection'>);
8
+ execute(payload: unknown): void | Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeContextCommandTarget } from '../../types/context-command-target.type';
3
+ /** Применяет запрос изменения языка через существующий метод Context. */
4
+ export declare class SetLocaleCommand implements EndgeCommandHandler {
5
+ readonly type: "context:set-locale";
6
+ private readonly _context;
7
+ constructor(context: Pick<EndgeContextCommandTarget, 'setCurrentLocale'>);
8
+ execute(payload: unknown): void | Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeContextCommandTarget } from '../../types/context-command-target.type';
3
+ /** Применяет запрос изменения темы через существующий метод Context. */
4
+ export declare class SetThemeCommand implements EndgeCommandHandler {
5
+ readonly type: "context:set-theme";
6
+ private readonly _context;
7
+ constructor(context: Pick<EndgeContextCommandTarget, 'setCurrentTheme'>);
8
+ execute(payload: unknown): void | Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeContextCommandTarget } from '../../types/context-command-target.type';
3
+ /** Применяет запрос изменения часового пояса через существующий метод Context. */
4
+ export declare class SetTimezoneCommand implements EndgeCommandHandler {
5
+ readonly type: "context:set-timezone";
6
+ private readonly _context;
7
+ constructor(context: Pick<EndgeContextCommandTarget, 'setCurrentTimezone'>);
8
+ execute(payload: unknown): void | Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeContextCommandTarget } from '../../types/context-command-target.type';
3
+ /** Применяет запрос изменения пользователя через существующий метод Context. */
4
+ export declare class SetUserCommand implements EndgeCommandHandler {
5
+ readonly type: "context:set-user";
6
+ private readonly _context;
7
+ constructor(context: Pick<EndgeContextCommandTarget, 'setCurrentUser'>);
8
+ execute(payload: unknown): void | Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeContextCommandTarget } from '../../types/context-command-target.type';
3
+ /** Применяет запрос изменения рабочего пространства через существующий метод Context. */
4
+ export declare class SetWorkspaceCommand implements EndgeCommandHandler {
5
+ readonly type: "context:set-workspace";
6
+ private readonly _context;
7
+ constructor(context: Pick<EndgeContextCommandTarget, 'setCurrentWorkspace'>);
8
+ execute(payload: unknown): void | Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeRuntimeCommandTarget } from '../../types/runtime-command-target.type';
3
+ /** Делегирует pause существующему владельцу runtime lifecycle. */
4
+ export declare class PauseRuntimeCommand implements EndgeCommandHandler {
5
+ private readonly _runtime;
6
+ readonly type: "runtime:pause";
7
+ constructor(_runtime: EndgeRuntimeCommandTarget);
8
+ execute(payload: unknown): Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeRuntimeCommandTarget } from '../../types/runtime-command-target.type';
3
+ /** Делегирует resume существующему владельцу runtime lifecycle. */
4
+ export declare class ResumeRuntimeCommand implements EndgeCommandHandler {
5
+ private readonly _runtime;
6
+ readonly type: "runtime:resume";
7
+ constructor(_runtime: EndgeRuntimeCommandTarget);
8
+ execute(payload: unknown): Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { EndgeCommandHandler } from '../../types/command-executor.type';
2
+ import { EndgeRuntimeCommandTarget } from '../../types/runtime-command-target.type';
3
+ /** Делегирует stop существующему владельцу runtime lifecycle. */
4
+ export declare class StopRuntimeCommand implements EndgeCommandHandler {
5
+ private readonly _runtime;
6
+ readonly type: "runtime:stop";
7
+ constructor(_runtime: EndgeRuntimeCommandTarget);
8
+ execute(payload: unknown): Promise<void>;
9
+ }
@@ -0,0 +1,4 @@
1
+ /** Проверяет строковый параметр команды; нормализация значения остаётся у владельца операции. */
2
+ export declare function readCommandString(payload: unknown, field: string): string;
3
+ /** Читает обязательную строку или явный null без приведения других типов. */
4
+ export declare function readCommandNullableString(payload: unknown, field: string): string | null;
@@ -0,0 +1,19 @@
1
+ import { EndgeCommand, EndgeCommandType } from '../domain/commands.types';
2
+ /** Исполнитель определяет способ выполнения команды, сохраняя единый API для вызывающего кода. */
3
+ export interface EndgeCommandExecutor {
4
+ execute: (command: EndgeCommand) => Promise<void>;
5
+ }
6
+ /** Отправляет команду выбранному удалённому клиенту и возвращает результат её выполнения. */
7
+ export interface EndgeRemoteCommandTransport {
8
+ send: (command: EndgeCommand) => Promise<void>;
9
+ }
10
+ /** Host передаёт транспорт текущего сеанса; режим исполнения определяется общим boot mode. */
11
+ export interface EndgeCommandsBootOptions {
12
+ local?: EndgeCommandExecutor;
13
+ remote?: EndgeRemoteCommandTransport;
14
+ }
15
+ /** Обработчик одной команды проверяет payload до обращения к владельцу операции. */
16
+ export interface EndgeCommandHandler {
17
+ readonly type: EndgeCommandType;
18
+ execute: (payload: unknown) => void | Promise<void>;
19
+ }
@@ -0,0 +1,12 @@
1
+ import { EndgeDataMode } from '../../workspace/domain/workspace.types';
2
+ /** Владелец локальных операций: Core setters либо штатные операции приложения с reset/boot. */
3
+ export interface EndgeContextCommandTarget {
4
+ setCurrentWorkspace: (workspace: string | null) => void | Promise<void>;
5
+ setFacetSelection: (facet: string, document: string) => void | Promise<void>;
6
+ setCurrentUser: (user: string) => void | Promise<void>;
7
+ setCurrentLocale: (locale: string | null) => void | Promise<void>;
8
+ setCurrentTheme: (theme: string | null) => void | Promise<void>;
9
+ setCurrentTimezone: (timezone: string | null) => void | Promise<void>;
10
+ setDataMode: (dataMode: EndgeDataMode) => void | Promise<void>;
11
+ clearDataModeOverride: () => void | Promise<void>;
12
+ }