MCPcopy Create free account
hub / github.com/cursor/plugins / parseRaisedReason

Function parseRaisedReason

orchestrate/skills/orchestrate/scripts/core/andon.ts:209–227  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

207}
208
209function parseRaisedReason(text: string): string | undefined {
210 const prefix = [ANDON_RAISED_PREFIX, SLACK_ANDON_RAISED_PREFIX].find(
211 candidate => text.startsWith(candidate)
212 );
213 if (!prefix) {
214 return undefined;
215 }
216 const reasonStart = text.indexOf(": ", prefix.length);
217 if (reasonStart === -1) return undefined;
218 // Reason lives on the first line of the message. The CLI appends an
219 // observability footer (`<https://...|view>`) on its own line; keep it out
220 // of the parsed reason so it never bleeds into state.json.
221 return (
222 text
223 .slice(reasonStart + 2)
224 .split("\n")[0]
225 ?.trim() || undefined
226 );
227}
228
229function compareSlackTsDesc(a: string, b: string): number {
230 return Number(b) - Number(a);

Callers 1

latestRaisedReasonMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected