MCPcopy Create free account
hub / github.com/deepnote/deepnote / makeDeepnoteFile

Function makeDeepnoteFile

packages/mcp/src/tools/test-helpers.ts:7–37  ·  view source on GitHub ↗
(args: {
  projectId: string
  initNotebookId?: string
  notebooks: Array<{ id: string; name: string; blockIds: string[] }>
  integrations?: Array<{ id: string; name: string; type: string }>
  settings?: Record<string, unknown>
})

Source from the content-addressed store, hash-verified

5
6/** Builds a minimal native `.deepnote` file, optionally declaring an init notebook / integrations / settings. */
7export function makeDeepnoteFile(args: {
8 projectId: string
9 initNotebookId?: string
10 notebooks: Array<{ id: string; name: string; blockIds: string[] }>
11 integrations?: Array<{ id: string; name: string; type: string }>
12 settings?: Record<string, unknown>
13}): DeepnoteFile {
14 return {
15 version: '1.0.0',
16 metadata: { createdAt: '2025-01-01T00:00:00Z' },
17 project: {
18 id: args.projectId,
19 name: 'Test Project',
20 ...(args.initNotebookId !== undefined ? { initNotebookId: args.initNotebookId } : {}),
21 ...(args.integrations !== undefined ? { integrations: args.integrations } : {}),
22 ...(args.settings !== undefined ? { settings: args.settings } : {}),
23 notebooks: args.notebooks.map(nb => ({
24 id: nb.id,
25 name: nb.name,
26 blocks: nb.blockIds.map((blockId, i) => ({
27 id: blockId,
28 type: 'code' as const,
29 blockGroup: `bg-${blockId}`,
30 sortingKey: `00${i}`,
31 content: `# ${blockId}`,
32 metadata: {},
33 })),
34 })),
35 },
36 }
37}
38
39/**
40 * Writes a main `.deepnote` (declaring a sibling init) plus an init-only sibling `.deepnote`

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected