GM-HZ/dsh-workflow--packages-core ↗★ 1
@gm-hz/dsh-dag-workflow-core
Plugin-extensible DAG workflow compiler and runtime for DeepSeek Harness
AI Analysis
核心用途是提供 DAG 工作流的编译与运行引擎。适合需要在 DSH 中构建、解析和执行复杂有向无环图(DAG)任务的开发者,支持插件扩展。
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full README ↗快速使用
import {
createDshToolGateway,
DagWorkflowEngine,
InMemoryWorkflowRunStore,
parseWorkflowTemplate,
registerCoreNodes,
WorkflowNodeRegistry,
} from '@gm-hz/dsh-dag-workflow-core'
const registry = new WorkflowNodeRegistry()
registerCoreNodes(registry)
const tools = createDshToolGateway(async input => {
// Host 插件在这里调用 ctx.tools.execute(),并绑定 owning Agent 与 CallId。
return executeThroughDsh(input)
})
const runStore = new InMemoryWorkflowRunStore()
const engine = new DagWorkflowEngine(registry, { tools }, { runStore })
const template = parseWorkflowTemplate(yamlSource)
const run = engine.start({ template, inputs: { message: 'hello' } })
const result = await run.result // 始终 resolve;通过 status 判断结果
// 进程恢复后使用同一个持久化 store;未知副作用节点需显式处理。
const resumed = engine.resume({
runId: run.id,
unknownNodeResolutions: { sideEffectNodeId: 'retry' },
})