// src/core/actor/IBecomePayload.ts

import type { IMessageMeta } from './IMessageMeta';
import type { AcceptsDefinition } from './AcceptsDefinition';

/**
 * Payload for $become system command.
 *
 * Enables runtime behavior change via message passing.
 * Each handler is a function that takes payload and meta, returns Promise<unknown>.
 */
export interface IBecomePayload<TAccepts extends AcceptsDefinition = AcceptsDefinition> {
  handlers: Partial<{
    [K in keyof TAccepts]: (payload: TAccepts[K], meta: IMessageMeta) => Promise<unknown>
  }>;
}

/** @deprecated Use IBecomePayload instead */
export type BecomePayload<TAccepts extends AcceptsDefinition = AcceptsDefinition> = IBecomePayload<TAccepts>;
