MCPcopy
hub / github.com/Dimillian/CodexMonitor / parseUserInputs

Function parseUserInputs

src/utils/threadItems.conversion.ts:15–42  ·  view source on GitHub ↗
(inputs: Array<Record<string, unknown>>)

Source from the content-addressed store, hash-verified

13}
14
15function parseUserInputs(inputs: Array<Record<string, unknown>>) {
16 const textParts: string[] = [];
17 const images: string[] = [];
18 inputs.forEach((input) => {
19 const type = asString(input.type);
20 if (type === "text") {
21 const text = asString(input.text);
22 if (text) {
23 textParts.push(text);
24 }
25 return;
26 }
27 if (type === "skill") {
28 const name = asString(input.name);
29 if (name) {
30 textParts.push(`$${name}`);
31 }
32 return;
33 }
34 if (type === "image" || type === "localImage") {
35 const value = extractImageInputValue(input);
36 if (value) {
37 images.push(value);
38 }
39 }
40 });
41 return { text: textParts.join(" ").trim(), images };
42}
43
44export function buildConversationItem(
45 item: Record<string, unknown>,

Callers 2

buildConversationItemFunction · 0.85

Calls 2

asStringFunction · 0.90
extractImageInputValueFunction · 0.85

Tested by

no test coverage detected