MCPcopy
hub / github.com/anomalyco/opencode / userMessage

Function userMessage

packages/app/e2e/smoke/session-timeline.fixture.ts:51–73  ·  view source on GitHub ↗
(sessionID: string, index: number, textLength: number, diffs: unknown[] = [])

Source from the content-addressed store, hash-verified

49}
50
51function userMessage(sessionID: string, index: number, textLength: number, diffs: unknown[] = []): Message {
52 const messageID = id("msg_user", index)
53 return {
54 info: {
55 id: messageID,
56 sessionID,
57 role: "user",
58 time: { created: 1700000000000 + index * 10_000 },
59 summary: { diffs },
60 agent: "build",
61 model,
62 },
63 parts: [
64 {
65 id: id("prt_user_text", index),
66 sessionID,
67 messageID,
68 type: "text",
69 text: lorem(index, textLength),
70 },
71 ],
72 }
73}
74
75function assistantMessage(sessionID: string, index: number, parentID: string, parts: MessagePart[]): Message {
76 const messageID = id("msg_assistant", index)

Callers 2

turnFunction · 0.70

Calls 2

idFunction · 0.70
loremFunction · 0.70

Tested by

no test coverage detected