DeepSeek Harness 插件

dsh-ipcalc

IP & subnet math toolbox for DeepSeek Harness (dsh): IPv4 subnet layouts, CIDR summarization and IPv4/IPv6 parsing with RFC 5952 normalization and IANA classification — zero runtime dependencies(英文原文)

跳到安装方式

来源信息

GitHub 仓库
TYEclipse/dsh-ipcalc
最近更新
2026年8月20日
分类
工具与能力
GitHub stars
1
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/TYEclipse/dsh-ipcalc
插件名:dsh-ipcalc
作者:TYEclipse

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-ipcalc

IP & subnet math toolbox for DeepSeek Harness (dsh). Three pure-math tools — zero runtime dependencies, no network I/O — so agents stop doing subnet arithmetic in their heads (where they frequently get it wrong).

Tools

ToolWhat it does
ipv4_subnetFull subnet layout for an IPv4 CIDR: network, broadcast, netmask, wildcard, host range, address counts, integer forms and IANA classes
ipv4_summarizeReduce a list of IPv4 addresses/ranges to the minimal covering CIDR list (merge + supernet)
ip_parseValidate, normalize (RFC 5952) and classify any IPv4/IPv6 address, including embedded IPv4-in-IPv6 forms

Install

dsh plugin --profile <your-profile> add github:TYEclipse/dsh-ipcalc

Usage

ipv4_subnet("192.168.1.25/24")
→ network 192.168.1.0/24
  netmask 255.255.255.0  wildcard 0.0.0.255  broadcast 192.168.1.255
  host range 192.168.1.1 – 192.168.1.254  (254 usable of 256)
  classes: network=private  host=private

ipv4_subnet("10.10.10.10/255.255.255.248")   # dotted-mask input works too
→ network 10.10.10.8/29  (6 usable hosts)

ipv4_summarize(["10.0.0.0/24", "10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"])
→ ["10.0.0.0/22"]

ip_parse("::ffff:192.168.1.1")
→ IPv6, class ipv4_mapped, normalized ::ffff:c0a8:101 (embeds 192.168.1.1)

Semantics

  • Exact arithmetic — all math uses plain double arithmetic on 32-bit integers

(values up to 2³² are exactly representable), so there is no bitwise-overflow risk.

  • /31 follows RFC 3021 — both addresses are reported as usable (point-to-point links).
  • /32 is a single host — first/last host equal the address itself.
  • Bare addresses are treated as /32; dotted netmasks (/255.255.255.248) are

accepted anywhere a prefix length is; non-contiguous masks are rejected.

  • RFC 5952 canonicalization — IPv6 is lowercased, leading zeros stripped, and the

longest (leftmost on ties) run of two or more zero hextets compressed to ::.

  • Classification follows the IANA special-purpose registries:

IPv4 unspecified / broadcast / loopback / private (10/8, 172.16/12, 192.168/16) / cgnat (100.64/10) / link_local (169.254/16) / documentation (192.0.2/24, 198.51.100/24, 203.0.113/24) / multicast (224/4) / reserved (240/4) / global; IPv6 unspecified / loopback / ipv4_mapped / ipv4_compatible / documentation (2001:db8::/32) / link_local (fe80::/10) / multicast (ff00::/8) / unique_local (fc00::/7) / global. Classification is best-effort for the common registry entries, not a full CIDR-overlap engine.

Development

pnpm install
pnpm build
pnpm test
pnpm lint

License

MIT

---

dsh-ipcalc(中文简介)

面向 DeepSeek Harness 的 IP 与子网数学工具箱,三个纯本地计算工具,零运行时依赖、无任何网络访问:

  • ipv4_subnet:给定 CIDR(支持 a.b.c.d/前缀、点分掩码、裸地址)输出完整子网布局——网络号、广播地址、子网掩码、反掩码、可用主机范围与数量、整数形式、IANA 分类(私网/环回/链路本地/CGNAT/文档段/组播/保留段等)。
  • ipv4_summarize:把一组 IPv4 地址/网段归并成最小覆盖 CIDR 列表(相邻合并 + 对齐超网)。
  • ip_parse:校验、规范化(RFC 5952)并分类任意 IPv4/IPv6 地址,识别 ::ffff:a.b.c.d 内嵌 IPv4 形式。

专门解决大模型心算子网边界常出错的问题;/31 遵循 RFC 3021,/32 视为单主机。