chore: 适配 DSH 0.2.3-alpha.3 工具注册表、React 19 与提示词快照(v0.2.18)

This commit is contained in:
yexi-by committed 2026-12-03 05:40:36 +08:00
1 parent 561a1236ab
commit a4c7c530d8
29 files changed
+517 -1857

No files matched your search

+6 -2
View File
@@ -144,8 +144,11 @@ async function presetAgent(id, suffix = '') {
return agents.get(key).agent
}
const { ToolStep } = await import(pathToFileURL(join(repo, 'packages/core/tools/lib/pipeline.js')).href)
async function assemblePrompt(agent) {
const assembly = await ctx.systemPrompt.assemble({ agent, scope: agent })
const toolStep = typeof ToolStep?.capture === 'function' ? ToolStep.capture(ctx.tools, agent) : undefined
const assembly = await ctx.systemPrompt.assemble(toolStep === undefined ? { agent, scope: agent } : { agent, scope: agent, toolStep })
return {
text: renderPrompt(assembly),
tools: JSON.stringify(assembly.tools),
@@ -205,7 +208,8 @@ async function preview(presetId) {
let assembly
try {
await ctx.agentPresets.mount(scope.ctx, presetId)
assembly = await ctx.systemPrompt.assemble({ scope: key })
const toolStep = typeof ToolStep?.capture === 'function' ? ToolStep.capture(ctx.tools, key) : undefined
assembly = await ctx.systemPrompt.assemble(toolStep === undefined ? { scope: key } : { scope: key, toolStep })
} finally {
await scope.dispose()
}