agentation@2.2.1 only treats these as local by default:
localhost127.0.0.10.0.0.0*.local
It does not include *.localhost (for example: app.localhost, docs.localhost).
This patch adds window.location.hostname.endsWith(".localhost") to local hostname detection.
Put the patch file at:
patches/agentation@2.2.1.patch
at the repository root.
In the root package.json, add/update:
{
"patchedDependencies": {
"agentation@2.2.1": "patches/agentation@2.2.1.patch"
}
}- Save the patch to
patches/agentation@2.2.1.patch. - Ensure your
agentationdependency version is2.2.1. - Add the
patchedDependenciesentry above in rootpackage.json. - Run:
bun installBun will apply the patch during install.
Use patch-package.
mkdir -p patches
curl -L "https://gist.githubusercontent.com/aaronvanston/c81755e3133b6d80fa352884dd5893fe/raw/322198bb7344c9a45671ef2f209b76f6b3baa2a8/agentation-localhost-support.patch" \
-o patches/agentation+2.2.1.patch
npm i -D patch-package
npm pkg set scripts.postinstall="patch-package"
npm installUse patch-package.
mkdir -p patches
curl -L "https://gist.githubusercontent.com/aaronvanston/c81755e3133b6d80fa352884dd5893fe/raw/322198bb7344c9a45671ef2f209b76f6b3baa2a8/agentation-localhost-support.patch" \
-o patches/agentation+2.2.1.patch
yarn add -D patch-package
# Add this to package.json scripts:
# "postinstall": "patch-package"
yarn installOption A: patch-package (same flow as npm/yarn).
mkdir -p patches
curl -L "https://gist.githubusercontent.com/aaronvanston/c81755e3133b6d80fa352884dd5893fe/raw/322198bb7344c9a45671ef2f209b76f6b3baa2a8/agentation-localhost-support.patch" \
-o patches/agentation+2.2.1.patch
pnpm add -D patch-package
pnpm pkg set scripts.postinstall="patch-package"
pnpm installOption B: native pnpm patch registration in package.json:
{
"pnpm": {
"patchedDependencies": {
"agentation@2.2.1": "patches/agentation@2.2.1.patch"
}
}
}mkdir -p patches
curl -L "https://gist.githubusercontent.com/aaronvanston/c81755e3133b6d80fa352884dd5893fe/raw/322198bb7344c9a45671ef2f209b76f6b3baa2a8/agentation-localhost-support.patch" \
-o patches/agentation@2.2.1.patch
bun installrg -n "endsWith\\(\"\\.localhost\\"\)" node_modules/agentation/dist/index.mjs node_modules/agentation/dist/index.jsYou should see matches in both files.
- Confirm installed version is exactly
agentation@2.2.1. - Re-run
bun installafter updatingpatchedDependencies. - For
npm/yarn/pnpm+patch-package, make sure patch filename ispatches/agentation+2.2.1.patchandpostinstallrunspatch-package.