MCPcopy Create free account
hub / github.com/cortexkit/magic-context / tokensFromMessage

Function tokensFromMessage

packages/cli/src/commands/migrate.ts:241–248  ·  view source on GitHub ↗
(row: OpenCodeMessageRow)

Source from the content-addressed store, hash-verified

239}
240
241function tokensFromMessage(row: OpenCodeMessageRow): OpenCodeMessageTokens {
242 try {
243 const data = parseJsonObject<OpenCodeMessageData>(row.data);
244 return data.tokens ?? {};
245 } catch {
246 return {};
247 }
248}
249
250function extractModel(rows: OpenCodeMessageRow[]): {
251 provider: string;

Callers 1

buildPiEntriesFunction · 0.85

Calls 1

parseJsonObjectFunction · 0.85

Tested by

no test coverage detected