MCPcopy Create free account
hub / github.com/Noumena-Network/code / stringifyUnknown

Function stringifyUnknown

src/tools/REPLTool/javascriptReplFactory.tsx:124–140  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

122}
123
124function stringifyUnknown(value: unknown): string {
125 if (typeof value === 'string') {
126 return value
127 }
128 try {
129 return (
130 jsonStringify(value, null, 2) ??
131 inspect(value, {
132 depth: 6,
133 })
134 )
135 } catch {
136 return inspect(value, {
137 depth: 6,
138 })
139 }
140}
141
142function preview(value: string, maxChars: number = PREVIEW_LIMIT): string {
143 if (value.length <= maxChars) {

Callers 3

formatToolCallSummaryFunction · 0.70
formatModelToolResultFunction · 0.70

Calls 1

jsonStringifyFunction · 0.85

Tested by

no test coverage detected