davidgereb/dsh-lib-context-injection
davidgereb★ 0JavaScriptLast synced: 2026-08-15
Context injection library to be used in DeepSeek Harness plugins.
README excerpt
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-lens fires scheduled off-peak sends, releases deferred (cheapass) prompts, and wakes interrupted work at the next off-peak start; dsh-plugin-watchdog wakes 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/message events and installing it via installModelSelection , 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…
View full README on GitHub →