// Centralizes the type-only import of the shared `/chat` Socket.IO contract from // @mosaicstack/types' source. // // `apps/web` does not declare `@mosaicstack/types` as a package dependency (P3 scope // forbids editing package manifests/lockfiles), so these are type-only imports // resolved directly against the package source. `import type` is erased at compile // time, so no runtime dependency is introduced — this only reuses the exact payload // shapes instead of redeclaring them. // // This deliberately imports the narrow `chat/events` and `commands/index` entry // points rather than the package's full `src/index` barrel: the barrel also re-exports // class-validator/class-transformer decorated DTOs (chat.dto.ts, reflection.dto.ts, // connector-lease.dto.ts) that require compiler options apps/web's tsconfig does not // set, which breaks `tsc --noEmit` here even though only types are imported. import type { Socket } from 'socket.io-client'; import type { AbortPayload, AgentEndPayload, AgentStartPayload, AgentTextPayload, AgentThinkingPayload, ChatMessagePayload, ClientToServerEvents, ErrorPayload, MessageAckPayload, RoutingDecisionInfo, ServerToClientEvents, SessionInfoPayload, SessionUsagePayload, SetThinkingPayload, ToolEndPayload, ToolStartPayload, } from '../../../../packages/types/src/chat/events'; import type { CommandDef, CommandManifest, CommandManifestPayload, SkillCommandDef, SlashCommandApprovalResultPayload, SlashCommandPayload, SlashCommandResultPayload, SystemReloadPayload, } from '../../../../packages/types/src/commands/index'; export type { AbortPayload, AgentEndPayload, AgentStartPayload, AgentTextPayload, AgentThinkingPayload, ChatMessagePayload, ClientToServerEvents, CommandDef, CommandManifest, CommandManifestPayload, ErrorPayload, MessageAckPayload, RoutingDecisionInfo, ServerToClientEvents, SessionInfoPayload, SessionUsagePayload, SetThinkingPayload, SkillCommandDef, SlashCommandApprovalResultPayload, SlashCommandPayload, SlashCommandResultPayload, SystemReloadPayload, ToolEndPayload, ToolStartPayload, }; /** The `/chat` namespace socket, narrowed to the exact typed event contract. */ export type ChatSocket = Socket;