{"version":3,"file":"dev.cjs","names":["ResolutionSessionService","DevFlowService","chainHeadPinLagNotice","Effect","auditSessionPlane"],"sources":["../../src/handlers/dev.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport { DevFlowService } from \"../services/dev/flow\";\nimport { chainHeadPinLagNotice } from \"../services/platform/manifest\";\nimport { auditSessionPlane, type PlaneAuditLine } from \"../services/resolution/plane-audit\";\nimport { ResolutionSessionService } from \"../services/resolution/session\";\nimport type { BosBuilder } from \"./shared\";\n\nconst renderAuditLines = (lines: readonly PlaneAuditLine[]): void => {\n  const divergences = lines.filter((line) => line.kind !== \"uncomposed\");\n  const notes = lines.filter((line) => line.kind === \"uncomposed\");\n  if (divergences.length > 0) {\n    console.log(`\\n  ${divergences.length} release-plane divergence(s) in the composition:`);\n    for (const line of divergences) {\n      console.log(`  - ${line.message}`);\n    }\n    console.log(\"\\n  The runtime survived on its pinned bytes — realign before shipping.\\n\");\n  }\n  if (notes.length > 0) {\n    console.log(\n      `\\n  ${notes.length} pinned-release slot(s) this config does not compose (informational):`,\n    );\n    for (const line of notes) {\n      console.log(`  - ${line.message}`);\n    }\n    console.log(\"\");\n  }\n};\n\nexport function registerDev(builder: BosBuilder) {\n  return {\n    dev: builder.dev.effect(function* (_opts, input) {\n      const session = yield* ResolutionSessionService;\n      const flow = yield* DevFlowService;\n      const result = yield* flow.dev(session, input);\n      if (result.status === \"started\" && session) {\n        const notice = chainHeadPinLagNotice(\n          session.releaseManifest?.frameworkVersion,\n          session.rawConfig?.platform,\n        );\n        if (notice) console.log(`\\n  ${notice}\\n`);\n        const audit = yield* Effect.tryPromise({\n          try: () => auditSessionPlane(session),\n          catch: () => undefined,\n        });\n        if (audit && audit.length > 0) renderAuditLines(audit);\n      }\n      return result;\n    }),\n\n    start: builder.start.effect(function* (_opts, input) {\n      const session = yield* ResolutionSessionService;\n      const flow = yield* DevFlowService;\n      return yield* flow.start(session, input);\n    }),\n  };\n}\n"],"mappings":";;;;;;;AAOA,MAAM,oBAAoB,UAA2C;CACnE,MAAM,cAAc,MAAM,QAAQ,SAAS,KAAK,SAAS,YAAY;CACrE,MAAM,QAAQ,MAAM,QAAQ,SAAS,KAAK,SAAS,YAAY;CAC/D,IAAI,YAAY,SAAS,GAAG;EAC1B,QAAQ,IAAI,OAAO,YAAY,OAAO,iDAAiD;EACvF,KAAK,MAAM,QAAQ,aACjB,QAAQ,IAAI,OAAO,KAAK,SAAS;EAEnC,QAAQ,IAAI,2EAA2E;CACzF;CACA,IAAI,MAAM,SAAS,GAAG;EACpB,QAAQ,IACN,OAAO,MAAM,OAAO,sEACtB;EACA,KAAK,MAAM,QAAQ,OACjB,QAAQ,IAAI,OAAO,KAAK,SAAS;EAEnC,QAAQ,IAAI,EAAE;CAChB;AACF;AAEA,SAAgB,YAAY,SAAqB;CAC/C,OAAO;EACL,KAAK,QAAQ,IAAI,OAAO,WAAW,OAAO,OAAO;GAC/C,MAAM,UAAU,OAAOA;GAEvB,MAAM,SAAS,QAAO,OADFC,4BACM,CAAC,IAAI,SAAS,KAAK;GAC7C,IAAI,OAAO,WAAW,aAAa,SAAS;IAC1C,MAAM,SAASC,uCACb,QAAQ,iBAAiB,kBACzB,QAAQ,WAAW,QACrB;IACA,IAAI,QAAQ,QAAQ,IAAI,OAAO,OAAO,GAAG;IACzC,MAAM,QAAQ,OAAOC,cAAO,WAAW;KACrC,WAAWC,sCAAkB,OAAO;KACpC,aAAa;IACf,CAAC;IACD,IAAI,SAAS,MAAM,SAAS,GAAG,iBAAiB,KAAK;GACvD;GACA,OAAO;EACT,CAAC;EAED,OAAO,QAAQ,MAAM,OAAO,WAAW,OAAO,OAAO;GACnD,MAAM,UAAU,OAAOJ;GAEvB,OAAO,QAAO,OADMC,4BACF,CAAC,MAAM,SAAS,KAAK;EACzC,CAAC;CACH;AACF"}