MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / cellOutputToToolResult

Function cellOutputToToolResult

source code/utils/notebook.ts:136–155  ·  view source on GitHub ↗
(output: NotebookCellSourceOutput)

Source from the content-addressed store, hash-verified

134}
135
136function cellOutputToToolResult(output: NotebookCellSourceOutput) {
137 const outputs: (TextBlockParam | ImageBlockParam)[] = []
138 if (output.text) {
139 outputs.push({
140 text: `\n${output.text}`,
141 type: 'text',
142 })
143 }
144 if (output.image) {
145 outputs.push({
146 type: 'image',
147 source: {
148 data: output.image.image_data,
149 media_type: output.image.media_type,
150 type: 'base64',
151 },
152 })
153 }
154 return outputs
155}
156
157function getToolResultFromCell(cell: NotebookCellSource) {
158 const contentResult = cellContentToToolResult(cell)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected