Skip to content

Add ~ support for user-entered file paths#572

Merged
backnotprop merged 5 commits intobacknotprop:mainfrom
AlexanderKolberg:fix/user-path-resolution
Apr 19, 2026
Merged

Add ~ support for user-entered file paths#572
backnotprop merged 5 commits intobacknotprop:mainfrom
AlexanderKolberg:fix/user-path-resolution

Conversation

@AlexanderKolberg
Copy link
Copy Markdown
Contributor

@AlexanderKolberg AlexanderKolberg commented Apr 16, 2026

This change adds support for ~ in user-entered file paths by expanding home-relative paths in the shared path resolver instead of treating the tilde literally. That shared resolver is now used by the annotate entrypoints and the Bun and Pi reference handlers, so file, folder, vault, and linked-document paths all handle ~ the same way.

@AlexanderKolberg AlexanderKolberg changed the title Support ~ in user-entered file paths Add ~ support for user-entered file paths Apr 16, 2026
The refactor removed `resolve` from `node:path` imports, but `resolvePlanPath()`
and the planning-mode write/edit guards still call `resolve(...)`. That breaks
plan submission and plan-file restriction at runtime for Pi users.

Also wires pi-extension's tsconfig into the root `typecheck` script so CI
catches this class of missing-symbol regression in the future. Required
adding @mariozechner/pi-* packages as explicit devDependencies so tsc can
resolve them (they were previously only reachable transitively via the
peer dep, which Bun keeps in its `.bun/` store unhoisted).

For provenance purposes, this commit was AI assisted.
…pecheck

resolveUserPath() trims input, so whitespace-only customPath/vaultPath
resolved to process.cwd(). Plans silently wrote into the repo root and
Obsidian notes landed in <cwd>/plannotator/ instead of erroring.

Guard at both call sites (getPlanDir, saveToObsidian — Bun + Pi copies).

Also prepend vendor.sh to the root typecheck script so fresh-clone
`bun run typecheck` works without a separate vendoring step.

For provenance purposes, this commit was AI assisted.
Trimming in normalizeUserPathInput meant whitespace-only input resolved
to cwd/baseDir. Callers like the annotate CLI and reference API endpoints
would then list the project root instead of erroring. Return "" early so
downstream existsSync/resolveMarkdownFile checks fail naturally.

For provenance purposes, this commit was AI assisted.
@backnotprop backnotprop merged commit 54c206c into backnotprop:main Apr 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants