@endge/core 2.0.2 → 2.0.4

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 (39) hide show
  1. package/ReadMe.md +23 -0
  2. package/dist/core.cjs +339 -315
  3. package/dist/core.js +23848 -22580
  4. package/dist/domain/entities/reflect/RConverter.d.ts +3 -3
  5. package/dist/domain/entities/reflect/RVocabs.d.ts +10 -2
  6. package/dist/domain/entities/runtime/ComponentSFCEventBoundary.d.ts +5 -3
  7. package/dist/domain/types/component/component-core.types.d.ts +2 -2
  8. package/dist/domain/types/component/sfc/ir.types.d.ts +17 -3
  9. package/dist/domain/types/component/sfc/ports.types.d.ts +40 -2
  10. package/dist/domain/types/component/sfc/tag-input-contract.types.d.ts +24 -1
  11. package/dist/domain/types/component/sfc/visual-projection.types.d.ts +11 -2
  12. package/dist/domain/types/program/program.types.d.ts +7 -1
  13. package/dist/domain/types/runtime/action.types.d.ts +27 -1
  14. package/dist/domain/types/source/query-source.types.d.ts +4 -0
  15. package/dist/domain/types/source/response-output.types.d.ts +10 -0
  16. package/dist/domain/types/source/source-engine.types.d.ts +1 -1
  17. package/dist/domain/types/source/vocab-source.types.d.ts +37 -0
  18. package/dist/domain/types/ui/context-menu.types.d.ts +1 -0
  19. package/dist/main.d.ts +5 -0
  20. package/dist/model/modules/domain/endge-vocabs.d.ts +20 -1
  21. package/dist/model/modules/program/endge-compiler.d.ts +5 -1
  22. package/dist/model/modules/program/endge-program.d.ts +3 -0
  23. package/dist/model/modules/runtime/core/endge-bind.d.ts +1 -1
  24. package/dist/model/modules/runtime/execution/endge-data-view.d.ts +2 -0
  25. package/dist/model/modules/runtime/execution/endge-response-output.d.ts +5 -0
  26. package/dist/model/services/compiler/component-sfc/component-sfc-compile.d.ts +1 -1
  27. package/dist/model/services/compiler/component-sfc/component-sfc-interactions.d.ts +1 -1
  28. package/dist/model/services/compiler/component-sfc/component-sfc-ports.d.ts +2 -2
  29. package/dist/model/services/compiler/component-sfc/component-sfc-table-menu.d.ts +6 -2
  30. package/dist/model/services/compiler/component-sfc/component-sfc-template.d.ts +5 -1
  31. package/dist/model/services/query/QueryExecutor.d.ts +2 -0
  32. package/dist/model/services/source-engine/compilers/vocab-source-compile.d.ts +2 -0
  33. package/dist/model/services/source-engine/strategies/VocabSourceEngineStrategy.d.ts +8 -0
  34. package/dist/model/services/source-engine/strategies/VocabSourceLanguageStrategy.d.ts +11 -0
  35. package/dist/model/services/source-engine/strategies/VocabSourcePatchStrategy.d.ts +9 -0
  36. package/dist/model/services/source-engine/templates/vocab.default.source.d.ts +1 -0
  37. package/dist/model/services/source-engine/vocab-source-patch.d.ts +10 -0
  38. package/dist/test/model/modules/domain/endge-vocabs-source.test.d.ts +1 -0
  39. package/package.json +4 -4
@@ -8,8 +8,8 @@ export interface RConverterSchema extends EntityManagement {
8
8
  }
9
9
  export declare class RConverter extends REntity {
10
10
  description: string | null;
11
- customHandler: ((v: any) => any) | undefined;
12
- setCustom(fn: ((v: any) => any) | undefined): void;
13
- convert(v: any): any;
11
+ customHandler: ((v: any, options?: Record<string, unknown>) => any) | undefined;
12
+ setCustom(fn: ((v: any, options?: Record<string, unknown>) => any) | undefined): void;
13
+ convert(v: any, options?: Record<string, unknown>): any;
14
14
  toPlain(): RConverterSchema;
15
15
  }
@@ -3,8 +3,9 @@ import { DiagnosticsProblemInput } from '../../types/diagnostics/diagnostics.typ
3
3
  export type RVocabMode = 'external_payload' | 'internal';
4
4
  /** Сущность словаря (коллекция vocabs). Один документ = один словарь. */
5
5
  export declare class RVocabs extends REntity {
6
- displayName: string;
7
- description?: string | null;
6
+ sourceVersion: number;
7
+ source: string;
8
+ description: string | null;
8
9
  mode: RVocabMode;
9
10
  baseApiUrl?: string | null;
10
11
  collectionSlug?: string | null;
@@ -17,3 +18,10 @@ export declare class RVocabs extends REntity {
17
18
  getDiagnosticProblems(): DiagnosticsProblemInput[];
18
19
  duplicate(options: DuplicateOptions): RVocabs;
19
20
  }
21
+ export declare function createLegacyVocabSource(input: {
22
+ mode: RVocabMode;
23
+ baseApiUrl?: string | null;
24
+ collectionSlug?: string | null;
25
+ authMode?: 'inherit' | 'profile' | 'none';
26
+ authProfileIdentity?: string | null;
27
+ }): string;
@@ -1,5 +1,5 @@
1
1
  import { ComponentSFCRuntimeHost } from './hosts/ComponentSFCRuntimeHost';
2
- import { ComponentSFCEventRuntimeSource, ComponentSFCPortManifest } from '../../types/component/sfc/ports.types';
2
+ import { ComponentSFCEventRuntimeSource, ComponentSFCRequiredPortBinding, ComponentSFCPortManifest } from '../../types/component/sfc/ports.types';
3
3
  import { RComponentSFC_IR_EventBinding } from '../../types/component/sfc/ir.types';
4
4
  /** Mount-scoped Event router for one Component SFC artifact boundary. */
5
5
  export declare class ComponentSFCEventBoundary {
@@ -10,15 +10,16 @@ export declare class ComponentSFCEventBoundary {
10
10
  private readonly parentSource?;
11
11
  private readonly parentBindings;
12
12
  private readonly parentEventTransform?;
13
+ private readonly requiredPortBindings;
13
14
  private readonly consumedLocalOnce;
14
15
  constructor(host: ComponentSFCRuntimeHost | null, componentIdentity: string, manifest: ComponentSFCPortManifest, parent?: ComponentSFCEventBoundary | null, parentSource?: ComponentSFCEventRuntimeSource | undefined, parentBindings?: readonly RComponentSFC_IR_EventBinding[], parentEventTransform?: ((event: string, payload: unknown) => {
15
16
  event: string;
16
17
  payload: unknown;
17
- } | null) | undefined);
18
+ } | null) | undefined, requiredPortBindings?: readonly ComponentSFCRequiredPortBinding[]);
18
19
  createChild(componentIdentity: string, manifest: ComponentSFCPortManifest, source: ComponentSFCEventRuntimeSource, bindings?: readonly RComponentSFC_IR_EventBinding[], transform?: (event: string, payload: unknown) => {
19
20
  event: string;
20
21
  payload: unknown;
21
- } | null): ComponentSFCEventBoundary;
22
+ } | null, requiredPortBindings?: readonly ComponentSFCRequiredPortBinding[]): ComponentSFCEventBoundary;
22
23
  /** True when the current public manifest observes one Event of this child source. */
23
24
  observesChild(source: ComponentSFCEventRuntimeSource, event: string): boolean;
24
25
  /** Claims a mount-scoped logical `.once` rule after it has matched. */
@@ -30,5 +31,6 @@ export declare class ComponentSFCEventBoundary {
30
31
  /** Emits an Event declared as own by this component. */
31
32
  emitOwn(name: string, payload: unknown, trace?: string[], depth?: number): Promise<void>;
32
33
  private dispatch;
34
+ private resolveRequiredPortAction;
33
35
  private reportError;
34
36
  }
@@ -11,13 +11,13 @@ export interface RComponentRef {
11
11
  /** Идентификатор компонента внутри выбранного хранилища. */
12
12
  id: string | number;
13
13
  /** Semantic dependency role in the compiled artifact. */
14
- role?: 'child-component' | 'port-default-component';
14
+ role?: 'child-component' | 'port-default-component' | 'port-override-component';
15
15
  }
16
16
  /** Ссылка SFC-компонента на computation provider. */
17
17
  export interface RComputationRef {
18
18
  source: 'computation';
19
19
  id: string | number;
20
- role: 'port-default-computation';
20
+ role: 'port-default-computation' | 'port-override-computation';
21
21
  }
22
22
  /** Описание одного сообщения компилятора или валидатора. */
23
23
  export interface RComponentDiagnostic {
@@ -1,6 +1,6 @@
1
1
  import { RComponentSFC_SourceRange } from './location.types';
2
2
  import { RComponentDiagnostic } from '../component-core.types';
3
- import { ComponentSFCEventAction, ComponentSFCPortForwardOrigin, ComponentSFCPortManifest, RComponentSFC_IR_ComponentPortMarker, RComponentSFC_IR_PortCall } from './ports.types';
3
+ import { ComponentSFCEventAction, ComponentSFCRequiredPortBinding, ComponentSFCPortForwardOrigin, ComponentSFCPortManifest, RComponentSFC_IR_ComponentPortMarker, RComponentSFC_IR_PortCall } from './ports.types';
4
4
  import { EndgeStyleSheetArtifact } from '../../style/style.types';
5
5
  /** Семантическая модель компонента после compiler pipeline, независимая от DOM и Nova. */
6
6
  export interface RComponentSFC_IR {
@@ -153,7 +153,7 @@ export interface ComponentSFCEditedEventPayload<T = unknown> {
153
153
  /** IR узел template после нормализации в Endge primitives. */
154
154
  export type RComponentSFC_IR_Node = RComponentSFC_IR_ElementNode | RComponentSFC_IR_TextNode | RComponentSFC_IR_ExpressionNode;
155
155
  /** Поддерживаемые v1 primitives нового SFC template. */
156
- export type RComponentSFC_IR_Tag = 'Text' | 'DateTime' | 'Number' | 'Icon' | 'Badge' | 'Dot' | 'Box' | 'Flex' | 'Grid' | 'Divider' | 'Input' | 'Textarea' | 'Checkbox' | 'Select' | 'Tooltip' | 'TooltipTrigger' | 'TooltipContent' | 'Component' | 'Table' | 'Column' | 'Cell' | 'ColumnMenu' | 'RowMenu' | 'MenuItem' | 'MenuSeparator' | 'Editable' | 'Variant';
156
+ export type RComponentSFC_IR_Tag = 'Text' | 'DateTime' | 'Number' | 'Icon' | 'Badge' | 'Dot' | 'Box' | 'Flex' | 'Grid' | 'Divider' | 'Input' | 'Textarea' | 'Checkbox' | 'Select' | 'Tooltip' | 'TooltipTrigger' | 'TooltipContent' | 'Component' | 'Table' | 'Column' | 'Cell' | 'ColumnMenu' | 'CellMenu' | 'RowMenu' | 'MenuItem' | 'MenuSeparator' | 'Editable' | 'Variant';
157
157
  /** IR element-узел, который renderer-слои могут читать без знания исходного синтаксиса. */
158
158
  export interface RComponentSFC_IR_ElementNode {
159
159
  /** Стабильный id узла внутри IR. */
@@ -178,17 +178,23 @@ export interface RComponentSFC_IR_ElementNode {
178
178
  children: RComponentSFC_IR_Node[];
179
179
  /** Local component port marker retained for future provider overrides. */
180
180
  port?: RComponentSFC_IR_ComponentPortMarker;
181
+ /** Static per-instance bindings for required ports of this child component. */
182
+ portBindings?: ComponentSFCRequiredPortBinding[];
181
183
  /** Compiler-resolved Table menus, including forwarded Action identities and targets. */
182
184
  tableMenus?: RComponentSFC_IR_TableMenus;
185
+ /** Compiler-resolved CellMenu override for one Column. */
186
+ cellMenu?: ComponentSFCTableCellMenuDescriptor;
183
187
  /** Позиция исходного AST-узла. */
184
188
  sourceRange?: RComponentSFC_SourceRange;
185
189
  }
186
190
  export interface RComponentSFC_IR_TableMenus {
187
191
  column: ComponentSFCTableColumnMenuDescriptor;
188
- row: ComponentSFCTableRowMenuDescriptor;
192
+ /** Default data-cell menu. `row` is retained as the compatibility field name. */
193
+ row: ComponentSFCTableCellMenuDescriptor;
189
194
  }
190
195
  export type ComponentSFCTableColumnMenuMode = 'default' | 'disabled' | 'inline';
191
196
  export type ComponentSFCTableRowMenuMode = 'none' | 'inline';
197
+ export type ComponentSFCTableCellMenuMode = 'none' | 'inline';
192
198
  /** Renderer-neutral menu retained in compiled SFC form until a concrete row/column context exists. */
193
199
  export interface ComponentSFCTableMenuDescriptor {
194
200
  kind: 'sfc-table-menu';
@@ -199,7 +205,13 @@ export interface ComponentSFCTableMenuItemDescriptor {
199
205
  kind: 'item';
200
206
  id: string;
201
207
  label: RComponentSFC_IR_Value;
208
+ /** `v-if` expression evaluated against the concrete table/cell context. */
209
+ visible?: RComponentSFC_IR_Value;
210
+ /** Static or dynamic disabled state evaluated against the same context as the Action. */
211
+ disabled?: RComponentSFC_IR_Value;
202
212
  action: string;
213
+ /** Required Action port whose mounted provider may replace `action`. */
214
+ requiredPort?: string;
203
215
  input?: RComponentSFC_IR_Value;
204
216
  icon?: string;
205
217
  /** Set only for a provided alias forwarded from this exact Table node. */
@@ -219,6 +231,8 @@ export interface ComponentSFCTableRowMenuDescriptor {
219
231
  menu: ComponentSFCTableMenuDescriptor | null;
220
232
  diagnostics: RComponentDiagnostic[];
221
233
  }
234
+ /** Canonical cell menu descriptor. RowMenu uses the same shape as a legacy alias. */
235
+ export type ComponentSFCTableCellMenuDescriptor = ComponentSFCTableRowMenuDescriptor;
222
236
  export type RComponentSFC_IR_EventModifier = 'stop' | 'prevent' | 'self' | 'once' | 'capture' | 'passive';
223
237
  export interface RComponentSFC_IR_EventBinding {
224
238
  name: string;
@@ -2,7 +2,8 @@ import { RComponentContractInput } from '../component-core.types';
2
2
  import { RComponentSFC_IR_Value } from './ir.types';
3
3
  import { RComponentSFC_SourceRange } from './location.types';
4
4
  export type ComponentSFCPortRole = 'require' | 'provides' | 'emits';
5
- export type ComponentSFCPortKind = 'computation' | 'component' | 'action' | 'event';
5
+ export type ComponentSFCPortKind = 'computation' | 'component' | 'action' | 'query' | 'event';
6
+ export type ComponentSFCRequiredPortKind = Exclude<ComponentSFCPortKind, 'event'>;
6
7
  /** Public child port selected by a compile-time `definePorts.forward` rule. */
7
8
  export interface ComponentSFCPortForwardOrigin {
8
9
  nodeId: string;
@@ -59,6 +60,12 @@ export type ComponentSFCPortProviderDescriptor = {
59
60
  isArray?: boolean;
60
61
  optional?: boolean;
61
62
  } | null;
63
+ } | {
64
+ kind: 'query';
65
+ identity: string;
66
+ active: boolean;
67
+ inputs: RComponentContractInput[];
68
+ outputs: RComponentContractInput[];
62
69
  };
63
70
  /** Computation port declared by `computation<Input, Output>`. */
64
71
  export interface ComponentSFCComputationPort {
@@ -92,6 +99,25 @@ export interface ComponentSFCActionPort {
92
99
  forwardedFrom?: ComponentSFCPortForwardOrigin;
93
100
  sourceRange?: RComponentSFC_SourceRange;
94
101
  }
102
+ /** Callable Query required by a component. */
103
+ export interface ComponentSFCQueryPort {
104
+ kind: 'query';
105
+ name: string;
106
+ defaultIdentity: string;
107
+ inputType: string;
108
+ outputType: string;
109
+ inputs: RComponentContractInput[];
110
+ outputs: RComponentContractInput[];
111
+ forwardedFrom?: ComponentSFCPortForwardOrigin;
112
+ sourceRange?: RComponentSFC_SourceRange;
113
+ }
114
+ /** One static provider override attached to a mounted child Component SFC call. */
115
+ export interface ComponentSFCRequiredPortBinding {
116
+ port: string;
117
+ kind: ComponentSFCRequiredPortKind;
118
+ identity: string;
119
+ sourceRange?: RComponentSFC_SourceRange;
120
+ }
95
121
  /** Multicast notification emitted by this component. */
96
122
  export interface ComponentSFCEventPort {
97
123
  kind: 'event';
@@ -124,6 +150,10 @@ export type ComponentSFCEventInputValue = {
124
150
  } | {
125
151
  kind: 'literal';
126
152
  value: unknown;
153
+ } | {
154
+ kind: 'coalesce';
155
+ left: ComponentSFCEventInputValue;
156
+ right: ComponentSFCEventInputValue;
127
157
  } | {
128
158
  kind: 'array';
129
159
  items: ComponentSFCEventInputValue[];
@@ -165,7 +195,14 @@ export interface ComponentSFCEventEmitAction {
165
195
  event: string;
166
196
  payload?: ComponentSFCEventInputValue;
167
197
  }
168
- export type ComponentSFCEventAction = ComponentSFCEventDirectAction | ComponentSFCEventDirectQuery | ComponentSFCEventTypescriptAction | ComponentSFCEventEmitAction;
198
+ /** Calls one required executable port through its effective per-instance provider. */
199
+ export interface ComponentSFCEventRequiredPortAction {
200
+ kind: 'required-port';
201
+ portKind: 'action' | 'query';
202
+ port: string;
203
+ input?: ComponentSFCEventInputValue;
204
+ }
205
+ export type ComponentSFCEventAction = ComponentSFCEventDirectAction | ComponentSFCEventDirectQuery | ComponentSFCEventTypescriptAction | ComponentSFCEventEmitAction | ComponentSFCEventRequiredPortAction;
169
206
  export interface ComponentSFCEventRuntimeSource {
170
207
  nodeId: string;
171
208
  ref?: string;
@@ -187,6 +224,7 @@ export interface ComponentSFCRequiredPorts {
187
224
  computations: ComponentSFCComputationPort[];
188
225
  components: ComponentSFCComponentPort[];
189
226
  actions: ComponentSFCActionPort[];
227
+ queries: ComponentSFCQueryPort[];
190
228
  }
191
229
  export interface ComponentSFCProvidedPorts {
192
230
  actions: ComponentSFCActionPort[];
@@ -1,7 +1,10 @@
1
1
  import { RComponentContractInput } from '../component-core.types';
2
2
  import { RComponentSFC_IR_Tag } from './ir.types';
3
3
  /** Публичный входной параметр renderer-neutral встроенного SFC tag. */
4
- export type ComponentSFCTagInputContract = Readonly<RComponentContractInput>;
4
+ export type ComponentSFCTagInputContract = Readonly<RComponentContractInput> & {
5
+ /** Допустимые SFC spelling aliases для одного renderer-facing параметра. */
6
+ aliases?: readonly string[];
7
+ };
5
8
  /**
6
9
  * Data-facing входы встроенных tags для source-aware visual editors.
7
10
  * Presentation-атрибуты остаются в отдельном редакторе атрибутов.
@@ -11,6 +14,11 @@ export declare const ENDGE_SFC_TAG_INPUT_CONTRACTS: {
11
14
  readonly name: "value";
12
15
  readonly type: "string";
13
16
  readonly optional: true;
17
+ }, {
18
+ readonly name: "editorVariant";
19
+ readonly aliases: readonly ["editor-variant"];
20
+ readonly type: "'default' | 'compact'";
21
+ readonly optional: true;
14
22
  }];
15
23
  readonly DateTime: readonly [{
16
24
  readonly name: "value";
@@ -24,6 +32,16 @@ export declare const ENDGE_SFC_TAG_INPUT_CONTRACTS: {
24
32
  readonly name: "timezone";
25
33
  readonly type: "string";
26
34
  readonly optional: true;
35
+ }, {
36
+ readonly name: "editMode";
37
+ readonly aliases: readonly ["edit-mode"];
38
+ readonly type: "'datetime' | 'time'";
39
+ readonly optional: true;
40
+ }, {
41
+ readonly name: "editorVariant";
42
+ readonly aliases: readonly ["editor-variant"];
43
+ readonly type: "'default' | 'compact'";
44
+ readonly optional: true;
27
45
  }, {
28
46
  readonly name: "empty";
29
47
  readonly type: "string";
@@ -33,6 +51,11 @@ export declare const ENDGE_SFC_TAG_INPUT_CONTRACTS: {
33
51
  readonly name: "value";
34
52
  readonly type: "number";
35
53
  readonly optional: false;
54
+ }, {
55
+ readonly name: "editorVariant";
56
+ readonly aliases: readonly ["editor-variant"];
57
+ readonly type: "'default' | 'compact'";
58
+ readonly optional: true;
36
59
  }, {
37
60
  readonly name: "decimals";
38
61
  readonly type: "number";
@@ -100,7 +100,7 @@ export interface ComponentSFCTableCellEditingProjection {
100
100
  message?: string;
101
101
  }
102
102
  /** Способ, которым содержимое ячейки представлено в простом visual editor. */
103
- export type ComponentSFCTableVisualCellTag = Exclude<RComponentSFC_IR_Tag, 'Component' | 'Table' | 'Column' | 'Cell' | 'ColumnMenu' | 'RowMenu' | 'MenuItem' | 'MenuSeparator' | 'Editable' | 'Variant'>;
103
+ export type ComponentSFCTableVisualCellTag = Exclude<RComponentSFC_IR_Tag, 'Component' | 'Table' | 'Column' | 'Cell' | 'ColumnMenu' | 'CellMenu' | 'RowMenu' | 'MenuItem' | 'MenuSeparator' | 'Editable' | 'Variant'>;
104
104
  export type ComponentSFCTableCellProjection = {
105
105
  kind: 'default';
106
106
  } | {
@@ -140,6 +140,8 @@ export interface ComponentSFCTableColumnProjection {
140
140
  cell: ComponentSFCTableCellProjection;
141
141
  editing: ComponentSFCTableCellEditingProjection;
142
142
  interactions: ComponentSFCTableCellInteractionsProjection;
143
+ /** Column-level CellMenu override; default mode inherits Table > CellMenu. */
144
+ cellMenu: ComponentSFCTableMenuProjection;
143
145
  hasCustomCell: boolean;
144
146
  cellSource: string | null;
145
147
  sourceRange: RComponentSFC_SourceRange;
@@ -161,6 +163,8 @@ export type ComponentSFCTableMenuNodeProjection = {
161
163
  action: ComponentSFCVisualSourceValue | null;
162
164
  input: ComponentSFCVisualSourceValue | null;
163
165
  icon: ComponentSFCVisualSourceValue | null;
166
+ visible: ComponentSFCVisualSourceValue | null;
167
+ disabled: ComponentSFCVisualSourceValue | null;
164
168
  sourceOwned: boolean;
165
169
  sourceRange: RComponentSFC_SourceRange;
166
170
  };
@@ -254,25 +258,30 @@ export type ComponentSFCTableSourcePatch = {
254
258
  } | {
255
259
  type: 'set-menu-mode';
256
260
  menu: ComponentSFCTableVisualMenuKind;
261
+ columnIndex?: number;
257
262
  mode: 'default' | 'disabled' | 'none' | 'custom';
258
263
  } | {
259
264
  type: 'add-menu-node';
260
265
  menu: ComponentSFCTableVisualMenuKind;
266
+ columnIndex?: number;
261
267
  node: 'item' | 'separator';
262
268
  } | {
263
269
  type: 'remove-menu-node';
264
270
  menu: ComponentSFCTableVisualMenuKind;
271
+ columnIndex?: number;
265
272
  nodeIndex: number;
266
273
  } | {
267
274
  type: 'move-menu-node';
268
275
  menu: ComponentSFCTableVisualMenuKind;
276
+ columnIndex?: number;
269
277
  fromIndex: number;
270
278
  toIndex: number;
271
279
  } | {
272
280
  type: 'set-menu-item-attribute';
273
281
  menu: ComponentSFCTableVisualMenuKind;
282
+ columnIndex?: number;
274
283
  nodeIndex: number;
275
- name: 'label' | 'action' | 'input' | 'icon';
284
+ name: 'label' | 'action' | 'input' | 'icon' | 'visible' | 'disabled';
276
285
  value: string | null;
277
286
  valueKind: 'expression' | 'literal';
278
287
  };
@@ -6,6 +6,8 @@ import { RComponentSFC_IR } from '../component/sfc/ir.types';
6
6
  import { RComponentSFC_RuntimeDependencies } from '../component/sfc/dependencies.types';
7
7
  import { RComponentSFCSource_Parts } from '../component/sfc/source.types';
8
8
  import { QueryProgramProp, SourceExpressionIR, SourceFieldDefinition } from '../source/source-expression.types';
9
+ import { ResponseOutputTransform } from '../source/response-output.types';
10
+ import { VocabProgramPayload } from '../source/vocab-source.types';
9
11
  import { ProgramMetadata } from './program-metadata.types';
10
12
  import { ComputationProgramPayload } from '../computation/computation-program.types';
11
13
  import { EndgeStyleSheetArtifact } from '../style/style.types';
@@ -13,7 +15,7 @@ import { ActionImplementation, ActionTargetSelector } from '../runtime/action.ty
13
15
  export type { ConfigurationProgramPayload } from '../source/configuration-source.types';
14
16
  export type ProgramArtifactKey = string;
15
17
  /** Тип доменной сущности, для которой compiler может построить program artifact. */
16
- export type ProgramEntityType = 'type' | 'component-sfc' | 'computation' | 'action' | 'query' | 'data-view' | 'store' | 'stream' | 'update' | 'filter' | 'composition' | 'style' | 'configuration';
18
+ export type ProgramEntityType = 'type' | 'component-sfc' | 'computation' | 'action' | 'query' | 'vocab' | 'data-view' | 'store' | 'stream' | 'update' | 'filter' | 'composition' | 'style' | 'configuration';
17
19
  /** Итоговый статус artifact после компиляции и валидации. */
18
20
  export type ProgramArtifactStatus = 'valid' | 'warning' | 'error';
19
21
  /** Возможность, которую artifact предоставляет runtime/render слоям. */
@@ -110,6 +112,9 @@ export type QueryProgramOutputSource = {
110
112
  export interface QueryProgramOutput {
111
113
  key: string;
112
114
  source: QueryProgramOutputSource;
115
+ /** Ordered transform chain used by new runtimes. */
116
+ transforms?: ResponseOutputTransform[];
117
+ /** Compatibility projection for runtimes compiled before ordered transforms. */
113
118
  dataViews: DataViewRef[];
114
119
  contract?: SourceFieldDefinition | null;
115
120
  materialization: {
@@ -162,6 +167,7 @@ export interface QueryProgramPayload {
162
167
  /** Ordered output graph, который runtime вычисляет после backend response. */
163
168
  outputs: QueryProgramOutput[];
164
169
  }
170
+ export type { VocabProgramPayload };
165
171
  /** Payload artifact для DataView: executable read-model без persisted runtime state. */
166
172
  export interface DataViewProgramPayload {
167
173
  /** Тип artifact для diagnostics/debug UI. */
@@ -146,9 +146,33 @@ export interface TableColumnActionContext extends RuntimeActionContext {
146
146
  sortState: TableColumnSortState;
147
147
  activeSortCount: number;
148
148
  }
149
- /** Renderer-neutral row/cell context shared by every Table menu adapter. */
149
+ export interface TableActionTableContext {
150
+ id: string;
151
+ runtimeId: string;
152
+ state: Readonly<Record<string, unknown>>;
153
+ }
154
+ export interface TableActionRowContext {
155
+ id: string;
156
+ index: number;
157
+ data: Record<string, unknown>;
158
+ }
159
+ export interface TableActionColumnContext {
160
+ key: string;
161
+ index: number;
162
+ title: string;
163
+ metadata: Readonly<Record<string, unknown>>;
164
+ }
165
+ export interface TableActionCellContext {
166
+ value: unknown;
167
+ }
168
+ /** Renderer-neutral cell context shared by every Table menu adapter. */
150
169
  export interface TableRowActionContext extends RuntimeActionContext {
170
+ /** Compatibility surface value retained for existing Action providers. */
151
171
  surface: 'table-row';
172
+ table: TableActionTableContext;
173
+ rowContext: TableActionRowContext;
174
+ column: TableActionColumnContext;
175
+ cell: TableActionCellContext;
152
176
  tableRuntimeId: string;
153
177
  tableId: string;
154
178
  target: TableRuntimeActionTarget;
@@ -158,3 +182,5 @@ export interface TableRowActionContext extends RuntimeActionContext {
158
182
  columnKey: string;
159
183
  value: unknown;
160
184
  }
185
+ /** Canonical name for new consumers; TableRowActionContext remains source-compatible. */
186
+ export type TableCellActionContext = TableRowActionContext;
@@ -3,6 +3,7 @@ import { ProgramDiagnostic, QueryProgramPayload } from '../program/program.types
3
3
  import { DataViewRef } from './data-view-source.types';
4
4
  import { ProgramMetadataMap } from '../program/program-metadata.types';
5
5
  import { QueryProgramProp, SourceExpressionIR, SourceFieldDefinition } from './source-expression.types';
6
+ import { ResponseOutputTransform } from './response-output.types';
6
7
  /** Поддерживаемые transport-kind Query source. */
7
8
  export type QuerySourceKind = 'rest' | 'graphql';
8
9
  /** Политика GraphQL errors в HTTP 2xx response. */
@@ -65,6 +66,9 @@ export type QueryOutputSource = {
65
66
  export interface QuerySourceOutput {
66
67
  key: string;
67
68
  source: QueryOutputSource;
69
+ /** Ordered transform chain. */
70
+ transforms: ResponseOutputTransform[];
71
+ /** Compatibility projection containing only DataView transforms. */
68
72
  dataViews: DataViewRef[];
69
73
  contract?: SourceFieldDefinition | null;
70
74
  }
@@ -0,0 +1,10 @@
1
+ import { DataViewRef } from './data-view-source.types';
2
+ /** Ordered response-output transform shared by Query and Vocab. */
3
+ export type ResponseOutputTransform = {
4
+ kind: 'data-view';
5
+ ref: DataViewRef;
6
+ } | {
7
+ kind: 'converter';
8
+ identity: string;
9
+ options?: Record<string, unknown>;
10
+ };
@@ -1,7 +1,7 @@
1
1
  import { I18nCatalogProvenance, I18nRuntimeCatalog } from '../i18n.types';
2
2
  import { TypeSourceDefinition } from './type-source.types';
3
3
  /** Канонический тип source-документа, для которого выбирается source strategy. */
4
- export type SourceKind = 'query' | 'data-view' | 'filter' | 'composition' | 'store' | 'stream' | 'update' | 'computation' | 'style' | 'type' | 'configuration';
4
+ export type SourceKind = 'query' | 'vocab' | 'data-view' | 'filter' | 'composition' | 'store' | 'stream' | '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-документа. */
@@ -0,0 +1,37 @@
1
+ import { RQueryAuth } from '../document/query.types';
2
+ import { ProgramDiagnostic, QueryProgramOutput } from '../program/program.types';
3
+ import { ProgramMetadataMap } from '../program/program-metadata.types';
4
+ export type VocabProviderBaseUrl = string | {
5
+ kind: 'env';
6
+ name: string;
7
+ };
8
+ export interface VocabPayloadProvider {
9
+ kind: 'payload';
10
+ baseUrl: VocabProviderBaseUrl;
11
+ collection: string;
12
+ auth: RQueryAuth;
13
+ }
14
+ export interface VocabMockReference {
15
+ identity: string;
16
+ path: string | null;
17
+ }
18
+ export interface VocabSourceDocument {
19
+ sourceVersion: 1;
20
+ provider: VocabPayloadProvider | null;
21
+ mock: VocabMockReference | null;
22
+ outputs: QueryProgramOutput[];
23
+ }
24
+ export interface VocabProgramPayload extends VocabSourceDocument {
25
+ ast?: unknown;
26
+ sourceDocument?: VocabSourceDocument | null;
27
+ }
28
+ export interface VocabSourceCompileResult {
29
+ ast: unknown;
30
+ document: VocabSourceDocument | null;
31
+ artifact: VocabProgramPayload | null;
32
+ metadata: ProgramMetadataMap;
33
+ diagnostics: Array<Omit<ProgramDiagnostic, 'entityRef'>>;
34
+ }
35
+ export interface VocabSourcePatch {
36
+ mock: VocabMockReference | null;
37
+ }
@@ -12,6 +12,7 @@ export interface ContextMenuItemDescriptor {
12
12
  action: RuntimeActionId;
13
13
  input?: unknown;
14
14
  icon?: string;
15
+ disabled?: boolean;
15
16
  }
16
17
  export interface ContextMenuSeparatorDescriptor {
17
18
  kind: 'separator';
package/dist/main.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './model/modules/mock/EndgeMock';
11
11
  export * from './model/modules/runtime/execution/endge-composition';
12
12
  export * from './model/modules/runtime/execution/endge-project';
13
13
  export * from './model/modules/runtime/execution/endge-data-view';
14
+ export * from './model/modules/runtime/execution/endge-response-output';
14
15
  export * from './model/modules/runtime/execution/endge-query';
15
16
  export * from './model/modules/runtime/execution/endge-computation';
16
17
  export * from './model/modules/runtime/core/endge-runtime';
@@ -103,6 +104,8 @@ export * from './domain/types/source/composition-source.types';
103
104
  export * from './domain/types/source/data-view-source.types';
104
105
  export * from './domain/types/source/filter-source.types';
105
106
  export * from './domain/types/source/query-source.types';
107
+ export * from './domain/types/source/response-output.types';
108
+ export * from './domain/types/source/vocab-source.types';
106
109
  export * from './domain/types/source/source-engine.types';
107
110
  export * from './domain/types/source/source-expression.types';
108
111
  export * from './domain/types/source/store-source.types';
@@ -226,6 +229,8 @@ export * from './model/services/style/endgecss-compile';
226
229
  export * from './model/services/style/endgecss-match';
227
230
  export * from './model/services/source-engine/source-expression-evaluate';
228
231
  export * from './model/services/source-engine/filter-source-patch';
232
+ export * from './model/services/source-engine/vocab-source-patch';
233
+ export * from './model/services/source-engine/compilers/vocab-source-compile';
229
234
  export * from './model/services/source-engine/type-source-serialize';
230
235
  export * from './model/services/source-engine/configuration-source-patch';
231
236
  export * from './model/services/source-engine/typescript-type-source';
@@ -1,5 +1,8 @@
1
1
  import { EndgeModule } from '../../../domain/entities/endge/EndgeModule';
2
2
  import { VocabCacheOperationResult, VocabLoadPolicy, VocabReference } from '../../../domain/types/runtime/vocab-cache.types';
3
+ export interface VocabAcquireOptions {
4
+ dataMode?: 'live' | 'mock';
5
+ }
3
6
  /**
4
7
  * Модуль загрузки и чтения external vocabs в Raph cache.
5
8
  */
@@ -12,6 +15,7 @@ export declare class EndgeVocabs extends EndgeModule {
12
15
  private byIdCache;
13
16
  private readonly loadedIdentities;
14
17
  private readonly loadedAtByIdentity;
18
+ private readonly loadedModeByIdentity;
15
19
  private readonly inFlight;
16
20
  private readonly cacheVersions;
17
21
  private _loadingRequests;
@@ -65,7 +69,7 @@ export declare class EndgeVocabs extends EndgeModule {
65
69
  /**
66
70
  * Загружает отсутствующие справочники параллельно и переиспользует cache.
67
71
  */
68
- acquire(vocabs: readonly VocabReference[], policy?: Partial<VocabLoadPolicy>): Promise<VocabCacheOperationResult[]>;
72
+ acquire(vocabs: readonly VocabReference[], policy?: Partial<VocabLoadPolicy>, options?: VocabAcquireOptions): Promise<VocabCacheOperationResult[]>;
69
73
  /**
70
74
  * Принудительно обновляет справочники параллельно, сохраняя дедупликацию одновременных запросов.
71
75
  */
@@ -87,7 +91,17 @@ export declare class EndgeVocabs extends EndgeModule {
87
91
  */
88
92
  loadVocab(idOrIdentity: string | number, options?: {
89
93
  throwOnError?: boolean;
94
+ dataMode?: 'live' | 'mock';
90
95
  }): Promise<any[]>;
96
+ /** Загружает raw Payload без output pipeline; используется authoring preview и Mock generator. */
97
+ loadRawVocab(idOrIdentity: string | number, options?: {
98
+ limit?: number;
99
+ throwOnError?: boolean;
100
+ }): Promise<unknown>;
101
+ /** Применяет pipeline source-outputs и проверяет обязательный массив items. */
102
+ private applyOutputs;
103
+ /** Читает explicit Mock JSON; отсутствие ссылки штатно означает пустой Vocab. */
104
+ private resolveMockValue;
91
105
  /**
92
106
  * Нормализует Vocab Id.
93
107
  */
@@ -103,6 +117,10 @@ export declare class EndgeVocabs extends EndgeModule {
103
117
  * Устанавливает By Identity Cache.
104
118
  */
105
119
  private setByIdentityCache;
120
+ /** Пишет canonical identity cache и переходный alias provider.collection. */
121
+ private setCache;
122
+ /** Читает canonical identity cache с переходным fallback на collection alias. */
123
+ private getCache;
106
124
  /**
107
125
  * Разрешает Vocab Config By Id.
108
126
  */
@@ -111,6 +129,7 @@ export declare class EndgeVocabs extends EndgeModule {
111
129
  * Разрешает Vocab Config By Id Or Identity.
112
130
  */
113
131
  private resolveVocabConfigByIdOrIdentity;
132
+ private createRuntimeConfig;
114
133
  /** Находит runtime config справочника по identity или collection slug. */
115
134
  private resolveVocabConfigByIdentityOrSlug;
116
135
  /** Собирает auth headers для обращения к внешнему справочнику. */
@@ -6,12 +6,14 @@ import { StreamSourceArtifact } from '../../../domain/types/source/stream-source
6
6
  import { UpdateSourceArtifact } from '../../../domain/types/source/update-source.types';
7
7
  import { TypeProgramPayload } from '../../../domain/types/source/type-source.types';
8
8
  import { ComponentSFCProgramPayload, ActionProgramPayload, ComputationProgramPayload, DataViewProgramPayload, ProgramArtifact, QueryProgramPayload, EndgeStyleProgramPayload } from '../../../domain/types/program/program.types';
9
+ import { VocabProgramPayload } from '../../../domain/types/source/vocab-source.types';
9
10
  import { EndgeModule } from '../../../domain/entities/endge/EndgeModule';
10
11
  import { RComponentSFC } from '../../../domain/entities/reflect/RComponentSFC';
11
12
  import { RAction } from '../../../domain/entities/reflect/RAction';
12
13
  import { RComputation } from '../../../domain/entities/reflect/RComputation';
13
14
  import { RDataView } from '../../../domain/entities/reflect/RDataView';
14
15
  import { RQuery } from '../../../domain/entities/reflect/RQuery';
16
+ import { RVocabs } from '../../../domain/entities/reflect/RVocabs';
15
17
  import { RFilter } from '../../../domain/entities/reflect/RFilter';
16
18
  import { RComposition } from '../../../domain/entities/reflect/RComposition';
17
19
  import { RStore } from '../../../domain/entities/reflect/RStore';
@@ -46,6 +48,8 @@ export declare class EndgeCompiler extends EndgeModule {
46
48
  build(_ctx: EndgeBootContext): void;
47
49
  /** Компилирует один query source в Endge.program без запуска остальных compiler-фаз. */
48
50
  buildQuery(entity: RQuery): ProgramArtifact<QueryProgramPayload>;
51
+ /** Компилирует один Vocab source в Endge.program. */
52
+ buildVocab(entity: RVocabs): ProgramArtifact<VocabProgramPayload>;
49
53
  /** Компилирует одну Computation в безопасный runtime artifact. */
50
54
  buildComputation(entity: RComputation): ProgramArtifact<ComputationProgramPayload>;
51
55
  /** Compiles one Type Source into the shared Type Registry. */
@@ -153,7 +157,7 @@ export declare class EndgeCompiler extends EndgeModule {
153
157
  */
154
158
  private _makeArtifact;
155
159
  /** Материализует локальные DataView внутри query output graph в child artifacts. */
156
- private _materializeQueryLocalDataViews;
160
+ private _materializeResponseOutputDataViews;
157
161
  /** Сворачивает цепочку DataView: byKey допустим только при одинаковом доказанном ключе. */
158
162
  private _resolveDataViewChainStrategy;
159
163
  /** Рекурсивно ищет локальный DataView artifact среди дочерних artifacts. */