@qilin-agent/dsh-compat 0.0.0-stage → 3.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kkutysllb
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,34 @@
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/util/dsh-compat/README.md
5
+ /:
6
+ en: 31f4d375f2c45aef
7
+ zh: 9beef4241a4e4953
8
+ /qilin-dsh-compat:
9
+ en: da01746b6aa01ff3
10
+ zh: d4f949eaed1392ea
11
+ /qilin-dsh-compat/summary:
12
+ en: 38552b541bcab51a
13
+ zh: b18b352279f6adda
14
+ /qilin-dsh-compat/table-of-contents:
15
+ en: 76368b6b1da79c80
16
+ zh: b4a2a0e132e8ddf8
17
+ /qilin-dsh-compat/use-this-package:
18
+ en: d0ad8090a9dbf715
19
+ zh: 90dcbcf230062cab
20
+ /qilin-dsh-compat/understand-the-implementation:
21
+ en: e9f1d745306596fd
22
+ zh: c547396e19b6eaa8
23
+ /qilin-dsh-compat/model-experience:
24
+ en: 0c1978665c0886b0
25
+ zh: d0159681b5568bdb
26
+ /qilin-dsh-compat/model-experience/kv-cache-effect:
27
+ en: 5df5e153f56aec41
28
+ zh: 7f70d29d8d80cb58
29
+ /qilin-dsh-compat/known-limitations-and-deferred-work:
30
+ en: ff21fa030cc8c41b
31
+ zh: b4246c9cff73db62
32
+ /qilin-dsh-compat/known-limitations-and-deferred-work/dev-note:
33
+ en: 6500ff89363ef9e9
34
+ zh: 2699e3038d5414cf
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ ---
2
+ description: "Runtime compatibility helpers that let QiLin load DSH-era plugin manifests and module names."
3
+ kind: "package-library"
4
+ ---
2
5
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
6
+ # @qilin-agent/dsh-compat
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ This package keeps the DSH plugin ecosystem usable in QiLin. It selects a bundle or client declaration from either the native `qilin` manifest key or the DSH-era `dsh` key, and canonicalizes renamed DSH module specifiers onto QiLin module-table entries.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Model Experience](#model-experience)
19
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
20
+ - [Dev Note](#dev-note)
21
+
22
+ -----
23
+
24
+ <a id="use-this-package"></a>
25
+ ## Use this package
26
+
27
+ Profile loading, the plugin manager's install gate and bundle inventory, and the client test runtime's roster use `bundlePatchOf` for `qilin.bundle.patch` and `dsh.bundle.patch`. The client module graph and browser loader use `clientDeclarationOf` and `dshCompatModuleId` so prebuilt DSH factories can keep their original `require()` names.
28
+
29
+ The exact platform aliases are exported as `DSH_PLATFORM_MODULE_ALIASES`. Unknown third-party names pass through unchanged; the compatibility layer does not replace service implementations or provide Electron-only APIs.
30
+
31
+ -----
32
+
33
+ <a id="understand-the-implementation"></a>
34
+ ## Understand the implementation
35
+
36
+ The manifest reader gives a QiLin declaration precedence when both keys exist. The module resolver applies explicit aliases first, then maps `@deepseek-ai/dsh-<name>` to `@qilin-agent/<name>`; `client-runtime` maps to QiLin’s `client-modules` package. The browser shell seeds static platform aliases, while dynamic graph edges and factory requests are canonicalized at their owning loaders.
37
+
38
+ -----
39
+
40
+ <a id="model-experience"></a>
41
+ ## Model Experience
42
+
43
+ None, as this utility only maps DSH-era manifest keys and module names; it changes no prompt, tool schema, session event, or token budget.
44
+
45
+ #### KV Cache effect
46
+
47
+ None; it adds nothing to a request and subscribes to no cached prefix.
48
+
49
+ ## Known Limitations and Deferred Work
50
+
51
+ <a id="known-limitations-and-deferred-work"></a>
52
+
53
+ - **Engine-specific DSH plugins still need per-plugin validation** — plugins that depend on engine-specific services, resource URL schemes, or Electron bridges are out of scope. This package handles manifest and module identity compatibility only; it does not emulate API drift between DSH and QiLin.
54
+
55
+ <a id="dev-note"></a>
56
+ ### Dev Note
57
+
58
+ The alias table mirrors the DSH-to-QiLin package renames used by the vendored coding-sidebar channel. Add a mapping only when a real DSH package or bundle requires it, and cover both graph ordering and browser `require()` behavior.
package/README.zh.md ADDED
@@ -0,0 +1,58 @@
1
+ ---
2
+ description: "让 QiLin 加载 DSH 时代插件 manifest 与模块名称的运行时兼容工具。"
3
+ kind: "package-library"
4
+ ---
5
+
6
+ # @qilin-agent/dsh-compat
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ 本包保持 DSH 插件生态在 QiLin 中可用。它会从原生的 `qilin` manifest 键或 DSH 时代的 `dsh` 键读取 bundle/client 声明,并把已重命名的 DSH 模块说明符归一化到 QiLin 的模块表条目。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [模型体验](#model-experience)
19
+ - [已知限制与延后工作](#known-limitations-and-deferred-work)
20
+ - [开发备注](#dev-note)
21
+
22
+ -----
23
+
24
+ <a id="use-this-package"></a>
25
+ ## 使用本包
26
+
27
+ Profile 加载、插件管理器的安装门与 bundle 清单、以及客户端测试运行时的 roster 通过 `bundlePatchOf` 同时读取 `qilin.bundle.patch` 与 `dsh.bundle.patch`。客户端模块图和浏览器加载器通过 `clientDeclarationOf` 与 `dshCompatModuleId` 处理预构建 DSH 工厂,使其可以保留原有的 `require()` 名称。
28
+
29
+ 精确的平台别名由 `DSH_PLATFORM_MODULE_ALIASES` 导出。未知的第三方名称保持不变;兼容层不会替换服务实现,也不会提供 Electron 专属 API。
30
+
31
+ -----
32
+
33
+ <a id="understand-the-implementation"></a>
34
+ ## 实现说明
35
+
36
+ 当两个键同时存在时,manifest 读取器优先使用 QiLin 声明。模块解析先应用精确别名,再把 `@deepseek-ai/dsh-<name>` 映射到 `@qilin-agent/<name>`;其中 `client-runtime` 映射到 QiLin 的 `client-modules`。浏览器 shell 提供静态平台别名,动态图边与工厂请求在各自的加载器中归一化。
37
+
38
+ -----
39
+
40
+ <a id="model-experience"></a>
41
+ ## 模型体验
42
+
43
+ 无,因为本工具只映射 DSH 时代的 manifest 键与模块名称;它不改变任何 prompt、工具 schema、Session 事件或 token 预算。
44
+
45
+ #### KV Cache 影响
46
+
47
+ 无;它不为请求增加任何内容,也不订阅任何缓存前缀。
48
+
49
+ ## 已知限制与延后工作
50
+
51
+ <a id="known-limitations-and-deferred-work"></a>
52
+
53
+ - **依赖引擎细节的 DSH 插件仍需逐个验证** —— 依赖引擎专属服务、资源 URL scheme 或 Electron bridge 的插件不在范围内。本包只处理 manifest 与模块身份兼容,不模拟 DSH 与 QiLin 之间已经漂移的 API。
54
+
55
+ <a id="dev-note"></a>
56
+ ### 开发备注
57
+
58
+ 别名表与 vendored coding-sidebar channel 使用的 DSH 到 QiLin 包名重写保持一致。只有在真实 DSH 包或 bundle 需要时增加映射,并同时覆盖图排序与浏览器 `require()` 行为。
package/lib/index.js ADDED
@@ -0,0 +1,108 @@
1
+ //#region lib/types/aliases.js
2
+ /**
3
+ * DSH-era module-name aliases.
4
+ *
5
+ * QiLin renamed every harness package (`@deepseek-ai/cordis` → `@qilin-agent/kylin`,
6
+ * `@deepseek-ai/dsh-client-ui-slots` → `@qilin-agent/client-ui-slots`, …), but the
7
+ * DSH plugin ecosystem ships prebuilt bundles whose factories `require()` the
8
+ * old names. The static platform aliases keep those `require` calls resolvable
9
+ * against QiLin's module table, and {@link dshCompatModuleId} canonicalizes the
10
+ * package-name edges (boot-graph `inject`/`external` lists) onto the renamed
11
+ * rows. The mapping mirrors the mechanical rewrite table of the vendored
12
+ * channel sync (`dsh-coding-sidebar` `scripts/sync-to-qilin.mjs` IMPORT_MAP) —
13
+ * keep the two tables consistent by hand: this package is the runtime source.
14
+ * @module @qilin-agent/dsh-compat/aliases
15
+ */
16
+ /**
17
+ * Exact aliases for the DSH-era platform (static) module names, including the
18
+ * bare `cordis` spelling some bundles require. Keys are DSH-era specifiers;
19
+ * values are QiLin platform module names (each also a static seed-table key).
20
+ */
21
+ const DSH_PLATFORM_MODULE_ALIASES = {
22
+ "cordis": "@qilin-agent/kylin",
23
+ "@deepseek-ai/cordis": "@qilin-agent/kylin",
24
+ "@deepseek-ai/schemastery": "@qilin-agent/schemastery",
25
+ "@deepseek-ai/dsh-client-store": "@qilin-agent/client-store",
26
+ "@deepseek-ai/dsh-client-ui-slots": "@qilin-agent/client-ui-slots",
27
+ "@deepseek-ai/dsh-client-ui-primitives": "@qilin-agent/client-ui-primitives",
28
+ "@deepseek-ai/dsh-client-ui-dockkit": "@qilin-agent/client-ui-dockkit"
29
+ };
30
+ /** The scoped prefix every renamed DSH engine package shares. */
31
+ const DSH_PACKAGE_PREFIX = "@deepseek-ai/dsh-";
32
+ /** The QiLin scope the prefix rule maps package heads onto. */
33
+ const QILIN_SCOPE = "@qilin-agent/";
34
+ /**
35
+ * Package heads whose QiLin name is not the mechanical `dsh-` strip: the
36
+ * DSH client module system (`dsh-client-runtime`) is QiLin's
37
+ * `@qilin-agent/client-modules`.
38
+ */
39
+ const DSH_PACKAGE_RENAMES = { "client-runtime": "client-modules" };
40
+ /**
41
+ * Canonicalize one module specifier for QiLin's module graph: an exact
42
+ * platform alias wins; a scoped `@deepseek-ai/dsh-<pkg>[/subpath]` name maps
43
+ * onto `@qilin-agent/<pkg>[/subpath]` with the rename table applied to the package
44
+ * head; every other specifier (including unrenamed `@deepseek-ai/*` names such
45
+ * as `@qilin-agent/schemastery`, which QiLin keeps verbatim) passes through
46
+ * unchanged.
47
+ * @param specifier - the specifier a manifest edge or a bundle `require` named.
48
+ * @returns the QiLin-canonical specifier for graph and seed-table lookups.
49
+ */
50
+ function dshCompatModuleId(specifier) {
51
+ const exact = DSH_PLATFORM_MODULE_ALIASES[specifier];
52
+ if (exact !== void 0) return exact;
53
+ if (!specifier.startsWith(DSH_PACKAGE_PREFIX)) return specifier;
54
+ const [head = "", ...subpath] = specifier.slice(17).split("/");
55
+ return QILIN_SCOPE + [DSH_PACKAGE_RENAMES[head] ?? head, ...subpath].join("/");
56
+ }
57
+ //#endregion
58
+ //#region lib/types/manifest.js
59
+ /**
60
+ * Manifest-key fallback readers for DSH-era plugin packages.
61
+ *
62
+ * A DSH plugin's `package.json` declares its Harness metadata under the `dsh`
63
+ * key (`dsh.bundle.patch`, `dsh.client`); a QiLin-native package declares the
64
+ * same shape under `qilin`. These readers pick the declaration a package
65
+ * actually carries so the profile launcher and the client module system mount
66
+ * either channel's packages unchanged. Each reader validates only its own
67
+ * pick (string presence for the patch path); the owning consumer keeps its
68
+ * full structural validation and error reporting.
69
+ * @module @qilin-agent/dsh-compat/manifest
70
+ */
71
+ /**
72
+ * The relative patch-file path a bundle package declares, from `qilin.bundle.patch`
73
+ * when the package carries the native key and from `dsh.bundle.patch` otherwise.
74
+ * A present-but-non-string declaration falls through to the other channel and
75
+ * finally to `undefined`, so the caller's fail-loud path reports it.
76
+ * @param manifest - the parsed `package.json` value of the bundle package.
77
+ * @returns the declared patch path, or `undefined` when neither key declares one.
78
+ */
79
+ function bundlePatchOf(manifest) {
80
+ const channels = manifest;
81
+ if (typeof channels !== "object" || channels === null) return void 0;
82
+ const qilin = channels.qilin?.bundle?.patch;
83
+ if (typeof qilin === "string") return qilin;
84
+ const dsh = channels.dsh?.bundle?.patch;
85
+ if (typeof dsh === "string") return dsh;
86
+ }
87
+ /**
88
+ * Pick a package's client declaration: `qilin.client` when present (the
89
+ * native key wins for a package that carries both), else `dsh.client`.
90
+ * @param manifest - the parsed `package.json` value of the package.
91
+ * @returns the picked declaration, or `undefined` when neither key declares one.
92
+ */
93
+ function clientDeclarationOf(manifest) {
94
+ const channels = manifest;
95
+ if (typeof channels !== "object" || channels === null) return void 0;
96
+ const qilin = channels.qilin?.client;
97
+ if (qilin !== void 0) return {
98
+ key: "qilin.client",
99
+ value: qilin
100
+ };
101
+ const dsh = channels.dsh?.client;
102
+ if (dsh !== void 0) return {
103
+ key: "dsh.client",
104
+ value: dsh
105
+ };
106
+ }
107
+ //#endregion
108
+ export { DSH_PLATFORM_MODULE_ALIASES, bundlePatchOf, clientDeclarationOf, dshCompatModuleId };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * DSH-era module-name aliases.
3
+ *
4
+ * QiLin renamed every harness package (`@deepseek-ai/cordis` → `@qilin-agent/kylin`,
5
+ * `@deepseek-ai/dsh-client-ui-slots` → `@qilin-agent/client-ui-slots`, …), but the
6
+ * DSH plugin ecosystem ships prebuilt bundles whose factories `require()` the
7
+ * old names. The static platform aliases keep those `require` calls resolvable
8
+ * against QiLin's module table, and {@link dshCompatModuleId} canonicalizes the
9
+ * package-name edges (boot-graph `inject`/`external` lists) onto the renamed
10
+ * rows. The mapping mirrors the mechanical rewrite table of the vendored
11
+ * channel sync (`dsh-coding-sidebar` `scripts/sync-to-qilin.mjs` IMPORT_MAP) —
12
+ * keep the two tables consistent by hand: this package is the runtime source.
13
+ * @module @qilin-agent/dsh-compat/aliases
14
+ */
15
+ /**
16
+ * Exact aliases for the DSH-era platform (static) module names, including the
17
+ * bare `cordis` spelling some bundles require. Keys are DSH-era specifiers;
18
+ * values are QiLin platform module names (each also a static seed-table key).
19
+ */
20
+ export declare const DSH_PLATFORM_MODULE_ALIASES: Readonly<Record<string, string>>;
21
+ /**
22
+ * Canonicalize one module specifier for QiLin's module graph: an exact
23
+ * platform alias wins; a scoped `@deepseek-ai/dsh-<pkg>[/subpath]` name maps
24
+ * onto `@qilin-agent/<pkg>[/subpath]` with the rename table applied to the package
25
+ * head; every other specifier (including unrenamed `@deepseek-ai/*` names such
26
+ * as `@qilin-agent/schemastery`, which QiLin keeps verbatim) passes through
27
+ * unchanged.
28
+ * @param specifier - the specifier a manifest edge or a bundle `require` named.
29
+ * @returns the QiLin-canonical specifier for graph and seed-table lookups.
30
+ */
31
+ export declare function dshCompatModuleId(specifier: string): string;
32
+ //# sourceMappingURL=aliases.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * DSH plugin ecosystem compatibility for QiLin: module-name aliases and
3
+ * manifest-key fallback readers. See {@link ./aliases.ts} and
4
+ * {@link ./manifest.ts}.
5
+ * @module @qilin-agent/dsh-compat
6
+ */
7
+ export { DSH_PLATFORM_MODULE_ALIASES, dshCompatModuleId, } from './aliases.ts';
8
+ export { bundlePatchOf, clientDeclarationOf, type ClientDeclaration, type ClientDeclarationKey, } from './manifest.ts';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Manifest-key fallback readers for DSH-era plugin packages.
3
+ *
4
+ * A DSH plugin's `package.json` declares its Harness metadata under the `dsh`
5
+ * key (`dsh.bundle.patch`, `dsh.client`); a QiLin-native package declares the
6
+ * same shape under `qilin`. These readers pick the declaration a package
7
+ * actually carries so the profile launcher and the client module system mount
8
+ * either channel's packages unchanged. Each reader validates only its own
9
+ * pick (string presence for the patch path); the owning consumer keeps its
10
+ * full structural validation and error reporting.
11
+ * @module @qilin-agent/dsh-compat/manifest
12
+ */
13
+ /**
14
+ * The relative patch-file path a bundle package declares, from `qilin.bundle.patch`
15
+ * when the package carries the native key and from `dsh.bundle.patch` otherwise.
16
+ * A present-but-non-string declaration falls through to the other channel and
17
+ * finally to `undefined`, so the caller's fail-loud path reports it.
18
+ * @param manifest - the parsed `package.json` value of the bundle package.
19
+ * @returns the declared patch path, or `undefined` when neither key declares one.
20
+ */
21
+ export declare function bundlePatchOf(manifest: unknown): string | undefined;
22
+ /** Which manifest key supplied a client declaration. */
23
+ export type ClientDeclarationKey = 'qilin.client' | 'dsh.client';
24
+ /** One picked client declaration: the key that supplied it and its raw value. */
25
+ export interface ClientDeclaration {
26
+ /** The manifest key the declaration was read from; consumers use it in diagnostics. */
27
+ readonly key: ClientDeclarationKey;
28
+ /** The raw declaration value; the consumer's structural validation applies unchanged. */
29
+ readonly value: unknown;
30
+ }
31
+ /**
32
+ * Pick a package's client declaration: `qilin.client` when present (the
33
+ * native key wins for a package that carries both), else `dsh.client`.
34
+ * @param manifest - the parsed `package.json` value of the package.
35
+ * @returns the picked declaration, or `undefined` when neither key declares one.
36
+ */
37
+ export declare function clientDeclarationOf(manifest: unknown): ClientDeclaration | undefined;
38
+ //# sourceMappingURL=manifest.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@qilin-agent/dsh-compat",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "DSH-era plugin ecosystem compatibility: module-name aliases and manifest-key fallback readers",
4
+ "version": "3.1.3",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/kkutysllb/QiLin.git",
11
+ "directory": "packages/util/dsh-compat"
12
+ },
13
+ "engines": {
14
+ "node": "^22.19.0 || >=24.0.0"
15
+ },
16
+ "type": "module",
17
+ "main": "lib/index.js",
18
+ "types": "lib/types/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./lib/types/index.d.ts",
22
+ "default": "./lib/index.js"
23
+ },
24
+ "./src/*": "./src/*",
25
+ "./package.json": "./package.json"
26
+ },
27
+ "files": [
28
+ "lib/index.js",
29
+ "lib/types/**/*.d.ts"
30
+ ],
31
+ "license": "MIT",
32
+ "peerDependencies": {
33
+ "@qilin-agent/kylin": "~4.0.3"
34
+ },
35
+ "devDependencies": {
36
+ "@qilin-agent/kylin": "~4.0.3"
37
+ }
6
38
  }