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

Function textFromUnknown

packages/cli/src/commands/migrate.ts:230–234  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

228}
229
230function textFromUnknown(value: unknown): string {
231 if (value === undefined || value === null) return "";
232 if (typeof value === "string") return value;
233 return JSON.stringify(value, null, 2);
234}
235
236function roleFromMessage(row: OpenCodeMessageRow): "user" | "assistant" | undefined {
237 const data = parseJsonObject<OpenCodeMessageData>(row.data);

Callers 1

makeToolResultEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected