Folder Type
The Folder Complex Type resolves document-relative paths and tracks filesystem changes with newer. It works for both folder paths and file paths.
Creation Syntax
@specsFolder new Folder "./test-skill/specs"
@specsPath := $specsFolder.path
The path property returns the absolute path resolved from document path + constructor relative path.
Change Detection
@specsFolder new Folder "./test-skill/specs"
@nestedFolder new Folder "./test-skill/specs/nested"
@specsChanged !specsFolder.newer "./test-skill/specs"
@indexChanged !specsFolder.newer "./test-skill/specs/index.md"
@nestedChanged !specsFolder.newer $nestedFolder
newer receives one argument that can be either a relative path string (resolved against document path) or a Folder instance (in which case it uses that instance's path property). It returns true when the tracked target changed since the previous check, including mtime/ctime updates, file creation, and file deletion.
Step-by-Step Interaction
The first check for a specific target path returns true and initializes the baseline snapshot. Subsequent checks return false while the snapshot is unchanged, then return true again after any detected filesystem change. For directories, detection is recursive and includes appearance/disappearance of files in subfolders.
This behavior is validated in tests/pipelines/customTypes/FolderTest.mjs, including relative docPath resolution and file/folder change scenarios.