dsh-folia 4.26.0-pre.27 → 4.26.0-pre.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/routes/pet-chat.js +12 -2
- package/package.json +1 -1
package/lib/routes/pet-chat.js
CHANGED
|
@@ -908,7 +908,12 @@ export function registerPetChatRoutes(webServer, c) {
|
|
|
908
908
|
res.end(JSON.stringify(payload));
|
|
909
909
|
};
|
|
910
910
|
const profileRoot = join(homedir(), 'AppData', 'Roaming', 'dsh-desktop', 'harness', 'profiles', 'web');
|
|
911
|
-
|
|
911
|
+
// ⚠️ ESM 没有 __dirname;这里只拼真实存在的位置(上一版用 __dirname 导致 400)
|
|
912
|
+
const roots = [
|
|
913
|
+
join(profileRoot, 'node_modules'),
|
|
914
|
+
join(profileRoot, 'node_modules', 'dsh-folia', 'node_modules'),
|
|
915
|
+
join(profileRoot, '..', '.generations', 'live'),
|
|
916
|
+
];
|
|
912
917
|
const findPkg = (name) => {
|
|
913
918
|
for (const root of roots) {
|
|
914
919
|
const f = join(root, ...name.split('/'), 'package.json');
|
|
@@ -957,7 +962,12 @@ export function registerPetChatRoutes(webServer, c) {
|
|
|
957
962
|
{ id: 'notify-hub', pkg: '@alotop/dsh-notify-hub', label: '消息推送', needs: '需要配置推送渠道(Bark/Telegram 等)' },
|
|
958
963
|
];
|
|
959
964
|
const profileRoot = join(homedir(), 'AppData', 'Roaming', 'dsh-desktop', 'harness', 'profiles', 'web');
|
|
960
|
-
|
|
965
|
+
// ⚠️ ESM 没有 __dirname;这里只拼真实存在的位置(上一版用 __dirname 导致 400)
|
|
966
|
+
const roots = [
|
|
967
|
+
join(profileRoot, 'node_modules'),
|
|
968
|
+
join(profileRoot, 'node_modules', 'dsh-folia', 'node_modules'),
|
|
969
|
+
join(profileRoot, '..', '.generations', 'live'),
|
|
970
|
+
];
|
|
961
971
|
const findPkg = (name) => {
|
|
962
972
|
for (const root of roots) {
|
|
963
973
|
const f = join(root, ...name.split('/'), 'package.json');
|