DeepSeek Harness Hub
← 返回列表

Hacker News 工具tanf1ng/dsh-tool-hackernews

DeepSeek Harnessspec-screened在 GitHub 查看 ↗
未验证

抓取 HN 热榜、搜索帖子并查看评论树

尚未跑自动兼容性验证,可查看页面内的依赖与入口分析。 · 最近上游提交 2026/8/14 · 已提供中文文档

Hacker News 工具套件(hn_top_stories、hn_search、hn_item),适用于 DeepSeek Harness 智能体

综合分
27.4
GitHub 分
27.4
用户评分
★ Stars
1
周下载量
安装插件(需先安装 dsh CLI 引擎:npm install -g @deepseek-ai/dsh)
dsh plugin --profile web add tanf1ng/dsh-tool-hackernews
该插件未发布到 npm,走 GitHub 源安装(pnpm 若拦截 prepare 脚本,按其提示在 pnpm-workspace.yaml 的 allowBuilds 中放行后重跑)
数据截至 2026/9/16(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
依赖的 DSH / Cordis 模块
@deepseek-ai/schemastery@deepseek-ai/cordis@deepseek-ai/dsh-tools
用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动

README

dsh-tool-hackernews

面向 DeepSeek Harness(DSH)智能体的 Hacker News 工具套件:hn_top_stories、hn_search、hn_item。基于免费的 Algolia HN 搜索 API 构建 —— 无需任何 API Key。

工具

| 工具 | 参数 | 行为 |
|---|---|---|
| hn_top_stories | limit(可选,1–30) | Hacker News 当前热门首页:标题、链接、评分、评论数、作者、相对时间。 |
| hn_search | query(必填)、tag(story/comment/poll/ask_hn/show_hn)、since_hours(1–8760)、limit(1–30) | 关键词搜索 HN,可限定标签或最近 N 小时。 |
| hn_item | id(必填)、max_comments(0–100) | 单个故事详情 + 有上限的评论树(自动去除 HTML、按层级缩进),保护上下文窗口。 |

三个工具都是只读且并发安全的,DSH 可以并行调度同级的工具调用。每个请求都携带部署方配置的超时预算,并转发调用方的 AbortSignal。

安装

DSH 插件通过 dsh plugin(底层是 pnpm)安装到 profile 中。从本 GitHub 仓库安装:

dsh plugin --profile  add "github:tanf1ng/dsh-tool-hackernews"

或从本地源码安装:

pnpm install
pnpm build
然后在需要加载它的 profile 里执行:
dsh plugin --profile  add "file:../../dsh-tool-hackernews"

在 profile 的 cordis.patch.yml(或产品 bundle)中启用插件:

- id: tool-hackernews
name: dsh-tool-hackernews

配置

所有配置项均可选:

| 配置项 | 默认值 | 含义 |
|---|---|---|
| registerTopStories | true | 是否注册 hn_top_stories。 |
| registerSearch | true | 是否注册 hn_search。 |
| registerItem | true | 是否注册 hn_item。 |
| topStoriesLimit | 10 | hn_top_stories 的默认结果条数上限。 |
| searchLimit | 8 | hn_search 的默认结果条数上限。 |
| maxComments | 20 | hn_item 的默认评论条数上限。 |
| fetchTimeoutMs | 15000 | 单次请求的超时预算(毫秒)。 |

开发

pnpm install
pnpm build     # tsc -> lib/
pnpm test      # 冒烟测试(stub fetch,无需网络)

本包遵循官方 DSH 工具插件模式:一个 Cordis 插件(name / inject / Config / apply),通过 ctx.tools.register(defineTool(...)) 注册工具,包含完整的参数 schema、规范化的输出 schema、文本渲染器和 presentCall UI 卡片。

使用示例

装上之后,你可以直接问智能体:

"今天 Hacker News 上最火的是什么?" → hn_top_stories
"HN 上最近有人讨论 DeepSeek 吗?" → hn_search(搜索 "deepseek",限最近 24 小时)
"这篇热门帖子的评论都在聊什么?" → hn_item

许可证

MIT

上游仓库有新提交时邮件通知你(每天最多一封,无更新不打扰),随时一键退订。

💬 加入 DPharness 群聊

插件用法、部署报错、新插件第一时间同步——群里问,比一个人翻文档快。

点击加入 QQ 群
DPharness 群聊二维码,手机 QQ 扫码进群
扫码进群