{"version":3,"file":"contextContributions.cjs","names":[],"sources":["../../src/schemas/contextContributions.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\n\n/** Session-scoped broker for bounded context rendered by optional Doom packages. */\nexport const DOOM_CONTEXT_CONTRIBUTIONS_SERVICE = 'doom/context-contributions';\n\nexport interface DoomContextContribution {\n  readonly source: string;\n  readonly id: string;\n  readonly label: string;\n  readonly order: number;\n  /** Returns provider-rendered, already-redacted text, or omits this contribution. */\n  snapshot(): string | undefined;\n}\n\nexport interface DoomContextContributionEntry {\n  readonly source: string;\n  readonly id: string;\n  readonly label: string;\n  readonly order: number;\n  readonly text: string;\n}\n\nexport interface DoomContextContributionError {\n  readonly source: string;\n  readonly id: string;\n  readonly label: string;\n  readonly order: number;\n  readonly message: string;\n}\n\nexport interface DoomContextContributionsSnapshot {\n  readonly entries: readonly DoomContextContributionEntry[];\n  readonly errors: readonly DoomContextContributionError[];\n}\n\nexport interface DoomContextContributionRegistration {\n  /** Removes the contribution. Repeated disposal is a no-op. */\n  dispose(): void;\n}\n\nexport interface DoomContextContributionsService {\n  /** Fences registrations and snapshots against a replaced Doom session. */\n  readonly generation: string;\n  register(contribution: DoomContextContribution): DoomContextContributionRegistration;\n  snapshot(): DoomContextContributionsSnapshot;\n}\n\ndeclare module '@deepseek-ai/cordis' {\n  interface Context {\n    'doom/context-contributions': DoomContextContributionsService;\n  }\n}\n\nexport function readDoomContextContributions(context: Context): DoomContextContributionsService | undefined {\n  return context.get(DOOM_CONTEXT_CONTRIBUTIONS_SERVICE) as DoomContextContributionsService | undefined;\n}\n\nexport function requireDoomContextContributions(context: Context): DoomContextContributionsService {\n  const service = readDoomContextContributions(context);\n  if (!service) throw new Error('Doom context contributions are unavailable. Start a Doom session first.');\n  return service;\n}\n"],"mappings":"AAGA,MAAa,EAAqC,6BAkDlD,SAAgB,EAA6B,EAA+D,CAC1G,OAAO,EAAQ,IAAI,CAAkC,CACvD,CAEA,SAAgB,EAAgC,EAAmD,CACjG,IAAM,EAAU,EAA6B,CAAO,EACpD,GAAI,CAAC,EAAS,MAAU,MAAM,yEAAyE,EACvG,OAAO,CACT"}