release: fix Desktop activation in v1.1.2

This commit is contained in:
qyh15 2026-11-26 17:13:59 +08:00
parent 93938c9a78
commit 67046beb0a
4 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# 三省六部(dsh-sansheng)· v1.1.1
# 三省六部(dsh-sansheng)· v1.1.2
在 DSH 里为每个项目提供固定的十席角色(丞相、中书、门下、尚书、吏部、户部、礼部、兵部、刑部、工部),
每席绑定一个独立的原生 root Session,模型与补充说明按项目独立保存。中间复用宿主原生会话,不替换聊天引擎。

View File

@ -1,4 +1,5 @@
// 三省六部宿主插件入口:只使用宿主公开注入服务,不 patch DSH,不写 profile 全局默认。
import { randomUUID } from 'node:crypto'
import { SanshengStore } from './src/host/store.js'
import { GlobalModelStore } from './src/host/global-store.js'
import { createModelSync } from './src/host/model-sync.js'
@ -40,9 +41,7 @@ export function apply(ctx, config = {}) {
sessionController: ctx.sessionController,
agents: ctx.agents,
llm: ctx.llm,
// 宿主提供时用于内部消息构造与队列落盘;缺失时各模块有安全回退。
createUserMessage: typeof ctx.createUserMessage === 'function' ? ctx.createUserMessage.bind(ctx) : undefined,
sessions: ctx.sessions ?? undefined,
createUserMessage: ({ content, source }) => ({ id: randomUUID(), role: 'user', content, source }),
}
const modelSync = createModelSync({ store, globalStore, host, normalizeCatalog })
const leadReporter = createLeadReporter({ store, host })

View File

@ -1,6 +1,6 @@
{
"name": "dsh-sansheng-liubu",
"version": "1.1.1",
"version": "1.1.2",
"description": "三省六部:每个项目固定十席角色与独立会话的 DSH 插件(第一版)。",
"keywords": [
"dsh-plugin",

View File

@ -6,7 +6,15 @@ import { createFakeHost, tempStateFile } from './fake-ctx.js'
test('apply 注册提示词与 /api/sansheng 路由并可处理请求', async () => {
const fake = createFakeHost()
const statePath = await tempStateFile()
await apply(fake.ctx, { statePath, globalSettingPath: statePath + '.global.json' })
const ctx = new Proxy(fake.ctx, {
get(target, property, receiver) {
if (typeof property === 'string' && !(property in target) && property !== 'on' && property !== 'get') {
throw new Error(`cannot get property "${property}" without inject`)
}
return Reflect.get(target, property, receiver)
},
})
await apply(ctx, { statePath, globalSettingPath: statePath + '.global.json' })
assert.equal(name, 'sansheng')
assert.ok(inject.includes('connection'))