Introduction¶
One of the core designs of DeepSeek Harness is a modular plugin ecosystem. In practical agent development, the model often needs “current time,” “weather conditions,” or “battery level” as context, but manually entering this information is inefficient and cannot update in real time. The dsh-environment-context plugin solves this need by registering an “Environment Context” page in DSH’s native settings panel.
Plugin Overview¶
This plugin is maintained by liqiming-whu. It dynamically injects current environment state through DSH’s systemPrompt.section(), without calling agent.inject() and without generating chat messages or accumulating context nodes.
Core Features¶
- Comprehensive environment data access: reads the current time, weather, location, battery level, and device information in real time.
- Automatic language adaptation: detects the browser’s preferred language and injects the corresponding text in Chinese or English.
- Multi-source support: weather sources support Open-Meteo, MET Norway, and wttr.in; reverse geocoding supports Nominatim, BigDataCloud, and Photon.
- Fine-grained control: provides switches in the settings panel to independently control the display of time, weather, battery level, and other information.
Installation and Activation¶
Install it using the official command. After installation, restart DSH Web Host for the changes to take effect.
dsh plugin --profile web add --allow-build=dsh-environment-context github:liqiming-whu/dsh-environment-context --trust-lockfile
After installation is complete, restart the Web Host and refresh the interface. Then click Settings → Environment Context at the bottom of the left sidebar.
Injection Example¶
The plugin automatically switches the injected content based on the browser language. If the browser language begins with zh (such as zh-CN or zh-TW), Chinese is used; otherwise, English is used. The following is a Chinese injection example:
【现实环境信息】
当前时间:2026年8月19日 17:36:49
时区:Asia/Shanghai
星期:星期三
地点:<当前地点>
天气:小毛毛雨
温度:34.4°C(体感:38.7°C)
湿度:52%
风速:8.2 km/h 东北
电量:100%
充电状态:充电中
设备信息:
设备名称:<设备名称>
设备型号:<设备型号>
平台:Microsoft Windows 11
Use Cases and Considerations¶
- Use cases: It is recommended to enable this feature only in role-playing (RP) scenarios that genuinely require a real-time environmental atmosphere.
- Cache impact: Dynamic environment injection changes the system prompt prefix, which may reduce the prompt cache hit rate, increase latency, and may affect cache billing discounts. For coding, documentation, and long-session tasks where stability is prioritized, keep it disabled.
- Data privacy: Location data does not use proxies or public IP addresses; battery and device information exist only in Host memory and are cleared when the Host restarts. They are not written to chat messages.
- Battery fault tolerance: If battery data collection fails, stale values are not reused, ensuring accuracy.
License¶
MIT