MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / inputPreview

Function inputPreview

e2e/src/clients/chat-theater.ts:66–73  ·  view source on GitHub ↗
(input: string | undefined)

Source from the content-addressed store, hash-verified

64
65/** Input block, like a TUI's call preview: trimmed lines, capped count. */
66const inputPreview = (input: string | undefined): string[] | undefined => {
67 if (!input) return undefined;
68 const lines = input
69 .split("\n")
70 .map((line) => line.trimEnd())
71 .filter((line) => line.trim().length > 0);
72 return lines.length > 7 ? [...lines.slice(0, 6), `… +${lines.length - 6} lines`] : lines;
73};
74
75const makeTheater = (push: (event: TheaterEvent) => Effect.Effect<void>): ChatTheater => ({
76 user: (text) => push({ type: "user", text }),

Callers 1

makeTheaterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected