@qilin-agent/dsh-compat 3.1.4 → 3.1.6
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 +54 -3
- package/lib/types/aliases.d.ts +13 -2
- package/lib/types/index.d.ts +2 -2
- package/lib/types/manifest.d.ts +7 -0
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* DSH-era module-name aliases.
|
|
4
4
|
*
|
|
5
|
-
* QiLin renamed every harness package
|
|
6
|
-
*
|
|
5
|
+
* QiLin renamed every harness package in the scope below, but the
|
|
6
|
+
* channel sync still hands this layer the upstream spellings, so
|
|
7
7
|
* DSH plugin ecosystem ships prebuilt bundles whose factories `require()` the
|
|
8
8
|
* old names. The static platform aliases keep those `require` calls resolvable
|
|
9
9
|
* against QiLin's module table, and {@link dshCompatModuleId} canonicalizes the
|
|
@@ -41,6 +41,22 @@ const DSH_PACKAGE_PREFIX = "@deepseek-ai/dsh-";
|
|
|
41
41
|
/** The QiLin scope the prefix rule maps package heads onto. */
|
|
42
42
|
const QILIN_SCOPE = "@qilin-agent/";
|
|
43
43
|
/**
|
|
44
|
+
* QiLin names the exact alias tables produce, reversed back onto their DSH-era
|
|
45
|
+
* spellings. The vendored foundations keep their published DSH-era names:
|
|
46
|
+
* schemastery stayed scoped, cosmokit was unscoped in the DSH ecosystem
|
|
47
|
+
* ([rescope mapping](../../../../../docs/rescope.md)).
|
|
48
|
+
*/
|
|
49
|
+
const QILIN_EXACT_ALIASES = {
|
|
50
|
+
"@qilin-agent/kylin": "@deepseek-ai/cordis",
|
|
51
|
+
"@qilin-agent/schemastery": "@deepseek-ai/schemastery",
|
|
52
|
+
"@qilin-agent/cosmokit": "@qilin-agent/cosmokit",
|
|
53
|
+
"@qilin-agent/cli": "@deepseek-ai/dsh",
|
|
54
|
+
"@qilin-agent/client-store": "@deepseek-ai/dsh-client-store",
|
|
55
|
+
"@qilin-agent/client-ui-slots": "@deepseek-ai/dsh-client-ui-slots",
|
|
56
|
+
"@qilin-agent/client-ui-primitives": "@deepseek-ai/dsh-client-ui-primitives",
|
|
57
|
+
"@qilin-agent/client-ui-dockkit": "@deepseek-ai/dsh-client-ui-dockkit"
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
44
60
|
* Package heads whose QiLin name is not the mechanical `dsh-` strip. The DSH
|
|
45
61
|
* client module system (`client-runtime`) is QiLin's `client-modules`; the
|
|
46
62
|
* Cordis runner and tool family, the agent preset, and the DSH-SDK subagent
|
|
@@ -65,6 +81,8 @@ const DSH_PACKAGE_RENAMES = {
|
|
|
65
81
|
"skill-badge": "experimental-skill-badge",
|
|
66
82
|
"session-title-all-prompts-llm": "experimental-session-title-all-prompts-llm"
|
|
67
83
|
};
|
|
84
|
+
/** DSH-era package heads the rename table maps QiLin heads back onto. */
|
|
85
|
+
const QILIN_TO_DSH_HEADS = Object.fromEntries(Object.entries(DSH_PACKAGE_RENAMES).map(([dshHead, qilinHead]) => [qilinHead, dshHead]));
|
|
68
86
|
/**
|
|
69
87
|
* Canonicalize one module specifier for QiLin's module graph: an exact
|
|
70
88
|
* platform or application alias wins; a scoped `@deepseek-ai/dsh-<pkg>[/subpath]` name maps
|
|
@@ -82,6 +100,24 @@ function dshCompatModuleId(specifier) {
|
|
|
82
100
|
const [head = "", ...subpath] = specifier.slice(17).split("/");
|
|
83
101
|
return QILIN_SCOPE + [DSH_PACKAGE_RENAMES[head] ?? head, ...subpath].join("/");
|
|
84
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* The DSH-era name one QiLin harness package also published under, when it has
|
|
105
|
+
* one: the inverse of {@link dshCompatModuleId} for the mechanical rescope and
|
|
106
|
+
* the exact alias values. Subpaths carry through (`@qilin-agent/session/sub`
|
|
107
|
+
* aliases to `@deepseek-ai/dsh-session/sub`). Vendored foundations without a
|
|
108
|
+
* DSH-era name and QiLin-authored families outside the rescope return
|
|
109
|
+
* undefined.
|
|
110
|
+
* @param qilinName - the QiLin package name (optionally with a subpath).
|
|
111
|
+
* @returns the DSH-era alias, or undefined when the name has none.
|
|
112
|
+
*/
|
|
113
|
+
function dshCompatAliasOf(qilinName) {
|
|
114
|
+
const exact = QILIN_EXACT_ALIASES[qilinName];
|
|
115
|
+
if (exact !== void 0) return exact;
|
|
116
|
+
if (!qilinName.startsWith(QILIN_SCOPE)) return void 0;
|
|
117
|
+
const [head = "", ...subpath] = qilinName.slice(13).split("/");
|
|
118
|
+
if (head.startsWith("kylin-plugin-")) return void 0;
|
|
119
|
+
return DSH_PACKAGE_PREFIX + [QILIN_TO_DSH_HEADS[head] ?? head, ...subpath].join("/");
|
|
120
|
+
}
|
|
85
121
|
//#endregion
|
|
86
122
|
//#region lib/types/manifest.js
|
|
87
123
|
/**
|
|
@@ -113,6 +149,21 @@ function bundlePatchOf(manifest) {
|
|
|
113
149
|
if (typeof dsh === "string") return dsh;
|
|
114
150
|
}
|
|
115
151
|
/**
|
|
152
|
+
* Read a bundle's declared patch files from either manifest channel, in application order.
|
|
153
|
+
* @param manifest - the bundle's parsed package.json.
|
|
154
|
+
* @returns the declared patch files; empty when the bundle declares none.
|
|
155
|
+
* @throws when a declaration is neither a string nor a list of strings.
|
|
156
|
+
*/
|
|
157
|
+
function bundlePatchFilesOf(manifest) {
|
|
158
|
+
const channels = manifest;
|
|
159
|
+
if (typeof channels !== "object" || channels === null) return [];
|
|
160
|
+
const declared = channels.qilin?.bundle?.patch ?? channels.dsh?.bundle?.patch;
|
|
161
|
+
if (declared === void 0) return [];
|
|
162
|
+
const files = typeof declared === "string" ? [declared] : declared;
|
|
163
|
+
if (!Array.isArray(files) || !files.every((file) => typeof file === "string")) throw new Error("qilin.bundle.patch must be a file path or a list of file paths");
|
|
164
|
+
return files;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
116
167
|
* Pick a package's client declaration: `qilin.client` when present (the
|
|
117
168
|
* native key wins for a package that carries both), else `dsh.client`.
|
|
118
169
|
* @param manifest - the parsed `package.json` value of the package.
|
|
@@ -133,4 +184,4 @@ function clientDeclarationOf(manifest) {
|
|
|
133
184
|
};
|
|
134
185
|
}
|
|
135
186
|
//#endregion
|
|
136
|
-
export { DSH_APPLICATION_MODULE_ALIASES, DSH_PLATFORM_MODULE_ALIASES, bundlePatchOf, clientDeclarationOf, dshCompatModuleId };
|
|
187
|
+
export { DSH_APPLICATION_MODULE_ALIASES, DSH_PLATFORM_MODULE_ALIASES, bundlePatchFilesOf, bundlePatchOf, clientDeclarationOf, dshCompatAliasOf, dshCompatModuleId };
|
package/lib/types/aliases.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DSH-era module-name aliases.
|
|
3
3
|
*
|
|
4
|
-
* QiLin renamed every harness package
|
|
5
|
-
*
|
|
4
|
+
* QiLin renamed every harness package in the scope below, but the
|
|
5
|
+
* channel sync still hands this layer the upstream spellings, so
|
|
6
6
|
* DSH plugin ecosystem ships prebuilt bundles whose factories `require()` the
|
|
7
7
|
* old names. The static platform aliases keep those `require` calls resolvable
|
|
8
8
|
* against QiLin's module table, and {@link dshCompatModuleId} canonicalizes the
|
|
@@ -38,4 +38,15 @@ export declare const DSH_APPLICATION_MODULE_ALIASES: Readonly<Record<string, str
|
|
|
38
38
|
* @returns the QiLin-canonical specifier for graph and seed-table lookups.
|
|
39
39
|
*/
|
|
40
40
|
export declare function dshCompatModuleId(specifier: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* The DSH-era name one QiLin harness package also published under, when it has
|
|
43
|
+
* one: the inverse of {@link dshCompatModuleId} for the mechanical rescope and
|
|
44
|
+
* the exact alias values. Subpaths carry through (`@qilin-agent/session/sub`
|
|
45
|
+
* aliases to `@deepseek-ai/dsh-session/sub`). Vendored foundations without a
|
|
46
|
+
* DSH-era name and QiLin-authored families outside the rescope return
|
|
47
|
+
* undefined.
|
|
48
|
+
* @param qilinName - the QiLin package name (optionally with a subpath).
|
|
49
|
+
* @returns the DSH-era alias, or undefined when the name has none.
|
|
50
|
+
*/
|
|
51
|
+
export declare function dshCompatAliasOf(qilinName: string): string | undefined;
|
|
41
52
|
//# sourceMappingURL=aliases.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* {@link ./manifest.ts}.
|
|
5
5
|
* @module @qilin-agent/dsh-compat
|
|
6
6
|
*/
|
|
7
|
-
export { DSH_APPLICATION_MODULE_ALIASES, DSH_PLATFORM_MODULE_ALIASES, dshCompatModuleId, } from './aliases.ts';
|
|
8
|
-
export { bundlePatchOf, clientDeclarationOf, type ClientDeclaration, type ClientDeclarationKey, } from './manifest.ts';
|
|
7
|
+
export { DSH_APPLICATION_MODULE_ALIASES, DSH_PLATFORM_MODULE_ALIASES, dshCompatAliasOf, dshCompatModuleId, } from './aliases.ts';
|
|
8
|
+
export { bundlePatchFilesOf, bundlePatchOf, clientDeclarationOf, type ClientDeclaration, type ClientDeclarationKey, } from './manifest.ts';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/manifest.d.ts
CHANGED
|
@@ -19,6 +19,13 @@
|
|
|
19
19
|
* @returns the declared patch path, or `undefined` when neither key declares one.
|
|
20
20
|
*/
|
|
21
21
|
export declare function bundlePatchOf(manifest: unknown): string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Read a bundle's declared patch files from either manifest channel, in application order.
|
|
24
|
+
* @param manifest - the bundle's parsed package.json.
|
|
25
|
+
* @returns the declared patch files; empty when the bundle declares none.
|
|
26
|
+
* @throws when a declaration is neither a string nor a list of strings.
|
|
27
|
+
*/
|
|
28
|
+
export declare function bundlePatchFilesOf(manifest: unknown): string[];
|
|
22
29
|
/** Which manifest key supplied a client declaration. */
|
|
23
30
|
export type ClientDeclarationKey = 'qilin.client' | 'dsh.client';
|
|
24
31
|
/** One picked client declaration: the key that supplied it and its raw value. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/dsh-compat",
|
|
3
3
|
"description": "DSH-era plugin ecosystem compatibility: module-name aliases and manifest-key fallback readers",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.6",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
],
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@qilin-agent/kylin": "~4.0.
|
|
33
|
+
"@qilin-agent/kylin": "~4.0.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@qilin-agent/kylin": "~4.0.
|
|
36
|
+
"@qilin-agent/kylin": "~4.0.5"
|
|
37
37
|
}
|
|
38
38
|
}
|