xinyuehtx/dsh-plugin-hooks-ordering

xinyuehtx★ 1TypeScript最后同步: 2026-08-17

在 GitHub 打开

为 deepseek harness 的 waterfall 和 serial 进行确定性 hooks 监听排序

README 摘要

dsh-plugin-hooks-ordering English 简体中文 Deterministic before / after ordering for Cordis waterfall hooks whose participants are contributed by independent, mutually-unaware plugins. - Playground (live): https://xinyuehtx.github.io/dsh-plugin-hooks-ordering/ - Runnable demo: npm run demo The problem Cordis dispatches waterfall listeners in registration order — their position in the internal listener array, with prepend as the only lever. Registration order is in turn driven by inject -dependency activation, which is non-deterministic between unrelated plugins . The consequence: a plugin cannot reliably state a relative order such as "run me after that other plugin." Concretely: - There is no before / after / stage declaration on ctx.on — only a boolean prepend , and prepend is last-prepender-wins , so it is not a stable "always first" either. - The only robust ordering primitive Cordis offers is inject : if plugin B injects a service plugin A provides, B activates after A. That pins order globally and single-directionally , and forces B to depend on A — impossible across vendors that must not depend on each other. - Two plugins may need opposite relative order on different hooks. A s…

在 GitHub 查看完整 README →
工具/开发dsh-plugin

分类