@endge/core 1.2.10 → 1.2.12

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.
@@ -9,7 +9,7 @@ export declare abstract class RuntimeHostBase<TType extends RuntimeEntityType, T
9
9
  /** Уникальный runtime-id host. */
10
10
  readonly id: string;
11
11
  /** Родительский runtime-host для отладки вложенных запусков. */
12
- readonly parent: RuntimeHost<any, any> | null;
12
+ parent: RuntimeHost<any, any> | null;
13
13
  /** Канонический runtime kind host. */
14
14
  readonly kind: RuntimeKind | 'runtime';
15
15
  /** Техническое имя реализации host. */
@@ -49,12 +49,12 @@ export declare abstract class RuntimeHostBase<TType extends RuntimeEntityType, T
49
49
  private _inputBindings;
50
50
  private _updateBindings;
51
51
  private _updateDisposers;
52
- private _updateHashes;
53
52
  private _updateTimers;
53
+ private _quiesced;
54
54
  /** Read-only доступ к compiled artifacts, если host связан с program artifact. */
55
- private readonly _artifactReader;
55
+ private _artifactReader;
56
56
  /** Ссылка на compiled artifact, связанный с host. */
57
- private readonly _artifactRef;
57
+ private _artifactRef;
58
58
  constructor(input: {
59
59
  /** Уникальный runtime-id host. */
60
60
  id: string;
@@ -96,6 +96,8 @@ export declare abstract class RuntimeHostBase<TType extends RuntimeEntityType, T
96
96
  reconcile(): void;
97
97
  stop(): void;
98
98
  unmount(): void;
99
+ /** Останавливает доставку новых updates, не освобождая данные host-а. */
100
+ quiesce(): void;
99
101
  /**
100
102
  * LIFECYCLE
101
103
  */
@@ -1,11 +1,13 @@
1
1
  import { RuntimeEntityType } from '../../types/runtime/runtime-entity-map.types';
2
- import { RuntimeHost, RuntimeHostSnapshot } from '../../types/runtime/runtime-host.types';
2
+ import { DestroyedRuntimeHostSnapshot, RuntimeHost } from '../../types/runtime/runtime-host.types';
3
3
  import { RuntimeHostRegistryLike, RuntimeHostRegistrySnapshot } from '../../types/runtime/runtime-registry.types';
4
4
  export declare class RuntimeHostRegistry implements RuntimeHostRegistryLike {
5
5
  private _hosts;
6
6
  private _indexByEntity;
7
7
  private _childrenByParent;
8
+ private _parentByChild;
8
9
  private _deletedSnapshots;
10
+ private _deletedSnapshotLimit;
9
11
  /**
10
12
  * ACCESS
11
13
  */
@@ -35,19 +37,21 @@ export declare class RuntimeHostRegistry implements RuntimeHostRegistryLike {
35
37
  /**
36
38
  * ACCESS
37
39
  */
38
- rememberDeletedSnapshot(snapshot: RuntimeHostSnapshot): void;
40
+ rememberDeletedSnapshot(snapshot: DestroyedRuntimeHostSnapshot): void;
39
41
  /**
40
42
  * ACCESS
41
43
  */
42
- getDeletedSnapshots(): RuntimeHostSnapshot[];
44
+ getDeletedSnapshots(): DestroyedRuntimeHostSnapshot[];
43
45
  /**
44
46
  * ACCESS
45
47
  */
46
- removeDeletedSnapshot(id: string): RuntimeHostSnapshot | null;
48
+ removeDeletedSnapshot(id: string): DestroyedRuntimeHostSnapshot | null;
47
49
  /**
48
50
  * ACCESS
49
51
  */
50
52
  clearDeleted(): void;
53
+ setDeletedSnapshotLimit(limit: number): void;
54
+ private trimDeletedSnapshots;
51
55
  /**
52
56
  * ACCESS
53
57
  */
@@ -86,6 +86,7 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
86
86
  private _requireOutputBridge;
87
87
  private _connectRuntimeOutputs;
88
88
  private _disconnectRuntimeOutputs;
89
+ quiesce(): void;
89
90
  destroy(): Promise<void>;
90
91
  /** Строит effective catalogs по той же иерархии, что и lifecycle scopes. */
91
92
  private _buildI18nCatalogs;
@@ -6,7 +6,6 @@ import { RuntimeHostBase } from '../RuntimeHostBase';
6
6
  /** Runtime-владелец Filter state, outputs и Actions. */
7
7
  export declare class FilterRuntimeHost extends RuntimeHostBase<'filter', RuntimeHostContext<'filter'>, FilterProgramPayload> {
8
8
  private _outputs;
9
- private _outputHashes;
10
9
  constructor(input: {
11
10
  id: string;
12
11
  model: RFilter;
@@ -31,6 +30,7 @@ export declare class FilterRuntimeHost extends RuntimeHostBase<'filter', Runtime
31
30
  getFields(): SourceFieldDefinition[];
32
31
  getOutput(name: string): FilterRuntimeOutput | null;
33
32
  getOutputs(): FilterRuntimeOutput[];
33
+ destroy(): void;
34
34
  /** Возвращает вызываемый Action изменения Filter state. */
35
35
  action(id: FilterRuntimeActionId): FilterRuntimeActionHandle;
36
36
  private _patch;
@@ -41,5 +41,4 @@ export declare class FilterRuntimeHost extends RuntimeHostBase<'filter', Runtime
41
41
  private _normalizePatch;
42
42
  private _isValidFieldValue;
43
43
  private _isValidScalarValue;
44
- private _outputHash;
45
44
  }
@@ -6,17 +6,19 @@ import { RuntimeHostBase } from '../RuntimeHostBase';
6
6
  export declare class QueryRuntimeHost extends RuntimeHostBase<'query', RuntimeHostContext<'query'>, QueryProgramPayload> {
7
7
  private _props;
8
8
  private _outputs;
9
- private _outputHashes;
9
+ private _outputGeneration;
10
10
  private _runSequence;
11
11
  private _abortController;
12
12
  private _filterChildIds;
13
13
  private _derivedHandles;
14
14
  private _outputWatchers;
15
15
  private _outputPaths;
16
+ private _outputDependents;
16
17
  private _responseInputPaths;
17
18
  private readonly _internalBase;
18
19
  private _derivedErrorActive;
19
20
  private _contextOff;
21
+ private _isMockEnabled;
20
22
  constructor(input: {
21
23
  id: string;
22
24
  model: RQuery;
@@ -45,6 +47,7 @@ export declare class QueryRuntimeHost extends RuntimeHostBase<'query', RuntimeHo
45
47
  pause(): void;
46
48
  stop(): void;
47
49
  reconcile(): Promise<void>;
50
+ quiesce(): void;
48
51
  destroy(): void;
49
52
  protected onUpdate(ctx: RuntimeHostUpdateContext): void;
50
53
  /** Монтирует compiled output graph как runtime-scoped Raph materialized dependencies. */
@@ -53,6 +56,8 @@ export declare class QueryRuntimeHost extends RuntimeHostBase<'query', RuntimeHo
53
56
  private _requireOutputPath;
54
57
  private _requireResponseInputPath;
55
58
  private _syncOutputs;
59
+ private _expandDependentOutputKeys;
60
+ private _publishOutputs;
56
61
  private _literalDefaults;
57
62
  private _applyProps;
58
63
  }
@@ -25,6 +25,7 @@ export declare class StreamRuntimeHost extends RuntimeHostBase<'stream', Runtime
25
25
  }): StreamRuntimeHost | null;
26
26
  start(): void;
27
27
  stop(): void;
28
+ quiesce(): void;
28
29
  destroy(): void;
29
30
  private _receive;
30
31
  }
@@ -134,6 +134,27 @@ export interface RuntimeHostSnapshot {
134
134
  /** Контекст host (для debug/inspection). */
135
135
  context: Record<string, unknown>;
136
136
  }
137
+ /** Lightweight archived descriptor. It deliberately excludes runtime data. */
138
+ export interface DestroyedRuntimeHostSnapshot {
139
+ id: string;
140
+ basePath: string;
141
+ parentId: string | null;
142
+ runtimeType: string;
143
+ capabilities: RuntimeHostCapability[];
144
+ entityType: RuntimeEntityType;
145
+ entityIdentity: string;
146
+ title: string;
147
+ previousStatus: RuntimeHostStatus;
148
+ status: 'destroyed';
149
+ createdAt: number;
150
+ updatedAt: number;
151
+ removedAt: number;
152
+ resources: Array<Omit<RuntimeHostResource, 'payload'>>;
153
+ channels: RuntimeHostChannel[];
154
+ }
155
+ export interface RuntimeInspectionLease {
156
+ release(): void;
157
+ }
137
158
  export interface RuntimeHostLifecycle {
138
159
  /** Compatibility entrypoint: mount + start. */
139
160
  create: () => Promise<void> | void;
@@ -144,6 +165,8 @@ export interface RuntimeHostLifecycle {
144
165
  reconcile: () => Promise<void> | void;
145
166
  stop: () => Promise<void> | void;
146
167
  unmount: () => Promise<void> | void;
168
+ /** Синхронно запрещает новые updates перед освобождением runtime tree. */
169
+ quiesce: () => Promise<void> | void;
147
170
  /** Корректно остановить host и освободить ресурсы. */
148
171
  destroy: () => Promise<void> | void;
149
172
  /** Обработать runtime update, пришедший из логической либо boundary Raph-фазы. */
@@ -179,7 +202,6 @@ export interface RuntimeHostUpdateBinding {
179
202
  };
180
203
  policy?: {
181
204
  debounceMs?: number;
182
- distinct?: 'none' | 'structural';
183
205
  };
184
206
  }
185
207
  /** Конкретное логическое обновление, разрешённое из Raph events. */
@@ -1,5 +1,5 @@
1
1
  import { RuntimeEntityType } from './runtime-entity-map.types';
2
- import { RuntimeHost, RuntimeHostSnapshot } from './runtime-host.types';
2
+ import { DestroyedRuntimeHostSnapshot, RuntimeHost, RuntimeHostSnapshot } from './runtime-host.types';
3
3
  export interface RuntimeHostRegistrySnapshot {
4
4
  /** Общее количество зарегистрированных host. */
5
5
  total: number;
@@ -10,7 +10,7 @@ export interface RuntimeHostRegistrySnapshot {
10
10
  /** Общее количество удалённых host, сохранённых в debug-архиве. */
11
11
  deletedTotal: number;
12
12
  /** Снимки удалённых host из debug-архива. */
13
- deletedHosts: RuntimeHostSnapshot[];
13
+ deletedHosts: DestroyedRuntimeHostSnapshot[];
14
14
  }
15
15
  export interface RuntimeHostRegistryLike {
16
16
  /** Зарегистрировать host в registry и вернуть его же. */
@@ -26,11 +26,13 @@ export interface RuntimeHostRegistryLike {
26
26
  /** Очистить registry и разрушить все host. */
27
27
  clear(): void;
28
28
  /** Сохранить snapshot удалённого host в debug-архив. */
29
- rememberDeletedSnapshot(snapshot: RuntimeHostSnapshot): void;
29
+ rememberDeletedSnapshot(snapshot: DestroyedRuntimeHostSnapshot): void;
30
30
  /** Получить снимки удалённых host из debug-архива. */
31
- getDeletedSnapshots(): RuntimeHostSnapshot[];
31
+ getDeletedSnapshots(): DestroyedRuntimeHostSnapshot[];
32
32
  /** Удалить один snapshot из debug-архива по runtime-id. */
33
- removeDeletedSnapshot(id: string): RuntimeHostSnapshot | null;
33
+ removeDeletedSnapshot(id: string): DestroyedRuntimeHostSnapshot | null;
34
+ /** Apply the effective bounded inspection capacity immediately. */
35
+ setDeletedSnapshotLimit(limit: number): void;
34
36
  /** Очистить debug-архив удалённых host. */
35
37
  clearDeleted(): void;
36
38
  /** Получить сериализованный snapshot registry. */
@@ -10,6 +10,7 @@ import { EndgeMockReference } from '../mock/mock-data.type';
10
10
  import { I18nCompiledLocales } from '../i18n.types';
11
11
  import { ComponentSFCEventInputValue } from '../component/sfc/ports.types';
12
12
  import { UpdateMutationStrategy } from './update-source.types';
13
+ import { EndgeDataMode } from '../document/workspace.types';
13
14
  export type CompositionRuntimeKind = 'filter' | 'query' | 'component' | 'composition' | 'stream' | 'filter-view';
14
15
  export type CompositionActivationMode = 'startup' | 'manual';
15
16
  export interface CompositionActivationDescriptor {
@@ -222,6 +223,8 @@ export type CompositionPreviewPropValue = {
222
223
  } | EndgeMockReference;
223
224
  export type CompositionPreviewProps = Record<string, CompositionPreviewPropValue>;
224
225
  export interface CompositionSourceDocument {
226
+ /** Локальный override режима данных; отсутствие значения наследует runtime ancestry. */
227
+ dataMode?: EndgeDataMode | null;
225
228
  activation: CompositionActivationDescriptor | null;
226
229
  /** Публичный props contract Composition. */
227
230
  props: SourceFieldDefinition[];
@@ -13,7 +13,7 @@ export declare class ConsoleDiagnosticsAdapter implements DiagnosticsAdapter {
13
13
  constructor(output: EndgeDiagnosticsOutputConfiguration);
14
14
  /** Выводит одну routed record в pretty или JSON формате. */
15
15
  acceptRecord(record: DiagnosticsRecord, context: DiagnosticsAdapterRecordContext): void;
16
- /** Выводит полный snapshot одной JSON-записью, пригодной для копирования. */
16
+ /** Выводит bounded summary снимка, не сериализуя telemetry history целиком. */
17
17
  acceptSnapshot(snapshot: DiagnosticsSnapshot, context: DiagnosticsAdapterSnapshotContext): void;
18
18
  /** Пишет безопасную тестовую строку без добавления record в diagnostics history. */
19
19
  test(): void;
@@ -1,7 +1,9 @@
1
1
  import { RuntimeEntityType } from '../../../../domain/types/runtime/runtime-entity-map.types';
2
2
  import { AnyRuntimeStrategy, AnyRuntimeHost } from '../../../../domain/types/runtime/runtime-strategy.types';
3
3
  import { RuntimeExecuteOptions } from '../../../../domain/types/runtime/runtime-execute.type';
4
+ import { DestroyedRuntimeHostSnapshot, RuntimeHost, RuntimeInspectionLease } from '../../../../domain/types/runtime/runtime-host.types';
4
5
  import { EndgeRuntimeSnapshot, RuntimeExecutableModel } from '../../../../domain/types/runtime/runtime.types';
6
+ import { EndgeDataMode } from '../../../../domain/types/document/workspace.types';
5
7
  import { EndgeModule } from '../../../../domain/entities/endge/EndgeModule';
6
8
  import { RuntimeAppScope, RuntimeAppScopeOptions } from '../../../../domain/entities/runtime/RuntimeAppScope';
7
9
  import { RuntimeScope } from '../../../../domain/entities/runtime/RuntimeScope';
@@ -35,11 +37,10 @@ export declare class EndgeRuntime extends EndgeModule {
35
37
  private _appScopes;
36
38
  private _defaultAppScope;
37
39
  private _unsubscribeWorkspace;
38
- private _retainDestroyedHostSnapshots;
39
- /** Показывает, сохраняются ли snapshots уничтоженных hosts для runtime inspection. */
40
- get retainDestroyedHostSnapshots(): boolean;
41
- /** Включает или отключает сохранение snapshots уничтоженных runtime hosts. */
42
- set retainDestroyedHostSnapshots(value: boolean);
40
+ private _destroyedSnapshotLeases;
41
+ private _destroyingRuntimeIds;
42
+ /** Retain only bounded lightweight descriptors for an explicit inspector. */
43
+ acquireDestroyedHostSnapshots(limit: number): RuntimeInspectionLease;
43
44
  /** Создаёт default app scope и регистрирует runtime strategies. */
44
45
  constructor();
45
46
  /**
@@ -54,6 +55,8 @@ export declare class EndgeRuntime extends EndgeModule {
54
55
  * Создаёт runtime-host для переданной доменной модели.
55
56
  */
56
57
  execute(model: RuntimeExecutableModel, options?: RuntimeExecuteOptions): AnyRuntimeHost | null;
58
+ /** Разрешает data mode по ближайшему Composition override с fallback на общий Endge context. */
59
+ resolveDataMode(host: RuntimeHost<any, any> | null | undefined): EndgeDataMode;
57
60
  /**
58
61
  * Регистрирует стратегию запуска runtime-сущности.
59
62
  */
@@ -85,7 +88,7 @@ export declare class EndgeRuntime extends EndgeModule {
85
88
  /**
86
89
  * Возвращает snapshots удалённых runtime hosts для inspection tools.
87
90
  */
88
- getDeletedRuntimeHostSnapshots(): import('../../../../domain/types/runtime/runtime-host.types').RuntimeHostSnapshot[];
91
+ getDeletedRuntimeHostSnapshots(): DestroyedRuntimeHostSnapshot[];
89
92
  /**
90
93
  * Полностью удаляет один snapshot уничтоженного runtime host.
91
94
  */
@@ -124,6 +127,8 @@ export declare class EndgeRuntime extends EndgeModule {
124
127
  * Внутренний destroy для host с контролем уведомления подписчиков.
125
128
  */
126
129
  private destroyRuntimeInternal;
130
+ private syncDestroyedSnapshotLimit;
131
+ private createDestroyedSnapshot;
127
132
  /** Регистрирует host, подключает infrastructure и только затем активирует его. */
128
133
  private registerAndActivateHost;
129
134
  /** Creates the lifecycle root lazily again after a full Endge.reset(). */
@@ -1,8 +1,9 @@
1
1
  import { CompositionMountOptions, CompositionPreviewProps, CompositionSession } from '../../../../domain/types/source/composition-source.types';
2
+ import { EndgeDataMode } from '../../../../domain/types/document/workspace.types';
2
3
  /** Публичный facade монтирования Composition runtime sessions. */
3
4
  export declare class EndgeComposition {
4
5
  /** Монтирует Composition runtime и возвращает управляемую session. */
5
6
  mount(identity: string, options?: CompositionMountOptions): Promise<CompositionSession>;
6
7
  }
7
8
  /** Materializes preview-only literals and RMock references into regular Composition props. */
8
- export declare function materializeCompositionPreviewProps(previewProps: CompositionPreviewProps | null | undefined): Record<string, unknown>;
9
+ export declare function materializeCompositionPreviewProps(previewProps: CompositionPreviewProps | null | undefined, dataMode?: EndgeDataMode): Record<string, unknown>;
@@ -1,6 +1,7 @@
1
1
  import { RQuery } from '../../../../domain/entities/reflect/RQuery';
2
2
  import { AxiosInstance } from 'axios';
3
3
  import { QueryProgramPayload } from '../../../../domain/types/program/program.types';
4
+ import { RuntimeParentRef } from '../../../../domain/types/runtime/runtime-execute.type';
4
5
  /**
5
6
  * Модуль выполнения доменных query: custom executor, mock data и REST.
6
7
  */
@@ -14,7 +15,7 @@ export declare class EndgeQuery {
14
15
  /**
15
16
  * Выполняет query через compiled artifact и сохраняет результат в Raph.
16
17
  */
17
- run(query: RQuery, params?: Record<string, unknown>): Promise<any>;
18
+ run(query: RQuery, params?: Record<string, unknown>, parent?: RuntimeParentRef | null): Promise<any>;
18
19
  /** Выполняет artifact для QueryRuntimeHost без преждевременной записи stores. */
19
20
  executeArtifact(input: {
20
21
  payload: QueryProgramPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@endge/core",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@babel/parser": "^7.27.2",
30
30
  "@babel/types": "^7.27.1",
31
- "@endge/utils": "^0.24.6",
31
+ "@endge/utils": "^0.24.7",
32
32
  "@vue/compiler-dom": "^3.5.24",
33
33
  "@vue/compiler-sfc": "^3.5.24",
34
34
  "axios": "^1.13.2",
@@ -44,8 +44,8 @@
44
44
  "yaml": "^2.8.1"
45
45
  },
46
46
  "peerDependencies": {
47
- "@endge/raph": "^3.0.4",
48
- "@endge/utils": "^0.24.6",
47
+ "@endge/raph": "^3.0.5",
48
+ "@endge/utils": "^0.24.7",
49
49
  "@primevue/themes": "^4.0.0-rc.1",
50
50
  "class-transformer": "^0.5.1",
51
51
  "class-validator": "^0.14.1",