DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Context Steward — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins

@whatsmore-nf/dsh-context-steward

Context Steward

DeepSeek Harness plugin: cognitive resource scheduling and intelligent compression system under fixed context capacity (supports dsh plugin CLI installation)

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add @whatsmore-nf/dsh-context-steward@0.20.0
READMECompatibilityVersions

Compatibility and provenance

Context Steward is published as @whatsmore-nf/dsh-context-steward and currently resolves to version 0.20.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
any
Release source
npm
Registry updated
9/20/2026

Versions

0.20.0stable
8/20/2026
0.1.5stable
8/18/2026
0.1.2stable
8/16/2026
Show 1 more versionCollapse versions
0.1.1stable
8/16/2026
Latest
0.20.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
551.1 kB
Files
46
Surface
any
License
MIT
Source
npm
GitHub
★ 1
Weekly downloads
11
Last push
8/20/2026
View source ↗Project homepage ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

README

@whatsmore-nf/dsh-context-steward

English | 中文

A DeepSeek Harness plugin that treats the fixed-capacity context window as a scarce cognitive resource and schedules it: within a hard token budget it protects attention bandwidth for the agent's current key decisions, tiers compression by value density, consolidates completed phases, and keeps a structured fact vault so evicted source text stays recallable.

It ships as a Cordis Service registered at ctx.contextSteward, with a schemastery-declared static Config and static inject, following the same plugin shape as the official Harness plugins (e.g. @deepseek-ai/dsh-compaction-basic).

Relationship to official compaction

Official dsh-compaction-* compacts the conversation body itself. This plugin is the complementary layer: it schedules injected memory — deduplicating repeated observations, tiered compression, phase consolidation, key-decision bandwidth guarantees, and fact recall — before the compacted snapshot is injected into the model-visible context. Both can run side by side.

Install

Via Harness plugin CLI (same as other official plugins):

dsh plugin --profile web add @whatsmore-nf/dsh-context-steward@latest

Or directly via npm:

npm install @whatsmore-nf/dsh-context-steward

The plugin needs the Harness runtime (@deepseek-ai/cordis, @deepseek-ai/dsh-agent, @deepseek-ai/dsh-llm, @deepseek-ai/dsh-session) as peer dependencies; a Harness profile already provides them.

Load

Add a row to a cordis.yml / cordis.patch.yml bundle:

- id: dsh-context-steward
  name: '@whatsmore-nf/dsh-context-steward'
  config:
    capacity: 8000
    enabled: true
    inject: true

Loading registers the ctx.contextSteward Service and wires it automatically to the Harness lifecycle events (see Events).

Config (ContextStewardConfig)

Every key is optional; missing keys fall back to the resolved defaults below. Unknown keys, wrong types, and out-of-range ratios fail plugin load (resolveConfig rejects them, mirroring official plugins).

KeyDefaultMeaning
capacity4000Token budget of the injected compressed context (the fixed bandwidth cap).
reserved0System tokens excluded from the compressible region.
decisionGuaranteefloor(capacity × 0.35)Attention bandwidth floor: max tokens the working set may occupy while a key decision is protected.
halfLifeMs600000Time-decay half-life (10 min) for recency weighting.
adaptiveRecencytrueAdapt the half-life to observed decision cadence.
minAdaptiveHalfLifeMs10000Lower bound of the adaptive half-life.
maxAdaptiveHalfLifeMs3600000Upper bound of the adaptive half-life.
adaptiveThresholdstrueSelf-tune demote/promote thresholds from churn.
churnWindowMs60000Churn observation window for threshold tuning.
tuneStep0.03Threshold tuning step.
demoteThreshold0.35Score below which working items are demoted to the cold pool.
promoteThreshold0.55Score above which cold items are promoted back to the working set.
workingRenderRatio0.5Share of the render budget given to the working set.
maxProtectedDecisions4Max protected decision snapshots kept verbatim (older ones age out).
coldCompactScore0.4Minimum score for cold-pool tiered compression.
rehydrateThreshold0.6

Usage

Service form (inside the Harness)

import type { Context } from '@deepseek-ai/cordis'
import ContextSteward from '@whatsmore-nf/dsh-context-steward'

export const name = 'context-steward'
export const inject = ['sessions']

export function apply(ctx: Context): void {
  const plugin = ctx.plugin(ContextSteward, { capacity: 8000 })
  // Optional: plug in an LLM semantic summarizer (async prewarm during pre-step idle time,
  // upgrading compression from heuristics to structured summaries)
  // plugin.asyncSummarize = async (content, depth) => await llm.complete(
  //   buildCompactionPrompt({ context: [content] }), { maxTokens: depth >= 3 ? 160 : 80 },
  // )
}

The Service is available as ctx.contextSteward; per-session schedulers are obtained with ctx.contextSteward.scheduler(session).

Standalone form (demo / unit tests, no Harness runtime)

import { createContextStewardPlugin } from '@whatsmore-nf/dsh-context-steward'

const plugin = createContextStewardPlugin({ capacity: 8000 })
plugin.hooks.onAppend?.({ id: 'u1', kind: 'user', content: '目标是部署服务', timestamp: 0 })
plugin.hooks.onDecision?.({ goal: '部署服务', currentStep: '选型', attentionFocus: ['部署', '服务'] })
const prompt = plugin.hooks.onBeforePrompt?.() // 注入压缩后的上下文

Scheduler core

CognitiveResourceScheduler is exported standalone: ingest(), checkpoint(), setPhase(), consolidatePhase(), compiledContext(), query(), exportArchive(), exportState() / restoreState() — see the type declarations for the full surface.

Events

When enabled is true, the plugin subscribes to:

EventPurpose
session/eventFeed model-visible user/assistant/tool events into the scheduler (dedupe, tiered compression, fact extraction, bandwidth accounting). Self-injected compressed context is skipped.
agent/pre-stepTreat the upcoming step as a key decision: attention re-ranking, then inject the compressed snapshot.
agent/request-errorOn CONTEXT_WINDOW_EXCEEDED failure, feed the overflow as an observation so the next snapshot perceives it.
agent/disposedExport the archive, log closing metrics, and release the session state.

License

MIT

Archive score threshold for rehydrating facts back into the working set.
dedupetrueAggregate repeated observations into repeated ×N records.
consolidatetrueConsolidate a finished phase into one structured summary.
renderBudgetavailable capacityToken cap of the rendered injected context.
maxItemChars6000Source-text truncation cap per tool/observation item (full text stays in the vault).
reclaimPeekLimit16Candidate peek count for value-density reclamation.
enabledtruefalse registers the Service only, without event wiring.
injecttrueEnable injecting the compressed snapshot (still gated by injectThresholdRatio).
injectThresholdRatio0.8Injection engages only when measured session pressure totalTokens >= floor(window × ratio) — the same trigger semantics as the official compaction's thresholdRatio. Below it the plugin only keeps invisible in-memory bookkeeping, so normal reasoning steps are not disturbed.
injectContextWindow0Explicit context-window override (tokens). 0 = resolve from the routed model adapter's contextWindow; when the window cannot be resolved and no override is set, injection is conservatively skipped.