MCPcopy Index your code
hub / github.com/simstudioai/sim / createEvent

Function createEvent

apps/sim/lib/copilot/request/session/event.ts:39–60  ·  view source on GitHub ↗
(
  input: TInput
)

Source from the content-addressed store, hash-verified

37} as const
38
39export function createEvent<TInput extends CreateEventInput>(
40 input: TInput
41): CreateEventResult<TInput> {
42 const { streamId, chatId, cursor, seq, requestId, type, payload, scope, ts } = input
43
44 return {
45 v: 1,
46 type,
47 seq,
48 ts: ts ?? new Date().toISOString(),
49 stream: {
50 streamId,
51 ...(chatId ? { chatId } : {}),
52 cursor,
53 },
54 trace: {
55 requestId,
56 },
57 ...(scope ? { scope } : {}),
58 payload,
59 } as CreateEventResult<TInput>
60}
61
62export function isEventRecord(value: unknown): value is PersistedStreamEventEnvelope {
63 return parsePersistedStreamEventEnvelope(value).ok

Callers 6

stream.test.tsFile · 0.90
createEnvelopeMethod · 0.90
buffer.test.tsFile · 0.90
checkForReplayGapFunction · 0.90
event.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected