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

Function stringifyUnknown

src/tools/REPLTool/pyReplFactory.tsx:128–144  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

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

Callers 2

formatToolCallSummaryFunction · 0.70

Calls 1

jsonStringifyFunction · 0.85

Tested by

no test coverage detected