* Parse a deepnote:// URI and extract the path
(uri: string)
| 55 | * Parse a deepnote:// URI and extract the path |
| 56 | */ |
| 57 | function parseDeepnoteUri(uri: string): { type: 'file' | 'examples' | 'workspace'; path?: string } { |
| 58 | if (uri.startsWith('deepnote://examples')) { |
| 59 | return { type: 'examples' } |
| 60 | } |
| 61 | if (uri.startsWith('deepnote://workspace')) { |
| 62 | return { type: 'workspace' } |
| 63 | } |
| 64 | if (uri.startsWith('deepnote://file/')) { |
| 65 | return { type: 'file', path: uri.slice('deepnote://file/'.length) } |
| 66 | } |
| 67 | return { type: 'file', path: uri.replace('deepnote://', '') } |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * List available resources |