singularity-forge/scripts
deseltrus 5d510ca6aa fix: read resources from dist/ to prevent branch-drift in npm-link setups (#314)
* fix: read resources from dist/ to prevent branch-drift in npm-link setups

initResources() reads extensions, prompts, skills, and agents from
src/resources/ — which points into the live working tree when gsd is
installed via npm link. Switching branches in the gsd repo changes
src/resources/ for ALL projects using gsd, causing stale or broken
extensions to be synced to ~/.gsd/agent/ on next launch.

Fix: the build step now copies src/resources/ to dist/resources/.
At runtime, resource-loader.ts and loader.ts prefer dist/resources/
(stable, set at build time) over src/resources/ (live working tree).
Fallback to src/resources/ is preserved for setups without a build.

Also adds npm run dev watch-resources watcher that syncs src/resources/
to dist/resources/ on file changes, running alongside tsc --watch.

* fix: cache prompt templates per session to prevent cross-session invalidation

When two gsd sessions run concurrently, the second session's
initResources() overwrites ~/.gsd/agent/ templates on disk. The first
session then reads a newer template that expects variables its in-memory
code doesn't know about, causing 'template declares {{X}} but no value
was provided' crashes that hang auto-mode indefinitely.

Fix: cache each template on first read. A running session uses the
template versions from when it first loaded them, immune to later
disk overwrites by other sessions.
2026-03-14 11:47:03 -06:00
..
ci_monitor.cjs feat: add GitHub Workflows skill with CI workflow and ci_monitor tool (#294) 2026-03-13 22:31:17 -06:00
ci_monitor.md feat: add GitHub Workflows skill with CI workflow and ci_monitor tool (#294) 2026-03-13 22:31:17 -06:00
dev.js fix: read resources from dist/ to prevent branch-drift in npm-link setups (#314) 2026-03-14 11:47:03 -06:00
install-pi-global.js Add pi global install scripts (#57) 2026-03-11 14:34:03 -06:00
link-workspace-packages.cjs fix: broken npm install — remove bundleDependencies, use postinstall symlinks (#369) 2026-03-14 10:04:12 -06:00
postinstall.js feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
sync-pkg-version.cjs feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
uninstall-pi-global.js Add pi global install scripts (#57) 2026-03-11 14:34:03 -06:00
validate-pack.sh fix: broken npm install — remove bundleDependencies, use postinstall symlinks (#369) 2026-03-14 10:04:12 -06:00
verify-s03.sh feat(wizard): add BRAVE_ANSWERS_KEY support 2026-03-10 22:44:28 -06:00
verify-s04.sh Replace remaining 'get stuff done' instances in verify script 2026-03-11 08:11:11 -06:00
watch-resources.js fix: read resources from dist/ to prevent branch-drift in npm-link setups (#314) 2026-03-14 11:47:03 -06:00