{"version":3,"file":"index.cjs","names":["persistMcpConfig","BaseCommand"],"sources":["../../../../src/cli/commands/emit-mcp/index.ts"],"sourcesContent":["import { persistMcpConfig } from '@agimon-ai/doompi-domain/mcp';\n\nimport type { HarnessContext } from '../../../builders/cli/harnessContext';\nimport type { HarnessOptions } from '../../../composition/types/harness';\nimport { BaseCommand } from '../baseCommand';\n\n/**\n * Writes the resolved MCP config to a directory and exits.\n *\n * Lets claude.sh and codex.sh reuse the same domain-scoped MCP surface instead\n * of reimplementing the filter in shell.\n */\nexport async function runEmitMcp(context: HarnessContext): Promise<number> {\n  const { options, resources } = context;\n  if (!options.emitMcp) throw new Error('--emit-mcp requires a target directory');\n  if (!resources.mcpConfigPath) throw new Error('--emit-mcp requires MCP to be enabled');\n\n  const emitted = await persistMcpConfig(resources.mcpConfigPath, resources.temporaryDirectory, options.emitMcp);\n  process.stdout.write(`${emitted}\\n`);\n  return 0;\n}\n\n/** Compatibility API. Executables call the command function directly. */\nexport class EmitMcpCommand extends BaseCommand {\n  readonly name = 'emit-mcp';\n\n  matches(options: HarnessOptions): boolean {\n    return Boolean(options.emitMcp);\n  }\n\n  async execute(context: HarnessContext): Promise<number> {\n    return runEmitMcp(context);\n  }\n}\n"],"mappings":";;;;;;;;;AAYA,eAAsB,WAAW,SAA0C;CACzE,MAAM,EAAE,SAAS,cAAc;CAC/B,IAAI,CAAC,QAAQ,SAAS,MAAM,IAAI,MAAM,wCAAwC;CAC9E,IAAI,CAAC,UAAU,eAAe,MAAM,IAAI,MAAM,uCAAuC;CAErF,MAAM,UAAU,OAAA,GAAMA,6BAAAA,iBAAAA,CAAiB,UAAU,eAAe,UAAU,oBAAoB,QAAQ,OAAO;CAC7G,QAAQ,OAAO,MAAM,GAAG,QAAQ,GAAG;CACnC,OAAO;AACT;;AAGA,IAAa,iBAAb,cAAoCC,oBAAAA,YAAY;CAC9C,OAAgB;CAEhB,QAAQ,SAAkC;EACxC,OAAO,QAAQ,QAAQ,OAAO;CAChC;CAEA,MAAM,QAAQ,SAA0C;EACtD,OAAO,WAAW,OAAO;CAC3B;AACF"}