(path: string | undefined)
| 96 | } |
| 97 | |
| 98 | function describeReadTarget(path: string | undefined): string | undefined { |
| 99 | if (!path) return undefined |
| 100 | |
| 101 | const segments = path |
| 102 | .split('/') |
| 103 | .map((segment) => segment.trim()) |
| 104 | .filter(Boolean) |
| 105 | .map(decodeVfsSegmentSafe) |
| 106 | |
| 107 | if (segments.length === 0) return undefined |
| 108 | |
| 109 | const resourceType = VFS_DIR_TO_RESOURCE[segments[0]] |
| 110 | if (!resourceType) { |
| 111 | return stripExtension(segments[segments.length - 1]) |
| 112 | } |
| 113 | |
| 114 | if (resourceType === 'file') { |
| 115 | return describeFileReadTarget(segments) |
| 116 | } |
| 117 | |
| 118 | if (resourceType === 'workflow') { |
| 119 | return stripExtension(getLeafResourceSegment(segments)) |
| 120 | } |
| 121 | |
| 122 | const resourceName = segments[1] || segments[segments.length - 1] |
| 123 | return stripExtension(resourceName) |
| 124 | } |
| 125 | |
| 126 | // A workspace file is addressed as a directory of facets in the VFS |
| 127 | // (files/{...path}/{name}/{facet}). `content` is the default facet — reading a |
no test coverage detected