@dsh-plugin/dsh-loader 1.3.3-dev.33217535464 → 1.3.3-dev.33722395196
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/dist/adapters/dsh-1-x.d.ts +10 -3
- package/dist/adapters/dsh-1-x.js +85 -16
- package/dist/adapters/dsh-1-x.js.map +1 -1
- package/dist/api.js +5 -5
- package/dist/api.js.map +1 -1
- package/dist/client-connection-api-compat.d.ts +3 -0
- package/dist/client-connection-api-compat.js +24 -2
- package/dist/client-connection-api-compat.js.map +1 -1
- package/dist/client.d.ts +8 -0
- package/dist/client.js +53 -12
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +27 -4
- package/dist/index.js +98 -16
- package/dist/index.js.map +1 -1
- package/dist/services/settings.js +62 -6
- package/dist/services/settings.js.map +1 -1
- package/dist/setup.js +13 -0
- package/dist/setup.js.map +1 -1
- package/dist/types.d.ts +11 -8
- package/lib/client.js +80 -30
- package/lib/client.js.map +1 -1
- package/lib/types/adapters/dsh-1-x.d.ts +10 -3
- package/lib/types/client-connection-api-compat.d.ts +3 -0
- package/lib/types/client-ui.d.ts +4 -0
- package/lib/types/client.d.ts +8 -0
- package/lib/types/types.d.ts +11 -8
- package/package.json +1 -1
|
@@ -6,9 +6,16 @@ export declare const hostPackageAliases: Record<string, string>;
|
|
|
6
6
|
export declare const clientModuleAliases: Record<string, string>;
|
|
7
7
|
export declare const clientPackageAliases: Record<string, string>;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Ensure the single Module._resolveFilename hook exists and merge `aliases`
|
|
10
|
+
* into its shared map. Never adds a wrapper: repeat calls (runtime
|
|
11
|
+
* `registerPackageAlias`, HMR re-apply) only mutate the map. When the chain
|
|
12
|
+
* top was replaced without chaining into us (the mapping silently stops
|
|
13
|
+
* applying), the hook is re-pointed at the current top — still the same
|
|
14
|
+
* single wrapper, no growth.
|
|
15
|
+
*
|
|
16
|
+
* Returns a dispose function that rolls back exactly the entries this call
|
|
17
|
+
* set (when unchanged since) and restores the original resolver once the
|
|
18
|
+
* last registrant disposes.
|
|
12
19
|
*/
|
|
13
20
|
export declare function installHostPackageAliases(aliases: Record<string, string>): Promise<() => void>;
|
|
14
21
|
/**
|
|
@@ -6,6 +6,9 @@ export declare const REMOTE_SERVICE = "remote";
|
|
|
6
6
|
export interface ConnectionApiCompatContext {
|
|
7
7
|
get?(name: string): unknown;
|
|
8
8
|
inject?(inject: string[], callback: (ctx: ConnectionApiCompatContext) => unknown): unknown;
|
|
9
|
+
/** cordis effect hook: when present, the bridge assignment and the
|
|
10
|
+
* fallback timer are torn down with the fiber (HMR-safe). */
|
|
11
|
+
effect?(fn: () => (() => void) | void): unknown;
|
|
9
12
|
}
|
|
10
13
|
/** Bare RpcResult the 0.1.2 Typert remote resolves to. */
|
|
11
14
|
export interface RpcResultOk<T> {
|
package/lib/types/client-ui.d.ts
CHANGED
|
@@ -53,5 +53,9 @@ interface ClientContextLike {
|
|
|
53
53
|
* facade, then publishes it both as the `dshLoaderUi` cordis service
|
|
54
54
|
* (ordered access) and on `window.__dshLoader__.ui` (ad-hoc access from
|
|
55
55
|
* non-cordis code).
|
|
56
|
+
*
|
|
57
|
+
* Every patch installClient makes (the load wrapper, the settings fetch
|
|
58
|
+
* interceptor) is registered through `ctx.effect`, so fiber unload / HMR
|
|
59
|
+
* reverts them instead of stacking wrappers on the shared window.
|
|
56
60
|
*/
|
|
57
61
|
export declare function apply(ctx: ClientContextLike): void;
|
package/lib/types/client.d.ts
CHANGED
|
@@ -124,6 +124,13 @@ interface InstallClientOpts {
|
|
|
124
124
|
clientCtx?: {
|
|
125
125
|
get?: (name: string) => any;
|
|
126
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* cordis effect hook (`ctx.effect`): the load wrapper and fetch
|
|
129
|
+
* interceptor register their disposers through it so fiber unload / HMR
|
|
130
|
+
* tears the patches down instead of leaking them. Absent in bare test
|
|
131
|
+
* environments, where patches simply live for the process.
|
|
132
|
+
*/
|
|
133
|
+
effect?: (fn: () => (() => void) | void) => unknown;
|
|
127
134
|
}
|
|
128
135
|
/**
|
|
129
136
|
* Install dshloader into a browser-like environment.
|
|
@@ -183,5 +190,6 @@ export declare function apply(ctx: {
|
|
|
183
190
|
loader?: {
|
|
184
191
|
internal?: DshModulesLike;
|
|
185
192
|
};
|
|
193
|
+
effect?: (fn: () => (() => void) | void) => unknown;
|
|
186
194
|
}): void;
|
|
187
195
|
export {};
|
package/lib/types/types.d.ts
CHANGED
|
@@ -90,16 +90,19 @@ export interface SettingsAPI {
|
|
|
90
90
|
*/
|
|
91
91
|
namespace(id: string): any;
|
|
92
92
|
/**
|
|
93
|
-
* Install the canonical optional-settings consumer wiring
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
93
|
+
* Install the canonical optional-settings consumer wiring: register `ns`
|
|
94
|
+
* with `entry` as the `base` layer, point the hooks' source thunk at the
|
|
95
|
+
* resolved scope while a settings service exists, and fall back to `entry`
|
|
96
|
+
* when it goes away.
|
|
97
97
|
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
98
|
+
* Delegates to dsh's `installSettingsSection` when the module exports it
|
|
99
|
+
* (dsh ≤ 0.1.2-alpha.1); on dsh ≥ 0.1.2-alpha.2 (which dropped the export
|
|
100
|
+
* but kept the settings service register() contract identical) the facade
|
|
101
|
+
* runs a faithful port of the same upstream semantics instead.
|
|
100
102
|
*
|
|
101
|
-
* @returns `true` when the wiring was installed, `false` when
|
|
102
|
-
*
|
|
103
|
+
* @returns `true` when the wiring was installed, `false` when the caller's
|
|
104
|
+
* context cannot inject the settings service (the caller then keeps using
|
|
105
|
+
* its composition entry).
|
|
103
106
|
*/
|
|
104
107
|
installSection<T>(ctx: any, ns: any, schema: any, entry: T, hooks: {
|
|
105
108
|
setSource(current: () => T): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plugin/dsh-loader",
|
|
3
|
-
"version": "1.3.3-dev.
|
|
3
|
+
"version": "1.3.3-dev.33722395196",
|
|
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": {
|