{"version":3,"file":"launcher-bootstrap.cjs","names":["readLauncherComposition","resolveLauncherLoadPlan","loadComposedExtensions"],"sources":["../../src/extensions/launcherBootstrap.ts"],"sourcesContent":["import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\n\nimport { loadComposedExtensions } from '../builders/cli/composition';\nimport { readLauncherComposition, resolveLauncherLoadPlan } from '../builders/cli/launcherComposition';\nimport { updateHarnessState } from '../composition/harnessState';\n\nconst WARNING = 'warning';\n\n/**\n * The one Pi entry a composing launcher session registers.\n *\n * Pi captures its CLI extension list once per process, so handing it the\n * fingerprint-named aggregate freezes the composition for the process. This\n * entry is a stable path instead: the list never changes, and every load,\n * including a reload, resolves the composition that is selected at that\n * moment and activates it. All work happens inside the factory rather than at\n * module scope, because Pi caches the module and only calls the export again.\n */\nexport async function launcherBootstrap(pi: ExtensionAPI): Promise<void> {\n  const state = readLauncherComposition();\n  if (!state) return;\n\n  const problems: string[] = [];\n  const plan = resolveLauncherLoadPlan(state);\n  // Doom Team reads the child activation and the identity from the environment\n  // the store publishes, so both have to be refreshed before anything spawns.\n  updateHarnessState({ childExtensions: plan.childExtensions, compositionFingerprint: plan.fingerprint });\n  await loadComposedExtensions(pi, plan.entries, problems);\n\n  if (problems.length > 0) {\n    pi.on('session_start', (_event, ctx) => {\n      for (const problem of problems) ctx.ui.notify(problem, WARNING);\n    });\n  }\n}\n\nexport default launcherBootstrap;\n"],"mappings":";;;;;;;;AAMA,MAAM,UAAU;;;;;;;;;;;AAYhB,eAAsB,kBAAkB,IAAiC;CACvE,MAAM,QAAQA,gBAAAA,wBAAwB;CACtC,IAAI,CAAC,OAAO;CAEZ,MAAM,WAAqB,CAAC;CAC5B,MAAM,OAAOC,gBAAAA,wBAAwB,KAAK;CAG1C,cAAA,mBAAmB;EAAE,iBAAiB,KAAK;EAAiB,wBAAwB,KAAK;CAAY,CAAC;CACtG,MAAMC,oBAAAA,uBAAuB,IAAI,KAAK,SAAS,QAAQ;CAEvD,IAAI,SAAS,SAAS,GACpB,GAAG,GAAG,kBAAkB,QAAQ,QAAQ;EACtC,KAAK,MAAM,WAAW,UAAU,IAAI,GAAG,OAAO,SAAS,OAAO;CAChE,CAAC;AAEL"}