MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / extractChartPayloads

Function extractChartPayloads

apps/cli/src/ai/chat-command.ts:88–99  ·  view source on GitHub ↗
(toolResult: unknown)

Source from the content-addressed store, hash-verified

86}
87
88function extractChartPayloads(toolResult: unknown): ChartPayload[] {
89 if (!isRecord(toolResult)) return []
90 const details = isRecord(toolResult.details) ? toolResult.details : toolResult
91 const charts: ChartPayload[] = []
92 if (isChartPayload(details.chart)) charts.push(details.chart)
93 if (Array.isArray(details.charts)) {
94 for (const chart of details.charts) {
95 if (isChartPayload(chart)) charts.push(chart)
96 }
97 }
98 return charts
99}
100
101function toPersistedChartPayload(chart: ChartPayload): ChartPayload {
102 return {

Callers 1

runChatTurnFunction · 0.70

Calls 2

isRecordFunction · 0.70
isChartPayloadFunction · 0.70

Tested by

no test coverage detected