MCPcopy Create free account
hub / github.com/Roy3838/Observer / formatSensorContent

Function formatSensorContent

app/src/utils/exportUtils.ts:24–43  ·  view source on GitHub ↗
(sensor: SensorData, includeImages: boolean)

Source from the content-addressed store, hash-verified

22
23// Format sensor content for display
24const formatSensorContent = (sensor: SensorData, includeImages: boolean): string => {
25 if (sensor.type === 'screenshot' || sensor.type === 'camera') {
26 if (includeImages && sensor.content) {
27 return `[Image data - ${sensor.size || 'unknown'} bytes]`;
28 }
29 return `[${sensor.type} - ${sensor.size || 'unknown'} bytes]`;
30 }
31
32 if (sensor.type === 'audio') {
33 const transcript = sensor.content?.transcript || '';
34 const source = sensor.source ? ` (${sensor.source})` : '';
35 return `${transcript}${source}`;
36 }
37
38 if (typeof sensor.content === 'string') {
39 return sensor.content;
40 }
41
42 return JSON.stringify(sensor.content, null, 2);
43};
44
45// Export as JSON
46export const exportAsJSON = (data: ExportData, options: ExportOptions): string => {

Callers 2

renderSensorHTMLFunction · 0.85
renderSensorMarkdownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected