MCPcopy Index your code
hub / github.com/deepnote/deepnote / serializeNotebookContext

Function serializeNotebookContext

packages/runtime-core/src/agent-handler.ts:40–58  ·  view source on GitHub ↗
(
  file: DeepnoteFile,
  notebookIndex: number,
  collectedOutputs: Map<string, { outputs: unknown[]; executionCount: number | null }>
)

Source from the content-addressed store, hash-verified

38}
39
40export function serializeNotebookContext(
41 file: DeepnoteFile,
42 notebookIndex: number,
43 collectedOutputs: Map<string, { outputs: unknown[]; executionCount: number | null }>
44): string {
45 const notebook = file.project.notebooks[notebookIndex]
46 if (notebook == null) {
47 return 'Empty notebook.'
48 }
49
50 const blocksWithAttachedOutputs = createBlocksWithAttachedOutputsFromCollectedOutputs({
51 blocks: notebook.blocks,
52 collectedOutputs,
53 })
54 return serializeNotebookContextFromBlocks({
55 blocks: blocksWithAttachedOutputs,
56 notebookName: notebook.name,
57 })
58}
59
60export function createBlocksWithAttachedOutputsFromCollectedOutputs({
61 blocks,

Callers 2

runProjectMethod · 0.90

Tested by

no test coverage detected