@endge/core 2.0.3 → 3.0.1

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 (75) hide show
  1. package/ReadMe.md +23 -0
  2. package/dist/core.cjs +381 -333
  3. package/dist/core.js +35196 -34321
  4. package/dist/domain/entities/reflect/RAction.d.ts +11 -29
  5. package/dist/domain/entities/reflect/RConverter.d.ts +3 -3
  6. package/dist/domain/entities/reflect/RVocabs.d.ts +10 -2
  7. package/dist/domain/entities/runtime/hosts/ActionRuntimeHost.d.ts +1 -1
  8. package/dist/domain/entities/runtime/hosts/CompositionRuntimeHost.d.ts +2 -0
  9. package/dist/domain/types/component/sfc/ir.types.d.ts +12 -2
  10. package/dist/domain/types/component/sfc/ports.types.d.ts +4 -0
  11. package/dist/domain/types/component/sfc/table-events.types.d.ts +13 -0
  12. package/dist/domain/types/component/sfc/tag-attribute-contract.types.d.ts +7 -0
  13. package/dist/domain/types/component/sfc/visual-projection.types.d.ts +13 -3
  14. package/dist/domain/types/program/action-program.types.d.ts +8 -0
  15. package/dist/domain/types/program/program.types.d.ts +12 -22
  16. package/dist/domain/types/runtime/action.types.d.ts +33 -4
  17. package/dist/domain/types/runtime/context-persistence.types.d.ts +4 -0
  18. package/dist/domain/types/runtime/runtime-host.types.d.ts +2 -11
  19. package/dist/domain/types/source/action-source.types.d.ts +40 -0
  20. package/dist/domain/types/source/composition-source.types.d.ts +24 -3
  21. package/dist/domain/types/source/query-source.types.d.ts +4 -0
  22. package/dist/domain/types/source/response-output.types.d.ts +10 -0
  23. package/dist/domain/types/source/source-engine.types.d.ts +23 -2
  24. package/dist/domain/types/source/source-expression.types.d.ts +9 -0
  25. package/dist/domain/types/source/vocab-source.types.d.ts +37 -0
  26. package/dist/domain/types/ui/context-menu.types.d.ts +1 -0
  27. package/dist/main.d.ts +10 -7
  28. package/dist/model/kernel/endge.d.ts +4 -15
  29. package/dist/model/modules/context/endge-context.d.ts +3 -1
  30. package/dist/model/modules/domain/endge-vocabs.d.ts +20 -1
  31. package/dist/model/modules/program/endge-compiler.d.ts +7 -1
  32. package/dist/model/modules/program/endge-program.d.ts +6 -6
  33. package/dist/model/modules/program/endge-source.d.ts +2 -1
  34. package/dist/model/modules/runtime/core/endge-actions.d.ts +16 -12
  35. package/dist/model/modules/runtime/core/endge-runtime.d.ts +5 -5
  36. package/dist/model/modules/runtime/execution/action/action-program-executor.d.ts +13 -0
  37. package/dist/model/modules/runtime/execution/computation/EndgeComputation.d.ts +36 -1
  38. package/dist/model/modules/runtime/execution/endge-converters.d.ts +36 -0
  39. package/dist/model/modules/runtime/execution/endge-data-view.d.ts +2 -0
  40. package/dist/model/modules/runtime/execution/endge-response-output.d.ts +5 -0
  41. package/dist/model/modules/runtime/implementation/endge-implementations.d.ts +3 -0
  42. package/dist/model/modules/runtime/operation/endge-operations.d.ts +18 -0
  43. package/dist/model/modules/runtime/operation/operation-history.d.ts +54 -0
  44. package/dist/model/services/compiler/action/action-compile.d.ts +3 -2
  45. package/dist/model/services/compiler/component-sfc/component-sfc-ports.d.ts +2 -0
  46. package/dist/model/services/compiler/component-sfc/component-sfc-table-menu.d.ts +6 -2
  47. package/dist/model/services/compiler/computation/computation-compile.d.ts +3 -0
  48. package/dist/model/services/source-engine/compilers/action-source-compile.d.ts +17 -0
  49. package/dist/model/services/source-engine/compilers/vocab-source-compile.d.ts +2 -0
  50. package/dist/model/services/source-engine/strategies/ActionSourceEngineStrategy.d.ts +7 -0
  51. package/dist/model/services/source-engine/strategies/ActionSourceLanguageStrategy.d.ts +23 -0
  52. package/dist/model/services/source-engine/strategies/VocabSourceEngineStrategy.d.ts +8 -0
  53. package/dist/model/services/source-engine/strategies/VocabSourceLanguageStrategy.d.ts +11 -0
  54. package/dist/model/services/source-engine/strategies/VocabSourcePatchStrategy.d.ts +9 -0
  55. package/dist/model/services/source-engine/templates/action.default.source.d.ts +1 -0
  56. package/dist/model/services/source-engine/templates/vocab.default.source.d.ts +1 -0
  57. package/dist/model/services/source-engine/vocab-source-patch.d.ts +10 -0
  58. package/dist/test/fixtures/action-source.d.ts +1 -0
  59. package/dist/test/model/modules/context/endge-context-theme-default.test.d.ts +1 -0
  60. package/dist/test/model/modules/domain/endge-vocabs-source.test.d.ts +1 -0
  61. package/dist/test/model/modules/runtime/action-runtime.test.d.ts +1 -0
  62. package/dist/test/model/modules/runtime/executable-implementations.test.d.ts +1 -0
  63. package/dist/test/model/modules/runtime/operation-history.test.d.ts +1 -0
  64. package/dist/test/model/services/compiler/component-sfc/component-sfc-action-reactions.test.d.ts +1 -0
  65. package/dist/test/model/services/source-engine/action-source-compile.test.d.ts +1 -0
  66. package/package.json +4 -4
  67. package/dist/domain/entities/action-flow/REndgeFlow.d.ts +0 -27
  68. package/dist/domain/types/flow/action.types.d.ts +0 -65
  69. package/dist/domain/types/flow/endge-flow-runtime.types.d.ts +0 -28
  70. package/dist/domain/types/flow/endge-flow.types.d.ts +0 -110
  71. package/dist/domain/types/flow/flow-condition.types.d.ts +0 -39
  72. package/dist/model/modules/runtime/core/endge-bind.d.ts +0 -39
  73. package/dist/model/modules/runtime/flow/endge-flow-registry.d.ts +0 -34
  74. package/dist/model/modules/runtime/flow/endge-flow.d.ts +0 -94
  75. /package/dist/test/{action-implementations.test.d.ts → domain/entities/runtime/composition-operation-history.integration.test.d.ts} +0 -0
@@ -1,39 +1,21 @@
1
- import { ActionCompiledFlow, ActionDefinition, ActionStepHandler, FlowValidationIssue } from '../../types/flow/action.types';
2
1
  import { EntityRef } from '../../types/document/entity-management.type';
3
2
  import { ActionImplementation, ActionTargetSelector } from '../../types/runtime/action.types';
4
3
  import { DuplicateOptions, REntity } from './REntity';
5
- import { RField } from './RField';
6
- /**
7
- * Действие хранится как flow-описание.
8
- * Атомарное действие = flow из одного шага.
9
- */
4
+ /** Canonical source-backed Action definition. Executable code is supplied by a provider. */
10
5
  export declare class RAction extends REntity {
11
- definition: ActionDefinition;
12
- input: RField | null;
13
- output: RField | null;
14
- /** Optional alternatives for the one runtime target accepted by this Action. */
6
+ displayName: string;
7
+ description: string | null;
8
+ source: string;
9
+ sourceVersion: number;
15
10
  target: ActionTargetSelector[] | null;
16
- /** Default route used when runtime has no explicit override binding. */
11
+ contract: {
12
+ input: unknown | null;
13
+ output: unknown | null;
14
+ };
17
15
  defaultImplementation: ActionImplementation;
18
- /** Definition that owns a derived/component-provided Action. */
19
16
  owner?: EntityRef;
20
- private readonly stepHandlers;
21
- setStepHandler(runtimeId: string, fn: ActionStepHandler | undefined): void;
22
- getStepHandler(runtimeId: string): ActionStepHandler | undefined;
23
- hasStepHandler(runtimeId: string): boolean;
24
- clearStepHandlers(): void;
25
- private _normalizeDefinition;
26
- private _buildCompiledFlow;
27
- private _validateFlow;
28
- private _fieldToPlain;
29
- get compiledFlow(): ActionCompiledFlow | null;
30
- getValidationIssues(): FlowValidationIssue[];
31
- validate(): FlowValidationIssue[];
32
- getCompiledRuntimeNodeId(runtimeId: string): string | null;
33
- /** Builds an immutable compiler payload without retaining compiled state on the entity. */
34
- buildCompiledFlow(): ActionCompiledFlow;
35
- compile(): void;
36
- run(): Promise<unknown>;
17
+ static fromPlain(json: any, storageMeta?: any): RAction;
18
+ run(input?: unknown): Promise<unknown>;
37
19
  toPlain(): Record<string, unknown>;
38
20
  duplicate(options: DuplicateOptions): RAction;
39
21
  }
@@ -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;
@@ -3,7 +3,7 @@ import { ActionRuntimeHostContext, RuntimeHost } from '../../../types/runtime/ru
3
3
  import { RuntimeHostBase } from '../RuntimeHostBase';
4
4
  /**
5
5
  * Создаёт контекст action-runtime с опциональной ссылкой на родительский контекст.
6
- * Всегда создаёт новый flowState (изоляция), при необходимости задаёт parent для иерархии.
6
+ * Создаёт изолированный invocation context и optional parent link.
7
7
  */
8
8
  export declare function createActionContext(options: {
9
9
  input?: Record<string, unknown> | unknown;
@@ -70,6 +70,8 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
70
70
  mutateStore(dataAlias: string, plan: StoreMutationPlan): void;
71
71
  /** Explicitly invokes one named Store-owned RUpdate outside Stream dispatch. */
72
72
  applyStoreUpdate(dataAlias: string, updateIdentity: string, payload: unknown): void;
73
+ /** Resolves an Update artifact to the Store data alias owned by this Composition. */
74
+ applyUpdateByIdentity(updateIdentity: string, payload: unknown): void;
73
75
  /** Устанавливает literal/Raph-backed источник публичных Composition props. */
74
76
  setInputSource(input: RuntimeHostInputSource | null | undefined): void;
75
77
  /** Проверяет обязательные props до создания child runtime graph. */
@@ -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. */
@@ -182,15 +182,19 @@ export interface RComponentSFC_IR_ElementNode {
182
182
  portBindings?: ComponentSFCRequiredPortBinding[];
183
183
  /** Compiler-resolved Table menus, including forwarded Action identities and targets. */
184
184
  tableMenus?: RComponentSFC_IR_TableMenus;
185
+ /** Compiler-resolved CellMenu override for one Column. */
186
+ cellMenu?: ComponentSFCTableCellMenuDescriptor;
185
187
  /** Позиция исходного AST-узла. */
186
188
  sourceRange?: RComponentSFC_SourceRange;
187
189
  }
188
190
  export interface RComponentSFC_IR_TableMenus {
189
191
  column: ComponentSFCTableColumnMenuDescriptor;
190
- row: ComponentSFCTableRowMenuDescriptor;
192
+ /** Default data-cell menu. `row` is retained as the compatibility field name. */
193
+ row: ComponentSFCTableCellMenuDescriptor;
191
194
  }
192
195
  export type ComponentSFCTableColumnMenuMode = 'default' | 'disabled' | 'inline';
193
196
  export type ComponentSFCTableRowMenuMode = 'none' | 'inline';
197
+ export type ComponentSFCTableCellMenuMode = 'none' | 'inline';
194
198
  /** Renderer-neutral menu retained in compiled SFC form until a concrete row/column context exists. */
195
199
  export interface ComponentSFCTableMenuDescriptor {
196
200
  kind: 'sfc-table-menu';
@@ -201,6 +205,10 @@ export interface ComponentSFCTableMenuItemDescriptor {
201
205
  kind: 'item';
202
206
  id: string;
203
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;
204
212
  action: string;
205
213
  /** Required Action port whose mounted provider may replace `action`. */
206
214
  requiredPort?: string;
@@ -223,6 +231,8 @@ export interface ComponentSFCTableRowMenuDescriptor {
223
231
  menu: ComponentSFCTableMenuDescriptor | null;
224
232
  diagnostics: RComponentDiagnostic[];
225
233
  }
234
+ /** Canonical cell menu descriptor. RowMenu uses the same shape as a legacy alias. */
235
+ export type ComponentSFCTableCellMenuDescriptor = ComponentSFCTableRowMenuDescriptor;
226
236
  export type RComponentSFC_IR_EventModifier = 'stop' | 'prevent' | 'self' | 'once' | 'capture' | 'passive';
227
237
  export interface RComponentSFC_IR_EventBinding {
228
238
  name: string;
@@ -150,6 +150,10 @@ export type ComponentSFCEventInputValue = {
150
150
  } | {
151
151
  kind: 'literal';
152
152
  value: unknown;
153
+ } | {
154
+ kind: 'coalesce';
155
+ left: ComponentSFCEventInputValue;
156
+ right: ComponentSFCEventInputValue;
153
157
  } | {
154
158
  kind: 'array';
155
159
  items: ComponentSFCEventInputValue[];
@@ -1,4 +1,5 @@
1
1
  export type TableSelectionMode = 'none' | 'single' | 'multiple';
2
+ export type TableCellSelectionMode = 'none' | 'single';
2
3
  export type TableSelectionTrigger = 'auto' | 'control' | 'row' | 'both';
3
4
  export type TableRowActivationKind = 'pointer' | 'keyboard';
4
5
  export interface TableEventBase {
@@ -28,6 +29,17 @@ export interface TableSelectionChangedEvent<TRow extends Record<string, unknown>
28
29
  addedRowIds: string[];
29
30
  removedRowIds: string[];
30
31
  }
32
+ export interface TableSelectedCell<TRow extends Record<string, unknown> = Record<string, unknown>> {
33
+ rowId: string;
34
+ rowIndex: number;
35
+ row: TRow;
36
+ columnKey: string;
37
+ value: unknown;
38
+ }
39
+ export interface TableCellSelectionChangedEvent<TRow extends Record<string, unknown> = Record<string, unknown>> extends TableEventBase {
40
+ selectedCell: TableSelectedCell<TRow> | null;
41
+ previousCell: TableSelectedCell<TRow> | null;
42
+ }
31
43
  export interface TableSortChangedEvent extends TableEventBase {
32
44
  sort: Array<{
33
45
  columnKey: string;
@@ -58,6 +70,7 @@ export interface TableEventMap {
58
70
  rowActivated: TableRowActivatedEvent;
59
71
  rowContextMenuRequested: TableRowContextMenuRequestedEvent;
60
72
  selectionChanged: TableSelectionChangedEvent;
73
+ cellSelectionChanged: TableCellSelectionChangedEvent;
61
74
  sortChanged: TableSortChangedEvent;
62
75
  columnVisibilityChanged: TableColumnVisibilityChangedEvent;
63
76
  columnPinChanged: TableColumnPinChangedEvent;
@@ -20,6 +20,7 @@ export interface ComponentSFCAttributeAnalysisOptions {
20
20
  resolveTagAttributeContracts?: (tag: string) => readonly ComponentSFCTagAttributeContract[] | null | undefined;
21
21
  }
22
22
  export declare const ENDGE_SFC_TABLE_SELECTION_MODES: readonly ["none", "single", "multiple"];
23
+ export declare const ENDGE_SFC_TABLE_CELL_SELECTION_MODES: readonly ["none", "single"];
23
24
  export declare const ENDGE_SFC_TABLE_SELECTION_TRIGGERS: readonly ["auto", "control", "row", "both"];
24
25
  export declare const ENDGE_SFC_TABLE_PAGING_MODES: readonly ["pages", "virtual"];
25
26
  export declare const ENDGE_SFC_TABLE_SORT_MODES: readonly ["multiple", "single", "fixed", "disabled"];
@@ -49,6 +50,12 @@ export declare const ENDGE_SFC_TAG_ATTRIBUTE_CONTRACTS: {
49
50
  readonly values: readonly ["auto", "control", "row", "both"];
50
51
  readonly defaultValue: "auto";
51
52
  readonly description: "Действие, которое меняет состояние выбора строки.";
53
+ }, {
54
+ readonly name: "cell-selection-mode";
55
+ readonly aliases: readonly ["cellSelectionMode"];
56
+ readonly values: readonly ["none", "single"];
57
+ readonly defaultValue: "none";
58
+ readonly description: "Режим выбора одной конкретной ячейки, независимый от выбора строк.";
52
59
  }, {
53
60
  readonly name: "paging";
54
61
  readonly values: readonly ["pages", "virtual"];
@@ -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
  };
@@ -190,7 +194,7 @@ export type ComponentSFCTableSourcePatch = {
190
194
  value: string | null;
191
195
  } | {
192
196
  type: 'set-table-attribute';
193
- name: 'ref' | 'selection-mode' | 'selection-trigger' | 'paging' | 'page-size' | 'page-sizes' | 'default-pin' | 'default-sort' | 'default-hidden';
197
+ name: 'ref' | 'selection-mode' | 'selection-trigger' | 'cell-selection-mode' | 'paging' | 'page-size' | 'page-sizes' | 'default-pin' | 'default-sort' | 'default-hidden';
194
198
  value: string | null;
195
199
  } | {
196
200
  type: 'set-column-component';
@@ -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
  };
@@ -291,6 +300,7 @@ export interface ComponentSFCTableVisualProjection {
291
300
  ref: ComponentSFCVisualSourceValue | null;
292
301
  selectionMode: ComponentSFCVisualSourceValue | null;
293
302
  selectionTrigger: ComponentSFCVisualSourceValue | null;
303
+ cellSelectionMode: ComponentSFCVisualSourceValue | null;
294
304
  rows: ComponentSFCVisualSourceValue | null;
295
305
  rowKey: ComponentSFCVisualSourceValue | null;
296
306
  paging: ComponentSFCVisualSourceValue | null;
@@ -0,0 +1,8 @@
1
+ import { ActionSourceDocument } from '../source/action-source.types';
2
+ import { ActionTargetSelector } from '../runtime/action.types';
3
+ export interface ActionProgramPayload {
4
+ type: 'action';
5
+ sourceVersion: number;
6
+ sourceDocument: ActionSourceDocument | null;
7
+ target: ActionTargetSelector[] | null;
8
+ }
@@ -1,4 +1,3 @@
1
- import { ActionCompiledFlow } from '../flow/action.types';
2
1
  import { RComponentContract, RComponentDependencies } from '../component/component-core.types';
3
2
  import { DataViewManualTransform, DataViewPipelineStep, DataViewRef, DataViewSourceDocument } from '../source/data-view-source.types';
4
3
  import { RComponentSFC_AST } from '../component/sfc/ast.types';
@@ -6,14 +5,16 @@ import { RComponentSFC_IR } from '../component/sfc/ir.types';
6
5
  import { RComponentSFC_RuntimeDependencies } from '../component/sfc/dependencies.types';
7
6
  import { RComponentSFCSource_Parts } from '../component/sfc/source.types';
8
7
  import { QueryProgramProp, SourceExpressionIR, SourceFieldDefinition } from '../source/source-expression.types';
8
+ import { ResponseOutputTransform } from '../source/response-output.types';
9
+ import { VocabProgramPayload } from '../source/vocab-source.types';
9
10
  import { ProgramMetadata } from './program-metadata.types';
10
11
  import { ComputationProgramPayload } from '../computation/computation-program.types';
11
12
  import { EndgeStyleSheetArtifact } from '../style/style.types';
12
- import { ActionImplementation, ActionTargetSelector } from '../runtime/action.types';
13
+ export type { ActionProgramPayload } from './action-program.types';
13
14
  export type { ConfigurationProgramPayload } from '../source/configuration-source.types';
14
15
  export type ProgramArtifactKey = string;
15
16
  /** Тип доменной сущности, для которой compiler может построить program artifact. */
16
- export type ProgramEntityType = 'type' | 'component-sfc' | 'computation' | 'action' | 'query' | 'data-view' | 'store' | 'stream' | 'update' | 'filter' | 'composition' | 'style' | 'configuration';
17
+ export type ProgramEntityType = 'type' | 'component-sfc' | 'computation' | 'action' | 'query' | 'vocab' | 'data-view' | 'store' | 'stream' | 'update' | 'filter' | 'composition' | 'style' | 'configuration';
17
18
  /** Итоговый статус artifact после компиляции и валидации. */
18
19
  export type ProgramArtifactStatus = 'valid' | 'warning' | 'error';
19
20
  /** Возможность, которую artifact предоставляет runtime/render слоям. */
@@ -54,6 +55,10 @@ export interface ProgramDependency {
54
55
  identity?: string;
55
56
  /** Роль зависимости: child-component, renderer, data-source и т.п. */
56
57
  role?: string;
58
+ /** Optional source location of the dependency reference for linker diagnostics. */
59
+ sourcePath?: string;
60
+ start?: number;
61
+ end?: number;
57
62
  }
58
63
  /** Единица compiled program: результат компиляции одной доменной сущности. */
59
64
  export interface ProgramArtifact<TPayload = unknown> {
@@ -80,25 +85,6 @@ export interface ProgramArtifact<TPayload = unknown> {
80
85
  /** Локальные compiled artifacts, принадлежащие только этому artifact. */
81
86
  children?: ProgramArtifact[];
82
87
  }
83
- /** Payload artifact для action: скомпилированный flow или null при ошибке компиляции. */
84
- export interface ActionProgramPayload {
85
- /** Нормализованный action-flow с индексами и runtime-ready структурой. */
86
- compiledFlow: ActionCompiledFlow | null;
87
- target: ActionTargetSelector[] | null;
88
- input: {
89
- type: string;
90
- name?: string;
91
- isArray?: boolean;
92
- optional?: boolean;
93
- } | null;
94
- output: {
95
- type: string;
96
- name?: string;
97
- isArray?: boolean;
98
- optional?: boolean;
99
- } | null;
100
- implementation: ActionImplementation;
101
- }
102
88
  export type QueryProgramOutputSource = {
103
89
  type: 'response';
104
90
  path: string | null;
@@ -110,6 +96,9 @@ export type QueryProgramOutputSource = {
110
96
  export interface QueryProgramOutput {
111
97
  key: string;
112
98
  source: QueryProgramOutputSource;
99
+ /** Ordered transform chain used by new runtimes. */
100
+ transforms?: ResponseOutputTransform[];
101
+ /** Compatibility projection for runtimes compiled before ordered transforms. */
113
102
  dataViews: DataViewRef[];
114
103
  contract?: SourceFieldDefinition | null;
115
104
  materialization: {
@@ -162,6 +151,7 @@ export interface QueryProgramPayload {
162
151
  /** Ordered output graph, который runtime вычисляет после backend response. */
163
152
  outputs: QueryProgramOutput[];
164
153
  }
154
+ export type { VocabProgramPayload };
165
155
  /** Payload artifact для DataView: executable read-model без persisted runtime state. */
166
156
  export interface DataViewProgramPayload {
167
157
  /** Тип artifact для diagnostics/debug UI. */
@@ -27,7 +27,7 @@ export interface ActionExecutionTarget<TValue = unknown> {
27
27
  }
28
28
  /** How an Action is executed when there is no higher-priority runtime binding. */
29
29
  export type ActionImplementation = {
30
- kind: 'flow';
30
+ kind: 'source';
31
31
  } | {
32
32
  kind: 'provider';
33
33
  providerKey: string;
@@ -41,8 +41,11 @@ export interface ActionDefinitionInput {
41
41
  description?: string | null;
42
42
  active?: boolean;
43
43
  target?: ActionTargetSelector[] | null;
44
- input?: unknown;
45
- output?: unknown;
44
+ contract?: {
45
+ input?: unknown;
46
+ output?: unknown;
47
+ };
48
+ defaultProviderKey?: string;
46
49
  defaultImplementation?: ActionImplementation;
47
50
  owner?: EntityRef;
48
51
  }
@@ -146,9 +149,33 @@ export interface TableColumnActionContext extends RuntimeActionContext {
146
149
  sortState: TableColumnSortState;
147
150
  activeSortCount: number;
148
151
  }
149
- /** Renderer-neutral row/cell context shared by every Table menu adapter. */
152
+ export interface TableActionTableContext {
153
+ id: string;
154
+ runtimeId: string;
155
+ state: Readonly<Record<string, unknown>>;
156
+ }
157
+ export interface TableActionRowContext {
158
+ id: string;
159
+ index: number;
160
+ data: Record<string, unknown>;
161
+ }
162
+ export interface TableActionColumnContext {
163
+ key: string;
164
+ index: number;
165
+ title: string;
166
+ metadata: Readonly<Record<string, unknown>>;
167
+ }
168
+ export interface TableActionCellContext {
169
+ value: unknown;
170
+ }
171
+ /** Renderer-neutral cell context shared by every Table menu adapter. */
150
172
  export interface TableRowActionContext extends RuntimeActionContext {
173
+ /** Compatibility surface value retained for existing Action providers. */
151
174
  surface: 'table-row';
175
+ table: TableActionTableContext;
176
+ rowContext: TableActionRowContext;
177
+ column: TableActionColumnContext;
178
+ cell: TableActionCellContext;
152
179
  tableRuntimeId: string;
153
180
  tableId: string;
154
181
  target: TableRuntimeActionTarget;
@@ -158,3 +185,5 @@ export interface TableRowActionContext extends RuntimeActionContext {
158
185
  columnKey: string;
159
186
  value: unknown;
160
187
  }
188
+ /** Canonical name for new consumers; TableRowActionContext remains source-compatible. */
189
+ export type TableCellActionContext = TableRowActionContext;
@@ -16,6 +16,10 @@ export interface EndgeContextSnapshot {
16
16
  theme: string | null;
17
17
  timezone: string | null;
18
18
  }
19
+ /** Storage payload that distinguishes an explicit theme choice from an effective default. */
20
+ export interface EndgePersistedContextSnapshot extends EndgeContextSnapshot {
21
+ themePreferenceVersion?: 1;
22
+ }
19
23
  /** Volatile keyboard state supplied by the active UI adapter. */
20
24
  export interface EndgeKeyboardContextSnapshot {
21
25
  platform: 'macos' | 'windows' | 'linux' | 'unknown';
@@ -1,4 +1,3 @@
1
- import { FlowExecutionResult, FlowExecutionState } from '../flow/endge-flow-runtime.types';
2
1
  import { RuntimeStateControllerLike } from './context-persistence.types';
3
2
  import { ProgramArtifact, ProgramEntityType } from '../program/program.types';
4
3
  import { RuntimeEntityModelMap, RuntimeEntityType } from './runtime-entity-map.types';
@@ -39,17 +38,9 @@ export interface RuntimeHostContextBase {
39
38
  updatedAt: string | null;
40
39
  }
41
40
  export interface ActionRuntimeHostContext extends RuntimeHostContextBase {
42
- /** Нормализованный input последнего запуска action-flow. */
41
+ /** Immutable input of the current Source Action invocation. */
43
42
  input: Record<string, unknown>;
44
- /** Каноническое runtime-state action-flow внутри этого host. */
45
- flowState: FlowExecutionState;
46
- /** Текущий node-id, который считается активным в host. */
47
- currentNodeId: string | null;
48
- /** Стек вызовов вложенных action-run'ов. */
49
- callStack: string[];
50
- /** Последний результат исполнения action-flow. */
51
- lastFlowResult: FlowExecutionResult | null;
52
- /** Контекст родительского action-host, если этот action вызван из другого flow (иерархия без мутации). */
43
+ result: unknown;
53
44
  parent?: ActionRuntimeHostContext | null;
54
45
  }
55
46
  export interface QueryRuntimeHostContext extends RuntimeHostContextBase {
@@ -0,0 +1,40 @@
1
+ import { SourceExpressionIR, SourceFieldDefinition } from './source-expression.types';
2
+ export interface ActionSourceContract {
3
+ input: SourceFieldDefinition | null;
4
+ output: SourceFieldDefinition | null;
5
+ }
6
+ export type ActionSourceEffectKind = 'query' | 'update' | 'action' | 'computation';
7
+ export interface ActionSourceEffectStep {
8
+ kind: ActionSourceEffectKind;
9
+ name: string;
10
+ identity: string;
11
+ input: SourceExpressionIR;
12
+ }
13
+ export interface ActionSourceExpressionStep {
14
+ kind: 'expression';
15
+ name: string;
16
+ expression: SourceExpressionIR;
17
+ }
18
+ export interface ActionSourceTypescriptStep {
19
+ kind: 'typescript';
20
+ name: string;
21
+ inputs: Record<string, SourceExpressionIR>;
22
+ moduleKey: string;
23
+ source: string;
24
+ }
25
+ export interface ActionSourceOperationStep {
26
+ kind: 'operation';
27
+ name: string;
28
+ input: SourceExpressionIR;
29
+ run: ActionSourceBlock;
30
+ undo: ActionSourceBlock;
31
+ redo: ActionSourceBlock | null;
32
+ }
33
+ export type ActionSourceStep = ActionSourceExpressionStep | ActionSourceEffectStep | ActionSourceTypescriptStep | ActionSourceOperationStep;
34
+ export interface ActionSourceBlock {
35
+ steps: ActionSourceStep[];
36
+ output: SourceExpressionIR | null;
37
+ }
38
+ export interface ActionSourceDocument extends ActionSourceBlock {
39
+ contract: ActionSourceContract;
40
+ }
@@ -11,18 +11,38 @@ import { I18nCompiledLocales } from '../i18n.types';
11
11
  import { ComponentSFCEventInputValue } from '../component/sfc/ports.types';
12
12
  import { UpdateMutationStrategy } from './update-source.types';
13
13
  import { EndgeDataMode } from '../document/workspace.types';
14
+ import { ComponentSFCInteractionTrigger } from '../component/sfc/ir.types';
14
15
  export type CompositionRuntimeKind = 'filter' | 'query' | 'component' | 'composition' | 'stream' | 'filter-view';
15
16
  export type CompositionActivationMode = 'startup' | 'manual';
16
17
  export interface CompositionActivationDescriptor {
17
18
  mode: CompositionActivationMode;
18
19
  }
19
- export interface CompositionResourceDescriptor {
20
+ interface CompositionResourceDescriptorBase {
20
21
  name: string;
21
22
  path: string;
22
23
  scopePath: string;
24
+ sourceOrder: number;
25
+ }
26
+ export type CompositionResourceDescriptor = CompositionResourceDescriptorBase & {
23
27
  kind: 'style' | 'i18n';
24
28
  identity: string;
25
- sourceOrder: number;
29
+ } | CompositionResourceDescriptorBase & {
30
+ kind: 'operation-history';
31
+ operationHistory: {
32
+ limit: number;
33
+ limitConfigurationPath: string | null;
34
+ shortcuts: OperationHistoryShortcutDescriptor[] | null;
35
+ };
36
+ };
37
+ export interface OperationHistoryShortcutDescriptor {
38
+ command: 'undo' | 'redo';
39
+ triggerSet: {
40
+ kind: 'configuration';
41
+ path: string;
42
+ } | {
43
+ kind: 'literal';
44
+ value: ComponentSFCInteractionTrigger[];
45
+ };
26
46
  }
27
47
  /** Материализованный i18n-resource внутри Composition program artifact. */
28
48
  export interface CompositionI18nResourceArtifact {
@@ -255,7 +275,7 @@ export interface CompositionSourceAddResourcePatch {
255
275
  type: 'add-resource';
256
276
  name: string;
257
277
  kind: CompositionResourceDescriptor['kind'];
258
- identity: string;
278
+ identity?: string;
259
279
  }
260
280
  /** Добавление runtime dependency в canonical Composition source. */
261
281
  export interface CompositionSourceAddRuntimePatch {
@@ -370,3 +390,4 @@ export interface CompositionSession {
370
390
  output: <T = unknown>(name: string) => T | undefined;
371
391
  unmount: () => Promise<void>;
372
392
  }
393
+ export {};
@@ -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
+ };