@elyx-code/project-logic-tree 0.0.7221 → 0.0.7223

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.
@@ -1,6 +1,6 @@
1
1
  import { EntityId, UserManagedElementShallowTransfer, EntityVersion } from '../definitions';
2
2
  import { ProjectState, UserManagedEntityState, EntityWithValueState, PersistChangeSetEntityActionRequestPayload, ChangeSet, CanvasEntityState, ChangeSetEvent, EntityError } from '../tree';
3
- import { IActiveBranchHeadResult, IEditor, IChannelConnections, EfimeralValueStore, ITest, Execution, IDynamicValue, DynamicValueTypes, PublicationRun, ExtensionsRegistry, TestableEntityState, ExtensionContextType, IEnvConfig, IBranch, ICanvasCopyPayload } from '.';
3
+ import { IActiveBranchHeadResult, IEditor, IChannelConnections, EfimeralValueStore, ITest, Execution, IDynamicValue, DynamicValueTypes, PublicationRun, ExtensionsRegistry, TestableEntityState, ExtensionContextType, IEnvConfig, IBranch, ICanvasCopyPayload, IPublishOptions, IPublishResult, ProjectValidationErrors } from '.';
4
4
  import { Events, IWebsocketsClient, YieldOptions } from '@elyx-code/common-ts-utils';
5
5
  import { ILiveMessageDTO, IPublication, InfrastructureResource, IWorkspace, IRichProjectRoleDTO } from '@elyx-code/definitions';
6
6
  import { Test } from './test-instance';
@@ -197,7 +197,11 @@ export declare class Editor implements IEditor, IEditorContext {
197
197
  }): Promise<ITest>;
198
198
  copyEntities(payload: ICanvasCopyPayload, options?: YieldOptions): Promise<ChangeSet>;
199
199
  resolveInitialChildrenPositions(parent: CanvasEntityState | null, children: CanvasEntityState[], changeSet: ChangeSet | null): CanvasEntityState[];
200
- publish(): Promise<void>;
200
+ validateProjectForPublication(): Promise<{
201
+ valid: boolean;
202
+ errors: ProjectValidationErrors[];
203
+ }>;
204
+ publish(options?: IPublishOptions): Promise<IPublishResult>;
201
205
  loadLivePublications(): Promise<void>;
202
206
  enrichPublication(publication: IPublication): PublicationRun;
203
207
  enrichPublications(publications: IPublication[]): PublicationRun[];
@@ -1,4 +1,4 @@
1
- import { CanvasEntityState, ChangeSet, IProjectInstanceParentContext, PersistChangeSetEntityActionRequestPayload, ProjectState } from '../tree';
1
+ import { CanvasEntityState, ChangeSet, EntityErrorCode, IProjectInstanceParentContext, PersistChangeSetEntityActionRequestPayload, ProjectState } from '../tree';
2
2
  import { Execution, TestableEntityState } from './execution';
3
3
  import { EfimeralValueStore, IDynamicValue, IValueStoreClient } from './value-store';
4
4
  import { EntityId, EntityType, EntityVersion, UserManagedElementShallowTransfer } from '../definitions';
@@ -9,6 +9,28 @@ import { DTOAction, ILiveMessageDTO, InfrastructureResource, IPublication, IRich
9
9
  import { PublicationRun } from './publication/publication';
10
10
  import { ExtensionContextType, ExtensionsRegistry, IRegisteredExtension } from './extensions';
11
11
 
12
+ export declare enum ProjectValidationErrorsEnum {
13
+ NO_LOGIC = "NO_LOGIC",
14
+ NO_NAME = "NO_NAME",
15
+ MISSING_ROW_TRANSFORMERS = "MISSING_ROW_TRANSFORMERS"
16
+ }
17
+ export type ProjectValidationErrors = ProjectValidationErrorsEnum | EntityErrorCode;
18
+ export interface IPublishOptions {
19
+ newId?: string;
20
+ awaitAwk?: boolean;
21
+ awaitComplete?: boolean;
22
+ timeout?: number;
23
+ validate?: boolean;
24
+ }
25
+ export interface IPublishResult {
26
+ started: boolean;
27
+ publication: PublicationRun | null;
28
+ finalEvent?: ILiveMessageDTO;
29
+ validation?: {
30
+ valid: boolean;
31
+ errors: ProjectValidationErrors[];
32
+ };
33
+ }
12
34
  export interface IBranch {
13
35
  id: string;
14
36
  userAuthor: string;
@@ -187,7 +209,7 @@ export interface IEditor extends IUndoableInterface, IValueResolutionContext, IP
187
209
  }): Promise<ITest>;
188
210
  copyEntities(payload: ICanvasCopyPayload, options: YieldOptions): Promise<ChangeSet>;
189
211
  resolveInitialChildrenPositions(parent: CanvasEntityState | null, children: CanvasEntityState[], changeSet: ChangeSet | null): CanvasEntityState[];
190
- publish(): Promise<void>;
212
+ publish(options?: IPublishOptions): Promise<IPublishResult>;
191
213
  loadGivenPublication(publicationId: string): Promise<IPublication>;
192
214
  requestExtension<T = any>(moduleId: string): IRegisteredExtension<T>;
193
215
  initRegistry(): Promise<ExtensionsRegistry<any>>;
@@ -1,4 +1,4 @@
1
- import { IActiveBranchHeadResult, IBranch, ICanvasCopyPayload, IChannelConnections, IEditor, IEnvConfig } from '../../editor';
1
+ import { IActiveBranchHeadResult, IBranch, ICanvasCopyPayload, IChannelConnections, IEditor, IEnvConfig, IPublishOptions, IPublishResult } from '../../editor';
2
2
  import { ExtensionContextBase } from './base';
3
3
  import { ExtensionsRegistry } from '../registry';
4
4
  import { ExtensionContextType } from '../module';
@@ -64,7 +64,7 @@ export declare class DefaultEditorContext extends ExtensionContextBase<Extension
64
64
  }): Promise<ITest>;
65
65
  copyEntities(payload: ICanvasCopyPayload, options?: YieldOptions): Promise<ChangeSet>;
66
66
  resolveInitialChildrenPositions(parent: CanvasEntityState | null, children: CanvasEntityState[], changeSet: ChangeSet | null): CanvasEntityState[];
67
- publish(): Promise<void>;
67
+ publish(options?: IPublishOptions): Promise<IPublishResult>;
68
68
  loadGivenPublication(publicationId: string): Promise<IPublication>;
69
69
  validateProjectState(options?: YieldOptions): Promise<void>;
70
70
  requestActiveDynamicValue(valueOwner: EntityWithValueState, onlyDefault?: boolean): IDynamicValue | null;
@@ -73,12 +73,16 @@ export interface ICommandSubcommandOption {
73
73
  description: string;
74
74
  category: string;
75
75
  }
76
+ export declare enum CommandExecutionType {
77
+ ClientProcess = "client-process",
78
+ AgentProcess = "agent-process"
79
+ }
76
80
  export interface ICommandDefinition {
77
81
  command: string;
78
82
  label: string;
79
83
  description?: string;
80
84
  category: string;
81
- executionType?: 'fe-action' | 'backend-process' | 'ai-prompt';
85
+ executionType: CommandExecutionType | 'client-process' | 'agent-process';
82
86
  hasRichEditor?: boolean;
83
87
  subcommands?: ICommandSubcommandOption[];
84
88
  args?: ICommandArgDef[];
@@ -92,9 +96,20 @@ export interface ICommandExecutionContext {
92
96
  args: Record<string, any>;
93
97
  rawInput: string;
94
98
  }
99
+ export interface IBeforeSubmitResult {
100
+ canProceed: boolean;
101
+ notification?: {
102
+ text: string;
103
+ color?: 'success' | 'error' | 'warning' | 'info';
104
+ };
105
+ widgetType?: string;
106
+ widgetPayload?: any;
107
+ message?: string;
108
+ }
95
109
  export interface ICommandExecutionResult {
96
110
  success: boolean;
97
111
  message?: string;
112
+ metadata?: Record<string, any>;
98
113
  widgetType?: string;
99
114
  widgetPayload?: any;
100
115
  createdEntityId?: string;
@@ -102,6 +117,7 @@ export interface ICommandExecutionResult {
102
117
  }
103
118
  export type CommandStage = 'normal' | 'command' | 'subcommand' | 'option' | 'args';
104
119
  export interface ICommandExtensionModule extends IExtensionModuleCore {
120
+ beforeSubmit?: (ctx: ICommandExecutionContext) => Promise<IBeforeSubmitResult>;
105
121
  execute: (ctx: ICommandExecutionContext) => Promise<ICommandExecutionResult>;
106
122
  getOptions?: (stage: CommandStage, query: string, ctx: any) => Promise<any[]>;
107
123
  }