@dcrays/dcgchat-test 0.4.10 → 0.4.11
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/package.json +1 -1
- package/src/agent.ts +4 -1
- package/src/channel.ts +2 -2
package/package.json
CHANGED
package/src/agent.ts
CHANGED
|
@@ -53,7 +53,10 @@ function copyAgentsFiles(clone_code: string) {
|
|
|
53
53
|
export async function onCreateAgent(params: Record<string, any>) {
|
|
54
54
|
const { clone_code, name, description } = params
|
|
55
55
|
try {
|
|
56
|
-
|
|
56
|
+
const workspacePath = getWorkspaceDir()
|
|
57
|
+
if (!workspacePath) return
|
|
58
|
+
const workspaceDir = path.join(workspacePath, '../', `workspace-${clone_code}`)
|
|
59
|
+
await sendMessageToGateway(JSON.stringify({ method: 'agents.create', params: { name: clone_code, workspace: workspaceDir } }))
|
|
57
60
|
} catch (err: unknown) {
|
|
58
61
|
dcgLogger(`agents.create failed: ${String(err)}`, 'error')
|
|
59
62
|
}
|
package/src/channel.ts
CHANGED
|
@@ -224,8 +224,8 @@ export const dcgchatPlugin: ChannelPlugin<ResolvedDcgchatAccount> = {
|
|
|
224
224
|
},
|
|
225
225
|
agentPrompt: {
|
|
226
226
|
messageToolHints: () => [
|
|
227
|
-
'书灵墨宝 / 内置 `message
|
|
228
|
-
'
|
|
227
|
+
'书灵墨宝 / 内置 `message`:回复当前会话时 **不要传 `target`**,由 OpenClaw 使用工具上下文里的 `currentChannelId`(来自入站 `To`,即当前 SessionKey)。',
|
|
228
|
+
'必须指定会话时:`target` 须为上下文中出现的 **整段 SessionKey,逐字一致**(如 `agent:…:mobook:direct:…` 或以 `agent:` 开头的路由键);**禁止**使用 `userId`、`From`、纯数字会话号等代替。',
|
|
229
229
|
'生成文件后,**尽可能不要**把文件路径、地址直接告诉用户;把文件名告诉用户;须通过工具发文件,勿在正文里直接输出可访问路径。',
|
|
230
230
|
'使用 `dcgchat_message` 时同样遵守上述 SessionKey 规则(该工具通常由插件注入当前会话,一般无需自造 target)。'
|
|
231
231
|
]
|