{"version":3,"file":"loopLaunchers.mjs","names":[],"sources":["../../src/schemas/loopLaunchers.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\n\n/** Provider-owned Cordis service for session-scoped recurring-loop launchers. */\nexport const DOOM_LOOP_LAUNCHERS_SERVICE = 'doom/loop-launchers';\n\nexport interface LoopLaunchRequest {\n  readonly instanceId: string;\n  readonly signal: AbortSignal;\n}\n\nexport interface StoppableLoop {\n  readonly instanceId: string;\n  readonly label?: string;\n  readonly detail?: string;\n  stop(reason?: string): void | Promise<void>;\n}\n\nexport interface LoopLauncherSummary {\n  readonly id: string;\n  readonly source: string;\n  readonly label: string;\n  readonly description?: string;\n}\n\nexport interface LoopInstanceSnapshot {\n  readonly instanceId: string;\n  readonly launcherId: string;\n  readonly launcherLabel: string;\n  readonly label?: string;\n  readonly detail?: string;\n  readonly state: 'starting' | 'running' | 'stopping';\n  readonly startedAt?: string;\n}\n\nexport interface LoopLauncherDefinition extends LoopLauncherSummary {\n  launch(request: LoopLaunchRequest): Promise<StoppableLoop | undefined>;\n}\n\nexport interface LoopLauncherRegistration {\n  readonly id: string;\n  readonly generation: string;\n  dispose(reason?: string): Promise<void>;\n}\n\n/** Direct registrar/control seam owned and provided by doompi-loop. */\nexport interface DoomLoopLaunchersService {\n  readonly generation: string;\n  register(definition: LoopLauncherDefinition): LoopLauncherRegistration;\n  listLaunchers(): readonly LoopLauncherSummary[];\n  listInstances(): readonly LoopInstanceSnapshot[];\n  subscribe(listener: () => void): () => void;\n  launch(launcherId: string, options?: { instanceId?: string }): Promise<LoopInstanceSnapshot | undefined>;\n  stop(instanceId: string, reason?: string): Promise<boolean>;\n  stopAll(reason?: string): Promise<void>;\n  dispose(reason?: string): Promise<void>;\n}\n\ndeclare module '@deepseek-ai/cordis' {\n  interface Context {\n    'doom/loop-launchers': DoomLoopLaunchersService;\n  }\n}\n\nexport function readDoomLoopLaunchers(context: Context): DoomLoopLaunchersService | undefined {\n  return context.get(DOOM_LOOP_LAUNCHERS_SERVICE) as DoomLoopLaunchersService | undefined;\n}\n\nexport function requireDoomLoopLaunchers(context: Context): DoomLoopLaunchersService {\n  const service = readDoomLoopLaunchers(context);\n  if (!service) throw new Error('Doom loop launchers are unavailable. Load @agimon-ai/doompi-loop.');\n  return service;\n}\n"],"mappings":"AAGA,MAAa,EAA8B,sBA4D3C,SAAgB,EAAsB,EAAwD,CAC5F,OAAO,EAAQ,IAAI,CAA2B,CAChD,CAEA,SAAgB,EAAyB,EAA4C,CACnF,IAAM,EAAU,EAAsB,CAAO,EAC7C,GAAI,CAAC,EAAS,MAAU,MAAM,mEAAmE,EACjG,OAAO,CACT"}