@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
@@ -0,0 +1,53 @@
1
+ import { ProgramDependency, ProgramDiagnostic } from '../../../program/domain/types/program.types';
2
+ /** Декларация будущей подмены request. Генерация данных здесь не выполняется. */
3
+ export interface SimulationMockRequest {
4
+ kind: 'mock-request';
5
+ seed?: string;
6
+ arrays: Record<string, number>;
7
+ }
8
+ export interface SimulationRuntimeOverride {
9
+ alias: string;
10
+ runtimes?: SimulationRuntimeOverride[];
11
+ request?: SimulationMockRequest;
12
+ }
13
+ export type SimulationTargetReference = {
14
+ entityType: 'composition';
15
+ identity: string;
16
+ } | {
17
+ entityType: 'project';
18
+ identity: string;
19
+ };
20
+ export interface SimulationSourceDocument {
21
+ target: SimulationTargetReference;
22
+ runtimes: SimulationRuntimeOverride[];
23
+ }
24
+ export interface SimulationSourceArtifact extends SimulationSourceDocument {
25
+ type: 'simulation';
26
+ sourceVersion: number;
27
+ }
28
+ export interface SimulationSourceCompileResult {
29
+ ast: unknown | null;
30
+ document: SimulationSourceDocument | null;
31
+ artifact: SimulationSourceArtifact | null;
32
+ diagnostics: Omit<ProgramDiagnostic, 'entityRef'>[];
33
+ dependencies: ProgramDependency[];
34
+ locations: Record<string, {
35
+ start: number;
36
+ end: number;
37
+ }>;
38
+ }
39
+ /** Read-only authoring inputs; Source services не получают Domain owner. */
40
+ export interface SimulationSourceInput {
41
+ id: string | number;
42
+ identity: string;
43
+ displayName?: string;
44
+ source: string;
45
+ sourceVersion: number;
46
+ isPrimitive?: boolean;
47
+ }
48
+ export interface SimulationSourceCatalog {
49
+ projects: readonly SimulationSourceInput[];
50
+ compositions: readonly SimulationSourceInput[];
51
+ queries: readonly SimulationSourceInput[];
52
+ types: readonly SimulationSourceInput[];
53
+ }
@@ -1,7 +1,7 @@
1
1
  import { I18nCatalogProvenance, I18nRuntimeCatalog } from '../../../i18n/domain/i18n.types';
2
2
  import { TypeSourceDefinition } from './type-source.types';
3
3
  /** Канонический тип source-документа, для которого выбирается source strategy. */
4
- export type SourceKind = 'action' | 'query' | 'vocab' | 'data-view' | 'filter' | 'composition' | 'store' | 'stream' | 'update' | 'computation' | 'style' | 'type' | 'configuration';
4
+ export type SourceKind = 'action' | 'query' | 'vocab' | 'data-view' | 'filter' | 'composition' | 'store' | 'stream' | 'simulation' | 'update' | 'computation' | 'style' | 'type' | 'configuration';
5
5
  /** Тип нейтральной source completion без привязки к Monaco или другому editor API. */
6
6
  export type SourceLanguageCompletionKind = 'keyword' | 'function' | 'property' | 'value' | 'snippet';
7
7
  /** Позиция курсора внутри source-документа. */
@@ -78,7 +78,7 @@ export interface SourceLanguageSignatureHelp {
78
78
  }>;
79
79
  }
80
80
  /** Логический тип внешнего доменного документа, на который ссылается source. */
81
- export type SourceDocumentReferenceTarget = 'action' | 'auth-profile' | 'component' | 'composition' | 'computation' | 'converter' | 'data-view' | 'filter' | 'i18n-bundles' | 'mock' | 'query' | 'store' | 'stream' | 'update' | 'style' | 'type' | 'vocabs';
81
+ export type SourceDocumentReferenceTarget = 'action' | 'auth-profile' | 'component' | 'composition' | 'computation' | 'converter' | 'data-view' | 'filter' | 'i18n-bundles' | 'project' | 'mock' | 'query' | 'store' | 'stream' | 'update' | 'style' | 'type' | 'vocabs';
82
82
  /** Семантическая ссылка из source на внешний доменный документ. */
83
83
  export interface SourceDocumentReference {
84
84
  /** Логический тип цели; UI может уточнить concrete document type через domain. */
@@ -0,0 +1,33 @@
1
+ import { ProgramDependency } from '../../program/domain/types/program.types';
2
+ import { CompositionSourceDocument } from '../domain/types/composition-source.types';
3
+ import { SimulationSourceCatalog, SimulationSourceCompileResult, SimulationSourceInput, SimulationTargetReference } from '../domain/types/simulation-source.types';
4
+ interface SimulationCompositionBranch {
5
+ owner: SimulationSourceInput;
6
+ document: CompositionSourceDocument;
7
+ scopePath: string;
8
+ }
9
+ export interface SimulationSourceTarget {
10
+ alias: string;
11
+ kind: 'project' | 'composition' | 'scope' | 'query' | 'unsupported';
12
+ identity: string;
13
+ branch: SimulationCompositionBranch | null;
14
+ }
15
+ interface QueryArrayContract {
16
+ paths: string[];
17
+ dependencies: ProgramDependency[];
18
+ errors: string[];
19
+ }
20
+ /** Read-only разрешение aliases и контрактов; не создаёт RuntimeHost или generator payload. */
21
+ export declare class SimulationSourceResolver {
22
+ private readonly _catalog;
23
+ private readonly _branches;
24
+ private readonly _queryContracts;
25
+ constructor(_catalog: SimulationSourceCatalog);
26
+ composition(identity: string): SimulationCompositionBranch | null;
27
+ graph(reference: SimulationTargetReference): SimulationCompositionBranch | null;
28
+ children(branch: SimulationCompositionBranch): SimulationSourceTarget[];
29
+ target(reference: SimulationTargetReference, aliases: readonly string[]): SimulationSourceTarget | null;
30
+ queryContract(identity: string): QueryArrayContract;
31
+ analyze(result: SimulationSourceCompileResult): SimulationSourceCompileResult;
32
+ }
33
+ export {};
@@ -0,0 +1,3 @@
1
+ import { SimulationSourceCompileResult } from '../../domain/types/simulation-source.types';
2
+ /** Разбирает только whitelist Simulation v1, не исполняя authored Source. */
3
+ export declare function compileSimulationSource(source: string, sourceVersion?: number): SimulationSourceCompileResult;
@@ -0,0 +1,10 @@
1
+ import { SimulationSourceCatalog } from '../../domain/types/simulation-source.types';
2
+ import { SourceEngineCompileResult, SourceEngineStrategy, SourceKind } from '../../domain/types/source-engine.types';
3
+ export declare class SimulationSourceEngineStrategy implements SourceEngineStrategy {
4
+ private readonly _catalog;
5
+ readonly id = "source:simulation";
6
+ readonly sourceKind: SourceKind;
7
+ constructor(_catalog: () => SimulationSourceCatalog);
8
+ supports(sourceKind: SourceKind | string): boolean;
9
+ compile(source: string): SourceEngineCompileResult;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { SimulationSourceCatalog } from '../../domain/types/simulation-source.types';
2
+ import { SourceKind, SourceLanguageCompletion, SourceLanguageContext, SourceLanguageStrategy, SourceLanguageValidationResult } from '../../domain/types/source-engine.types';
3
+ export declare class SimulationSourceLanguageStrategy implements SourceLanguageStrategy {
4
+ private readonly _catalog;
5
+ readonly id = "source-language:simulation";
6
+ readonly sourceKind: SourceKind;
7
+ readonly syntax: import('../../domain/types/source-engine.types').SourceLanguageSyntaxDefinition;
8
+ constructor(_catalog: () => SimulationSourceCatalog);
9
+ supports(sourceKind: SourceKind | string): boolean;
10
+ createDefaultSource(): string;
11
+ validate(source: string): SourceLanguageValidationResult;
12
+ completions(context: SourceLanguageContext): SourceLanguageCompletion[];
13
+ resolveReference(context: SourceLanguageContext): import('../../domain/types/source-engine.types').SourceDocumentReference | null;
14
+ }
@@ -0,0 +1,2 @@
1
+ /** Пустой корневой граф нового проекта, готовый к запуску без внешних ресурсов. */
2
+ export declare const PROJECT_DEFAULT_SOURCE = "defineComposition({\n activateOn: startup(),\n data: {},\n resources: {},\n runtimes: {},\n hooks: [],\n outputs: {},\n})\n";
@@ -0,0 +1,2 @@
1
+ /** Новый документ требует выбора целевой Composition или Project. */
2
+ export declare const SIMULATION_DEFAULT_SOURCE = "defineSimulation({\n target: composition(''),\n overrides: {\n runtimes: {},\n },\n})";
package/dist/main.d.ts CHANGED
@@ -6,6 +6,9 @@ export * from './features/federation/types/endge-modules.types';
6
6
  export * from './features/federation/constants/federation.constants';
7
7
  export * from './features/federation/types/federation.types';
8
8
  export * from './features/core/kernel/endge';
9
+ export * from './features/core/modules/bridge/EndgeBridge_Module';
10
+ export * from './features/core/modules/bridge/domain/bridge.type';
11
+ export { parseBridgeAllowedServers } from './features/core/modules/bridge/config/bridge.config';
9
12
  export * from './features/core/modules/domain/EndgeDomain_Module';
10
13
  export * from './features/core/modules/document-import/EndgeDocumentImport_Module';
11
14
  export { EndgeDomainRepository_Module, EndgeDomainRepositoryReadOnlyError } from './features/core/modules/domain-repository/EndgeDomainRepository_Module';
@@ -123,6 +126,7 @@ export * from './features/core/modules/source/domain/types/source-engine.types';
123
126
  export * from './features/core/modules/source/domain/types/source-expression.types';
124
127
  export * from './features/core/modules/source/domain/types/store-source.types';
125
128
  export * from './features/core/modules/source/domain/types/stream-source.types';
129
+ export * from './features/core/modules/source/domain/types/simulation-source.types';
126
130
  export * from './features/core/modules/source/domain/types/update-source.types';
127
131
  export * from './features/core/modules/source/domain/types/type-source.types';
128
132
  export * from './features/core/modules/source/domain/types/configuration-source.types';
@@ -145,6 +149,7 @@ export * from './features/core/modules/domain/entities/RDataView';
145
149
  export * from './features/core/modules/domain/entities/RComposition';
146
150
  export * from './features/core/modules/domain/entities/RStore';
147
151
  export * from './features/core/modules/domain/entities/RStream';
152
+ export * from './features/core/modules/domain/entities/RSimulation';
148
153
  export * from './features/core/modules/domain/entities/RUpdate';
149
154
  export * from './features/core/modules/domain/entities/RMock';
150
155
  export * from './features/core/modules/domain/entities/RQueryFilter';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@endge/core",
3
3
  "type": "module",
4
- "version": "7.1.0",
4
+ "version": "8.0.0",
5
5
  "private": false,
6
6
  "packageManager": "pnpm@8.8.0",
7
7
  "license": "Apache-2.0",
@@ -30,7 +30,7 @@
30
30
  "lint-fix": "eslint . --fix --cache"
31
31
  },
32
32
  "peerDependencies": {
33
- "@endge/raph": "^3.2.0",
33
+ "@endge/raph": "^3.3.0",
34
34
  "class-transformer": "^0.5.1",
35
35
  "class-validator": "^0.14.1",
36
36
  "reflect-metadata": "^0.2.2"
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@babel/parser": "^7.27.2",
40
40
  "@babel/types": "^7.27.1",
41
- "@endge/utils": "^0.26.0",
41
+ "@endge/utils": "^0.26.1",
42
42
  "@vue/compiler-dom": "^3.5.24",
43
43
  "@vue/compiler-sfc": "^3.5.24",
44
44
  "axios": "^1.13.2",
@@ -64,5 +64,6 @@
64
64
  "unplugin-dts": "^1.0.3",
65
65
  "vite": "^6.1.0",
66
66
  "vitest": "^2.1.9"
67
- }
67
+ },
68
+ "version_updated": "09.09.2026"
68
69
  }
@@ -1,86 +0,0 @@
1
- import { EndgeModule } from '../../federation/EndgeModule';
2
- export interface RuntimeDebugTab {
3
- id: string;
4
- url: string;
5
- title: string;
6
- at: number;
7
- }
8
- /**
9
- * Подключает вкладку к каналу обмена для отладки.
10
- * start() - создаёт канал и слушает регистрации (вызывать в админке).
11
- * activate() - регистрирует текущую вкладку как клиент Runtime Debug.
12
- */
13
- export declare class EndgeRuntimeDebugger_Module extends EndgeModule {
14
- /** Канал для отправки (activate) */
15
- private _channel;
16
- /** Канал для приёма (start); живёт глобально в админке */
17
- private _listenerChannel;
18
- private _tabId;
19
- private _tabs;
20
- private _autoRegisterTimer;
21
- private _analysisByTabId;
22
- private _diagnosticsListener;
23
- private _unsubscribeDiagnostics;
24
- /** Закрывает browser channels, timers и diagnostics subscription. */
25
- reset(): void;
26
- /** Доступ к текущему состоянию runtime debugger. */
27
- /**
28
- * Возвращает список вкладок, известных runtime debugger.
29
- */
30
- get tabs(): RuntimeDebugTab[];
31
- /**
32
- * Показывает, открыт ли BroadcastChannel для runtime debug.
33
- */
34
- get isListening(): boolean;
35
- /**
36
- * Возвращает накопленные результаты анализа для вкладки.
37
- */
38
- getAnalysis(tabId: string): string[];
39
- /** Возвращает безопасную диагностическую проекцию известных debug-вкладок. */
40
- createDiagnosticsSnapshot(): unknown;
41
- /**
42
- * Отправить команду во все подключённые вкладки.
43
- * Используется админкой для запуска анализа по текущей вкладке.
44
- */
45
- sendCommand(command: string, payload?: Record<string, unknown>): void;
46
- /**
47
- * Запустить прослушку канала (создать канал и накапливать вкладки). Вызывать из админки при init.
48
- */
49
- startListening(): void;
50
- /**
51
- * Остановить прослушку, закрыть канал, очистить список вкладок.
52
- */
53
- stop(): void;
54
- private _onMessage;
55
- /**
56
- * Возвращает Channel.
57
- */
58
- private _getChannel;
59
- /**
60
- * Возвращает Tab Id.
61
- */
62
- private _getTabId;
63
- /**
64
- * Внутренний helper модуля: post Register.
65
- */
66
- private _postRegister;
67
- /**
68
- * Обработка команд на стороне клиентской вкладки.
69
- * Здесь просто логируем получение команды для отладки.
70
- */
71
- private _onClientMessage;
72
- /**
73
- * Гарантирует Auto Register.
74
- */
75
- private _ensureAutoRegister;
76
- /**
77
- * Зарегистрировать текущую вкладку в канале отладки.
78
- * При активации подписывается на Endge.diagnostics и дублирует записи в канал для админки.
79
- */
80
- activate(): void;
81
- /** Один раз подписаться на diagnostics и слать записи в канал. Не делаем на странице админки. */
82
- /**
83
- * Гарантирует Diagnostics Forwarding.
84
- */
85
- private _ensureDiagnosticsForwarding;
86
- }