@noob-stupid/dsh-plugin-console 0.5.27 → 0.5.29
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/client.js +8 -4
- package/lib/server/domain/ai.js +4 -1
- package/lib/server/domain/format-scan.js +4 -1
- package/lib/server/domain/install-job.js +3 -3
- package/lib/server/domain/preset-declare.js +573 -0
- package/lib/server/domain/preset-in-package.js +14 -3
- package/lib/server/domain/preset-install.js +92 -4
- package/lib/server/domain/preset-rows.js +285 -0
- package/lib/server/domain/preset-source.js +27 -18
- package/lib/server/domain/presets.js +6 -3
- package/lib/server/domain/suite.js +21 -3
- package/lib/server/routes/components.js +3 -1
- package/lib/server/routes/framework-preflight.js +12 -3
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -309,7 +309,11 @@ window.__ModuleLoader__.load({
|
|
|
309
309
|
diagIntegrityNone: "来源无摘要,未校验",
|
|
310
310
|
diagIntegrityMismatch: "摘要不匹配(已安装,未拦截)",
|
|
311
311
|
diagIntegritySkip: "摘要未校验(读取失败,不影响安装)",
|
|
312
|
-
|
|
312
|
+
// 0.5.28 改错:框架 0.1.7-rc.x 起预设改为**声明行**(不再扫 .agent-presets 目录),
|
|
313
|
+
// "新建会话时选择"对没写成声明行的预设是错的。可见性由服务端下发的 presetNote 说清
|
|
314
|
+
// (「已声明为预设行 … 重启实例后在新会话可选」/「文件已就位,但…需要声明行」),
|
|
315
|
+
// 这里只留一句中性提示,不再替服务端断言"选了就能用"。
|
|
316
|
+
presetDot: "。预设:见上方说明(需要声明行才会出现在选择器里)",
|
|
313
317
|
presetInstalledMsg: "预设已装配",
|
|
314
318
|
diagChannelNotes: "通道说明",
|
|
315
319
|
direct: "(浏览器直连 GitHub;若你的浏览器打不开 GitHub,将自动回退到服务端通道)",
|
|
@@ -593,7 +597,7 @@ window.__ModuleLoader__.load({
|
|
|
593
597
|
frameworkUpgradeMore: "展开全部可选版本({n})",
|
|
594
598
|
// 升级前契约预检(2026-09-24 事故:v4 消息格式变更让运行期生产方全部失效)
|
|
595
599
|
fwPreflightBtn: "升级预检",
|
|
596
|
-
fwPreflightTitle: "升级前契约预检:抓目标版本的会话格式契约(迁移边),扫描 agent-presets 与已装插件里的旧形状消息来源;可一键适配并自动备份(.bak-preflight-*)",
|
|
600
|
+
fwPreflightTitle: "升级前契约预检:抓目标版本的会话格式契约(迁移边),扫描 .agent-presets 与已装插件里的旧形状消息来源;可一键适配并自动备份(.bak-preflight-*)",
|
|
597
601
|
fwPreflightRunning: "预检中…",
|
|
598
602
|
fwPreflightClean: "预检通过:本地生产方没有会触发格式校验的旧写法",
|
|
599
603
|
fwPreflightFound: "预检发现 {n} 处必须适配(另有 {m} 处提示)",
|
|
@@ -848,7 +852,7 @@ window.__ModuleLoader__.load({
|
|
|
848
852
|
diagIntegrityNone: "No digest from source; not verified",
|
|
849
853
|
diagIntegrityMismatch: "Digest mismatch (installed, not blocked)",
|
|
850
854
|
diagIntegritySkip: "Digest not verified (read failed; install unaffected)",
|
|
851
|
-
presetDot: ". Preset:
|
|
855
|
+
presetDot: ". Preset: see the note above (a declaration row is required for it to appear)",
|
|
852
856
|
presetInstalledMsg: "Presets installed",
|
|
853
857
|
diagChannelNotes: "Channel notes",
|
|
854
858
|
direct: "(The browser calls GitHub directly; the server channel is used as fallback.)",
|
|
@@ -1132,7 +1136,7 @@ window.__ModuleLoader__.load({
|
|
|
1132
1136
|
frameworkUpgradeMore: "Show all available versions ({n})",
|
|
1133
1137
|
// Pre-upgrade contract preflight (2026-09-24 incident: v4 message-format change broke every runtime producer)
|
|
1134
1138
|
fwPreflightBtn: "Pre-upgrade preflight",
|
|
1135
|
-
fwPreflightTitle: "Pre-upgrade contract preflight: fetch the target session-format contract (migration edges) and scan agent-presets + installed plugins for legacy message sources; one click adapts with .bak-preflight-* backups",
|
|
1139
|
+
fwPreflightTitle: "Pre-upgrade contract preflight: fetch the target session-format contract (migration edges) and scan .agent-presets + installed plugins for legacy message sources; one click adapts with .bak-preflight-* backups",
|
|
1136
1140
|
fwPreflightRunning: "Preflighting…",
|
|
1137
1141
|
fwPreflightClean: "Preflight passed: no legacy producer shape that would fail format validation",
|
|
1138
1142
|
fwPreflightFound: "Preflight found {n} blockers to adapt ({m} advisories)",
|
package/lib/server/domain/ai.js
CHANGED
|
@@ -209,7 +209,10 @@ function aiEmpowerPresetFor(source) {
|
|
|
209
209
|
const common = [
|
|
210
210
|
'## 本机环境事实(务必遵守)',
|
|
211
211
|
'- 网络:pypi.org 不通、清华镜像 403;pip 必须用 `--index-url https://mirrors.aliyun.com/pypi/simple/`。npm registry.npmjs.org 可能黑洞,pnpm 用 `--registry https://registry.npmmirror.com`。huggingface.co 被墙,模型文件一律用 `https://hf-mirror.com/<同一路径>`(执行器会自动把 huggingface.co 换成 hf-mirror.com,计划里也可直接写 hf-mirror)。',
|
|
212
|
-
|
|
212
|
+
// 0.5.28 改错:这条原本把它写成"本机用户名含中文(花火)"的**个案**,读起来像只在
|
|
213
|
+
// 那台机器上成立。真正的规则是通用的:只要**写盘路径**里出现非 ASCII 字符,各语言的
|
|
214
|
+
// Rust/原生向量库就可能报 UnicodeDecodeError —— 与用户名具体是不是中文无关。
|
|
215
|
+
'- 用户名/路径含非 ASCII 字符时:任何写盘路径若含非 ASCII 字符,各语言的 Rust/原生向量库会报 UnicodeDecodeError——服务数据目录必须纯 ASCII(如 `D:/OpenVikingData`)。',
|
|
213
216
|
'- 凭据复用:DSH 的 DeepSeek 密钥在 `${home}/.dsh/.credentials.yaml`(YAML 行 `DEEPSEEK_API_KEY: sk-...`);模型选择在 `${home}/.dsh/settings.yaml` 的 `agent-default-model`(provider deepseek-official)。对外 OpenAI 兼容接口:api_base `https://api.deepseek.com`,模型名 `deepseek-v4-flash-vision-exp`。',
|
|
214
217
|
'- 步骤解释用中文;每个动作一个步骤;步骤数尽量少;不得包含任何破坏性命令;服务类组件必须配 start-service + wait-health。',
|
|
215
218
|
]
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// L1 · domain —— format-scan.js:会话格式契约预检(Step 2 · 本地生产方扫描 + 补丁)
|
|
2
2
|
//
|
|
3
3
|
// 扫描面(这次事故的三类生产方,正是它们让「一发消息就炸」):
|
|
4
|
-
// ① ~/.dsh
|
|
4
|
+
// ① ~/.dsh/.agent-presets/** —— 用户自己的 agent 预设(10 个文件 11 处)
|
|
5
|
+
// (★ 2026-09-27 改错:这里旧注释写成 `~/.dsh/agent-presets/**`,**少一个点**。
|
|
6
|
+
// 框架的目录是 `.agent-presets`(旧 discovery 的 USER_PRESET_DIR),routes/framework-preflight.js
|
|
7
|
+
// 的扫描面也跟着错了同一个字 —— 于是预检**从未**扫到预设,升级前"0 blocker"是假绿。)
|
|
5
8
|
// ② profile 内已装插件包里的运行时代码 —— agent.inject / createUserMessage 的构造点(3 处)
|
|
6
9
|
// ③ 插件里引用了目标版本已移除的框架 API(报告项,不自动改)
|
|
7
10
|
//
|
|
@@ -72,6 +72,8 @@ function channelImpls(ports) {
|
|
|
72
72
|
* 属无意义尝试)**并保留 !expanded**(同一作业里对同一个 job.repo 反复 clone 纯属浪费时间,
|
|
73
73
|
* 级联顺序也不该被破坏)。 */
|
|
74
74
|
async function tryCandidateChannels({ job, ch, name, profileDir, registries, repoChannelAllowed, budget, baseUrl = null, expanded = false, deadline = null, expand = null, sourceDeps = {} }) {
|
|
75
|
+
// 声明行的目标 profile(0.5.28):框架 0.1.7-rc.x 起预设不再靠目录发现,装配后必须往这个 profile 的补丁写 `preset-<id>` 行,否则用户看不见(见 preset-declare.js 顶部)。
|
|
76
|
+
const patchPath = join(profileDir, 'cordis.patch.yml')
|
|
75
77
|
let installedName = null
|
|
76
78
|
let lastError = null
|
|
77
79
|
// 加法优化:包已在 node_modules 且名字匹配时,不再重复安装/触发 EPERM,直接进入启用流程
|
|
@@ -219,7 +221,7 @@ async function runInstallJob(job, ports, deps = {}) {
|
|
|
219
221
|
probes.expandSubpackages = (opts = {}) => expandSubpackageCandidates({ ...opts, deps: { fetchSubpackageNames: probes.fetchSubpackageNames } })
|
|
220
222
|
}
|
|
221
223
|
const jobBudgetMs = Number.isFinite(deps.jobBudgetMs) && deps.jobBudgetMs > 0 ? deps.jobBudgetMs : 8 * 60 * 1000
|
|
222
|
-
// 源码通道(体积门禁 + 稀疏取源码 + 预设装配)的注入缝:与 marketProbes
|
|
224
|
+
// 源码通道(体积门禁 + 稀疏取源码 + 预设装配)的注入缝:与 marketProbes 同一风格,生产调用方不传。
|
|
223
225
|
const sourceDeps = deps.sourceDeps ?? {}
|
|
224
226
|
const aiConsentTimeoutMs = Number.isFinite(deps.aiConsentTimeoutMs) && deps.aiConsentTimeoutMs > 0 ? deps.aiConsentTimeoutMs : AI_CONSENT_TIMEOUT_MS
|
|
225
227
|
/** 「安装即声明」的收尾(三个调用点共用一个出口):清单写回结果 → job 上的可见字段。
|
|
@@ -544,7 +546,6 @@ async function runInstallJob(job, ports, deps = {}) {
|
|
|
544
546
|
job.finishedAt = Date.now()
|
|
545
547
|
}
|
|
546
548
|
}
|
|
547
|
-
|
|
548
549
|
/** 用 corepack pnpm 移除包(与安装同一管理器与凭据抑制环境)。
|
|
549
550
|
* 注意:pnpm remove 不支持 --registry 选项,去掉避免静默失败。 */
|
|
550
551
|
async function pnpmRemove(profileDir, packageName) {
|
|
@@ -562,7 +563,6 @@ async function pnpmRemove(profileDir, packageName) {
|
|
|
562
563
|
// 与 pnpmInstall 同一套跨平台定位(Linux 的 corepack 不在 <node bin>/node_modules 下)
|
|
563
564
|
await runPnpmWithFallback(args, { execOpts: opts })
|
|
564
565
|
}
|
|
565
|
-
|
|
566
566
|
/** 读取用户额外 bundle(非官方模板)的补丁插入行 id 与包名,用于"额外插件"判定。 */
|
|
567
567
|
async function readExtraBundleRows(profileDir) {
|
|
568
568
|
const rows = new Set()
|