@jayyuen66/dsh-dir-prep-organize 0.1.12 → 0.1.14
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/CHANGELOG.md +26 -0
- package/README.md +14 -5
- package/README.zh-CN.md +14 -5
- package/client.js +40 -2172
- package/cordis.patch.yml +4 -0
- package/docs/DETAIL.md +6 -0
- package/docs/DETAIL.zh.md +6 -0
- package/host.js +15 -7
- package/package.json +20 -16
package/cordis.patch.yml
CHANGED
|
@@ -3,5 +3,9 @@
|
|
|
3
3
|
# 内置精选集由 host 半从 templates.data.mjs 经 defaults 方法按需下发。
|
|
4
4
|
# 架构与数据流见 README 与 host.ts / src/client-entry.ts。
|
|
5
5
|
- insert:
|
|
6
|
+
# 固定 id:该供应行必须保持开启;停用后本包设置卡会失去 shared 客户端供应。
|
|
7
|
+
# 多个插件共用同一个 id,宿主会把开关标成“无法唯一定位”并禁用。
|
|
8
|
+
- id: dsh-plugin-shared
|
|
9
|
+
name: "@jayyuen66/dsh-plugin-shared"
|
|
6
10
|
- id: dir-prep-organize
|
|
7
11
|
name: "@jayyuen66/dsh-dir-prep-organize"
|
package/docs/DETAIL.md
CHANGED
|
@@ -24,3 +24,9 @@ No external CLI, interpreter or credential of its own. It uses the host's model
|
|
|
24
24
|
## Further detail
|
|
25
25
|
|
|
26
26
|
The vendored role library, the generated default-template table and the import-scan depth rules are developer-facing and live in the package README (`README.md` / `README.zh-CN.md`).
|
|
27
|
+
|
|
28
|
+
## Feedback
|
|
29
|
+
|
|
30
|
+
Issues and pull requests are welcome: [https://github.com/JayYuen666/dsh-dir-prep-organize/issues](https://github.com/JayYuen666/dsh-dir-prep-organize/issues).
|
|
31
|
+
|
|
32
|
+
If a plugin fails to boot, include the dsh host version, the profile install shape, and the browser console line. The `missed the module table` line is especially useful: it tells us whether the shared client row was materialized.
|
package/docs/DETAIL.zh.md
CHANGED
|
@@ -24,3 +24,9 @@
|
|
|
24
24
|
## 更完整的说明
|
|
25
25
|
|
|
26
26
|
vendored 角色库、生成的默认模板表、导入扫描的层数规则都属于开发内容,写在随包 README(`README.md` / `README.zh-CN.md`)。
|
|
27
|
+
|
|
28
|
+
## 反馈
|
|
29
|
+
|
|
30
|
+
欢迎提 issue 和 PR:[https://github.com/JayYuen666/dsh-dir-prep-organize/issues](https://github.com/JayYuen666/dsh-dir-prep-organize/issues)。
|
|
31
|
+
|
|
32
|
+
插件启动失败时,请附上 dsh 宿主版本、profile 安装形态和浏览器控制台原文。`missed the module table` 这一行尤其有用:它能直接说明 shared 客户端供应行有没有被物化。
|
package/host.js
CHANGED
|
@@ -5,7 +5,9 @@ import { brandString } from "@deepseek-ai/dsh-brand";
|
|
|
5
5
|
import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
6
6
|
import { LOCALE_SETTINGS_NAMESPACE, messagesFor, resolveLocalePreference } from "@jayyuen66/dsh-plugin-shared/lib/locale";
|
|
7
7
|
import { isRecord } from "@jayyuen66/dsh-plugin-shared/lib/record";
|
|
8
|
+
import { truncateCodePoints } from "@jayyuen66/dsh-plugin-shared/lib/text";
|
|
8
9
|
import { errorText } from "@jayyuen66/dsh-plugin-shared/lib/errors";
|
|
10
|
+
import { claimInstance } from "@jayyuen66/dsh-plugin-shared/lib/instance-lock";
|
|
9
11
|
// src/host-messages.ts
|
|
10
12
|
const HOST_MESSAGES = {
|
|
11
13
|
zh: {
|
|
@@ -187,13 +189,6 @@ function readFrontmatterPair(line) {
|
|
|
187
189
|
}
|
|
188
190
|
return result;
|
|
189
191
|
}
|
|
190
|
-
/** 按 Unicode 码点截断:`String#slice` 数的是 UTF-16 码元,会把一个 emoji(代理对)或
|
|
191
|
-
* 组合字符劈成半个,落进模板后显示成空白方块。两个截断点(frontmatter 解析与 `sanitizeTemplateList`)
|
|
192
|
-
* 共用这一份实现,scripts/gen-defaults-lib.mjs 有同源镜像。 */
|
|
193
|
-
function truncateCodePoints(value, max) {
|
|
194
|
-
const points = Array.from(value);
|
|
195
|
-
return points.length > max ? points.slice(0, max).join("") : value;
|
|
196
|
-
}
|
|
197
192
|
/** 键 → 目标位:防重复(已有值不覆盖,取首个同名键);emoji 截断至 EMOJI_MAX_LENGTH(按码点)。 */
|
|
198
193
|
function takeFrontmatterField(fields, key, value) {
|
|
199
194
|
if (key === "name" && fields.name === "" && value.length > 0) fields.name = value;
|
|
@@ -1618,6 +1613,11 @@ function installDirPrepRemote(ctx, scope) {
|
|
|
1618
1613
|
new DirPrepRemoteService(ctx, scope);
|
|
1619
1614
|
return true;
|
|
1620
1615
|
}
|
|
1616
|
+
/**
|
|
1617
|
+
* 单实例锁的服务名。取包名形态而**不带随机后缀**:名字必须每一份实例都算出同一个串才可能
|
|
1618
|
+
* 互斥,随机后缀等于谁都能抢到。判据与边界见 shared 的 lib/instance-lock 头注释。
|
|
1619
|
+
*/
|
|
1620
|
+
const INSTANCE_LOCK_KEY = "@jayyuen66/dsh-dir-prep-organize/instance";
|
|
1621
1621
|
/** settings 注册的占位清理(无额外拆卸动作,注册随插件生命周期存续)。 */
|
|
1622
1622
|
function noopDisposer() {}
|
|
1623
1623
|
/** host apply:登记设置页策略 + 注册官方 Remote 服务(注入子上下文,卸载即撤)。
|
|
@@ -1625,6 +1625,14 @@ function noopDisposer() {}
|
|
|
1625
1625
|
* 不再向 settings 注册任何东西;配置值由 cordis 校验并填过默认后按 volatile 引用交进来
|
|
1626
1626
|
* (第二参数 config),读当前值一律 `.get()`。 */
|
|
1627
1627
|
function apply(ctx, config) {
|
|
1628
|
+
const lockContext = {
|
|
1629
|
+
get: (name) => isServiceGetter(ctx) ? ctx.get(name) : void 0,
|
|
1630
|
+
reflect: ctx.reflect
|
|
1631
|
+
};
|
|
1632
|
+
if (!claimInstance(lockContext, INSTANCE_LOCK_KEY)) {
|
|
1633
|
+
console.warn("[dir-prep-organize] 检测到本插件已在同一作用域内装载:本次装配让路,设置卡与工具由在册的那一份提供。");
|
|
1634
|
+
return;
|
|
1635
|
+
}
|
|
1628
1636
|
const getService = (name) => {
|
|
1629
1637
|
let result;
|
|
1630
1638
|
if (isServiceGetter(ctx)) result = ctx.get(name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayyuen66/dsh-dir-prep-organize",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "dsh 插件:对话输入框「润色」按钮(主键直接润色/▾ 以角色风格润色,结合当前目录 + session 模型润色草稿)+「模板」下拉(内置精选角色集生成自插件 agents/ 角色库,可按部门分组;设置卡可增删改/一键导入内置全部/导入本地角色 .md)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cordis",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"registry": "https://registry.npmjs.org"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@jayyuen66/dsh-plugin-shared": "^0.2.
|
|
64
|
+
"@jayyuen66/dsh-plugin-shared": "^0.2.10",
|
|
65
65
|
"zod": "4.6.7"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"@deepseek-ai/dsh-home-paths": "0.2.2-rc.2",
|
|
85
85
|
"@deepseek-ai/dsh-launch-environment": "0.2.2-rc.2",
|
|
86
86
|
"@deepseek-ai/dsh-llm": "0.2.2-rc.2",
|
|
87
|
+
"@deepseek-ai/dsh-output-retention": "0.2.2-rc.2",
|
|
87
88
|
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.2",
|
|
88
89
|
"@deepseek-ai/dsh-scope": "0.2.2-rc.2",
|
|
89
90
|
"@deepseek-ai/dsh-session": "0.2.2-rc.2",
|
|
@@ -113,18 +114,18 @@
|
|
|
113
114
|
"peerDependencies": {
|
|
114
115
|
"@deepseek-ai/cordis": "^4.0.5 || ^4.0.6-alpha.2",
|
|
115
116
|
"@deepseek-ai/cosmokit": "^1.8.6 || ^1.8.7-alpha.2",
|
|
116
|
-
"@deepseek-ai/dsh": "^0.2.2-rc.
|
|
117
|
-
"@deepseek-ai/dsh-agent-default-model": "^0.2.2-rc.
|
|
118
|
-
"@deepseek-ai/dsh-brand": "^0.2.2-rc.
|
|
119
|
-
"@deepseek-ai/dsh-client-locale": "^0.2.2-rc.
|
|
120
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.2-rc.
|
|
121
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.
|
|
122
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.
|
|
123
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.
|
|
124
|
-
"@deepseek-ai/dsh-fs": "^0.2.2-rc.
|
|
125
|
-
"@deepseek-ai/dsh-llm": "^0.2.2-rc.
|
|
126
|
-
"@deepseek-ai/dsh-session": "^0.2.2-rc.
|
|
127
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.2.2-rc.
|
|
117
|
+
"@deepseek-ai/dsh": "^0.2.2-rc.2",
|
|
118
|
+
"@deepseek-ai/dsh-agent-default-model": "^0.2.2-rc.2",
|
|
119
|
+
"@deepseek-ai/dsh-brand": "^0.2.2-rc.2",
|
|
120
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.2-rc.2",
|
|
121
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.2-rc.2",
|
|
122
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.2",
|
|
123
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.2",
|
|
124
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.2",
|
|
125
|
+
"@deepseek-ai/dsh-fs": "^0.2.2-rc.2",
|
|
126
|
+
"@deepseek-ai/dsh-llm": "^0.2.2-rc.2",
|
|
127
|
+
"@deepseek-ai/dsh-session": "^0.2.2-rc.2",
|
|
128
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.2.2-rc.2",
|
|
128
129
|
"@deepseek-ai/schemastery": "^3.19.0"
|
|
129
130
|
},
|
|
130
131
|
"peerDependenciesMeta": {
|
|
@@ -170,7 +171,7 @@
|
|
|
170
171
|
},
|
|
171
172
|
"icon": "icon.svg",
|
|
172
173
|
"engines": {
|
|
173
|
-
"dsh": "^0.2.2-rc.
|
|
174
|
+
"dsh": "^0.2.2-rc.2",
|
|
174
175
|
"node": ">=24.9.0"
|
|
175
176
|
},
|
|
176
177
|
"dsh": {
|
|
@@ -180,7 +181,10 @@
|
|
|
180
181
|
},
|
|
181
182
|
"client": {
|
|
182
183
|
"platform": "web",
|
|
183
|
-
"immediately": true
|
|
184
|
+
"immediately": true,
|
|
185
|
+
"external": [
|
|
186
|
+
"@jayyuen66/dsh-plugin-shared/client"
|
|
187
|
+
]
|
|
184
188
|
}
|
|
185
189
|
},
|
|
186
190
|
"scripts": {
|