在 DSH 右侧栏和整页提供 ShellPulse AI 新闻流,包含新闻、热点、精选、教程与论文视图、中文摘要、AI 解读和 arXiv 论文阅读。它的 HTTP 路由没有 DSH 的访问检查,浏览器里打开的网页可以调用它们。
安装
# npm 包(预构建)
dsh plugin --profile web add @lukema/dsh-news
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:lukema95/dsh-news
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A right-sidebar tab that shows the public ShellPulse AI feed while you work: the materialized hot ranking, the latest timeline and the featured picks, with Chinese titles and summaries when available.
What it does
- Right sidebar tab, next to Files / Browser / Terminal, so the conversation stays visible.
- Left rail entry that opens the same feed as a full page in the main column, for reading without the conversation taking half the width. Both surfaces share one implementation.
- Five views — 新闻 (
all, paginated with load-more), 精选 (featured), 热点 (hot, the server's Top 20), 教程 (all&category=tutorials) and 论文 (all&category=papers) — plus a category filter filled from/api/meta. The backend's plainallview excludes tutorials and papers by policy (2026-11-15), so the two content types have their own tabs. Category views are warmed in the background and cached longer, because the backend's keyword filter makes them slower than the plain timeline. - Rows carry a publisher mark, source, relative time, multi-source count
(
story_size > 1),热点/精选badges when the item has them, and the model quality score (llm_quality× 100, the same number the site calls "AI 评分"). - Detail view: selecting a row fetches
/api/item/{id}and replaces the list with the article — title, model summary,body_zh(falling back tobody), a truncation note when the translation is partial, categories, and open/copy actions. Back returns to the list with its view and filters intact. - AI actions: the detail view offers
AI 解读(a structured explain-this-article prompt) and和 AI 聊聊(a discussion opener). Both insert the prompt into the current Session's composer through the standardinputActionsprop, so the user reviews and sends it; when the composer is not bound (the full-page entry), the prompt is copied to the clipboard instead and the hint says so. shellpulse_articletool: the Host half registers a model-facing tool that returns one article's title, source, summary and stored body (Chinese translation first). The inserted prompts carry the article id and ask the agent to call it, so an analysis or a follow-up discussion reads exactly what the panel shows instead of re-fetching the publisher page. The tool is registered throughctx.tools.registerwith a plain JSON Schema definition, so the bundle depends on no@deepseek-ai/*package.- Full-paper reader, arXiv's own rendering:
加载原文callsGET /shellpulse/paper?id=…. The Host resolves the arXiv id, reads the abs page for the latest version, and fetcheshttps://arxiv.org/html/<id>v<n>(falling back toar5iv.labs.arxiv.orgwhen arXiv has no HTML). It returns the article HTML plus arXiv's own paper stylesheet (its@importchain inlined,:rootrebound to:host, image URLs absolute), and the client mounts both in a shadow root, so the paper keeps arXiv's typography, tables, figure captions and MathML while none of that CSS leaks into the Harness UI. - Why not KaTeX/MathJax: the plugin has no build step or asset pipeline, and loading a CDN script into an offline app is not acceptable. arXiv's HTML already carries MathML, which Chromium typesets natively, so the reader keeps that instead of adding a second engine.
- Figure images:
sanitizeArxivHtmlrewrites allowlisted figure images (arxiv.org,static.arxiv.org,ar5iv.labs.arxiv.org) to/shellpulse/img?u=…; the Host proxy re-checks the host, refuses non-image/*responses and anything over 8 MB, and caches for an hour. - Sanitised before rendering: the Host strips scripts, frames and event handlers as a first
pass, then the client re-parses the markup with
DOMParserand applies a DOM allowlist — dropping executable/navigable elements, everyon*andstyleattribute, and anysrcthat is not the local image proxy. The paper stylesheet loses@importand anyurl()that does not point at arXiv, so neither the HTML nor the CSS can reach a third-party origin. - Explain a selection: selecting text inside the paper (including inside the shadow root)
shows a floating
解释这段button; it posts the excerpt toPOST /shellpulse/explain, which asks the model for a short Chinese explanation of the passage, its key symbols and its context, and shows the answer in a popover. - Markdown body: fenced code, headings, ordered/bullet lists, quotes, rules, and inline code/bold/links are rendered as React nodes, never as HTML, so article text cannot inject markup. Unknown constructs stay plain text.
- Publisher mark degrades like the site: the source icon the API carries, then the
origin's own
/favicon.ico, then the source initial. No third-party favicon service. - Change probe every 60 s through
/api/feed/head; a "N 条新内容" strip appears instead of silently reloading the list. - Failure states stay readable: the last good list is kept and marked stale.
- First run is discoverable: the panel opens once per browser profile (the
dsh.shellpulse.news.intro.v1key); closing it afterwards is respected.
Architecture
The browser half never calls the public API directly. Production CORS is an origin
allowlist, and the Harness page origin is either a changing loopback port or file://,
so the Host half (index.js) registers a same-origin proxy on the Host's own web server:
browser: fetch('/shellpulse/feed?view=hot')
│
Host: ctx.webServer.register({ kind: 'prefix', path: '/shellpulse' })
├─ GET /shellpulse/feed → https://api.shellpulse.xyz/api/feed
├─ GET /shellpulse/meta → /api/meta
├─ GET /shellpulse/head → /api/feed/head
└─ GET /shellpulse/item/:id → /api/item/:id
│ whitelisted params · 45 s memory cache · single-flight · 8 s timeout
▼
https://api.shellpulse.xyz
Rules the proxy keeps:
GET/HEADonly; every other method answers405.- The upstream origin and route set are fixed — no arbitrary URL, so it cannot become an open fetcher.
- Query parameters are whitelisted and bounded (
limit≤ 50,hours≤ 720, known views and languages only). Unknown parameters answer400. - Only successful responses are cached, keyed by route + query; upstream
429is returned with itsRetry-After, network failures answer502with a short JSON body. - Responses are
no-storeso the browser does not add a second cache layer.
Install
From this directory:
dsh plugin --profile <profile> add link:$PWD
Or in the Harness GUI: Plugins → Add plugin and paste the absolute path to this directory. Enable the bundle, restart the Host if the profile does not hot-reload, then reload the page. Open it from:
- the left rail's AI 新闻 entry (full page in the main column), or
- the right sidebar's + control (guide → AI 新闻) for the narrow tab.
Configuration
- insert:
- id: shellpulse-news
name: '@lukema/dsh-news'
config:
apiBase: https://api.shellpulse.xyz # another deployment, or http://127.0.0.1:8000
cacheSeconds: 45 # 0 disables the Host cache (max 600)
llmProvider: deepseek-official # model used by AI 翻译
llmModel: deepseek-flash
The row config is read once when the plugin activates; change it in the profile patch and reload the Host.
Development
No build step: index.js is a plain ESM plugin and client.js is a lazy-CJS factory for
the Harness module loader. After editing client.js, reload the page; after editing
index.js, restart the Host.
node --check index.js
node --check client.js
node --test test/*.test.js
test/proxy.test.js exercises the Host routing contract with a fake ctx.webServer:
parameter whitelisting, cache hits, 429 passthrough and the method guard.
Privacy
- The panel never talks to ShellPulse directly: the Host half requests
api.shellpulse.xyz,arxiv.organdar5iv.labs.arxiv.orgon the user's machine. AI 解读/和 AI 聊聊only put text into the composer; nothing is sent until the user presses Enter.解释这段/翻译这段send the selected excerpt and the paper title to the model the user configured in Harness (ctx.llm). No ShellPulse server is involved, and nothing is stored. The Host accepts this only for same-origin JSON requests and rate-limits it to 10 per minute, so another page cannot spend the user's model quota.- No API keys, tokens or accounts are required. Images are fetched through the local proxy and cached in memory only.
Limits
- The public API has no search endpoint, so the panel has no search box.
- Full article bodies and translations stay out of the sidebar; the row links to the source.
- The right sidebar needs a session; without one there is no place to mount the tab.
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-task-board★ 10458
侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。
zhu1090093659/dsh-web#packages/dsh-web-all★ 10458
DSH Web UI 插件与皮肤合集:任务看板、git 图、右侧面板、远程移动端 UI、桌宠、实时 token 统计与皮肤中心。
ccch1mneyyy/dsh-TUI★ 7797
Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7271
右下角常驻的小鲸鱼挂件:余额、今日已用与每轮对话消耗(含峰谷价),余额预警与今日预算的泡泡内容都可编辑;泡泡点击序列模块化自定义,支持并列加权 A/B、随机台词与随机图片;内置 30+ 厂商模板(OpenAI / OpenRouter / Kimi / 硅基流动 / 方舟 / 智谱 / MiniMax 等),按模型查余额与订阅额度;另有任务结束音效、导入音频、自定义角色与资源管理。数据全在本机,无遥测。
omdsh-dev/DSH-better-sidebar★ 5191
侧边栏完整工作台:内置文件渲染编辑、终端、Git 与子代理,支持三方插件注册新 Tab。
omdsh-dev/dsh-genui★ 1007
助手回复内渲染交互式 UI 组件:布局、图表、表单、测验、mermaid、3D 场景与回传事件循环。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。