knqiufan/powercontext-dsh11

powercontext-dsh

DSH 插件,通过 HTTP 连接到 PowerContext 服务器,实现召回、记忆、交接、经验和技能管理。

AI 分析

核心用途是连接 PowerContext 服务以增强 Agent 的上下文召回与记忆能力。适合需要跨项目、跨会话进行经验和技能管理的复杂任务。必要条件是同时运行 PowerContext 服务端。

包名
powercontext-dsh
版本
0.0.3
许可证
Apache-2.0
最近更新
2026年8月16日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:knqiufan/powercontext-dsh

Configuration

Environment variables override patch config. Do not put secrets in files that --dump-config can print.

FieldEnvironment variableDefaultMeaning
baseUrlPOWERCONTEXT_DSH_BASE_URLhttp://127.0.0.1:8000Server root URL, no trailing slash
authorizationPOWERCONTEXT_DSH_AUTHORIZATIONemptyFull Bearer
scopeIdPOWERCONTEXT_DSH_SCOPE_IDemptyOverrides automatic project scope
timeoutMs4000Shared recall + capture budget
requestTimeoutMs1000Single HTTP timeout
maxBytes8000prepare_context budget
capturePromptsPOWERCONTEXT_DSH_CAPTURE_PROMPTStruePersist user input as a Source
flushOnCapturePOWERCONTEXT_DSH_FLUSH_ON_CAPTUREfalseFlush immediately after capture

For durable non-secret defaults, edit ~/.dsh/profiles/web/cordis.patch.yml. Harness replaces the whole config object for that row, so restate every key you still need:

- id: powercontext-dsh
  config:
    baseUrl: https://pc.example.com
    timeoutMs: 4000
    requestTimeoutMs: 1000
    maxBytes: 8000
    capturePrompts: true
    flushOnCapture: false

Remote Server

The plugin runs inside the Harness process. The browser never calls PowerContext. The default Server bind is 127.0.0.1. A remote Server must listen more widely and enable auth. Put TLS in front before exposing it on a network.

export POWERCONTEXT_SERVER_HTTP_HOST=0.0.0.0
export POWERCONTEXT_SERVER_HTTP_PORT=8000
export POWERCONTEXT_SERVER_AUTH_ENABLED=true
export POWERCONTEXT_SERVER_AUTH_TOKEN=
powercontext server run

Publish the API root users actually use, for example https://pc.example.com. No trailing slash, and no /mcp.

export POWERCONTEXT_DSH_BASE_URL=https://pc.example.com
export POWERCONTEXT_DSH_AUTHORIZATION="Bearer "
dsh web

POWERCONTEXT_DSH_AUTHORIZATION must be the full Bearer and must match POWERCONTEXT_SERVER_AUTH_TOKEN. Keep the token in the environment variable, not in the patch file.

Common Server variables:

VariableMeaning
POWERCONTEXT_SERVER_HTTP_HOST / _PORTListen address
POWERCONTEXT_SERVER_AUTH_ENABLED / _TOKENStatic Bearer
POWERCONTEXT_HOMEData directory
POWERCONTEXT_SERVER_RUNTIME_SCHEDULE_SECONDSExtraction interval; unset disables the job
POWERCONTEXT_SERVER_INFERENCE_GENERATION_MODELGeneration model used for extraction