@klarkxy/dsh-model-center 0.1.0
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 +41 -0
- package/README.md +37 -0
- package/cordis.patch.yml +5 -0
- package/docs/README.zh-CN.md +13 -0
- package/lib/client.inner.cjs +1776 -0
- package/lib/client.inner.cjs.map +1 -0
- package/lib/client.js +1946 -0
- package/lib/contracts.d.ts +76 -0
- package/lib/contracts.js +21 -0
- package/lib/contracts.js.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +43 -0
- package/lib/index.js.map +1 -0
- package/package.json +99 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
The Star And Thank Author License (SATA)
|
|
2
|
+
Version 2.1, September 2026
|
|
3
|
+
|
|
4
|
+
Copyright © 2026 Klarkxy(278370456@qq.com)
|
|
5
|
+
|
|
6
|
+
Project Url: https://github.com/klarkxy/dsh-editor
|
|
7
|
+
https://github.com/klarkxy/sata-license
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
And wait, one more thing — an invitation, not a condition: it would be best if
|
|
20
|
+
you star/+1/like the project(s) in the project url section above, and thank the
|
|
21
|
+
author(s) in the Copyright section. You may, and arguably you should — but the
|
|
22
|
+
permissions above hold either way, star or no star.
|
|
23
|
+
|
|
24
|
+
Here are some suggested ways:
|
|
25
|
+
|
|
26
|
+
- Email the authors a thank-you letter, and make friends with him/her/them.
|
|
27
|
+
- Report bugs or issues.
|
|
28
|
+
- Tell friends what a wonderful project this is.
|
|
29
|
+
- And, sure, you can just express thanks in your mind without telling the world.
|
|
30
|
+
|
|
31
|
+
Contributors of this project by forking have the option to add his/her name and
|
|
32
|
+
forked project url at copyright and project url sections, but shall not delete
|
|
33
|
+
or modify anything else in these two sections.
|
|
34
|
+
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
36
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
37
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
38
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
39
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
40
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
41
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @klarkxy/dsh-model-center
|
|
2
|
+
|
|
3
|
+
[简体中文](./docs/README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
Model Center for DSH. Starts enabled and remains independently switchable.
|
|
6
|
+
|
|
7
|
+
[License](./LICENSE)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Requires Node.js ≥22 and DSH `0.1.7-alpha.1`.
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
dsh plugin --profile web add @klarkxy/dsh-ai-services
|
|
15
|
+
dsh plugin --profile web add @klarkxy/dsh-model-center
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
AI policy is stored by `@klarkxy/dsh-ai-services`. Provider credentials stay in native DSH settings.
|
|
19
|
+
|
|
20
|
+
## Use
|
|
21
|
+
|
|
22
|
+
Settings → **模型中心** (or the host Models page when the editor supplies that seat).
|
|
23
|
+
|
|
24
|
+
- **Model routing** opens with four tiers: Quick, Chat, Thinking, and Fantasy. These correspond to Haiku, Sonnet, Opus, and Fable respectively, while allowing models from any provider. Fantasy is reserved for explicit user selection and is never a built-in plugin default. Each tier configures a model and reasoning effort; unconfigured tiers inherit Chat. Capability defaults can follow any tier or use a separate model and effort. Auxiliary capabilities can also follow the current session.
|
|
25
|
+
- **Runtime** owns concurrency, timeout, input/output caps, and retry attempts.
|
|
26
|
+
- **Providers** only manages connections and available models.
|
|
27
|
+
- Tier changes apply to capabilities that follow them. New conversations read the saved default; existing conversation selections stay unchanged.
|
|
28
|
+
|
|
29
|
+
## Develop
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pnpm --filter @klarkxy/dsh-model-center typecheck
|
|
33
|
+
pnpm exec vitest run packages/dsh-model-center/src
|
|
34
|
+
pnpm --filter @klarkxy/dsh-model-center build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The Editor preinstalls this feature enabled. In the Editor, use Settings → Plugins to switch it without restarting. Standalone DSH must load `@klarkxy/dsh-ai-services` before this package; installation or removal may require a restart when the host asks for one.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @klarkxy/dsh-model-center
|
|
2
|
+
|
|
3
|
+
默认启用的模型中心。Editor 在「设置 → 模型」中先显示模型配置,再显示供应商管理;独立 DSH 使用「模型中心」设置页。
|
|
4
|
+
|
|
5
|
+
[English](../README.md)
|
|
6
|
+
|
|
7
|
+
需要 Node.js ≥22、DSH 0.1.7-alpha.1,以及已加载的 @klarkxy/dsh-ai-services。供应商和凭据仍由 DSH 原生设置管理。
|
|
8
|
+
|
|
9
|
+
「模型档位」提供快速、对话、思考、幻想四档,四档分别对应 Haiku、Sonnet、Opus、Fable 的定位,可绑定任意供应商模型,每档分别设置模型与思考强度。未单独设置的档位跟随对话档。「能力默认值」中的新对话、补全、改写、标题、澄清、回顾等可引用任一档,也可单独设置模型与思考强度;辅助能力仍可跟随当前会话。修改档位会影响引用它的能力;新对话使用保存后的默认值,已有对话的手动选择保持不变。并发、超时、输入输出上限和重试次数统一放在「运行设置」。供应商页只管理连接与模型。无效配置会报告错误,不自动改用其他供应商;推理强度来自当前模型目录。
|
|
10
|
+
|
|
11
|
+
当前宿主在开关改变客户端模块时,需要保存工作后重新加载界面;插件设置会提示。关闭模型中心后,重新加载可恢复原模型设置页。
|
|
12
|
+
|
|
13
|
+
插件默认档位:正文补全、当前标题、回顾使用快速;新对话、选区改写、需求澄清、自我改进使用对话;记忆整理使用思考。幻想档成本较高,不作为任何插件的默认档位,仅在用户显式选择时使用。保留用户已保存的单独设置。未安装或停用管理器时,档位调用使用默认对话模型。
|