MCPcopy Create free account
hub / github.com/anomalyco/opencode / eventSessionID

Function eventSessionID

packages/app/src/context/server-session.ts:637–657  ·  view source on GitHub ↗
(event: { type: string; properties?: unknown })

Source from the content-addressed store, hash-verified

635 }
636
637 const eventSessionID = (event: { type: string; properties?: unknown }) => {
638 const properties = event.properties
639 if (!properties || typeof properties !== "object") return
640 if ("sessionID" in properties && typeof properties.sessionID === "string") return properties.sessionID
641 if (
642 "info" in properties &&
643 properties.info &&
644 typeof properties.info === "object" &&
645 "sessionID" in properties.info &&
646 typeof properties.info.sessionID === "string"
647 )
648 return properties.info.sessionID
649 if (
650 "part" in properties &&
651 properties.part &&
652 typeof properties.part === "object" &&
653 "sessionID" in properties.part &&
654 typeof properties.part.sessionID === "string"
655 )
656 return properties.part.sessionID
657 }
658
659 const apply = (event: { type: string; properties?: unknown }) => {
660 const eventID = eventSessionID(event)

Callers 1

applyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected