@iasiv5/dsh-skip-browser-auth 0.3.1 → 0.3.3
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/connection-runtime.js +16 -5
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** Runtime connection module loader used by compatibility adapters. */
|
|
2
|
-
import { API_PATH as PINNED_API_PATH, HostConnectionService as PinnedHostConnectionService } from '@deepseek-ai/dsh-client-connection';
|
|
3
2
|
import { CONNECTION_PACKAGE } from './gate.js';
|
|
4
3
|
function isRuntimeConnectionModule(value) {
|
|
5
4
|
if (typeof value !== 'object' || value === null)
|
|
@@ -45,8 +44,20 @@ export async function loadRuntimeConnectionModule(ctx) {
|
|
|
45
44
|
}
|
|
46
45
|
return loaded;
|
|
47
46
|
}
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
return importPinnedConnectionModule();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Pinned dev 副本惰性加载(审计修复 2026-09-28):只允许在完全没有 loader
|
|
51
|
+
* 服务的直接单元测试上下文执行。禁止顶层静态 import——那会让 0.1.2 旧模块
|
|
52
|
+
* 图在产品环境随插件加载被求值,且 bare specifier 绑定随安装布局漂移(dev
|
|
53
|
+
* 树内嵌时遮蔽命中 pinned 副本,净装则经 pnpm hoist 命中宿主副本)。动态
|
|
54
|
+
* import() 把模块解析推迟到实际调用点,产品路径(loader 恒在)永不触碰该
|
|
55
|
+
* 副本。不变量由 tests/manifest.test.mjs 的 lazy-load 断言锁定。
|
|
56
|
+
*/
|
|
57
|
+
async function importPinnedConnectionModule() {
|
|
58
|
+
const pinned = (await import('@deepseek-ai/dsh-client-connection'));
|
|
59
|
+
if (typeof pinned?.HostConnectionService !== 'function' || typeof pinned?.API_PATH !== 'string') {
|
|
60
|
+
throw new Error(`@iasiv5/dsh-skip-browser-auth: pinned dev module ${CONNECTION_PACKAGE} has an incompatible export shape`);
|
|
61
|
+
}
|
|
62
|
+
return pinned;
|
|
52
63
|
}
|