/** * MPLP Protocol v1.0.0 — Frozen Specification * Freeze Date: 2025-12-03 * Status: FROZEN (no breaking changes permitted) * Governance: MPLP Protocol Governance Committee (MPGC) * * © 2026 Jearon Wong. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * http://www.apache.org/licenses/LICENSE-2.0 */ /** * Convenience helper event interface used by this coordination package. * It is not a direct mirror of the canonical protocol event schemas. */ export interface MplpEvent { /** Event type identifier (e.g., "context.created", "plan.approved") */ type: string; /** ISO 8601 timestamp when event was created */ timestamp: string; /** Run identifier this event belongs to */ runId: string; /** Optional module that emitted the event */ module?: string; /** Event payload data */ payload?: Record; } /** * Convenience helper contract used to describe coordination flows in this package. * It is derived from protocol-aligned types and is not a protocol SSOT object. */ export interface FlowContract { id: string; name: string; description?: string; version: string; modules: string[]; } /** * Single Agent Flow output structure. */ export interface SingleAgentFlowOutput { context: Record; plan: Record; confirm: Record; trace: Record; } /** * Convenience single-agent flow helper contract for this package. */ export declare const SingleAgentFlowContract: FlowContract; /** * Module handler context passed to each module during flow execution. */ export interface ModuleHandlerContext { context?: Record; plan?: Record; confirm?: Record; trace?: Record; role?: Record; extension?: Record; dialog?: Record; collab?: Record; core?: Record; network?: Record; } /** Runtime coordination state alias consumed by downstream runtime helpers. */ export type CoordinationContext = ModuleHandlerContext & { ids?: { runId?: string; projectId?: string; correlationId?: string; }; metadata?: Record; }; /** * Module handler result returned by each module. */ export interface ModuleHandlerResult { output: T; events?: MplpEvent[]; } /** Context module handler type. */ export type ContextModuleHandler = (params: { ctx: ModuleHandlerContext; }) => Promise; }>>; /** Plan module handler type. */ export type PlanModuleHandler = (params: { ctx: ModuleHandlerContext; }) => Promise; }>>; /** Confirm module handler type. */ export type ConfirmModuleHandler = (params: { ctx: ModuleHandlerContext; }) => Promise; }>>; /** Trace module handler type. */ export type TraceModuleHandler = (params: { ctx: ModuleHandlerContext; }) => Promise; }>>; /** Role module handler type. */ export type RoleModuleHandler = ModuleHandler<{ role: Record; }>; /** Extension module handler type. */ export type ExtensionModuleHandler = ModuleHandler<{ extension: Record; }>; /** Dialog module handler type. */ export type DialogModuleHandler = ModuleHandler<{ dialog: Record; }>; /** Collab module handler type. */ export type CollabModuleHandler = ModuleHandler<{ collab: Record; }>; /** Core module handler type. */ export type CoreModuleHandler = ModuleHandler<{ core: Record; }>; /** Network module handler type. */ export type NetworkModuleHandler = ModuleHandler<{ network: Record; }>; /** Generic module handler type. */ export type ModuleHandler = (params: { ctx: ModuleHandlerContext; }) => Promise>; /** Create an MPLP event with current timestamp. */ export declare function createMplpEvent(type: string, runId: string, payload?: Record, module?: string): MplpEvent;