@elyx-code/project-logic-tree 0.0.7226 → 0.0.7229

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.
@@ -233,7 +233,7 @@ export declare enum NamedColor {
233
233
  ListValue = "list--value",
234
234
  ObjectValue = "object--value"
235
235
  }
236
- export interface ICommandPart {
236
+ export interface ICommandPart<TMetadata = Record<string, any>> {
237
237
  id?: string;
238
238
  stepId?: string;
239
239
  index: number;
@@ -244,28 +244,25 @@ export interface ICommandPart {
244
244
  color?: string;
245
245
  namedColor?: NamedColor | string;
246
246
  icon?: string;
247
- metadata?: {
248
- entity?: any;
249
- [key: string]: unknown;
250
- };
247
+ metadata?: TMetadata;
251
248
  }
252
- export interface ICommandExecutionContext {
253
- project?: any;
249
+ export interface ICommandExecutionContext<TProject = any> {
250
+ project?: TProject;
254
251
  conversationId: string;
255
252
  command: string;
256
253
  subcommand?: string;
257
254
  option?: string;
258
- args: Record<string, any>;
255
+ args: Record<string, string | undefined>;
259
256
  rawInput: string;
260
257
  parts?: ICommandPart[];
261
258
  }
262
- export interface ICommandAutocompleteContext {
263
- project?: any;
259
+ export interface ICommandAutocompleteContext<TProject = any> {
260
+ project?: TProject;
264
261
  conversationId?: string;
265
262
  command?: string;
266
263
  subcommand?: string;
267
264
  option?: string;
268
- args?: Record<string, any>;
265
+ args?: Record<string, string | undefined>;
269
266
  rawInput?: string;
270
267
  parts?: ICommandPart[];
271
268
  [key: string]: unknown;
@@ -277,7 +274,7 @@ export interface IBeforeSubmitResult {
277
274
  color?: 'success' | 'error' | 'warning' | 'info';
278
275
  };
279
276
  widgetType?: string;
280
- widgetPayload?: any;
277
+ widgetPayload?: unknown;
281
278
  message?: string;
282
279
  }
283
280
  export interface ICommandExecutionResult {
@@ -308,7 +305,7 @@ export interface ICommandOptionItem<TMetadata = any> {
308
305
  colorType?: string;
309
306
  rendererId?: string;
310
307
  metadata?: TMetadata;
311
- rawEntity?: any;
308
+ rawEntity?: unknown;
312
309
  }
313
310
  export interface ICommandValidationResult {
314
311
  isValid: boolean;
@@ -317,7 +314,7 @@ export interface ICommandValidationResult {
317
314
  export interface ICommandStepContext<TContext = any> {
318
315
  /** Project context / editor service */
319
316
  context?: TContext;
320
- project?: any;
317
+ project?: TContext;
321
318
  /** Complete list of confirmed parts in sequence */
322
319
  confirmedParts: ICommandPart[];
323
320
  /** Dictionary mapping part id/type/stepId to ICommandPart */
@@ -333,7 +330,7 @@ export interface ICommandStepContext<TContext = any> {
333
330
  /** Helper to retrieve the full ICommandPart by step ID or type */
334
331
  getPart: (idOrType: string) => ICommandPart | undefined;
335
332
  }
336
- export interface ICommandStep<TContext = any> {
333
+ export interface ICommandStep<TContext = any, TMetadata = any> {
337
334
  id: string;
338
335
  type: CommandStepType;
339
336
  label: string;
@@ -342,12 +339,15 @@ export interface ICommandStep<TContext = any> {
342
339
  required?: boolean | ((ctx: ICommandStepContext<TContext>) => boolean);
343
340
  allowFreeText?: boolean | ((ctx: ICommandStepContext<TContext>) => boolean);
344
341
  isEnabled?: (ctx: ICommandStepContext<TContext>) => boolean;
345
- getOptions?: (query: string, ctx: ICommandStepContext<TContext>) => Promise<ICommandOptionItem[]>;
346
- resolvePart: (valueOrOption: any, ctx: ICommandStepContext<TContext>, partIndex: number) => ICommandPart;
342
+ getOptions?: (query: string, ctx: ICommandStepContext<TContext>) => Promise<ICommandOptionItem<TMetadata>[]>;
343
+ resolvePart: (valueOrOption: string | ICommandOptionItem<TMetadata> | any, ctx: ICommandStepContext<TContext>, partIndex: number) => ICommandPart;
347
344
  isStepSatisfied?: (value: string | ICommandPart, ctx: ICommandStepContext<TContext>) => boolean;
348
345
  validatePart?: (part: ICommandPart, ctx: ICommandStepContext<TContext>) => ICommandValidationResult | boolean;
349
346
  onConfirmed?: (part: ICommandPart, ctx: ICommandStepContext<TContext>) => void;
350
347
  }
348
+ export type CommandWidgetReference<TAction = any, TContext = any> = string | any | ((action: TAction, ctx?: {
349
+ project?: TContext;
350
+ }) => string | any | null | undefined) | null;
351
351
  export interface IComposableCommand<TContext = any> {
352
352
  name: string;
353
353
  label?: string;
@@ -355,21 +355,22 @@ export interface IComposableCommand<TContext = any> {
355
355
  category?: string;
356
356
  icon?: string;
357
357
  namedColor?: NamedColor | string;
358
+ widget?: CommandWidgetReference<any, TContext>;
358
359
  subcommands?: Record<string, IComposableCommand<TContext>> | IComposableCommand<TContext>[];
359
- steps?: ICommandStep<TContext>[] | ((ctx: ICommandStepContext<TContext>) => ICommandStep<TContext>[]);
360
- getNextStep?: (ctx: ICommandStepContext<TContext>) => ICommandStep<TContext> | null;
360
+ steps?: ICommandStep<TContext, any>[] | ((ctx: ICommandStepContext<TContext>) => ICommandStep<TContext, any>[]);
361
+ getNextStep?: (ctx: ICommandStepContext<TContext>) => ICommandStep<TContext, any> | null;
361
362
  onInit?: (ctx: ICommandStepContext<TContext>) => void;
362
- onPartConfirmed?: (part: ICommandPart, ctx: ICommandStepContext<TContext>) => void | ICommandStep<TContext> | ICommandStep<TContext>[];
363
+ onPartConfirmed?: (part: ICommandPart, ctx: ICommandStepContext<TContext>) => void | ICommandStep<TContext, any> | ICommandStep<TContext, any>[];
363
364
  onPartRemoved?: (part: ICommandPart, ctx: ICommandStepContext<TContext>) => void;
364
365
  validate?: (ctx: ICommandStepContext<TContext>) => ICommandValidationResult | boolean;
365
- beforeSubmit?: (ctx: ICommandExecutionContext) => Promise<IBeforeSubmitResult>;
366
- execute?: (ctx: ICommandExecutionContext) => Promise<ICommandExecutionResult>;
367
- getOptions?: (stage: CommandStage, query: string, ctx: ICommandAutocompleteContext) => Promise<any[]>;
366
+ beforeSubmit?: (ctx: ICommandExecutionContext<TContext>) => Promise<IBeforeSubmitResult>;
367
+ execute?: (ctx: ICommandExecutionContext<TContext>) => Promise<ICommandExecutionResult>;
368
+ getOptions?: (stage: CommandStage, query: string, ctx: ICommandAutocompleteContext<TContext>) => Promise<any[]>;
368
369
  }
369
370
  export interface ICommandStepResolution<TContext = any> {
370
371
  activeCommand: IComposableCommand<TContext> | ICommandExtension | null;
371
372
  activeSubcommand?: IComposableCommand<TContext> | null;
372
- currentStep: ICommandStep<TContext> | null;
373
+ currentStep: ICommandStep<TContext, any> | null;
373
374
  stepIndex: number;
374
375
  isComplete: boolean;
375
376
  placeholder: string;
@@ -0,0 +1,56 @@
1
+ import { EntityWithValueState, LiteralValueState, PropertyState, ValueDescriptorState, DefinitionEntityState, BuiltInBaseEntityState, EntityState, PrimitiveEntityState, DataTypeState, FunctionDeclarationState } from '../tree';
2
+
3
+ export declare enum IconNames {
4
+ DatabaseTableIcon = "database-table-icon",
5
+ HTTPEndpointIcon = "http-endpoint-icon",
6
+ RelationalDatabaseIcon = "relational-database-icon",
7
+ CronJobIcon = "cron-job-icon",
8
+ SQLConnectionConfigIcon = "sql-connection-config-icon",
9
+ SSLCertificateConfigIcon = "ssl-certificate-config-icon",
10
+ SQLRowTransformerIcon = "sql-row-transformer-icon",
11
+ SharedDriveIcon = "shared-drive-icon",
12
+ SharedDriveMountIcon = "shared-drive-mount-icon",
13
+ ContainerComputeIcon = "container-compute-icon",
14
+ CloudFileSystemIcon = "cloud-file-system-icon",
15
+ ExternalIntegrationAccountConnectionIcon = "external-integration-account-connection-icon",
16
+ ContainerRegistryIcon = "container-registry-icon",
17
+ ExecutionIcon = "execution-icon",
18
+ TerminalIcon = "terminal-icon",
19
+ NumberDataTypeIcon = "number-data-type-icon",
20
+ ListDataTypeIcon = "list-data-type-icon",
21
+ DefinitionEntityDataTypeIcon = "definition-entity-data-type-icon",
22
+ TextDataTypeIcon = "text-data-type-icon",
23
+ BooleanDataTypeIcon = "boolean-data-type-icon",
24
+ UUIDDataTypeIcon = "uuid-data-type-icon",
25
+ DateTimeDataTypeIcon = "date-time-data-type-icon",
26
+ UnknownDataTypeIcon = "unknown-data-type-icon",
27
+ NullDataTypeIcon = "null-data-type-icon",
28
+ VoidDataTypeIcon = "void-data-type-icon",
29
+ ExplicitAnyDataTypeIcon = "explicit-any-data-type-icon",
30
+ BytesDataTypeIcon = "bytes-data-type-icon",
31
+ ForeignKeyRefIcon = "foreign-key-ref-icon",
32
+ SQLProgramIcon = "sql-program-icon",
33
+ FileDataTypeIcon = "file-data-type-icon",
34
+ SpreadsheetRangeDataTypeIcon = "spreadsheet-range-data-type-icon",
35
+ RGBDataTypeIcon = "rgb-data-type-icon",
36
+ RGBADataTypeIcon = "rgba-data-type-icon",
37
+ GlobalEventIcon = "global-event-icon",
38
+ InternalCallIcon = "internal-call-icon",
39
+ OperationIcon = "operation-icon",
40
+ LoopIcon = "loop-icon",
41
+ ConditionIcon = "condition-icon",
42
+ FunctionDeclarationIcon = "function-declaration-icon",
43
+ VariableInstanceIcon = "variable-instance-icon",
44
+ PropertyIcon = "property-icon",
45
+ CubeIcon = "cube-icon",
46
+ TrashCanIcon = "trash-can-icon",
47
+ PencilIcon = "pencil-icon"
48
+ }
49
+ export declare const INTEGRATIONS_ICON_NAMES_PREFIX = "integration__";
50
+ export declare function resolveBuiltInBaseEntityIconName(entity: BuiltInBaseEntityState): string;
51
+ export declare function resolveDefinitionEntityIconName(entity: DefinitionEntityState): string;
52
+ export declare function resolveLiteralValueDataTypeIconName(entity: LiteralValueState): string;
53
+ export declare function resolvePrimitiveEntityDataTypeIconName(entity: PrimitiveEntityState): string;
54
+ export declare function resolveDataTypeIconName(dataType: DataTypeState): string;
55
+ export declare function resolveEntityDataTypeIconName(entity: EntityWithValueState | PropertyState | ValueDescriptorState | FunctionDeclarationState): string;
56
+ export declare function resolveEntityIconName(entity: EntityState): string;
@@ -9,3 +9,4 @@ export * from './ui-utils';
9
9
  export * from './publication';
10
10
  export * from './extensions';
11
11
  export * from './utils';
12
+ export * from './icons';