babylonjs-node-render-graph-editor 9.3.0 → 9.3.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.
@@ -2733,7 +2733,6 @@ export interface IDisplayManager {
2733
2733
 
2734
2734
  }
2735
2735
  declare module "babylonjs-node-render-graph-editor/modularTool/modularTool" {
2736
- import { IDisposable } from "babylonjs/index";
2737
2736
  import { IExtensionFeed } from "babylonjs-node-render-graph-editor/modularTool/extensibility/extensionFeed";
2738
2737
  import { WeaklyTypedServiceDefinition, ServiceContainer } from "babylonjs-node-render-graph-editor/modularTool/modularity/serviceContainer";
2739
2738
  import { ShellServiceOptions } from "babylonjs-node-render-graph-editor/modularTool/services/shellService";
@@ -2774,7 +2773,65 @@ export type ModularToolOptions = {
2774
2773
  * @param options The options for the tool.
2775
2774
  * @returns A token that can be used to dispose of the tool.
2776
2775
  */
2777
- export function MakeModularTool(options: ModularToolOptions): IDisposable;
2776
+ export function MakeModularTool(options: ModularToolOptions): {
2777
+ dispose: () => Promise<void>;
2778
+ };
2779
+
2780
+ }
2781
+ declare module "babylonjs-node-render-graph-editor/modularTool/modularBridge" {
2782
+ import { IDisposable } from "babylonjs/index";
2783
+ import { WeaklyTypedServiceDefinition, ServiceContainer } from "babylonjs-node-render-graph-editor/modularTool/modularity/serviceContainer";
2784
+ /**
2785
+ * Options for creating a modular bridge container.
2786
+ * @experimental
2787
+ * @internal
2788
+ */
2789
+ export type ModularBridgeOptions = {
2790
+ /**
2791
+ * WebSocket port for the bridge's browser port. Defaults to 4400.
2792
+ */
2793
+ port?: number;
2794
+ /**
2795
+ * Session display name reported to the bridge. Defaults to `document.title`.
2796
+ */
2797
+ name?: string;
2798
+ /**
2799
+ * Whether the bridge should automatically start trying to connect.
2800
+ * Defaults to false.
2801
+ */
2802
+ autoStart?: boolean;
2803
+ /**
2804
+ * Additional service definitions to register with the bridge container.
2805
+ */
2806
+ serviceDefinitions?: readonly WeaklyTypedServiceDefinition[];
2807
+ };
2808
+ /**
2809
+ * A token returned by {@link MakeModularBridge} that owns the headless
2810
+ * {@link ServiceContainer}. Dispose it to tear down the bridge and all services.
2811
+ * @experimental
2812
+ * @internal
2813
+ */
2814
+ export type ModularBridgeToken = IDisposable & {
2815
+ /**
2816
+ * The headless ServiceContainer that hosts the bridge.
2817
+ */
2818
+ readonly serviceContainer: ServiceContainer;
2819
+ /**
2820
+ * Whether this token has been disposed.
2821
+ */
2822
+ readonly isDisposed: boolean;
2823
+ };
2824
+ /**
2825
+ * Creates a headless {@link ServiceContainer} that hosts a bridge service.
2826
+ *
2827
+ * The returned token owns the container. Dispose it to tear down the bridge.
2828
+ *
2829
+ * @param options Optional configuration for the bridge.
2830
+ * @returns A {@link ModularBridgeToken} that owns the container.
2831
+ * @experimental
2832
+ * @internal
2833
+ */
2834
+ export function MakeModularBridge(options?: ModularBridgeOptions): ModularBridgeToken;
2778
2835
 
2779
2836
  }
2780
2837
  declare module "babylonjs-node-render-graph-editor/modularTool/themes/babylonTheme" {
@@ -3254,6 +3311,359 @@ import { ServiceDefinition } from "babylonjs-node-render-graph-editor/modularToo
3254
3311
  import { IShellService } from "babylonjs-node-render-graph-editor/modularTool/services/shellService";
3255
3312
  export const ExtensionListServiceDefinition: ServiceDefinition<[], [IShellService]>;
3256
3313
 
3314
+ }
3315
+ declare module "babylonjs-node-render-graph-editor/modularTool/services/cli/protocol" {
3316
+ /**
3317
+ * Serializable description of a command argument, used in protocol messages.
3318
+ */
3319
+ export type CommandArgInfo = {
3320
+ /** The name of the argument. */
3321
+ name: string;
3322
+ /** A human-readable description of the argument. */
3323
+ description: string;
3324
+ /** Whether this argument is required. */
3325
+ required?: boolean;
3326
+ /** The type of the argument. Defaults to "string". When "file", the CLI reads the file and sends its contents. */
3327
+ type?: "string" | "file";
3328
+ };
3329
+ /**
3330
+ * Serializable description of a command, used in protocol messages.
3331
+ */
3332
+ export type CommandInfo = {
3333
+ /** A unique identifier for the command. */
3334
+ id: string;
3335
+ /** A human-readable description of the command. */
3336
+ description: string;
3337
+ /** The arguments this command accepts. */
3338
+ args?: CommandArgInfo[];
3339
+ };
3340
+ /**
3341
+ * Serializable description of a session, used in protocol messages.
3342
+ */
3343
+ export type SessionInfo = {
3344
+ /** The numeric session identifier. */
3345
+ id: number;
3346
+ /** The display name of the session. */
3347
+ name: string;
3348
+ /** ISO 8601 timestamp of when the session connected. */
3349
+ connectedAt: string;
3350
+ };
3351
+ /**
3352
+ * CLI → Bridge: Request the list of active browser sessions.
3353
+ */
3354
+ export type SessionsRequest = {
3355
+ /** The message type discriminator. */
3356
+ type: "sessions";
3357
+ };
3358
+ /**
3359
+ * CLI → Bridge: Request the list of commands available from a session.
3360
+ */
3361
+ export type CommandsRequest = {
3362
+ /** The message type discriminator. */
3363
+ type: "commands";
3364
+ /** The session to query for commands. */
3365
+ sessionId: number;
3366
+ };
3367
+ /**
3368
+ * CLI → Bridge: Execute a command on a session.
3369
+ */
3370
+ export type ExecRequest = {
3371
+ /** The message type discriminator. */
3372
+ type: "exec";
3373
+ /** The session to execute the command on. */
3374
+ sessionId: number;
3375
+ /** The identifier of the command to execute. */
3376
+ commandId: string;
3377
+ /** Key-value pairs of arguments for the command. */
3378
+ args: Record<string, string>;
3379
+ };
3380
+ /**
3381
+ * CLI → Bridge: Stop the bridge process.
3382
+ */
3383
+ export type StopRequest = {
3384
+ /** The message type discriminator. */
3385
+ type: "stop";
3386
+ };
3387
+ /**
3388
+ * All messages that the CLI sends to the bridge.
3389
+ */
3390
+ export type CliRequest = SessionsRequest | CommandsRequest | ExecRequest | StopRequest;
3391
+ /**
3392
+ * Bridge → CLI: Response with the list of active sessions.
3393
+ */
3394
+ export type SessionsResponse = {
3395
+ /** The message type discriminator. */
3396
+ type: "sessionsResponse";
3397
+ /** The list of active sessions. */
3398
+ sessions: SessionInfo[];
3399
+ };
3400
+ /**
3401
+ * Bridge → CLI: Response with the list of commands from a session.
3402
+ */
3403
+ export type CommandsResponse = {
3404
+ /** The message type discriminator. */
3405
+ type: "commandsResponse";
3406
+ /** The list of available commands, if successful. */
3407
+ commands?: CommandInfo[];
3408
+ /** An error message, if the request failed. */
3409
+ error?: string;
3410
+ };
3411
+ /**
3412
+ * Bridge → CLI: Response with the result of a command execution.
3413
+ */
3414
+ export type ExecResponse = {
3415
+ /** The message type discriminator. */
3416
+ type: "execResponse";
3417
+ /** The result of the command execution, if successful. */
3418
+ result?: string;
3419
+ /** An error message, if the execution failed. */
3420
+ error?: string;
3421
+ };
3422
+ /**
3423
+ * Bridge → CLI: Acknowledgement that the bridge is stopping.
3424
+ */
3425
+ export type StopResponse = {
3426
+ /** The message type discriminator. */
3427
+ type: "stopResponse";
3428
+ /** Whether the bridge stopped successfully. */
3429
+ success: boolean;
3430
+ };
3431
+ /**
3432
+ * All messages that the bridge sends to the CLI.
3433
+ */
3434
+ export type CliResponse = SessionsResponse | CommandsResponse | ExecResponse | StopResponse;
3435
+ /**
3436
+ * Browser → Bridge: Register a new session.
3437
+ */
3438
+ export type RegisterRequest = {
3439
+ /** The message type discriminator. */
3440
+ type: "register";
3441
+ /** The display name for this session. */
3442
+ name: string;
3443
+ };
3444
+ /**
3445
+ * Browser → Bridge: Response to a listCommands request from the bridge.
3446
+ */
3447
+ export type CommandListResponse = {
3448
+ /** The message type discriminator. */
3449
+ type: "commandListResponse";
3450
+ /** The identifier of the original request. */
3451
+ requestId: string;
3452
+ /** The list of registered commands. */
3453
+ commands: CommandInfo[];
3454
+ };
3455
+ /**
3456
+ * Browser → Bridge: Response to an execCommand request from the bridge.
3457
+ */
3458
+ export type CommandResponse = {
3459
+ /** The message type discriminator. */
3460
+ type: "commandResponse";
3461
+ /** The identifier of the original request. */
3462
+ requestId: string;
3463
+ /** The result of the command execution, if successful. */
3464
+ result?: string;
3465
+ /** An error message, if the execution failed. */
3466
+ error?: string;
3467
+ };
3468
+ /**
3469
+ * Browser → Bridge: Response to a getInfo request from the bridge.
3470
+ */
3471
+ export type InfoResponse = {
3472
+ /** The message type discriminator. */
3473
+ type: "infoResponse";
3474
+ /** The identifier of the original request. */
3475
+ requestId: string;
3476
+ /** The current display name of the session. */
3477
+ name: string;
3478
+ };
3479
+ /**
3480
+ * All messages that the browser sends to the bridge.
3481
+ */
3482
+ export type BrowserRequest = RegisterRequest | CommandListResponse | CommandResponse | InfoResponse;
3483
+ /**
3484
+ * Bridge → Browser: Request the list of registered commands.
3485
+ */
3486
+ export type ListCommandsRequest = {
3487
+ /** The message type discriminator. */
3488
+ type: "listCommands";
3489
+ /** A unique identifier for this request. */
3490
+ requestId: string;
3491
+ };
3492
+ /**
3493
+ * Bridge → Browser: Request execution of a command.
3494
+ */
3495
+ export type ExecCommandRequest = {
3496
+ /** The message type discriminator. */
3497
+ type: "execCommand";
3498
+ /** A unique identifier for this request. */
3499
+ requestId: string;
3500
+ /** The identifier of the command to execute. */
3501
+ commandId: string;
3502
+ /** Key-value pairs of arguments for the command. */
3503
+ args: Record<string, string>;
3504
+ };
3505
+ /**
3506
+ * Bridge → Browser: Request current session information.
3507
+ */
3508
+ export type GetInfoRequest = {
3509
+ /** The message type discriminator. */
3510
+ type: "getInfo";
3511
+ /** A unique identifier for this request. */
3512
+ requestId: string;
3513
+ };
3514
+ /**
3515
+ * All messages that the bridge sends to the browser.
3516
+ */
3517
+ export type BrowserResponse = ListCommandsRequest | ExecCommandRequest | GetInfoRequest;
3518
+
3519
+ }
3520
+ declare module "babylonjs-node-render-graph-editor/modularTool/services/cli/bridgeService" {
3521
+ import { ServiceDefinition } from "babylonjs-node-render-graph-editor/modularTool/modularity/serviceDefinition";
3522
+ import { ICliConnectionStatus } from "babylonjs-node-render-graph-editor/modularTool/services/cli/bridgeConnectionStatus";
3523
+ import { IBridgeCommandRegistry } from "babylonjs-node-render-graph-editor/modularTool/services/cli/bridgeCommandRegistry";
3524
+ /**
3525
+ * Options for the CLI bridge service.
3526
+ * @experimental
3527
+ * @internal
3528
+ */
3529
+ export type BridgeServiceOptions = {
3530
+ /**
3531
+ * The WebSocket port for the bridge's browser port.
3532
+ */
3533
+ port: number;
3534
+ /**
3535
+ * The session display name sent to the bridge.
3536
+ * Can be a getter to provide a dynamic value that is re-read
3537
+ * each time the bridge queries session information.
3538
+ */
3539
+ name: string;
3540
+ /**
3541
+ * Whether to automatically start connecting when the service is created.
3542
+ */
3543
+ autoStart: boolean;
3544
+ };
3545
+ /**
3546
+ * Creates the service definition for the CLI Bridge Service.
3547
+ * @param options The options for connecting to the bridge.
3548
+ * @returns A service definition that produces an IBridgeCommandRegistry and ICliConnectionStatus.
3549
+ * @experimental
3550
+ * @internal
3551
+ */
3552
+ export function MakeBridgeServiceDefinition(options: BridgeServiceOptions): ServiceDefinition<[IBridgeCommandRegistry, ICliConnectionStatus], []>;
3553
+
3554
+ }
3555
+ declare module "babylonjs-node-render-graph-editor/modularTool/services/cli/bridgeConnectionStatus" {
3556
+ import { IReadonlyObservable } from "babylonjs/index";
3557
+ import { IService } from "babylonjs-node-render-graph-editor/modularTool/modularity/serviceDefinition";
3558
+ /**
3559
+ * The service identity for the CLI connection status.
3560
+ * @experimental
3561
+ * @internal
3562
+ */
3563
+ export const CliConnectionStatusIdentity: unique symbol;
3564
+ /**
3565
+ * Provides the connection status and enable/disable control for the CLI bridge.
3566
+ * @experimental
3567
+ * @internal
3568
+ */
3569
+ export interface ICliConnectionStatus extends IService<typeof CliConnectionStatusIdentity> {
3570
+ /**
3571
+ * Whether the bridge is enabled. When true, the bridge actively tries to
3572
+ * maintain a WebSocket connection. When false, the bridge is disconnected
3573
+ * and idle.
3574
+ */
3575
+ isEnabled: boolean;
3576
+ /**
3577
+ * Whether the bridge WebSocket is currently connected.
3578
+ */
3579
+ readonly isConnected: boolean;
3580
+ /**
3581
+ * Observable that fires when either {@link isEnabled} or {@link isConnected} changes.
3582
+ */
3583
+ readonly onConnectionStatusChanged: IReadonlyObservable<void>;
3584
+ }
3585
+
3586
+ }
3587
+ declare module "babylonjs-node-render-graph-editor/modularTool/services/cli/bridgeCommandRegistry" {
3588
+ import { IDisposable } from "babylonjs/index";
3589
+ import { IService } from "babylonjs-node-render-graph-editor/modularTool/modularity/serviceDefinition";
3590
+ /**
3591
+ * The type of a bridge command argument, which determines how
3592
+ * the CLI processes the value before sending it to the browser.
3593
+ * @experimental
3594
+ * @internal
3595
+ */
3596
+ export type BridgeCommandArgType = "string" | "file";
3597
+ /**
3598
+ * Describes an argument for a bridge command.
3599
+ * @experimental
3600
+ * @internal
3601
+ */
3602
+ export type BridgeCommandArg = {
3603
+ /**
3604
+ * The name of the argument.
3605
+ */
3606
+ name: string;
3607
+ /**
3608
+ * A description of the argument.
3609
+ */
3610
+ description: string;
3611
+ /**
3612
+ * Whether the argument is required.
3613
+ */
3614
+ required?: boolean;
3615
+ /**
3616
+ * The type of the argument. Defaults to "string".
3617
+ * When set to "file", the CLI reads the file at the given path
3618
+ * and passes its contents as the argument value.
3619
+ */
3620
+ type?: BridgeCommandArgType;
3621
+ };
3622
+ /**
3623
+ * Describes a command that can be invoked from the bridge.
3624
+ * @experimental
3625
+ * @internal
3626
+ */
3627
+ export type BridgeCommandDescriptor = {
3628
+ /**
3629
+ * A unique identifier for the command.
3630
+ */
3631
+ id: string;
3632
+ /**
3633
+ * A human-readable description of what the command does.
3634
+ */
3635
+ description: string;
3636
+ /**
3637
+ * The arguments that this command accepts.
3638
+ */
3639
+ args?: BridgeCommandArg[];
3640
+ /**
3641
+ * Executes the command with the given arguments and returns a result string.
3642
+ * @param args A map of argument names to their values.
3643
+ * @returns A promise that resolves to the result string.
3644
+ */
3645
+ executeAsync: (args: Record<string, string>) => Promise<string>;
3646
+ };
3647
+ /**
3648
+ * The service identity for the bridge command registry.
3649
+ * @experimental
3650
+ * @internal
3651
+ */
3652
+ export const BridgeCommandRegistryIdentity: unique symbol;
3653
+ /**
3654
+ * A registry for commands that can be invoked from the bridge.
3655
+ * @experimental
3656
+ * @internal
3657
+ */
3658
+ export interface IBridgeCommandRegistry extends IService<typeof BridgeCommandRegistryIdentity> {
3659
+ /**
3660
+ * Registers a command that can be invoked from the bridge.
3661
+ * @param descriptor The command descriptor.
3662
+ * @returns A disposable token that unregisters the command when disposed.
3663
+ */
3664
+ addCommand(descriptor: BridgeCommandDescriptor): IDisposable;
3665
+ }
3666
+
3257
3667
  }
3258
3668
  declare module "babylonjs-node-render-graph-editor/modularTool/modularity/serviceDefinition" {
3259
3669
  import { IDisposable } from "babylonjs/index";
@@ -3278,14 +3688,13 @@ type ExtractContractIdentities<ServiceContracts extends IService<symbol>[]> = {
3278
3688
  [Index in keyof ServiceContracts]: ExtractContractIdentity<ServiceContracts[Index]>;
3279
3689
  };
3280
3690
  type UnionToIntersection<Union> = (Union extends any ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
3281
- type MaybePromise<T> = T | Promise<T>;
3282
3691
  /**
3283
3692
  * A factory function responsible for creating a service instance.
3284
3693
  * Consumed services are passed as arguments to the factory function.
3285
- * The returned value must implement all produced services, and may IDisposable.
3286
- * If not services are produced, the returned value may implement IDisposable, otherwise it may return void.
3694
+ * The returned value must implement all produced services, and may implement IDisposable.
3695
+ * If no services are produced, the returned value may implement IDisposable, otherwise it may return void.
3287
3696
  */
3288
- export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes, abortSignal?: AbortSignal]) => MaybePromise<Produces extends [] ? Partial<IDisposable> | void : Partial<IDisposable> & UnionToIntersection<Produces[number]>>;
3697
+ export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes]) => Produces extends [] ? Partial<IDisposable> | void : Partial<IDisposable> & UnionToIntersection<Produces[number]>;
3289
3698
  /**
3290
3699
  * Defines a service, which is a logical unit that consumes other services (dependencies), and optionally produces services that can be consumed by other services (dependents).
3291
3700
  */
@@ -3351,20 +3760,19 @@ export class ServiceContainer implements IDisposable {
3351
3760
  */
3352
3761
  constructor(_friendlyName: string, _parent?: ServiceContainer | undefined);
3353
3762
  /**
3354
- * Adds a set of service definitions in the service container.
3763
+ * Adds a set of service definitions to the service container.
3355
3764
  * The services are sorted based on their dependencies.
3356
- * @param args The service definitions to register, and optionally an abort signal.
3357
- * @returns A disposable that will remove the service definition from the service container.
3765
+ * @param serviceDefinitions The service definitions to register.
3766
+ * @returns A disposable that will remove the service definitions from the service container.
3358
3767
  */
3359
- addServicesAsync(...args: WeaklyTypedServiceDefinition[] | [...serviceDefinitions: WeaklyTypedServiceDefinition[], abortSignal: AbortSignal]): Promise<IDisposable>;
3768
+ addServices(...serviceDefinitions: WeaklyTypedServiceDefinition[]): IDisposable;
3360
3769
  /**
3361
3770
  * Registers a service definition in the service container.
3362
3771
  * @param serviceDefinition The service definition to register.
3363
- * @param abortSignal An optional abort signal.
3364
3772
  * @returns A disposable that will remove the service definition from the service container.
3365
3773
  */
3366
- addServiceAsync<Produces extends IService<symbol>[] = [], Consumes extends IService<symbol>[] = []>(serviceDefinition: ServiceDefinition<Produces, Consumes>, abortSignal?: AbortSignal): Promise<IDisposable>;
3367
- private _addServiceAsync;
3774
+ addService<Produces extends IService<symbol>[] = [], Consumes extends IService<symbol>[] = []>(serviceDefinition: ServiceDefinition<Produces, Consumes>): IDisposable;
3775
+ private _addService;
3368
3776
  /**
3369
3777
  * Resolves a dependency by contract identity for a consuming service.
3370
3778
  * Checks local services first, then walks up the parent chain.
@@ -10555,7 +10963,69 @@ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
10555
10963
  * @param options The options for the tool.
10556
10964
  * @returns A token that can be used to dispose of the tool.
10557
10965
  */
10558
- export function MakeModularTool(options: ModularToolOptions): BABYLON.IDisposable;
10966
+ export function MakeModularTool(options: ModularToolOptions): {
10967
+ dispose: () => Promise<void>;
10968
+ };
10969
+
10970
+
10971
+
10972
+ }
10973
+ declare namespace BABYLON.NodeRenderGraphEditor {
10974
+
10975
+
10976
+ }
10977
+ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
10978
+ /**
10979
+ * Options for creating a modular bridge container.
10980
+ * @experimental
10981
+ * @internal
10982
+ */
10983
+ export type ModularBridgeOptions = {
10984
+ /**
10985
+ * WebSocket port for the bridge's browser port. Defaults to 4400.
10986
+ */
10987
+ port?: number;
10988
+ /**
10989
+ * Session display name reported to the bridge. Defaults to `document.title`.
10990
+ */
10991
+ name?: string;
10992
+ /**
10993
+ * Whether the bridge should automatically start trying to connect.
10994
+ * Defaults to false.
10995
+ */
10996
+ autoStart?: boolean;
10997
+ /**
10998
+ * Additional service definitions to register with the bridge container.
10999
+ */
11000
+ serviceDefinitions?: readonly BABYLON.NodeRenderGraphEditor.SharedUIComponents.WeaklyTypedServiceDefinition[];
11001
+ };
11002
+ /**
11003
+ * A token returned by {@link MakeModularBridge} that owns the headless
11004
+ * {@link BABYLON.NodeRenderGraphEditor.SharedUIComponents.ServiceContainer}. Dispose it to tear down the bridge and all services.
11005
+ * @experimental
11006
+ * @internal
11007
+ */
11008
+ export type ModularBridgeToken = BABYLON.IDisposable & {
11009
+ /**
11010
+ * The headless BABYLON.NodeRenderGraphEditor.SharedUIComponents.ServiceContainer that hosts the bridge.
11011
+ */
11012
+ readonly serviceContainer: BABYLON.NodeRenderGraphEditor.SharedUIComponents.ServiceContainer;
11013
+ /**
11014
+ * Whether this token has been disposed.
11015
+ */
11016
+ readonly isDisposed: boolean;
11017
+ };
11018
+ /**
11019
+ * Creates a headless {@link BABYLON.NodeRenderGraphEditor.SharedUIComponents.ServiceContainer} that hosts a bridge service.
11020
+ *
11021
+ * The returned token owns the container. Dispose it to tear down the bridge.
11022
+ *
11023
+ * @param options Optional configuration for the bridge.
11024
+ * @returns A {@link ModularBridgeToken} that owns the container.
11025
+ * @experimental
11026
+ * @internal
11027
+ */
11028
+ export function MakeModularBridge(options?: ModularBridgeOptions): ModularBridgeToken;
10559
11029
 
10560
11030
 
10561
11031
 
@@ -11075,6 +11545,376 @@ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
11075
11545
 
11076
11546
 
11077
11547
 
11548
+ }
11549
+ declare namespace BABYLON.NodeRenderGraphEditor {
11550
+
11551
+
11552
+ }
11553
+ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
11554
+ /**
11555
+ * Serializable description of a command argument, used in protocol messages.
11556
+ */
11557
+ export type CommandArgInfo = {
11558
+ /** The name of the argument. */
11559
+ name: string;
11560
+ /** A human-readable description of the argument. */
11561
+ description: string;
11562
+ /** Whether this argument is required. */
11563
+ required?: boolean;
11564
+ /** The type of the argument. Defaults to "string". When "file", the CLI reads the file and sends its contents. */
11565
+ type?: "string" | "file";
11566
+ };
11567
+ /**
11568
+ * Serializable description of a command, used in protocol messages.
11569
+ */
11570
+ export type CommandInfo = {
11571
+ /** A unique identifier for the command. */
11572
+ id: string;
11573
+ /** A human-readable description of the command. */
11574
+ description: string;
11575
+ /** The arguments this command accepts. */
11576
+ args?: CommandArgInfo[];
11577
+ };
11578
+ /**
11579
+ * Serializable description of a session, used in protocol messages.
11580
+ */
11581
+ export type SessionInfo = {
11582
+ /** The numeric session identifier. */
11583
+ id: number;
11584
+ /** The display name of the session. */
11585
+ name: string;
11586
+ /** ISO 8601 timestamp of when the session connected. */
11587
+ connectedAt: string;
11588
+ };
11589
+ /**
11590
+ * CLI → Bridge: Request the list of active browser sessions.
11591
+ */
11592
+ export type SessionsRequest = {
11593
+ /** The message type discriminator. */
11594
+ type: "sessions";
11595
+ };
11596
+ /**
11597
+ * CLI → Bridge: Request the list of commands available from a session.
11598
+ */
11599
+ export type CommandsRequest = {
11600
+ /** The message type discriminator. */
11601
+ type: "commands";
11602
+ /** The session to query for commands. */
11603
+ sessionId: number;
11604
+ };
11605
+ /**
11606
+ * CLI → Bridge: Execute a command on a session.
11607
+ */
11608
+ export type ExecRequest = {
11609
+ /** The message type discriminator. */
11610
+ type: "exec";
11611
+ /** The session to execute the command on. */
11612
+ sessionId: number;
11613
+ /** The identifier of the command to execute. */
11614
+ commandId: string;
11615
+ /** Key-value pairs of arguments for the command. */
11616
+ args: Record<string, string>;
11617
+ };
11618
+ /**
11619
+ * CLI → Bridge: Stop the bridge process.
11620
+ */
11621
+ export type StopRequest = {
11622
+ /** The message type discriminator. */
11623
+ type: "stop";
11624
+ };
11625
+ /**
11626
+ * All messages that the CLI sends to the bridge.
11627
+ */
11628
+ export type CliRequest = SessionsRequest | CommandsRequest | ExecRequest | StopRequest;
11629
+ /**
11630
+ * Bridge → CLI: Response with the list of active sessions.
11631
+ */
11632
+ export type SessionsResponse = {
11633
+ /** The message type discriminator. */
11634
+ type: "sessionsResponse";
11635
+ /** The list of active sessions. */
11636
+ sessions: SessionInfo[];
11637
+ };
11638
+ /**
11639
+ * Bridge → CLI: Response with the list of commands from a session.
11640
+ */
11641
+ export type CommandsResponse = {
11642
+ /** The message type discriminator. */
11643
+ type: "commandsResponse";
11644
+ /** The list of available commands, if successful. */
11645
+ commands?: CommandInfo[];
11646
+ /** An error message, if the request failed. */
11647
+ error?: string;
11648
+ };
11649
+ /**
11650
+ * Bridge → CLI: Response with the result of a command execution.
11651
+ */
11652
+ export type ExecResponse = {
11653
+ /** The message type discriminator. */
11654
+ type: "execResponse";
11655
+ /** The result of the command execution, if successful. */
11656
+ result?: string;
11657
+ /** An error message, if the execution failed. */
11658
+ error?: string;
11659
+ };
11660
+ /**
11661
+ * Bridge → CLI: Acknowledgement that the bridge is stopping.
11662
+ */
11663
+ export type StopResponse = {
11664
+ /** The message type discriminator. */
11665
+ type: "stopResponse";
11666
+ /** Whether the bridge stopped successfully. */
11667
+ success: boolean;
11668
+ };
11669
+ /**
11670
+ * All messages that the bridge sends to the CLI.
11671
+ */
11672
+ export type CliResponse = SessionsResponse | CommandsResponse | ExecResponse | StopResponse;
11673
+ /**
11674
+ * Browser → Bridge: Register a new session.
11675
+ */
11676
+ export type RegisterRequest = {
11677
+ /** The message type discriminator. */
11678
+ type: "register";
11679
+ /** The display name for this session. */
11680
+ name: string;
11681
+ };
11682
+ /**
11683
+ * Browser → Bridge: Response to a listCommands request from the bridge.
11684
+ */
11685
+ export type CommandListResponse = {
11686
+ /** The message type discriminator. */
11687
+ type: "commandListResponse";
11688
+ /** The identifier of the original request. */
11689
+ requestId: string;
11690
+ /** The list of registered commands. */
11691
+ commands: CommandInfo[];
11692
+ };
11693
+ /**
11694
+ * Browser → Bridge: Response to an execCommand request from the bridge.
11695
+ */
11696
+ export type CommandResponse = {
11697
+ /** The message type discriminator. */
11698
+ type: "commandResponse";
11699
+ /** The identifier of the original request. */
11700
+ requestId: string;
11701
+ /** The result of the command execution, if successful. */
11702
+ result?: string;
11703
+ /** An error message, if the execution failed. */
11704
+ error?: string;
11705
+ };
11706
+ /**
11707
+ * Browser → Bridge: Response to a getInfo request from the bridge.
11708
+ */
11709
+ export type InfoResponse = {
11710
+ /** The message type discriminator. */
11711
+ type: "infoResponse";
11712
+ /** The identifier of the original request. */
11713
+ requestId: string;
11714
+ /** The current display name of the session. */
11715
+ name: string;
11716
+ };
11717
+ /**
11718
+ * All messages that the browser sends to the bridge.
11719
+ */
11720
+ export type BrowserRequest = RegisterRequest | CommandListResponse | CommandResponse | InfoResponse;
11721
+ /**
11722
+ * Bridge → Browser: Request the list of registered commands.
11723
+ */
11724
+ export type ListCommandsRequest = {
11725
+ /** The message type discriminator. */
11726
+ type: "listCommands";
11727
+ /** A unique identifier for this request. */
11728
+ requestId: string;
11729
+ };
11730
+ /**
11731
+ * Bridge → Browser: Request execution of a command.
11732
+ */
11733
+ export type ExecCommandRequest = {
11734
+ /** The message type discriminator. */
11735
+ type: "execCommand";
11736
+ /** A unique identifier for this request. */
11737
+ requestId: string;
11738
+ /** The identifier of the command to execute. */
11739
+ commandId: string;
11740
+ /** Key-value pairs of arguments for the command. */
11741
+ args: Record<string, string>;
11742
+ };
11743
+ /**
11744
+ * Bridge → Browser: Request current session information.
11745
+ */
11746
+ export type GetInfoRequest = {
11747
+ /** The message type discriminator. */
11748
+ type: "getInfo";
11749
+ /** A unique identifier for this request. */
11750
+ requestId: string;
11751
+ };
11752
+ /**
11753
+ * All messages that the bridge sends to the browser.
11754
+ */
11755
+ export type BrowserResponse = ListCommandsRequest | ExecCommandRequest | GetInfoRequest;
11756
+
11757
+
11758
+
11759
+ }
11760
+ declare namespace BABYLON.NodeRenderGraphEditor {
11761
+
11762
+
11763
+ }
11764
+ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
11765
+ /**
11766
+ * Options for the CLI bridge service.
11767
+ * @experimental
11768
+ * @internal
11769
+ */
11770
+ export type BridgeServiceOptions = {
11771
+ /**
11772
+ * The WebSocket port for the bridge's browser port.
11773
+ */
11774
+ port: number;
11775
+ /**
11776
+ * The session display name sent to the bridge.
11777
+ * Can be a getter to provide a dynamic value that is re-read
11778
+ * each time the bridge queries session information.
11779
+ */
11780
+ name: string;
11781
+ /**
11782
+ * Whether to automatically start connecting when the service is created.
11783
+ */
11784
+ autoStart: boolean;
11785
+ };
11786
+ /**
11787
+ * Creates the service definition for the CLI Bridge Service.
11788
+ * @param options The options for connecting to the bridge.
11789
+ * @returns A service definition that produces an BABYLON.NodeRenderGraphEditor.SharedUIComponents.IBridgeCommandRegistry and BABYLON.NodeRenderGraphEditor.SharedUIComponents.ICliConnectionStatus.
11790
+ * @experimental
11791
+ * @internal
11792
+ */
11793
+ export function MakeBridgeServiceDefinition(options: BridgeServiceOptions): BABYLON.NodeRenderGraphEditor.SharedUIComponents.ServiceDefinition<[IBridgeCommandRegistry, BABYLON.NodeRenderGraphEditor.SharedUIComponents.ICliConnectionStatus], []>;
11794
+
11795
+
11796
+
11797
+ }
11798
+ declare namespace BABYLON.NodeRenderGraphEditor {
11799
+
11800
+
11801
+ }
11802
+ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
11803
+ /**
11804
+ * The service identity for the CLI connection status.
11805
+ * @experimental
11806
+ * @internal
11807
+ */
11808
+ export var CliConnectionStatusIdentity: unique symbol;
11809
+ /**
11810
+ * Provides the connection status and enable/disable control for the CLI bridge.
11811
+ * @experimental
11812
+ * @internal
11813
+ */
11814
+ export interface ICliConnectionStatus extends BABYLON.NodeRenderGraphEditor.SharedUIComponents.IService<typeof CliConnectionStatusIdentity> {
11815
+ /**
11816
+ * Whether the bridge is enabled. When true, the bridge actively tries to
11817
+ * maintain a WebSocket connection. When false, the bridge is disconnected
11818
+ * and idle.
11819
+ */
11820
+ isEnabled: boolean;
11821
+ /**
11822
+ * Whether the bridge WebSocket is currently connected.
11823
+ */
11824
+ readonly isConnected: boolean;
11825
+ /**
11826
+ * Observable that fires when either {@link isEnabled} or {@link isConnected} changes.
11827
+ */
11828
+ readonly onConnectionStatusChanged: BABYLON.IReadonlyObservable<void>;
11829
+ }
11830
+
11831
+
11832
+
11833
+ }
11834
+ declare namespace BABYLON.NodeRenderGraphEditor {
11835
+
11836
+
11837
+ }
11838
+ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
11839
+ /**
11840
+ * The type of a bridge command argument, which determines how
11841
+ * the CLI processes the value before sending it to the browser.
11842
+ * @experimental
11843
+ * @internal
11844
+ */
11845
+ export type BridgeCommandArgType = "string" | "file";
11846
+ /**
11847
+ * Describes an argument for a bridge command.
11848
+ * @experimental
11849
+ * @internal
11850
+ */
11851
+ export type BridgeCommandArg = {
11852
+ /**
11853
+ * The name of the argument.
11854
+ */
11855
+ name: string;
11856
+ /**
11857
+ * A description of the argument.
11858
+ */
11859
+ description: string;
11860
+ /**
11861
+ * Whether the argument is required.
11862
+ */
11863
+ required?: boolean;
11864
+ /**
11865
+ * The type of the argument. Defaults to "string".
11866
+ * When set to "file", the CLI reads the file at the given path
11867
+ * and passes its contents as the argument value.
11868
+ */
11869
+ type?: BridgeCommandArgType;
11870
+ };
11871
+ /**
11872
+ * Describes a command that can be invoked from the bridge.
11873
+ * @experimental
11874
+ * @internal
11875
+ */
11876
+ export type BridgeCommandDescriptor = {
11877
+ /**
11878
+ * A unique identifier for the command.
11879
+ */
11880
+ id: string;
11881
+ /**
11882
+ * A human-readable description of what the command does.
11883
+ */
11884
+ description: string;
11885
+ /**
11886
+ * The arguments that this command accepts.
11887
+ */
11888
+ args?: BridgeCommandArg[];
11889
+ /**
11890
+ * Executes the command with the given arguments and returns a result string.
11891
+ * @param args A map of argument names to their values.
11892
+ * @returns A promise that resolves to the result string.
11893
+ */
11894
+ executeAsync: (args: Record<string, string>) => Promise<string>;
11895
+ };
11896
+ /**
11897
+ * The service identity for the bridge command registry.
11898
+ * @experimental
11899
+ * @internal
11900
+ */
11901
+ export var BridgeCommandRegistryIdentity: unique symbol;
11902
+ /**
11903
+ * A registry for commands that can be invoked from the bridge.
11904
+ * @experimental
11905
+ * @internal
11906
+ */
11907
+ export interface IBridgeCommandRegistry extends BABYLON.NodeRenderGraphEditor.SharedUIComponents.IService<typeof BridgeCommandRegistryIdentity> {
11908
+ /**
11909
+ * Registers a command that can be invoked from the bridge.
11910
+ * @param descriptor The command descriptor.
11911
+ * @returns A disposable token that unregisters the command when disposed.
11912
+ */
11913
+ addCommand(descriptor: BridgeCommandDescriptor): BABYLON.IDisposable;
11914
+ }
11915
+
11916
+
11917
+
11078
11918
  }
11079
11919
  declare namespace BABYLON.NodeRenderGraphEditor {
11080
11920
 
@@ -11102,14 +11942,13 @@ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
11102
11942
  [Index in keyof ServiceContracts]: ExtractContractIdentity<ServiceContracts[Index]>;
11103
11943
  };
11104
11944
  type UnionToIntersection<Union> = (Union extends any ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
11105
- type MaybePromise<T> = T | Promise<T>;
11106
11945
  /**
11107
11946
  * A factory function responsible for creating a service instance.
11108
11947
  * Consumed services are passed as arguments to the factory function.
11109
- * The returned value must implement all produced services, and may BABYLON.IDisposable.
11110
- * If not services are produced, the returned value may implement BABYLON.IDisposable, otherwise it may return void.
11948
+ * The returned value must implement all produced services, and may implement BABYLON.IDisposable.
11949
+ * If no services are produced, the returned value may implement BABYLON.IDisposable, otherwise it may return void.
11111
11950
  */
11112
- export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes, abortSignal?: AbortSignal]) => MaybePromise<Produces extends [] ? Partial<BABYLON.IDisposable> | void : Partial<BABYLON.IDisposable> & UnionToIntersection<Produces[number]>>;
11951
+ export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes]) => Produces extends [] ? Partial<BABYLON.IDisposable> | void : Partial<BABYLON.IDisposable> & UnionToIntersection<Produces[number]>;
11113
11952
  /**
11114
11953
  * Defines a service, which is a logical unit that consumes other services (dependencies), and optionally produces services that can be consumed by other services (dependents).
11115
11954
  */
@@ -11178,20 +12017,19 @@ declare namespace BABYLON.NodeRenderGraphEditor.SharedUIComponents {
11178
12017
  */
11179
12018
  constructor(_friendlyName: string, _parent?: ServiceContainer | undefined);
11180
12019
  /**
11181
- * Adds a set of service definitions in the service container.
12020
+ * Adds a set of service definitions to the service container.
11182
12021
  * The services are sorted based on their dependencies.
11183
- * @param args The service definitions to register, and optionally an abort signal.
11184
- * @returns A disposable that will remove the service definition from the service container.
12022
+ * @param serviceDefinitions The service definitions to register.
12023
+ * @returns A disposable that will remove the service definitions from the service container.
11185
12024
  */
11186
- addServicesAsync(...args: WeaklyTypedServiceDefinition[] | [...serviceDefinitions: WeaklyTypedServiceDefinition[], abortSignal: AbortSignal]): Promise<BABYLON.IDisposable>;
12025
+ addServices(...serviceDefinitions: WeaklyTypedServiceDefinition[]): BABYLON.IDisposable;
11187
12026
  /**
11188
12027
  * Registers a service definition in the service container.
11189
12028
  * @param serviceDefinition The service definition to register.
11190
- * @param abortSignal An optional abort signal.
11191
12029
  * @returns A disposable that will remove the service definition from the service container.
11192
12030
  */
11193
- addServiceAsync<Produces extends BABYLON.NodeRenderGraphEditor.SharedUIComponents.IService<symbol>[] = [], Consumes extends BABYLON.NodeRenderGraphEditor.SharedUIComponents.IService<symbol>[] = []>(serviceDefinition: BABYLON.NodeRenderGraphEditor.SharedUIComponents.ServiceDefinition<Produces, Consumes>, abortSignal?: AbortSignal): Promise<BABYLON.IDisposable>;
11194
- private _addServiceAsync;
12031
+ addService<Produces extends BABYLON.NodeRenderGraphEditor.SharedUIComponents.IService<symbol>[] = [], Consumes extends BABYLON.NodeRenderGraphEditor.SharedUIComponents.IService<symbol>[] = []>(serviceDefinition: BABYLON.NodeRenderGraphEditor.SharedUIComponents.ServiceDefinition<Produces, Consumes>): BABYLON.IDisposable;
12032
+ private _addService;
11195
12033
  /**
11196
12034
  * Resolves a dependency by contract identity for a consuming service.
11197
12035
  * Checks local services first, then walks up the parent chain.