dsh-feishu-lark-notify 0.26.0 → 0.26.1
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/index.js +17 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import { startWsInbound } from './inbound-ws.js'
|
|
|
37
37
|
export const name = 'feishu-notify'
|
|
38
38
|
|
|
39
39
|
/** 版本号(与 package.json 保持一致,单测会校验)。 */
|
|
40
|
-
export const VERSION = '0.26.
|
|
40
|
+
export const VERSION = '0.26.1'
|
|
41
41
|
|
|
42
42
|
/** 内存日志上限。 */
|
|
43
43
|
const LOG_LIMIT = 200
|
|
@@ -1973,6 +1973,9 @@ export function apply(ctx, rawConfig) {
|
|
|
1973
1973
|
void replyToChat(message.chatId, `借不到模型配置(${anchor.label || anchor.id.slice(-6)} 没有 modelSelection),先在 DSH 里给它选个模型。`)
|
|
1974
1974
|
return { ok: false, created: false, reason: 'no-model' }
|
|
1975
1975
|
}
|
|
1976
|
+
// 目录一定要用**当前会话的项目目录**:用 processPath() 会落进 profile 目录,
|
|
1977
|
+
// 新会话就会跑到「未分组」里去。
|
|
1978
|
+
const cwd = sessionCwd(anchorAgent.session, stateFor(anchorAgent.session))
|
|
1976
1979
|
|
|
1977
1980
|
let handle
|
|
1978
1981
|
try {
|
|
@@ -1982,7 +1985,7 @@ export function apply(ctx, rawConfig) {
|
|
|
1982
1985
|
model: model.model,
|
|
1983
1986
|
...(model.reasoningEffort === undefined ? {} : { reasoningEffort: model.reasoningEffort }),
|
|
1984
1987
|
},
|
|
1985
|
-
meta: { cwd: projectRoot() },
|
|
1988
|
+
meta: { cwd: cwd === '' ? projectRoot() : cwd },
|
|
1986
1989
|
})
|
|
1987
1990
|
} catch (error) {
|
|
1988
1991
|
const detail = String(error?.message ?? error)
|
|
@@ -2003,6 +2006,18 @@ export function apply(ctx, rawConfig) {
|
|
|
2003
2006
|
if (typeof title === 'string' && title !== '') {
|
|
2004
2007
|
createdTitles.set(agent.id, title)
|
|
2005
2008
|
sessionRoster.remember([{ id: agent.id, label: title, status: 'running', live: true }, ...rosterSessions()])
|
|
2009
|
+
// 真的把标题写进会话(否则模型会按第一句自动起名,你看到的就不是「测试」)
|
|
2010
|
+
try {
|
|
2011
|
+
const titles = ctx.get('sessionTitle')
|
|
2012
|
+
if (titles !== undefined && typeof titles.rename === 'function') {
|
|
2013
|
+
await titles.rename(agent.session, title)
|
|
2014
|
+
log(`[${via}] 新会话标题已设为「${title}」`)
|
|
2015
|
+
} else {
|
|
2016
|
+
log(`[${via}] 宿主没有 sessionTitle 服务,标题只在插件内生效`)
|
|
2017
|
+
}
|
|
2018
|
+
} catch (error) {
|
|
2019
|
+
log(`[${via}] 设置标题失败(不影响使用):${error?.message ?? error}`)
|
|
2020
|
+
}
|
|
2006
2021
|
}
|
|
2007
2022
|
|
|
2008
2023
|
let sent = false
|