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-novel-studio

v0.3.0

Published

DSH web plugin: 创作台 sidebar tab that mirrors a manuscript-project novel workspace (manifest / outline / characters / world / chapters).

Downloads

137

Readme

dsh-novel-studio

DSH Web 伴生插件:在 dsh-better-sidebar 里注册「创作台」标签页,只读镜像 manuscript-project 技能规定的小说稿件目录。

Agent 按约定维护 manifest.md / outline/ / characters/ / world/ / chapters/,侧边栏自动跟上。无独立状态文件。

功能

  • 侧边栏 tab novel-studio(书形图标,order: 55
  • GET /novel/api/snapshot?sessionId=&cwd= → 结构化快照
  • GET /novel/api/file?sessionId=&path= → 项目内文件(必须落在会话 cwd 内);POST 同路径支持版本守卫写入(replaceIfVersion,过期版本返回 409 conflict)
  • 可选工具 novel_state:返回与侧边栏相同的快照,供 Agent 自查可解析性;非小说工作区返回 {found:false},无害
  • 可选工具 novel_role:把内置专家角色作为只读子代理 spawn——consistency-checker(连续性检查员)、plot-analyst(线索健康分析员)、style-auditor(文风审读员),persona 在 assets/roles/;工具白名单与调用者可见工具取交集,无 dsh-subagent 时自动跳过
  • 实时文件跟随:tab 可见时订阅会话 running 位——Agent 产出期间 1.5s 快轮询、结束瞬间立即补拉;空闲时回落 3s,revision 指纹去重
  • 快速编辑:章节表逐行 ✎ 打开编辑面板,带「预览」(安全 Markdown 渲染树:标题/表格/任务清单/引用/代码块,原始 HTML 一律按文本)与冲突处理
  • 插件配置(Schemastery):trustedHosts(在宿主信任列表之外追加围栏条目)、maxFileBytes(单文件读取上限,默认 2MiB)、bundledSkills(进程级注册内置技能,默认
  • 预设门控:所有运行时面(守卫 / 工具 / API / 创作台 tab)只对「小说创作模式」(preset id novel-writing)会话激活;其他命名预设的会话收到切换引导或 403 preset-required。无预设头的会话(headless、未部署预设的部署)不受影响。技能默认仅经部署的 preset 副本提供——天然只在小说模式下可见
  • 内置技能assets/skills/ 下 SKILL.md 在宿主挂载 ctx.skills(dsh-skill)时注册为 bundled 提供者(rank 600)。部署的 preset 副本(customSkillDirs,rank 300)优先,本包为未部署时的兜底

创作台分区(v2.4)

  • 创作意图卡:解析 outline/creative-intent.md,顶部展示 主题 / 读者承诺 / 情感旅程 / 核心矛盾 / 决策日志条数
  • 活跃线索:解析 world/plot-threads.md,按状态着色——planted 灰 / active 蓝 / resolving 橙 / resolved 绿
  • 角色弧线:解析 characters/arc-tracker.md,每角色一卡:弧光类型、当前阶段、已完成节拍、下一节拍
  • 节奏热力图:纯 CSS 柱状图(无需图表库),柱长 ∝ 章节字数,按 draft 黄 / revised 蓝 / final 绿 / 未写灰 着色
  • 下一步建议:未写大纲章节 + active/resolving 线索 + 非空弧线下一节拍,合并排序后最多 6 条

所有解析器对缺失 / 畸形文件容错:文件不存在 → 空数组或 null,分区显示占位文案而非报错。

安装(web profile)

# npm(推荐)
dsh plugin --profile web add dsh-novel-studio

# 或从 GitHub Release 装 tarball
dsh plugin --profile web add https://github.com/winterhuan/dsh-novels/releases/download/v0.2.0/dsh-novel-studio-0.2.0.tgz

# 本地开发:构建后链入
cd sidecar/dsh-novel-studio
pnpm install && pnpm build
# ~/.dsh/profiles/web/package.json:
#   dependencies["dsh-novel-studio"] = "link:<本目录绝对路径>"
#   dsh.profile.bundles 追加 "dsh-novel-studio"
cd ~/.dsh/profiles/web && pnpm install

prepack 钩子保证 npm/发布产物总是新鲜构建。

然后重启 dsh web(host 半改动需要进程重启),浏览器硬刷新。不要在 profile 的 cordis.patch.yml 再手写一行——dsh.bundle.patch 已经会 insert novel-studio

依赖:profile 里必须已挂载 dsh-better-sidebar。未安装时本插件 host 半仍提供 API,client 半跳过 tab 注册。dsh-skill 未安装时 host 半照常工作,仅不注册内置技能。

部署预设(deployPreset

assets/ 里打包了 preset/agent.cordis.yml + preset.yml)与 skills/(9 个技能)。 库用户可调用 deployPreset() 把它们镜像到 ${DSH_HOME:-$HOME/.dsh}/.agent-presets/novel-writing (yml 与 skills/ 同级,满足 customSkillDirs 的 baseUrl 相对解析);工作区开发用仓库根 node sync.mjs

数据契约

assets/skills/manuscript-project/SKILL.md §2 与「机器可读约定」(工作区编辑源为仓库根 preset/skills/manuscript-project/SKILL.md,随 sync.mjs 同步)。解析器对缺失分区容错(隐藏而非报错)。