npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-obsidian-sync

v2.1.1

Published

DSH Obsidian Sync - DSH Cordis plugin: on-demand Obsidian knowledge-base search + DSH session archiving following your vault's existing PARA rules (zero token injection, in-process fs, inverted index, idempotent upsert)

Readme

DSH Obsidian Sync

DSH Cordis 插件:按需搜索 Obsidian 知识库 + 幂等归档 DSH 会话(零 token 注入)

设计理念

纯模型 Tool 按需调用,不注入系统提示词。默认 token 成本 ≈ 两个 Tool 的 schema。

  • 进程内 fs 服务(resolve/stat/listDir/readText/writeText),不起子进程
  • 倒排索引 + 60s 增量重建(dirty 标记,跳过 .obsidian/.git)
  • CJK bigram 分词 + 全文索引 + IDF 加权排序
  • date + shortId 幂等 upsert(标题变更不影响去重)
  • 笔记写入 vault/04-Archive/,YAML frontmatter + Obsidian 原生标签
  • 自动挂 DSH-会话归档-索引.md 的按日期段(双井号边界 + 同 shortId 去重)

提供的 Tool

obsidian.search

在 Obsidian 知识库中按关键词搜索相关笔记(中英文均可,自动 CJK bigram 分词)。

// 输入
{ "topic": "npm 发布 2FA", "limit": 5 }

// 输出
{
  "ok": true,
  "matches": [
    {
      "file": "04-Archive/2026-09-12-3073121a-…",
      "score": 3.72,
      "snippet": "npm 2FA 查证:TOTP 已废弃…",
      "size": 4200,
      "matchReason": "npm pub lis 2fa"
    }
  ],
  "count": 5,
  "vaultPath": "E:/dsh-workspace/obsidian-vault"
}

obsidian.sync_session

把当前 DSH 会话幂等归档到 Obsidian vault。摘要未变则跳过写盘。

// 输入
{
  "session_id": "session-76bb60db-bdde-…",
  "title": "dsh-obsidian-sync 优化与发布",
  "summary": "用户需求:… 过程要点:… 交付物:…",
  "tags": ["dsh", "obsidian", "cordis"],
  "related": ["2026-09-11-a9095879-dsh-tool-agnes工具升级与发布.md"],
  "raw_log": "C:\\Users\\dph\\.dsh\\sessions\\--E-dsh-workspace--\\session-76bb60db\\session.v3.jsonl.zstd"
}

// 输出(首次写入)
{ "ok": true, "skipped": false, "file": "04-Archive/2026-09-13-76bb60db-…", "index": "updated" }

// 输出(摘要未变)
{ "ok": true, "skipped": true, "file": "…", "reason": "summary unchanged", "index": "unchanged" }

// 输出(失败)
{ "ok": false, "error": "writeText failed: …", "code": "WRITE_FAILED" }

安装

方式一:从 npm 安装(推荐)

dsh plugin --profile web add dsh-obsidian-sync

方式二:从本地路径安装

cd dsh-obsidian-sync
pnpm install
pnpm build
dsh plugin --profile web add .

配置

~/.dsh/settings.yaml 中添加:

obsidian-sync:
  vaultPath: "E:/dsh-workspace/obsidian-vault"
  searchEnabled: true
  indexRefreshMs: 60000

所有字段均有默认值,可不配置直接挂载。

开发

pnpm install
pnpm build        # tsdown 构建 → lib/
pnpm typecheck    # tsc 类型检查

测试

node scripts/test-tokenize.mjs      # CJK bigram 分词
node scripts/test-idempotent.mjs    # 幂等 upsert
node scripts/test-index-boundary.mjs # 索引边界插入

发布

pnpm version patch
git push origin main --tags
npm publish

.npmrc 不入版本库(含 npm access token),发布前需本地配置。

许可证

MIT


作者: Dingpenghui-good
仓库: https://github.com/Dingpenghui-good/dsh-obsidian-sync