(s: string | undefined | null)
| 24 | |
| 25 | /** Parse a `telegram:<id>` / `discord:<id>` / `slack:<id>` target. Returns null when malformed. PURE. */ |
| 26 | export function parseDeliveryTarget(s: string | undefined | null): DeliveryTarget | null { |
| 27 | if (!s) return null; |
| 28 | const m = /^\s*(telegram|discord|slack)\s*:\s*(\S.*?)\s*$/i.exec(s); |
| 29 | if (!m) return null; |
| 30 | return { platform: m[1]!.toLowerCase() as DeliveryTarget['platform'], chatId: m[2]! }; |
| 31 | } |
| 32 | |
| 33 | /** Build the chat summary for a finished run. PURE. Pulls out a recipe's final status line |
| 34 | * (e.g. `VERIFIED-PR: opened …`) and leads with it, since that's the headline a user wants. */ |
no outgoing calls
no test coverage detected