Introduction

DeepSeek Harness (DSH) uses a plugin-based architecture, aiming to extend agent capabilities through standardized interfaces. When developing agents that need to fetch external technical news or monitor community hot topics, integrating third-party APIs often requires writing additional network request logic. The dsh-tool-hackernews plugin provides a ready-made solution for this, encapsulating Hacker News’s core data retrieval capabilities as a DSH-native tool.

Plugin Overview

The plugin is maintained by developer tanf1ng and belongs to the category of web tool plugins. It provides a toolset for Hacker News, built on the free Algolia HN Search API, and does not require an API Key. All requests are read-only and concurrency-safe, allowing DSH to invoke multiple tools in parallel within the same session.

Core Features

The plugin mainly includes three tool functions:

  1. hn_top_stories(limit)
    Retrieves the current Hacker News front page content.

    • Parameter: limit is optional, with a numeric range of 1-30. The default value is usually 10.
    • Return: Includes information such as title, link, score, comment count, author, and relative time.
  2. hn_search(query, tag, since_hours, limit)
    Performs keyword search within Hacker News.

    • Parameters: query is the required keyword; tag is used to limit the type (e.g., story, comment, ask_hn, etc.); since_hours is used to limit the time range (1-8760 hours); limit controls the number of returned results.
    • Return: A list of matching search results.
  3. hn_item(id, max_comments)
    Retrieves details of a specific item and its comments.

    • Parameters: id is required, which is the unique ID of the article on HN; max_comments is used to limit the number of comments fetched (0-100).
    • Return: The article details and comment tree. The content is stripped of HTML tags and indented to ensure context safety.

Installation and Configuration

Installing the plugin requires the dsh plugin command. The plugin will be installed into the specified configuration file.

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

After installation, you need to enable the plugin definition in cordis.patch.yml in the configuration file:

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

The plugin supports multiple configuration options to adjust default behavior:

Configuration Option Default Value Description
registerTopStories true Whether to register the hn_top_stories tool.
registerSearch true Whether to register the hn_search tool.
registerItem true Whether to register the hn_item tool.
topStoriesLimit 10 Default number of results returned by hn_top_stories.
searchLimit 8 Default number of results returned by hn_search.
maxComments 20 Default maximum number of comments for hn_item.
fetchTimeoutMs 15000 Timeout for a single request (milliseconds).

Typical Usage

The following is an example of invoking the plugin in a DSH agent:

# 获取 Hacker News 首页的前 5 条
hn_top_stories(5)

# 搜索过去 24 小时内关于 "AI" 的故事,限制结果为 10 条
hn_search("AI", "story", 24, 10)

# 获取 ID 为 12345 的文章,最多展示 50 条评论
hn_item(12345, 50)

Applicable Scenarios and Notes

This plugin is suitable for DSH agent development scenarios that require actively fetching tech community hot topics, performing keyword searches, or analyzing specific topics.

Because the plugin runs within the permission scope of the DSH process, it is recommended to check the source code and license (MIT) before use. Although it is based on a public API, attention should be paid to the stability of network requests and the service status of the Algolia API.