@dsh-plugin/dsh-loader 1.3.0 → 1.3.1

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.
@@ -29,6 +29,31 @@ interface DshLoaderWindowLike {
29
29
  }
30
30
  declare global {
31
31
  }
32
+ /** The client module-system surface legacy plugins read off `window.__DSH_MODULES__`. */
33
+ interface DshModulesLike {
34
+ import(specifier: string): Promise<unknown>;
35
+ }
36
+ /**
37
+ * Compatibility shim: mount `window.__DSH_MODULES__` for plugins that read the
38
+ * client module system off the global.
39
+ *
40
+ * dsh ≤ 0.1.0-rc.7 set `globalThis.__DSH_MODULES__ = <ClientModuleSystem>`
41
+ * during web boot; 0.1.0-rc.8+ stopped exposing it globally and instead hands
42
+ * the same instance to the cordis client loader as `ctx.loader.internal`.
43
+ * Plugins built against the old global (e.g. dsh-better-sidebar's lazy chunks)
44
+ * break with "client module system unavailable" on the new versions. dshloader
45
+ * bridges the gap so those plugins need no change across every dsh version:
46
+ * when the global is missing but the cordis loader carries the module system,
47
+ * mirror it back onto the global.
48
+ *
49
+ * Returns true when the global is present after this call (either it already
50
+ * was, or we just mirrored it).
51
+ */
52
+ export declare function ensureDshModulesGlobal(win: DshLoaderWindowLike, ctx: {
53
+ loader?: {
54
+ internal?: DshModulesLike;
55
+ };
56
+ } | undefined): boolean;
32
57
  export declare class ModuleNotFoundError extends Error {
33
58
  specifier: string;
34
59
  constructor(specifier: string);
@@ -152,5 +177,8 @@ export declare const name = "@dsh-plugin/dsh-loader";
152
177
  export declare const inject: string[];
153
178
  export declare function apply(ctx: {
154
179
  get?: (name: string) => any;
180
+ loader?: {
181
+ internal?: DshModulesLike;
182
+ };
155
183
  }): void;
156
184
  export {};
@@ -1,2 +1,2 @@
1
- export declare const LOADER_VERSION = "1.3.0";
1
+ export declare const LOADER_VERSION = "1.3.1";
2
2
  export declare const LOG_PREFIX = "[dshloader]";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plugin/dsh-loader",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Runtime compatibility shim for dsh (DeepSeek Harness) cordis bundle plugins: decouples third-party plugins from real dsh internal service names, module paths, and RPC details via a version-aware adapter registry.",
5
5
  "type": "module",
6
6
  "repository": {