@qilin-agent/dsh-compat 0.0.0-stage → 3.1.4
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 +21 -0
- package/README.i18n.yaml +34 -0
- package/README.md +57 -2
- package/README.zh.md +58 -0
- package/lib/index.js +136 -0
- package/lib/types/aliases.d.ts +41 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/manifest.d.ts +38 -0
- package/package.json +35 -3
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.
|
package/README.i18n.yaml
ADDED
|
@@ -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-agent-dsh-compat:
|
|
9
|
+
en: d9c93221040cbdd1
|
|
10
|
+
zh: dd0b43d6e172f9fa
|
|
11
|
+
/qilin-agent-dsh-compat/summary:
|
|
12
|
+
en: 38552b541bcab51a
|
|
13
|
+
zh: b18b352279f6adda
|
|
14
|
+
/qilin-agent-dsh-compat/table-of-contents:
|
|
15
|
+
en: 76368b6b1da79c80
|
|
16
|
+
zh: b4a2a0e132e8ddf8
|
|
17
|
+
/qilin-agent-dsh-compat/use-this-package:
|
|
18
|
+
en: 5b39a3886f762bb5
|
|
19
|
+
zh: 79907bd12094a6ce
|
|
20
|
+
/qilin-agent-dsh-compat/understand-the-implementation:
|
|
21
|
+
en: d68592a80cda03af
|
|
22
|
+
zh: 80169f5e2d9d6019
|
|
23
|
+
/qilin-agent-dsh-compat/model-experience:
|
|
24
|
+
en: 0c1978665c0886b0
|
|
25
|
+
zh: d0159681b5568bdb
|
|
26
|
+
/qilin-agent-dsh-compat/model-experience/kv-cache-effect:
|
|
27
|
+
en: 5df5e153f56aec41
|
|
28
|
+
zh: 7f70d29d8d80cb58
|
|
29
|
+
/qilin-agent-dsh-compat/known-limitations-and-deferred-work:
|
|
30
|
+
en: ff21fa030cc8c41b
|
|
31
|
+
zh: b4246c9cff73db62
|
|
32
|
+
/qilin-agent-dsh-compat/known-limitations-and-deferred-work/dev-note:
|
|
33
|
+
en: 6500ff89363ef9e9
|
|
34
|
+
zh: 2699e3038d5414cf
|
package/README.md
CHANGED
|
@@ -1,3 +1,58 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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` and the DSH CLI application alias as `DSH_APPLICATION_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>`, with renamed heads landing on their QiLin package: `client-runtime` → `client-modules`, `tool-cordis` → `tool-kylin`, `ui-cordis` → `client-ui-kylin`, `cordis-host-runner` → `kylin-host-runner`, `cordis-client-runner` → `kylin-client-runner`, `agent-preset` → `agent-presets`, `subagent-dsh-sdk` → `subagent-qilin-sdk`. 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` 导出,DSH CLI 应用别名由 `DSH_APPLICATION_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>`,其中被改名的包头落到各自的 QiLin 包:`client-runtime` → `client-modules`、`tool-cordis` → `tool-kylin`、`ui-cordis` → `client-ui-kylin`、`cordis-host-runner` → `kylin-host-runner`、`cordis-client-runner` → `kylin-client-runner`、`agent-preset` → `agent-presets`、`subagent-dsh-sdk` → `subagent-qilin-sdk`。浏览器 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,136 @@
|
|
|
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
|
+
/**
|
|
31
|
+
* Exact aliases for DSH-era application package names, which no prefix rule
|
|
32
|
+
* reaches: the DSH CLI application (`@deepseek-ai/dsh`) is
|
|
33
|
+
* `@qilin-agent/cli` here. Applications stay out of
|
|
34
|
+
* {@link DSH_PLATFORM_MODULE_ALIASES} because the browser shell resolves every
|
|
35
|
+
* value of that table against its static seed table, which carries platform
|
|
36
|
+
* modules only.
|
|
37
|
+
*/
|
|
38
|
+
const DSH_APPLICATION_MODULE_ALIASES = { "@deepseek-ai/dsh": "@qilin-agent/cli" };
|
|
39
|
+
/** The scoped prefix every renamed DSH engine package shares. */
|
|
40
|
+
const DSH_PACKAGE_PREFIX = "@deepseek-ai/dsh-";
|
|
41
|
+
/** The QiLin scope the prefix rule maps package heads onto. */
|
|
42
|
+
const QILIN_SCOPE = "@qilin-agent/";
|
|
43
|
+
/**
|
|
44
|
+
* Package heads whose QiLin name is not the mechanical `dsh-` strip. The DSH
|
|
45
|
+
* client module system (`client-runtime`) is QiLin's `client-modules`; the
|
|
46
|
+
* Cordis runner and tool family, the agent preset, and the DSH-SDK subagent
|
|
47
|
+
* provider carry QiLin names without a `cordis` or `dsh` head.
|
|
48
|
+
*/
|
|
49
|
+
const DSH_PACKAGE_RENAMES = {
|
|
50
|
+
"client-runtime": "client-modules",
|
|
51
|
+
"tool-cordis": "tool-kylin",
|
|
52
|
+
"ui-cordis": "client-ui-kylin",
|
|
53
|
+
"cordis-host-runner": "kylin-host-runner",
|
|
54
|
+
"cordis-client-runner": "kylin-client-runner",
|
|
55
|
+
"agent-preset": "agent-presets",
|
|
56
|
+
"subagent-dsh-sdk": "subagent-qilin-sdk",
|
|
57
|
+
"hook-protocol": "experimental-hook-protocol",
|
|
58
|
+
"hooks-claude-code": "experimental-hooks-claude-code",
|
|
59
|
+
"hooks-codex": "experimental-hooks-codex",
|
|
60
|
+
"webhook": "experimental-webhook",
|
|
61
|
+
"webhook-github": "experimental-webhook-github",
|
|
62
|
+
"tool-terminal": "experimental-tool-terminal",
|
|
63
|
+
"tool-ralph": "experimental-tool-ralph",
|
|
64
|
+
"tool-session-query": "experimental-tool-session-query",
|
|
65
|
+
"skill-badge": "experimental-skill-badge",
|
|
66
|
+
"session-title-all-prompts-llm": "experimental-session-title-all-prompts-llm"
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Canonicalize one module specifier for QiLin's module graph: an exact
|
|
70
|
+
* platform or application alias wins; a scoped `@deepseek-ai/dsh-<pkg>[/subpath]` name maps
|
|
71
|
+
* onto `@qilin-agent/<pkg>[/subpath]` with the rename table applied to the package
|
|
72
|
+
* head; every other specifier (including unrenamed `@deepseek-ai/*` names such
|
|
73
|
+
* as `@qilin-agent/schemastery`, which QiLin keeps verbatim) passes through
|
|
74
|
+
* unchanged.
|
|
75
|
+
* @param specifier - the specifier a manifest edge or a bundle `require` named.
|
|
76
|
+
* @returns the QiLin-canonical specifier for graph and seed-table lookups.
|
|
77
|
+
*/
|
|
78
|
+
function dshCompatModuleId(specifier) {
|
|
79
|
+
const exact = DSH_PLATFORM_MODULE_ALIASES[specifier] ?? DSH_APPLICATION_MODULE_ALIASES[specifier];
|
|
80
|
+
if (exact !== void 0) return exact;
|
|
81
|
+
if (!specifier.startsWith(DSH_PACKAGE_PREFIX)) return specifier;
|
|
82
|
+
const [head = "", ...subpath] = specifier.slice(17).split("/");
|
|
83
|
+
return QILIN_SCOPE + [DSH_PACKAGE_RENAMES[head] ?? head, ...subpath].join("/");
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region lib/types/manifest.js
|
|
87
|
+
/**
|
|
88
|
+
* Manifest-key fallback readers for DSH-era plugin packages.
|
|
89
|
+
*
|
|
90
|
+
* A DSH plugin's `package.json` declares its Harness metadata under the `dsh`
|
|
91
|
+
* key (`dsh.bundle.patch`, `dsh.client`); a QiLin-native package declares the
|
|
92
|
+
* same shape under `qilin`. These readers pick the declaration a package
|
|
93
|
+
* actually carries so the profile launcher and the client module system mount
|
|
94
|
+
* either channel's packages unchanged. Each reader validates only its own
|
|
95
|
+
* pick (string presence for the patch path); the owning consumer keeps its
|
|
96
|
+
* full structural validation and error reporting.
|
|
97
|
+
* @module @qilin-agent/dsh-compat/manifest
|
|
98
|
+
*/
|
|
99
|
+
/**
|
|
100
|
+
* The relative patch-file path a bundle package declares, from `qilin.bundle.patch`
|
|
101
|
+
* when the package carries the native key and from `dsh.bundle.patch` otherwise.
|
|
102
|
+
* A present-but-non-string declaration falls through to the other channel and
|
|
103
|
+
* finally to `undefined`, so the caller's fail-loud path reports it.
|
|
104
|
+
* @param manifest - the parsed `package.json` value of the bundle package.
|
|
105
|
+
* @returns the declared patch path, or `undefined` when neither key declares one.
|
|
106
|
+
*/
|
|
107
|
+
function bundlePatchOf(manifest) {
|
|
108
|
+
const channels = manifest;
|
|
109
|
+
if (typeof channels !== "object" || channels === null) return void 0;
|
|
110
|
+
const qilin = channels.qilin?.bundle?.patch;
|
|
111
|
+
if (typeof qilin === "string") return qilin;
|
|
112
|
+
const dsh = channels.dsh?.bundle?.patch;
|
|
113
|
+
if (typeof dsh === "string") return dsh;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Pick a package's client declaration: `qilin.client` when present (the
|
|
117
|
+
* native key wins for a package that carries both), else `dsh.client`.
|
|
118
|
+
* @param manifest - the parsed `package.json` value of the package.
|
|
119
|
+
* @returns the picked declaration, or `undefined` when neither key declares one.
|
|
120
|
+
*/
|
|
121
|
+
function clientDeclarationOf(manifest) {
|
|
122
|
+
const channels = manifest;
|
|
123
|
+
if (typeof channels !== "object" || channels === null) return void 0;
|
|
124
|
+
const qilin = channels.qilin?.client;
|
|
125
|
+
if (qilin !== void 0) return {
|
|
126
|
+
key: "qilin.client",
|
|
127
|
+
value: qilin
|
|
128
|
+
};
|
|
129
|
+
const dsh = channels.dsh?.client;
|
|
130
|
+
if (dsh !== void 0) return {
|
|
131
|
+
key: "dsh.client",
|
|
132
|
+
value: dsh
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { DSH_APPLICATION_MODULE_ALIASES, DSH_PLATFORM_MODULE_ALIASES, bundlePatchOf, clientDeclarationOf, dshCompatModuleId };
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
* Exact aliases for DSH-era application package names, which no prefix rule
|
|
23
|
+
* reaches: the DSH CLI application (`@deepseek-ai/dsh`) is
|
|
24
|
+
* `@qilin-agent/cli` here. Applications stay out of
|
|
25
|
+
* {@link DSH_PLATFORM_MODULE_ALIASES} because the browser shell resolves every
|
|
26
|
+
* value of that table against its static seed table, which carries platform
|
|
27
|
+
* modules only.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DSH_APPLICATION_MODULE_ALIASES: Readonly<Record<string, string>>;
|
|
30
|
+
/**
|
|
31
|
+
* Canonicalize one module specifier for QiLin's module graph: an exact
|
|
32
|
+
* platform or application alias wins; a scoped `@deepseek-ai/dsh-<pkg>[/subpath]` name maps
|
|
33
|
+
* onto `@qilin-agent/<pkg>[/subpath]` with the rename table applied to the package
|
|
34
|
+
* head; every other specifier (including unrenamed `@deepseek-ai/*` names such
|
|
35
|
+
* as `@qilin-agent/schemastery`, which QiLin keeps verbatim) passes through
|
|
36
|
+
* unchanged.
|
|
37
|
+
* @param specifier - the specifier a manifest edge or a bundle `require` named.
|
|
38
|
+
* @returns the QiLin-canonical specifier for graph and seed-table lookups.
|
|
39
|
+
*/
|
|
40
|
+
export declare function dshCompatModuleId(specifier: string): string;
|
|
41
|
+
//# 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_APPLICATION_MODULE_ALIASES, 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
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "DSH-era plugin ecosystem compatibility: module-name aliases and manifest-key fallback readers",
|
|
4
|
+
"version": "3.1.4",
|
|
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
|
}
|