fix(resolvers): stop env-var hosts from doubling $HOME in the binary fallback path

The browse/design/make-pdf setup resolvers built the fallback binary path as
"$HOME" + dir.replace(/^~/, ''), which is only correct for ~-rooted dirs.
Env-var hosts carry an absolute $GSTACK_* dir, so the generated fallback
became $HOME$GSTACK_.../browse — a path that never exists. New toShellPath()
in scripts/resolvers/types.ts expands ~ to $HOME and passes absolute
env-var dirs through untouched; all five call sites route through it.

Claude-host generated output is byte-identical, so no SKILL.md regeneration
is needed here.

Closes #2055.

Contributed by @simjak (PR #2056).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-14 20:20:58 -07:00
co-authored by Claude Fable 5
parent da6fd8bf25
commit dcdd28ce34
4 changed files with 18 additions and 8 deletions
+10
View File
@@ -71,6 +71,16 @@ function buildHostPaths(): Record<string, HostPaths> {
export const HOST_PATHS: Record<string, HostPaths> = buildHostPaths();
/**
* Render a HostPaths binary dir as a shell-expandable absolute path.
* Claude-style dirs are `~`-rooted (e.g. `~/.claude/skills/gstack/browse/dist`)
* and expand via `$HOME`; env-var hosts already carry an absolute `$GSTACK_*`
* value, so they pass through untouched — prepending `$HOME` would double it.
*/
export function toShellPath(dir: string): string {
return dir.startsWith('~') ? `$HOME${dir.slice(1)}` : dir;
}
import type { Model } from '../models';
export type { Model } from '../models';