dsh-mnemon 0.5.26 → 0.5.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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/lib/bundle.js +1 -1
- package/lib/client.js +2065 -1268
- package/lib/extension-sdk.js +18 -2
- package/lib/index.js +643 -198
- package/lib/{starter-resolution-BjfPGF8R.js → starter-resolution-CLmHa3uV.js} +2 -2
- package/lib/starter.js +1 -1
- package/lib/types/src/client/locales.d.ts +153 -100
- package/lib/types/src/host/protocol.d.ts +57 -2
- package/package.json +3 -3
package/lib/extension-sdk.js
CHANGED
|
@@ -2,18 +2,34 @@ import { a as memoryConfigurationDigest, c as record, d as truncate, f as withMe
|
|
|
2
2
|
import { COMPOSABLE_MEMORY_API_VERSION, MEMORY_VIEW_EXTENSION_SLOTS } from "./contracts.js";
|
|
3
3
|
import { a as defineMemoryStrategy, i as defineMemorySource, o as defineMemoryStrategyExtension, r as defineMemoryPlugin } from "./definitions-j9QPbrXb.js";
|
|
4
4
|
//#region src/sdk/install.ts
|
|
5
|
+
function locatedEntryId(ctx) {
|
|
6
|
+
const located = ctx.get("loader", false)?.locate(ctx.fiber)?.trim();
|
|
7
|
+
return located === "" ? void 0 : located;
|
|
8
|
+
}
|
|
5
9
|
function stableEntryId(ctx, explicit) {
|
|
6
10
|
const configured = explicit?.trim();
|
|
7
11
|
if (configured !== void 0 && configured !== "") return configured;
|
|
8
|
-
const located =
|
|
9
|
-
if (located !== void 0
|
|
12
|
+
const located = locatedEntryId(ctx);
|
|
13
|
+
if (located !== void 0) return located;
|
|
10
14
|
throw new Error("installMemory requires a stable Loader Entry id; pass options.instanceId for direct ctx.plugin() mounts");
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
17
|
+
* dshmarket mounts `mkt-client-<package>` for a profile dependency that
|
|
18
|
+
* declares `dsh.client` without `dsh.bundle`, meant to run no host code. A
|
|
19
|
+
* Source installed on its own in a profile matches that rule although the
|
|
20
|
+
* Starter composes it, and dshmarket 1.66 imports the real module there, so
|
|
21
|
+
* the Source would register a second instance (#359). Nothing installs under
|
|
22
|
+
* such a mount, whatever identity the plugin passes. The Loader prefixes an
|
|
23
|
+
* Entry id with its parents' ids, as in `include:dsh-market:mkt-client-<package>`,
|
|
24
|
+
* so the last segment names it.
|
|
25
|
+
*/
|
|
26
|
+
const MARKET_CLIENT_SHIM = /(?:^|:)mkt-client-[^:]*$/u;
|
|
27
|
+
/**
|
|
13
28
|
* Register a plugin's Source and/or Strategy definitions as one Fiber-owned batch.
|
|
14
29
|
* Contribution roles do not dictate package or repository boundaries.
|
|
15
30
|
*/
|
|
16
31
|
function installMemory(ctx, contribution, options = {}) {
|
|
32
|
+
if (MARKET_CLIENT_SHIM.test(locatedEntryId(ctx) ?? "")) return;
|
|
17
33
|
const entryId = stableEntryId(ctx, options.instanceId);
|
|
18
34
|
ctx.effect(() => ctx.mnemonMemory.installContributions(contribution, {
|
|
19
35
|
...options,
|