// src/engine/remoting/IIntrospectResult.ts

import type { IMethodSchemaInfo } from './IMethodSchemaInfo';
import type { IEventSchemaInfo } from './IEventSchemaInfo';
import type {
  IActionAffordance,
  IEventAffordance,
  IPropertyAffordance,
  ISemanticAnnotations,
  ILocalityInfo,
} from '../../core/composite/IIntrospectableComponent';

/**
 * Introspect result from a component.
 * Supports WoT-style metadata for multi-protocol discovery.
 * @see COMPONENT-COMMON.md, MATRIX-PROTOCOL-3 §21.5
 */
export interface IIntrospectResult {
  // Core identification
  mount: string;
  componentClass: string;
  accepts: string[];
  emits: string[];
  acceptsSchema: Record<string, IMethodSchemaInfo>;
  emitsSchema: Record<string, IEventSchemaInfo>;
  shellTag?: string;
  moduleUrl?: string;
  children?: IIntrospectResult[];

  // WoT extensions (optional)
  '@context'?: string | string[];
  '@type'?: string | string[];
  title?: string;
  description?: string;
  implements?: string[];
  semantics?: ISemanticAnnotations;
  actions?: Record<string, IActionAffordance>;
  events?: Record<string, IEventAffordance>;
  properties?: Record<string, IPropertyAffordance>;
  locality?: ILocalityInfo;

  // Allow additional fields
  [key: string]: unknown;
}
