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

@hytime/dsh-companion

v0.1.17

Published

DSH Companion 鲸鱼 Skill/CLI 插件前端(dual-face Cordis 插件)

Readme

@hytime/dsh-companion

DSH Companion 鲸鱼 Skill/CLI 前端插件(dual-face Cordis 插件),发布到 npm 公共 registry。

默认在 DSH 右下角显示鲸鱼(二次元娘)悬浮按钮,用户继续使用 DSH 当前对话框输入;DSH Skill 调用 hyc CLI,本插件接收 Host 投影的 CLI 状态并把鲸鱼回复反馈到当前 DSH 对话。

数据流

DSH 当前对话框 ──用户输入──▶ Skill 触发
                              │
                              ▼
                    DSH Host 调用 Go CLI(hyc)
                    (凭据 / 超时 / 取消 / 结构化结果)
                              │
                              ▼
                    结构化结果(text / emotion / status)
                              │
          ┌───────────────────┴───────────────────┐
          ▼                                       ▼
   当前 DSH 对话展示最终文本              鲸鱼悬浮窗反馈状态
   (唯一输出位置)                    (idle/connecting/thinking/
                                        replying/success/error/cancelled
                                         + 表情帧切换)

本插件不负责 Token、CLI 执行和最终对话消息持久化;不创建第二个聊天输入框,不维护独立 SSE 会话。

安装前置条件(必须按序满足)

安装/激活本插件前,必须先满足:

  1. hyc CLI 可用command -v hyc 命中(系统入口 ~/.local/bin/hyc)。
  2. DSH 技能已安装$DSH_HOME/skills/ 下存在 hy-companionhy-companion-*(先安装 CLI,再执行技能安装器写入 $DSH_HOME/skills)。

任一缺失时按顺序先补齐(先 CLI、再技能、再插件),不得跳步。完整顺序与验证命令见根 README「安装前置依赖」一节。

安装

发布后

本插件发布到 npm 公共 registry,直接添加:

dsh plugin add @hytime/dsh-companion

本地开发(tarball)

本地开发使用 tarball 安装,避免 link: 目录安装带来的双实例 / 产物目录变化 / 可复现性差问题:

# 1) 构建插件产物(生成 lib/ 与鲸鱼帧资源)
pnpm --filter @hytime/dsh-companion run build
#    或监听模式:
pnpm --filter @hytime/dsh-companion run watch

# 2) 打成 tarball
pnpm --filter @hytime/dsh-companion run pack
#    产物:packages/dsh-companion/hytime-dsh-companion-0.1.0.tgz

# 3) 装进 DSH(把 *.tgz 替换为实际文件名)
dsh plugin add ./packages/dsh-companion/hytime-dsh-companion-0.1.0.tgz

# 4) 重启 DSH 使插件生效

发布包名为 @hytime/dsh-companion(scope 已定型,无需再作替换)。仅当整体更换 scope 时,才运行根目录的 node scripts/rename-package.mjs <新scope> 全局替换。

开发命令

pnpm --filter @hytime/dsh-companion run typecheck
pnpm --filter @hytime/dsh-companion run lint
pnpm --filter @hytime/dsh-companion run test
pnpm --filter @hytime/dsh-companion run build      # library build → lib/
pnpm --filter @hytime/dsh-companion run pack

公开 API

  • WhaleFloatingWidget(props:statusemotion?lastError?companionName?buddyTitle?buddyMessage?onReply?onClose?frameSrc?
  • createSkillStatusAdapter(source, onChange?)SkillStatusSource 接口
  • 纯 JSON 类型与函数:TravelNoteSkillInputTravelNoteCLIResultSkillStatusCompanionEmotionCharacterActivityparseTravelNoteCLIResultnormalizeSkillStatusnormalizeCompanionEmotionskillStatusToActivityEMOTION_TO_FRAMEresolveWhaleFrame
  • 样式:由组件内联注入(CSS Modules,构建时编译进 lib/client.js

不导出 mock、CLI 执行器或 DSH live 对象。

表情与 Phaser 对齐

CompanionEmotion(idle/thinking/talking/happy/shy/surprised)、CharacterActivity (idle/listening/thinking/speaking)与既有 Companion 的 Phaser 角色状态机 (COMPANION_EMOTIONSCHARACTER_EMOTION_MAPEXPRESSION_TO_FRAME)逐项一致; 鲸鱼娘形象帧位于 public/deepseek-girl-phaser/(atlas + frames/*.png), build 时由 scripts/copy-assets.mjs 拷贝到 lib/deepseek-girl-phaser/(host 半 defaultAssetRoot() 据此提供静态路由);resolveWhaleFrame(status, emotion) 负责选择当前表情帧。

运行环境

  • React 19(peer dependency),TypeScript 5.6,Vite 6,Vitest 3 + Testing Library。
  • 仅浏览器环境;不依赖 Next.js、SSR 或 App Router。