// src/runtime/RuntimeControl.ts

export interface ISpawnComponentOptions {
  /** Custom element tag, e.g. "app-root" or "x-worker". */
  tag: string;

  /**
   * Optional explicit mount for the new component.
   * If provided, LocalRuntimeControl will set it as the element's "mount"
   * attribute so MatrixRuntime uses it when deriving the child scope.
   */
  mount?: string;

  /** Arbitrary attributes / configuration for the element. */
  attributes?: Record<string, string>;
}

export interface ISpawnResult {
  mount: string;
}

/**
 * Abstract control plane interface for a Matrix runtime.
 */
export interface IRuntimeControl {
  readonly name: string;
  readonly mount: string;

  spawnComponent(opts: ISpawnComponentOptions): Promise<ISpawnResult>;
  destroyComponent(mount: string): Promise<void>;
}
