The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { classifyMarkdownImageSource } from "@t3tools/client-runtime/markdown-images"; |
| 2 | import { |
| 3 | resolveMediaSource, |
| 4 | type ResolveMediaSourceInput, |
| 5 | } from "@t3tools/client-runtime/media-source"; |
| 6 | |
| 7 | export function resolveMobileMarkdownMediaSource(href: string, input: ResolveMediaSourceInput) { |
| 8 | const media = resolveMediaSource(href, input); |
| 9 | if (media?.access !== "unavailable" || !input.workspaceRoot) return media; |
| 10 | const source = classifyMarkdownImageSource(href, input.workspaceRoot); |
| 11 | if (source._tag !== "WorkspaceFile") return media; |
| 12 | return { |
| 13 | ...media, |
| 14 | access: "environment" as const, |
| 15 | resource: { |
| 16 | _tag: "draft-workspace-file" as const, |
| 17 | cwd: input.workspaceRoot, |
| 18 | path: source.path, |
| 19 | }, |
| 20 | }; |
| 21 | } |