MCPcopy
hub / github.com/simstudioai/sim / sendMothershipMessage

Function sendMothershipMessage

apps/sim/lib/mothership/events.ts:30–47  ·  view source on GitHub ↗
(message: string, contexts?: ChatContext[])

Source from the content-addressed store, hash-verified

28 * this to decide whether to persist a handoff instead.
29 */
30export function sendMothershipMessage(message: string, contexts?: ChatContext[]): boolean {
31 const trimmed = message.trim()
32 if (!trimmed) {
33 logger.warn('sendMothershipMessage called with empty message')
34 return false
35 }
36 const consumed = !window.dispatchEvent(
37 new CustomEvent<MothershipSendMessageDetail>(MOTHERSHIP_SEND_MESSAGE_EVENT, {
38 detail: { message: trimmed, contexts },
39 cancelable: true,
40 })
41 )
42 logger.info('Dispatched mothership message event', {
43 messageLength: trimmed.length,
44 consumed,
45 })
46 return consumed
47}

Callers 3

notifyBlockErrorFunction · 0.90
LogDetailsContentFunction · 0.90
terminal.tsxFile · 0.90

Calls 2

infoMethod · 0.80
warnMethod · 0.65

Tested by

no test coverage detected