davidgereb/dsh-lib-context-injection ↗★ 0
dsh-lib-context-injection
Shared agent context-injection helpers for dsh web plugins: follow-up message injection (agent.followup) and model-selection restoration (installModelSelection) for scheduled sends, cheapass gating, and crash/restart resume
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-lib-context-injection
Shared agent context-injection helpers for dsh web plugins.
Several dsh web host plugins need to push context into a live agent's session with no browser in the loop, and they used to each implement the same two patterns by hand:
- Follow-up message injection —
agent.followup(createUserMessage(...)):dsh-plugin-cost-lensfires scheduled off-peak sends, releases deferred (cheapass) prompts, and wakes interrupted work at the next off-peak start;dsh-plugin-watchdogwakes a crash-resumed agent with a "continue where you left off" prompt. - Model-selection restoration — deriving the session's last durable route
(provider / model / reasoning effort) from its
request/header+assistant/messageevents and installing it viainstallModelSelection, so the persona prompt's{{model}}/{{provider}}variables resolve on headless/resumed agents (which have no browser to install the selection).
This package is the single implementation of both patterns.
Install
Host-only ESM library; it runs inside the dsh server process and imports
@deepseek-ai/dsh-llm + @deepseek-ai/dsh-agent (both shipped with dsh web).
This is a dependency package, not a Cordis plugin — there is no loader entry to add to
cordis.patch.yml, anddsh plugin addwill not make anything load it. If you use one of the consuming plugins (cost-lens, watchdog), it is installed automatically as their git dependency — you don't need to install it yourself.
From GitHub (add as a dependency of your own host code)
npm install --save github:davidgereb/dsh-lib-context-injection
# or with pnpm:
pnpm add github:davidgereb/dsh-lib-context-injection
From a local checkout
npm install /path/to/dsh-lib-context-injection
# or with pnpm:
pnpm add /path/to/dsh-lib-context-injection