dsh-agentone 0.5.4 → 0.5.5
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/index.js +3 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -545,7 +545,7 @@ button{font:inherit;padding:9px 22px;border-radius:10px;border:none;cursor:point
|
|
|
545
545
|
* location.search 不含宿主 query,页面自检在设置 iframe 场景会漏。
|
|
546
546
|
*/
|
|
547
547
|
function isDesktopHost() {
|
|
548
|
-
return /DSH Desktop\.app/i.test(process.execPath);
|
|
548
|
+
return /DSH Desktop\.(?:app|exe)/i.test(process.execPath);
|
|
549
549
|
}
|
|
550
550
|
|
|
551
551
|
export function apply(ctx, config) {
|
|
@@ -554,6 +554,7 @@ export function apply(ctx, config) {
|
|
|
554
554
|
// 只在 DSH Desktop 存在。据此把插件管理切到当前 profile,并用受管
|
|
555
555
|
// desktopPnpm 做装/卸/升级(desktop 里 dsh CLI 拒绝操作 desktop profile)。
|
|
556
556
|
const desktopProfiles = ctx.get?.('desktopProfiles');
|
|
557
|
+
const isDesktopRuntime = Boolean(desktopProfiles?.current?.name) || isDesktopHost();
|
|
557
558
|
if (desktopProfiles?.current?.name) {
|
|
558
559
|
PLUGIN_PROFILE = desktopProfiles.current.name;
|
|
559
560
|
ctx.inject(['desktopPnpm'], (desktopCtx) => {
|
|
@@ -643,7 +644,7 @@ export function apply(ctx, config) {
|
|
|
643
644
|
// DSH Desktop:宿主 webserver 只信 Electron 内部请求,外部浏览器访问
|
|
644
645
|
// /agentone/callback 会 403。desktop 环境(服务端自检 execPath 或页面
|
|
645
646
|
// 传 desktop 标记)改由插件在本进程起一次性本地服务收回调。
|
|
646
|
-
const callbackUrl = body.desktop ||
|
|
647
|
+
const callbackUrl = body.desktop || isDesktopRuntime
|
|
647
648
|
? await openCallbackServer(config, log)
|
|
648
649
|
: String(body.callback_url || '');
|
|
649
650
|
if (!/^https?:\/\/|^\/portal\//.test(callbackUrl)) {
|
package/package.json
CHANGED