@endge/core 1.2.7 → 1.2.9

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 (99) hide show
  1. package/dist/core.cjs +330 -256
  2. package/dist/core.js +27169 -24015
  3. package/dist/domain/entities/reflect/RComputation.d.ts +0 -3
  4. package/dist/domain/entities/reflect/RStream.d.ts +8 -0
  5. package/dist/domain/entities/reflect/RType.d.ts +2 -9
  6. package/dist/domain/entities/reflect/RUpdate.d.ts +10 -0
  7. package/dist/domain/entities/runtime/RuntimeHostBase.d.ts +2 -0
  8. package/dist/domain/entities/runtime/hosts/ComponentSFCRuntimeHost.d.ts +10 -0
  9. package/dist/domain/entities/runtime/hosts/CompositionRuntimeHost.d.ts +18 -1
  10. package/dist/domain/entities/runtime/hosts/FilterViewRuntimeHost.d.ts +13 -0
  11. package/dist/domain/entities/runtime/hosts/StoreRuntimeHost.d.ts +16 -0
  12. package/dist/domain/entities/runtime/hosts/StreamRuntimeHost.d.ts +30 -0
  13. package/dist/domain/types/component/sfc/dependencies.types.d.ts +13 -0
  14. package/dist/domain/types/component/sfc/ir.types.d.ts +13 -0
  15. package/dist/domain/types/computation/computation-source.types.d.ts +3 -0
  16. package/dist/domain/types/document/document.types.d.ts +4 -2
  17. package/dist/domain/types/document/domain-export.type.d.ts +2 -0
  18. package/dist/domain/types/document/schema.types.d.ts +6 -0
  19. package/dist/domain/types/program/program.types.d.ts +5 -2
  20. package/dist/domain/types/runtime/action.types.d.ts +3 -0
  21. package/dist/domain/types/runtime/index.d.ts +1 -0
  22. package/dist/domain/types/runtime/runtime-entity-map.types.d.ts +3 -0
  23. package/dist/domain/types/runtime/runtime-host.types.d.ts +7 -0
  24. package/dist/domain/types/runtime/runtime-project-session.types.d.ts +3 -0
  25. package/dist/domain/types/runtime/runtime.types.d.ts +3 -2
  26. package/dist/domain/types/runtime/stream-runtime.types.d.ts +17 -0
  27. package/dist/domain/types/runtime/vocab-cache.types.d.ts +33 -0
  28. package/dist/domain/types/source/composition-source.types.d.ts +43 -1
  29. package/dist/domain/types/source/data-view-source.types.d.ts +6 -1
  30. package/dist/domain/types/source/filter-source.types.d.ts +47 -0
  31. package/dist/domain/types/source/index.d.ts +2 -0
  32. package/dist/domain/types/source/query-source.types.d.ts +2 -1
  33. package/dist/domain/types/source/source-engine.types.d.ts +2 -2
  34. package/dist/domain/types/source/source-expression.types.d.ts +4 -1
  35. package/dist/domain/types/source/store-source.types.d.ts +9 -0
  36. package/dist/domain/types/source/stream-source.types.d.ts +39 -0
  37. package/dist/domain/types/source/type-source.types.d.ts +6 -1
  38. package/dist/domain/types/source/update-source.types.d.ts +32 -0
  39. package/dist/main.d.ts +7 -0
  40. package/dist/model/db/repositories/Actions_Repository.d.ts +0 -7
  41. package/dist/model/db/repositories/Computations_Repository.d.ts +0 -2
  42. package/dist/model/db/repositories/PageTemplates_Repository.d.ts +1 -0
  43. package/dist/model/db/repositories/Pages_Repository.d.ts +1 -0
  44. package/dist/model/db/repositories/Streams_Repository.d.ts +27 -0
  45. package/dist/model/db/repositories/Types_Repository.d.ts +5 -8
  46. package/dist/model/db/repositories/Updates_Repository.d.ts +26 -0
  47. package/dist/model/endge/domain/endge-domain.d.ts +32 -0
  48. package/dist/model/endge/domain/endge-types.d.ts +12 -0
  49. package/dist/model/endge/domain/endge-vocabs.d.ts +24 -0
  50. package/dist/model/endge/kernel/endge.d.ts +3 -0
  51. package/dist/model/endge/program/endge-compiler.d.ts +13 -0
  52. package/dist/model/endge/program/endge-program.d.ts +6 -0
  53. package/dist/model/endge/runtime/core/endge-actions.d.ts +1 -0
  54. package/dist/model/endge/runtime/core/endge-bind.d.ts +1 -5
  55. package/dist/model/endge/runtime/execution/computation/EndgeComputation.d.ts +6 -0
  56. package/dist/model/services/compiler/component-sfc/component-sfc-expression.d.ts +2 -0
  57. package/dist/model/services/compiler/computation/computation-compile.d.ts +1 -3
  58. package/dist/model/services/compiler/type/type-program-validation.d.ts +5 -1
  59. package/dist/model/services/runtime/strategies/StreamRuntimeStrategy.d.ts +9 -0
  60. package/dist/model/services/runtime/transports/BrowserSseStreamTransportFactory.d.ts +5 -0
  61. package/dist/model/services/source-engine/compilers/source-field-compile.d.ts +4 -1
  62. package/dist/model/services/source-engine/compilers/stream-source-compile.d.ts +3 -0
  63. package/dist/model/services/source-engine/compilers/type-source-compile.d.ts +7 -1
  64. package/dist/model/services/source-engine/compilers/update-source-compile.d.ts +3 -0
  65. package/dist/model/services/source-engine/composition-source-patch.d.ts +6 -0
  66. package/dist/model/services/source-engine/filter-source-patch.d.ts +12 -0
  67. package/dist/model/services/source-engine/source-document-reference.d.ts +7 -0
  68. package/dist/model/services/source-engine/strategies/CompositionSourcePatchStrategy.d.ts +13 -0
  69. package/dist/model/services/source-engine/strategies/FilterSourcePatchStrategy.d.ts +10 -0
  70. package/dist/model/services/source-engine/strategies/StreamSourceEngineStrategy.d.ts +7 -0
  71. package/dist/model/services/source-engine/strategies/StreamSourceLanguageStrategy.d.ts +10 -0
  72. package/dist/model/services/source-engine/strategies/UpdateSourceEngineStrategy.d.ts +7 -0
  73. package/dist/model/services/source-engine/strategies/UpdateSourceLanguageStrategy.d.ts +10 -0
  74. package/dist/model/services/source-engine/templates/stream.default.source.d.ts +1 -0
  75. package/dist/model/services/source-engine/templates/update.default.source.d.ts +1 -0
  76. package/dist/test/component-sfc-table-visibility.test.d.ts +1 -0
  77. package/dist/test/domain/entities/runtime/ComponentSFCEventBoundary.test.d.ts +1 -0
  78. package/dist/test/domain/entity-meta.test.d.ts +1 -0
  79. package/dist/test/model/db/repositories/types-repository.test.d.ts +1 -0
  80. package/dist/test/model/endge/domain/type-identity-index.test.d.ts +1 -0
  81. package/dist/test/model/endge/program/endge-compiler-query-auth.test.d.ts +1 -0
  82. package/dist/test/model/endge/program/endge-compiler-type.test.d.ts +1 -0
  83. package/dist/test/model/endge/runtime/computation-source-preview.test.d.ts +1 -0
  84. package/dist/test/model/endge/schema/document-create.test.d.ts +1 -0
  85. package/dist/test/model/endge/schema/type-payload.test.d.ts +1 -0
  86. package/dist/test/model/services/compiler/computation/groundhandling-process-state.test.d.ts +1 -0
  87. package/dist/test/model/services/source-engine/component-sfc/component-sfc-metadata-source-patch.test.d.ts +1 -0
  88. package/dist/test/model/services/source-engine/component-sfc/component-sfc-ports-source-patch.test.d.ts +1 -0
  89. package/dist/test/model/services/source-engine/component-sfc/component-sfc-props-source-patch.test.d.ts +1 -0
  90. package/dist/test/model/services/source-engine/data-view-select-steps.test.d.ts +1 -0
  91. package/dist/test/model/services/source-engine/source-language-normalize.test.d.ts +1 -0
  92. package/dist/test/model/services/source-engine/type-source-compile.test.d.ts +1 -0
  93. package/dist/test/model/services/source-engine/typescript-type-source.test.d.ts +1 -0
  94. package/dist/test/model/services/source-engine/value-expression-operations.test.d.ts +1 -0
  95. package/dist/test/runtime/sfc-render-inspection-session.test.d.ts +1 -0
  96. package/dist/test/tools/type-import-source.test.d.ts +1 -0
  97. package/package.json +4 -3
  98. package/dist/model/seed/actions/console_log.d.ts +0 -3
  99. package/dist/model/seed/actions/load_vocabs.d.ts +0 -3
@@ -1,6 +1,5 @@
1
1
  import { DuplicateOptions, REntity } from './REntity';
2
2
  import { DiagnosticsProblemInput } from '../../types/diagnostics';
3
- import { RField } from './RField';
4
3
  /** Persisted executable specification. Runtime execution is provided separately. */
5
4
  export declare class RComputation extends REntity {
6
5
  displayName: string;
@@ -8,8 +7,6 @@ export declare class RComputation extends REntity {
8
7
  source: string;
9
8
  sourceVersion: number;
10
9
  contractVersion: number;
11
- input: RField | null;
12
- output: RField | null;
13
10
  static fromPayload(json: any): RComputation;
14
11
  static fromPlain(json: any, storageMeta?: any): RComputation;
15
12
  toPlain(): Record<string, unknown>;
@@ -0,0 +1,8 @@
1
+ import { DuplicateOptions, REntity } from './REntity';
2
+ /** Persisted source-first definition of a normalized event stream. */
3
+ export declare class RStream extends REntity {
4
+ readonly type: "stream";
5
+ source: string;
6
+ sourceVersion: number;
7
+ duplicate(options: DuplicateOptions): RStream;
8
+ }
@@ -1,20 +1,13 @@
1
- import { RField } from './RField';
2
1
  import { REntity } from './REntity';
3
2
  /**
4
- * Класс рефлексии для хранения информации о типе.
5
- * Содержит название и список полей.
3
+ * Source-first доменная сущность типа.
6
4
  */
7
5
  export declare class RType extends REntity {
8
6
  get id(): string;
9
7
  name: string;
10
8
  isPrimitive: boolean;
11
- /** Независимый Type Source. Legacy fields не генерируются из него автоматически. */
9
+ /** Каноническое структурное определение типа. */
12
10
  source: string;
13
11
  sourceVersion: number;
14
- fields: Map<string, RField>;
15
12
  constructor(name: string);
16
- addField(field: RField): void;
17
- getField(fieldName: string | number): RField | null;
18
- hasField(fieldName: string | number): boolean;
19
- getFields(): string[];
20
13
  }
@@ -0,0 +1,10 @@
1
+ import { DuplicateOptions, REntity } from './REntity';
2
+ /** Persisted source-first Store-owned mutation definition. */
3
+ export declare class RUpdate extends REntity {
4
+ readonly type: "update";
5
+ /** Stable identity of the only Store that may execute this Update. */
6
+ storeIdentity: string;
7
+ source: string;
8
+ sourceVersion: number;
9
+ duplicate(options: DuplicateOptions): RUpdate;
10
+ }
@@ -141,6 +141,8 @@ export declare abstract class RuntimeHostBase<TType extends RuntimeEntityType, T
141
141
  * ACCESS
142
142
  */
143
143
  getArtifact(): ProgramArtifact<TArtifactPayload> | null;
144
+ /** Возвращает read-only artifact reader текущей runtime session. */
145
+ getArtifactReader(): RuntimeArtifactReader | null;
144
146
  /**
145
147
  * ACCESS
146
148
  */
@@ -4,6 +4,8 @@ import { RComponentSFC_AST, RComponentSFC_IR, RComponentSFC_RuntimeDependencies,
4
4
  import { ComponentSFCPreviewOptions, ComponentSFCProgramPayload, ProgramDiagnostic } from '../../../types/program/program.types';
5
5
  import { RuntimeArtifactReader, RuntimeHost, RuntimeHostContext, RuntimeHostInputSource, RuntimeHostUpdateContext } from '../../../types/runtime/runtime-host.types';
6
6
  import { ComputationResource } from '../../../types/computation';
7
+ import { SourceFieldOption } from '../../../types/source/source-expression.types';
8
+ import { VocabOptionMapping } from '../../../types/runtime/vocab-cache.types';
7
9
  import { RuntimeHostBase } from '../RuntimeHostBase';
8
10
  /**
9
11
  * Runtime-host нового SFC-компонента.
@@ -18,6 +20,7 @@ export declare class ComponentSFCRuntimeHost extends RuntimeHostBase<'component-
18
20
  private readonly _computationErrorSignatures;
19
21
  private _styleLease;
20
22
  private readonly _eventPortListeners;
23
+ private readonly _vocabDisposers;
21
24
  constructor(input: {
22
25
  id: string;
23
26
  model: RComponentSFC;
@@ -43,6 +46,11 @@ export declare class ComponentSFCRuntimeHost extends RuntimeHostBase<'component-
43
46
  getDiagnostics(): ProgramDiagnostic[];
44
47
  /** Переводит public key через накопленный Composition catalog этого runtime. */
45
48
  translate(key: string, fallback?: string): string;
49
+ /**
50
+ * Читает Vocab alias из ближайшего Composition scope и преобразует cache
51
+ * records в renderer-neutral Select options.
52
+ */
53
+ resolveVocabOptions(alias: string, mapping?: Partial<VocabOptionMapping>): SourceFieldOption[];
46
54
  /** Возвращает внешний контракт компонента из compiled artifact. */
47
55
  getContract(): RComponentContract | null;
48
56
  /** Возвращает зависимости компонента из compiled artifact. */
@@ -90,6 +98,8 @@ export declare class ComponentSFCRuntimeHost extends RuntimeHostBase<'component-
90
98
  /** Backward-compatible alias для старого runtime prepare API. */
91
99
  preparePlaceholders(target: RComponentRenderTarget | null): void;
92
100
  private makeArtifactResourcePayload;
101
+ /** Подписывает host на shared Vocab path один раз, включая вложенные SFC artifacts. */
102
+ private _ensureVocabSubscription;
93
103
  private _createRuntimeBoundaryNodes;
94
104
  private _createTableColumnBoundaryNode;
95
105
  private _bindRaphInputSource;
@@ -1,8 +1,10 @@
1
1
  import { RComposition } from '../../reflect/RComposition';
2
2
  import { FilterViewRuntimeHost } from './FilterViewRuntimeHost';
3
+ import { StoreMutationPlan } from '../../../types/source/update-source.types';
3
4
  import { CompositionFilterFieldsSlice, CompositionProgramPayload, CompositionPublicOutputHandle, CompositionRuntimeActivationHandle, CompositionRuntimeChildHandle } from '../../../types/source/composition-source.types';
4
5
  import { RuntimeArtifactReader, RuntimeHost, RuntimeHostContext, RuntimeHostInputSource, RuntimeHostUpdateContext } from '../../../types/runtime/runtime-host.types';
5
6
  import { I18nRuntimeCatalog } from '../../../types/i18n.types';
7
+ import { VocabRuntimeCatalog } from '../../../types/runtime/vocab-cache.types';
6
8
  import { RuntimeHostBase } from '../RuntimeHostBase';
7
9
  import { RuntimeScope } from '../RuntimeScope';
8
10
  /** Runtime orchestration host: children, bindings, hooks и public handles. */
@@ -25,8 +27,11 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
25
27
  private _ownedStoreRuntimeIds;
26
28
  private _compositionInputBindings;
27
29
  private _i18nCatalogs;
30
+ private _vocabCatalogs;
28
31
  private _orchestratedQueries;
29
32
  private _orchestratedSuccesses;
33
+ private _streamBatches;
34
+ private _streamBatchTimers;
30
35
  private _mounted;
31
36
  constructor(input: {
32
37
  id: string;
@@ -51,6 +56,8 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
51
56
  getScope(path: string): RuntimeScope | null;
52
57
  /** Возвращает накопленный translation catalog для заданного lifecycle scope. */
53
58
  getI18nCatalog(scopePath?: string): I18nRuntimeCatalog;
59
+ /** Возвращает накопленный Vocab catalog для заданного lifecycle scope. */
60
+ getVocabCatalog(scopePath?: string): VocabRuntimeCatalog;
54
61
  getRuntimeHandle(path: string): CompositionRuntimeActivationHandle | null;
55
62
  /** Возвращает текущее значение публичного Composition output. */
56
63
  getOutput(name: string): unknown;
@@ -58,6 +65,10 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
58
65
  getDataSnapshot(): Readonly<Record<string, unknown>>;
59
66
  /** Возвращает текущие значения публичных Composition props. */
60
67
  getProps(): Readonly<Record<string, unknown>>;
68
+ /** Imperative local mutation for UI flows that do not need a persisted RUpdate. */
69
+ mutateStore(dataAlias: string, plan: StoreMutationPlan): void;
70
+ /** Explicitly invokes one named Store-owned RUpdate outside Stream dispatch. */
71
+ applyStoreUpdate(dataAlias: string, updateIdentity: string, payload: unknown): void;
61
72
  /** Устанавливает literal/Raph-backed источник публичных Composition props. */
62
73
  setInputSource(input: RuntimeHostInputSource | null | undefined): void;
63
74
  /** Проверяет обязательные props до создания child runtime graph. */
@@ -78,7 +89,9 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
78
89
  destroy(): Promise<void>;
79
90
  /** Строит effective catalogs по той же иерархии, что и lifecycle scopes. */
80
91
  private _buildI18nCatalogs;
81
- /** Монтирует vocab data и разрешает Store aliases через explicit, ancestor или local provider. */
92
+ /** Строит nearest-scope catalog публичных Vocab aliases поверх shared cache paths. */
93
+ private _buildVocabCatalogs;
94
+ /** Регистрирует shared Vocab paths и разрешает Store aliases через explicit, ancestor или local provider. */
82
95
  private _mountData;
83
96
  /** Находит ближайший Store provider только среди Composition ancestors. */
84
97
  private _findAncestorStoreProvider;
@@ -88,8 +101,12 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
88
101
  private _publishUpdates;
89
102
  protected onUpdate(ctx: RuntimeHostUpdateContext): void;
90
103
  private _requireDataPath;
104
+ private _requireStoreRuntime;
105
+ private _resolveDataReference;
91
106
  private _createChild;
92
107
  private _bindChild;
108
+ private _bindStreamDispatch;
109
+ private _flushStreamBatch;
93
110
  private _makeOutputs;
94
111
  /** Не допускает прямые и транзитивные циклы Composition runtime tree. */
95
112
  private _assertCompositionCycle;
@@ -14,6 +14,7 @@ export declare class FilterViewRuntimeHost extends RuntimeHostBase<'filter', Run
14
14
  private readonly _implementation;
15
15
  private readonly _onSourceChange;
16
16
  private readonly _disposeSourceWatch;
17
+ private readonly _disposeVocabWatch;
17
18
  private _props;
18
19
  constructor(input: {
19
20
  id: string;
@@ -40,4 +41,16 @@ export declare class FilterViewRuntimeHost extends RuntimeHostBase<'filter', Run
40
41
  getSlice(): CompositionFilterFieldsSlice;
41
42
  destroy(): void;
42
43
  private _resolveControl;
44
+ /**
45
+ * Возвращает готовые renderer-neutral options без сетевых запросов.
46
+ */
47
+ private _resolveOptions;
48
+ /**
49
+ * Возвращает Raph path справочника, используемого полем.
50
+ */
51
+ private _resolveVocabPath;
52
+ /**
53
+ * Читает вложенное значение строки справочника.
54
+ */
55
+ private _readPath;
43
56
  }
@@ -1,6 +1,8 @@
1
1
  import { RStore } from '../../reflect/RStore';
2
2
  import { RuntimeArtifactReader, RuntimeHost, RuntimeHostContext } from '../../../types/runtime/runtime-host.types';
3
3
  import { StoreDataDescriptor, StoreSourceArtifact } from '../../../types/source/store-source.types';
4
+ import { StoreMutationPlan } from '../../../types/source/update-source.types';
5
+ import { StreamEventEnvelope } from '../../../types/source/stream-source.types';
4
6
  import { RuntimeHostBase } from '../RuntimeHostBase';
5
7
  /** Runtime-владелец writable Store state и реактивных DataView projections. */
6
8
  export declare class StoreRuntimeHost extends RuntimeHostBase<'store', RuntimeHostContext<'store'>, StoreSourceArtifact> {
@@ -31,8 +33,22 @@ export declare class StoreRuntimeHost extends RuntimeHostBase<'store', RuntimeHo
31
33
  isWritable(path: string): boolean;
32
34
  /** Записывает значение в writable Store field и запускает derived graph через Raph. */
33
35
  set(path: string, value: unknown): void;
36
+ /**
37
+ * Маршрутизирует нормализованное событие по compile-time таблице Store.
38
+ * Возвращает false, если Store не объявляет Update для данного типа.
39
+ */
40
+ dispatch(event: StreamEventEnvelope): boolean;
41
+ /** Применяет именованный дочерний Update к Store без привязки к транспорту. */
42
+ applyUpdate(updateIdentity: string, payload: unknown): void;
43
+ /**
44
+ * Применяет inline mutation из Composition/UI.
45
+ * Это escape hatch для локальных изменений, которым не нужен persisted RUpdate.
46
+ */
47
+ applyMutation(plan: StoreMutationPlan): void;
34
48
  /** Освобождает derived registrations до удаления Store state. */
35
49
  destroy(): void;
36
50
  /** Инициализирует writable fields и затем immediate derived graph. */
37
51
  private _mount;
52
+ private _makeMutationPlans;
53
+ private _applyMutationPlan;
38
54
  }
@@ -0,0 +1,30 @@
1
+ import { RStream } from '../../reflect/RStream';
2
+ import { RuntimeArtifactReader, RuntimeHost, RuntimeHostContext } from '../../../types/runtime/runtime-host.types';
3
+ import { StreamTransportFactory } from '../../../types/runtime/stream-runtime.types';
4
+ import { StreamSourceArtifact } from '../../../types/source/stream-source.types';
5
+ import { RuntimeHostBase } from '../RuntimeHostBase';
6
+ /** Runtime lifecycle owner for one compiled Stream transport. */
7
+ export declare class StreamRuntimeHost extends RuntimeHostBase<'stream', RuntimeHostContext<'stream'>, StreamSourceArtifact> {
8
+ private _connection;
9
+ constructor(input: {
10
+ id: string;
11
+ model: RStream;
12
+ parent?: RuntimeHost<any, any> | null;
13
+ meta?: Record<string, unknown>;
14
+ artifactReader: RuntimeArtifactReader;
15
+ privateTransportFactory: StreamTransportFactory;
16
+ });
17
+ private readonly _transportFactory;
18
+ static createRuntime(input: {
19
+ id: string;
20
+ model: RStream;
21
+ meta?: Record<string, any>;
22
+ parent?: RuntimeHost<any, any> | null;
23
+ artifacts: RuntimeArtifactReader;
24
+ transportFactory: StreamTransportFactory;
25
+ }): StreamRuntimeHost | null;
26
+ start(): void;
27
+ stop(): void;
28
+ destroy(): void;
29
+ private _receive;
30
+ }
@@ -42,12 +42,25 @@ export interface RComponentSFC_RuntimeBoundaryDependency {
42
42
  /** Колонки таблицы, которые можно обновлять точечно. */
43
43
  columns: RComponentSFC_RuntimeTableColumnDependency[];
44
44
  }
45
+ /** Runtime-зависимость SFC от Vocab alias ближайшего Composition scope. */
46
+ export interface RComponentSFC_RuntimeVocabDependency {
47
+ /** Публичный, scope-local alias; физическая Vocab identity сюда не протекает. */
48
+ alias: string;
49
+ /** Путь option value внутри элемента Vocab. */
50
+ valuePath: string;
51
+ /** Путь option label внутри элемента Vocab. */
52
+ labelPath: string;
53
+ /** Исходное выражение для diagnostics/debug. */
54
+ raw: string;
55
+ }
45
56
  /** Набор runtime-зависимостей SFC artifact. */
46
57
  export interface RComponentSFC_RuntimeDependencies {
47
58
  /** Зависимости от props, которые можно связать с внешним input source. */
48
59
  props: RComponentSFC_RuntimeDependency[];
49
60
  /** Patchable boundaries, для которых runtime строит отдельные Raph-ноды. */
50
61
  boundaries: RComponentSFC_RuntimeBoundaryDependency[];
62
+ /** Vocab aliases, которые должен предоставить ближайший Composition scope. */
63
+ vocabs?: RComponentSFC_RuntimeVocabDependency[];
51
64
  }
52
65
  /** Создает пустой dependency artifact SFC runtime. */
53
66
  export declare function createEmptyComponentSFCRuntimeDependencies(): RComponentSFC_RuntimeDependencies;
@@ -123,6 +123,19 @@ export interface RComponentSFC_IR_ExpressionValue {
123
123
  source: string;
124
124
  /** Зависимости, которые выражение читает. */
125
125
  reads: RComponentSFC_IR_Read[];
126
+ /** Статические обращения к Vocab aliases текущего Composition scope. */
127
+ vocabReads?: RComponentSFC_IR_VocabRead[];
128
+ }
129
+ /** Статическое обращение `vocab(alias, mapping?)` внутри SFC expression. */
130
+ export interface RComponentSFC_IR_VocabRead {
131
+ /** Публичный alias из ближайшего Composition scope. */
132
+ alias: string;
133
+ /** Путь option value внутри элемента Vocab. */
134
+ valuePath: string;
135
+ /** Путь option label внутри элемента Vocab. */
136
+ labelPath: string;
137
+ /** Исходное выражение для diagnostics/debug. */
138
+ raw: string;
126
139
  }
127
140
  /** Реактивное чтение, найденное внутри выражения. */
128
141
  export interface RComponentSFC_IR_Read {
@@ -1,4 +1,5 @@
1
1
  import { SourceExpressionIR } from '../source/source-expression.types';
2
+ import { ComputationContractField } from './computation-program.types';
2
3
  export interface ComputationSourceRange {
3
4
  start: number;
4
5
  end: number;
@@ -23,6 +24,8 @@ export type ComputationSourceNode = {
23
24
  };
24
25
  /** Canonical compiler-derived representation of defineComputation source. */
25
26
  export interface ComputationSourceDocument {
27
+ input: ComputationContractField | null;
28
+ output: ComputationContractField | null;
26
29
  outputs: ComputationSourceNode[];
27
30
  result: SourceExpressionIR;
28
31
  }
@@ -20,6 +20,8 @@ import { RWorkspace } from '../../entities/reflect/RWorkspace';
20
20
  import { RComponent } from '../component/component.types';
21
21
  import { RComposition } from '../../entities/reflect/RComposition';
22
22
  import { RStore } from '../../entities/reflect/RStore';
23
+ import { RStream } from '../../entities/reflect/RStream';
24
+ import { RUpdate } from '../../entities/reflect/RUpdate';
23
25
  import { RMock } from '../../entities/reflect/RMock';
24
26
  import { RComputation } from '../../entities/reflect/RComputation';
25
27
  /**
@@ -84,7 +86,7 @@ export declare enum DomainSectionType {
84
86
  /**
85
87
  * Все возможные типы документов
86
88
  */
87
- export type DomainDocumentType = 'primitive' | 'type' | 'action' | 'converter' | 'computation' | 'data-view' | 'composition' | 'store' | 'mock' | 'integration' | 'page-template' | 'page' | 'navigation' | 'environment' | 'policy' | 'style' | 'vocabs' | 'i18n-bundles' | 'auth-profile' | 'tenant' | 'project' | 'workspace' | Exclude<ComponentType, ComponentType.Component | ComponentType.Html> | QueryType | ParameterType | FilterType;
89
+ export type DomainDocumentType = 'primitive' | 'type' | 'action' | 'converter' | 'computation' | 'data-view' | 'composition' | 'store' | 'stream' | 'update' | 'mock' | 'integration' | 'page-template' | 'page' | 'navigation' | 'environment' | 'policy' | 'style' | 'vocabs' | 'i18n-bundles' | 'auth-profile' | 'tenant' | 'project' | 'workspace' | Exclude<ComponentType, ComponentType.Component | ComponentType.Html> | QueryType | ParameterType | FilterType;
88
90
  /**
89
91
  * Описывает любой документ
90
92
  */
@@ -96,4 +98,4 @@ export interface Document {
96
98
  /**
97
99
  * Описывает любой документ рефлекцию
98
100
  */
99
- export type RDocument = RComponent | RComponentSFC | RQuery | RDataView | RComposition | RStore | RMock | RAction | RConverter | RComputation | RIntegration | RParameter | RFilter | RPolicy | RStyle | RType | RVocabs | RI18nBundle | RAuthProfile | RWorkspace | RTenant | RPageTemplate | RPage | RNavigation;
101
+ export type RDocument = RComponent | RComponentSFC | RQuery | RDataView | RComposition | RStore | RStream | RUpdate | RMock | RAction | RConverter | RComputation | RIntegration | RParameter | RFilter | RPolicy | RStyle | RType | RVocabs | RI18nBundle | RAuthProfile | RWorkspace | RTenant | RPageTemplate | RPage | RNavigation;
@@ -12,6 +12,8 @@ export interface EndgeDomainPlain {
12
12
  dataViews: unknown[];
13
13
  compositions: unknown[];
14
14
  stores: unknown[];
15
+ streams: unknown[];
16
+ updates: unknown[];
15
17
  mocks: unknown[];
16
18
  components: unknown[];
17
19
  componentSFCs: unknown[];
@@ -24,6 +24,8 @@ import { Tenants_Repository } from '../../../model/db/repositories/Tenants_Repos
24
24
  import { Workspaces_Repository } from '../../../model/db/repositories/Workspaces_Repository';
25
25
  import { Compositions_Repository } from '../../../model/db/repositories/Compositions_Repository';
26
26
  import { Stores_Repository } from '../../../model/db/repositories/Stores_Repository';
27
+ import { Streams_Repository } from '../../../model/db/repositories/Streams_Repository';
28
+ import { Updates_Repository } from '../../../model/db/repositories/Updates_Repository';
27
29
  import { Mocks_Repository } from '../../../model/db/repositories/Mocks_Repository';
28
30
  import { Computations_Repository } from '../../../model/db/repositories/Computations_Repository';
29
31
  export interface EndgeSchemaDump {
@@ -35,6 +37,8 @@ export interface EndgeSchemaDump {
35
37
  dataViews: any[];
36
38
  compositions: any[];
37
39
  stores: any[];
40
+ streams: any[];
41
+ updates: any[];
38
42
  mocks: any[];
39
43
  folders: any[];
40
44
  components: any[];
@@ -73,6 +77,8 @@ export type RepositoriesBag = {
73
77
  dataViews: DataViews_Repository;
74
78
  compositions: Compositions_Repository;
75
79
  stores: Stores_Repository;
80
+ streams: Streams_Repository;
81
+ updates: Updates_Repository;
76
82
  mocks: Mocks_Repository;
77
83
  folders: Folders_Repository;
78
84
  components: Components_Repository;
@@ -2,13 +2,13 @@ import { ActionCompiledFlow } from '../flow/action.types';
2
2
  import { RComponentContract, RComponentDependencies } from '../component/component-core.types';
3
3
  import { DataViewManualTransform, DataViewPipelineStep, DataViewRef, DataViewSourceDocument } from '../source/data-view-source.types';
4
4
  import { RComponentSFC_AST, RComponentSFC_IR, RComponentSFC_RuntimeDependencies, RComponentSFCSource_Parts } from '../component/sfc';
5
- import { QueryProgramProp, SourceExpressionIR } from '../source/source-expression.types';
5
+ import { QueryProgramProp, SourceExpressionIR, SourceFieldDefinition } from '../source/source-expression.types';
6
6
  import { ProgramMetadata } from './program-metadata.types';
7
7
  import { ComputationProgramPayload } from '../computation';
8
8
  import { EndgeStyleSheetArtifact } from '../style';
9
9
  import { ActionImplementation, ActionTargetSelector } from '../runtime/action.types';
10
10
  /** Тип доменной сущности, для которой compiler может построить program artifact. */
11
- export type ProgramEntityType = 'type' | 'component-sfc' | 'computation' | 'action' | 'query' | 'data-view' | 'store' | 'filter' | 'composition' | 'style';
11
+ export type ProgramEntityType = 'type' | 'component-sfc' | 'computation' | 'action' | 'query' | 'data-view' | 'store' | 'stream' | 'update' | 'filter' | 'composition' | 'style';
12
12
  /** Итоговый статус artifact после компиляции и валидации. */
13
13
  export type ProgramArtifactStatus = 'valid' | 'warning' | 'error';
14
14
  /** Возможность, которую artifact предоставляет runtime/render слоям. */
@@ -106,6 +106,7 @@ export interface QueryProgramOutput {
106
106
  key: string;
107
107
  source: QueryProgramOutputSource;
108
108
  dataViews: DataViewRef[];
109
+ contract?: SourceFieldDefinition | null;
109
110
  materialization: {
110
111
  kind: 'source';
111
112
  } | {
@@ -160,6 +161,8 @@ export interface DataViewProgramPayload {
160
161
  materializationStrategy: import('../source/data-view-source.types').DataViewMaterializationStrategy;
161
162
  /** Canonical source document для debug/preview UI. */
162
163
  sourceDocument: DataViewSourceDocument | null;
164
+ /** Декларативный входной и выходной тип DataView. */
165
+ contract?: DataViewSourceDocument['contract'];
163
166
  /** Compiled manual transform. Используется только в mode=manual. */
164
167
  transform: DataViewManualTransform | null;
165
168
  /** Compiled pipeline steps. Используется только в mode=pipeline. */
@@ -4,6 +4,9 @@ export type RuntimeActionSurface = string;
4
4
  /** Stable identities of targetless Actions provided by Endge itself. */
5
5
  export declare const BUILTIN_ACTION_IDS: {
6
6
  readonly consoleLog: "built-in-console-log";
7
+ readonly vocabAcquire: "built-in-vocabs-acquire";
8
+ readonly vocabRefresh: "built-in-vocabs-refresh";
9
+ readonly vocabInvalidate: "built-in-vocabs-invalidate";
7
10
  };
8
11
  /** Declarative reference accepted by interactive primitives such as MenuItem. */
9
12
  export interface ActionBinding<TInput = unknown> {
@@ -1,4 +1,5 @@
1
1
  export * from './action.types';
2
+ export * from './vocab-cache.types';
2
3
  export * from './implementation.types';
3
4
  export * from './context-persistence.types';
4
5
  export * from './query-execution.types';
@@ -6,6 +6,7 @@ import { RQuery } from '../../entities/reflect/RQuery';
6
6
  import { RFilter } from '../../entities/reflect/RFilter';
7
7
  import { RComposition } from '../../entities/reflect/RComposition';
8
8
  import { RStore } from '../../entities/reflect/RStore';
9
+ import { RStream } from '../../entities/reflect/RStream';
9
10
  /**
10
11
  * Канонический перечень сущностей, для которых может существовать runtime-host.
11
12
  */
@@ -24,6 +25,8 @@ export interface RuntimeEntityModelMap {
24
25
  composition: RComposition;
25
26
  /** Source-first reactive Store runtime. */
26
27
  store: RStore;
28
+ /** External or emulated normalized event stream. */
29
+ stream: RStream;
27
30
  /** Доменная модель action. */
28
31
  action: RAction;
29
32
  }
@@ -68,6 +68,10 @@ export interface StoreRuntimeHostContext extends RuntimeHostContextBase {
68
68
  writableFields: string[];
69
69
  derivedFields: string[];
70
70
  }
71
+ export interface StreamRuntimeHostContext extends RuntimeHostContextBase {
72
+ lastEventAt: string | null;
73
+ receivedCount: number;
74
+ }
71
75
  export interface ComponentSFCRuntimeHostContext extends RuntimeHostContextBase {
72
76
  /** Target последней подготовки SFC. */
73
77
  target: 'dom' | 'canvas' | null;
@@ -90,6 +94,7 @@ export interface RuntimeHostContextMap {
90
94
  filter: FilterRuntimeHostContext;
91
95
  composition: CompositionRuntimeHostContext;
92
96
  store: StoreRuntimeHostContext;
97
+ stream: StreamRuntimeHostContext;
93
98
  'component-sfc': ComponentSFCRuntimeHostContext;
94
99
  page: PageRuntimeHostContext;
95
100
  project: ProjectRuntimeHostContext;
@@ -309,6 +314,8 @@ export interface RuntimeHost<TType extends RuntimeEntityType = RuntimeEntityType
309
314
  bindUpdate: (binding: RuntimeHostUpdateBinding) => () => void;
310
315
  /** Возвращает compiled artifact, связанный с host, если он доступен. */
311
316
  getArtifact: () => ProgramArtifact<TArtifactPayload> | null;
317
+ /** Возвращает session-local reader, через который host читает compiled artifacts. */
318
+ getArtifactReader: () => RuntimeArtifactReader | null;
312
319
  /** Возвращает payload compiled artifact, связанный с host, если он доступен. */
313
320
  getArtifactPayload: () => TArtifactPayload | null;
314
321
  /** Изменить статус host и обновить updatedAt. */
@@ -1,6 +1,7 @@
1
1
  import { CompositionPublicOutputHandle, CompositionSession } from '../source/composition-source.types';
2
2
  import { CompositionRuntimeHost } from '../../entities/runtime/hosts/CompositionRuntimeHost';
3
3
  import { RuntimeScopeHandle } from './runtime-scope.types';
4
+ import { RuntimeArtifactReader } from './runtime-host.types';
4
5
  export interface ProjectCompositionRegistry {
5
6
  get: (identity: string) => ProjectCompositionHandle | null;
6
7
  require: (identity: string) => ProjectCompositionHandle;
@@ -21,6 +22,8 @@ export interface ProjectCompositionHandle {
21
22
  export interface ProjectRuntimeMountOptions {
22
23
  /** `declared` preserves root activateOn; `none` creates stable handles for an on-demand/debug session. */
23
24
  autoActivate?: 'declared' | 'none';
25
+ /** Session-local artifact projection used by Preview without mutating Endge.program. */
26
+ artifactReader?: RuntimeArtifactReader;
24
27
  }
25
28
  export interface ProjectRuntimeSession {
26
29
  readonly id: string;
@@ -1,6 +1,7 @@
1
1
  import { RFilter } from '../../entities/reflect/RFilter';
2
2
  import { RComposition } from '../../entities/reflect/RComposition';
3
3
  import { RStore } from '../../entities/reflect/RStore';
4
+ import { RStream } from '../../entities/reflect/RStream';
4
5
  import { RAction } from '../../entities/reflect/RAction';
5
6
  import { RComponentSFC } from '../../entities/reflect/RComponentSFC';
6
7
  import { RPage } from '../../entities/reflect/RPage';
@@ -10,8 +11,8 @@ import { RuntimeHostRegistrySnapshot } from './runtime-registry.types';
10
11
  /**
11
12
  * Runtime kinds
12
13
  */
13
- export type RuntimeKind = 'query' | 'filter' | 'composition' | 'store' | 'action' | 'runtime';
14
- export type RuntimeExecutableModel = RQuery | RAction | RProject | RPage | RComponentSFC | RFilter | RComposition | RStore;
14
+ export type RuntimeKind = 'query' | 'filter' | 'composition' | 'store' | 'stream' | 'action' | 'runtime';
15
+ export type RuntimeExecutableModel = RQuery | RAction | RProject | RPage | RComponentSFC | RFilter | RComposition | RStore | RStream;
15
16
  export interface EndgeRuntimeSnapshot extends RuntimeHostRegistrySnapshot {
16
17
  generatedAt: number;
17
18
  scopes: import('./runtime-scope.types').RuntimeScopeSnapshot[];
@@ -0,0 +1,17 @@
1
+ import { StreamSourceArtifact } from '../source/stream-source.types';
2
+ export interface StreamTransportMessage {
3
+ sourceEvent: string;
4
+ id: string | null;
5
+ data: unknown;
6
+ }
7
+ export interface StreamTransportConnection {
8
+ close: () => void;
9
+ }
10
+ /** Browser-neutral port used by StreamRuntimeHost. */
11
+ export interface StreamTransportFactory {
12
+ open: (artifact: StreamSourceArtifact, callbacks: {
13
+ message: (message: StreamTransportMessage) => void;
14
+ error: (error: unknown) => void;
15
+ open: () => void;
16
+ }) => StreamTransportConnection;
17
+ }
@@ -0,0 +1,33 @@
1
+ export type VocabReference = string | number;
2
+ export type VocabLoadStrategy = 'cache-first' | 'network-first' | 'stale-while-revalidate';
3
+ export type VocabLoadErrorPolicy = 'fail' | 'use-cache';
4
+ export interface VocabLoadPolicy {
5
+ strategy: VocabLoadStrategy;
6
+ /**
7
+ * Максимальный возраст cache entry в миллисекундах.
8
+ * `null` означает, что cache не устаревает автоматически.
9
+ */
10
+ maxAgeMs: number | null;
11
+ onError: VocabLoadErrorPolicy;
12
+ }
13
+ export declare const DEFAULT_VOCAB_LOAD_POLICY: Readonly<VocabLoadPolicy>;
14
+ export type VocabCacheOperationStatus = 'cache-hit' | 'loaded' | 'refreshed' | 'refreshing' | 'invalidated';
15
+ export interface VocabCacheOperationResult {
16
+ identity: string;
17
+ status: VocabCacheOperationStatus;
18
+ count: number;
19
+ }
20
+ /** Один публичный Vocab alias, доступный внутри runtime scope Composition. */
21
+ export interface VocabRuntimeCatalogEntry {
22
+ /** Физическая identity Vocab-документа, полезная для diagnostics. */
23
+ identity: string;
24
+ /** Реактивный Raph path загруженного массива значений. */
25
+ path: string;
26
+ }
27
+ /** Накопленный Vocab catalog ближайшего Composition scope. */
28
+ export type VocabRuntimeCatalog = Record<string, VocabRuntimeCatalogEntry>;
29
+ /** Явное преобразование элемента Vocab в renderer-neutral option. */
30
+ export interface VocabOptionMapping {
31
+ valuePath: string;
32
+ labelPath: string;
33
+ }