dsh-agentic-pet 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 beyondgjc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,50 +1,56 @@
1
- ---
2
- description: "The dsh desktop pet: an agentic pet plugin that serves the pet renderer over the web composition, drives it from in-process dsh events, and answers approvals and questions from the desktop."
3
- kind: "package-bundle"
4
- ---
5
-
6
- # dsh-agentic-pet
7
-
8
- English | [中文](README.zh.md)
9
-
10
- ## Summary
11
-
12
- `dsh-agentic-pet` is a desktop-pet plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) ecosystem: the pet lives on your desktop as a transparent always-on-top window, follows your agent sessions (idle / thinking / working / error), races the web GUI to answer approvals and user questions (first answer wins), collects a per-pet touch-affection ledger, and exposes expressive tools (`pet_say`, `pet_do`, `pet_digest`, `pet_interactions`, `pet_state`) so the model can speak and act through the pet. Multiple pet implementations can run side by side — a directory registry (`~/.dsh/pet-http.d/`) discovers every live pet and routes state, interactions, and ledgers per pet.
13
-
14
- The pet itself is a dumb display with zero dsh knowledge. Everything that understands the runtime — event convergence, interaction waterfalls, multi-pet routing, the model tools — lives in the plugin's driver, and the pet only implements a small local HTTP control interface. Any pet implementation that speaks the same HTTP contract can be adopted without changing this plugin.
15
-
16
- ## What's in this repo
17
-
18
- | Path | What it is |
19
- |---|---|
20
- | `src/` | The plugin (Cordis bundle): `/pet` route, event driver, registry, `PetService` seam, model tools, settings-page routes |
21
- | `client/` | The desktop sidebar settings page (client half) |
22
- | `carrier/` | The Electron carrier **build artifacts** shipped with the package (`lib/`, `dist-renderer/`) |
23
- | `carrier-src/` | The carrier **sources** (mirrored from the dev upstream; media assets live in [dsh-pet-assets](https://github.com/beyondgjc/dsh-pet-assets)) |
24
- | `vendor/typert-plugin/` | Vendored typert decorator plugin used by the packaging config |
25
- | `tests/` | Vitest specs (pure-function coverage of the registry routing and the `/status` field-matrix normalization) |
26
-
27
- ## Install
28
-
29
- From the DeepSeek Harness desktop app's plugin page, or:
30
-
31
- ```bash
32
- dsh plugin --profile <name> add dsh-agentic-pet
33
- ```
34
-
35
- The animation media ship as a separate package, `dsh-agentic-pet-assets`, and are pulled in automatically as a dependency.
36
-
37
- ## Development
38
-
39
- The TypeScript build still runs inside the dsh monorepo workspace (the bundled `@deepseek-ai/dsh-*` deps are not published to npm). The flow:
40
-
41
- 1. In the monorepo: `pnpm run build` (plugin `lib/`) and `pnpm --filter @deepseek-ai/dsh-pet run build` (carrier `lib/` + `dist-renderer/`).
42
- 2. Here: `scripts\sync-from-monorepo.cmd` — mirrors sources and build outputs into this repo.
43
- 3. Commit here, then `npm publish` (assets package first; see [dsh-pet-assets/PUBLISH.md](../dsh-pet-assets/PUBLISH.md) for the release manual).
44
-
45
- Tests: `npx vitest run tests/registry-service.spec.ts` runs self-contained (needs only `cordis` and `vitest`); the full suite including `tests/pet-app.spec.ts` runs in the monorepo workspace.
46
-
47
- ## Documentation
48
-
49
- - Control-plane contract (the frozen consumer API every pet implementation speaks): see the multi-pet guide in the project documentation.
50
- - Known limitations and design notes live in the repo wiki and the project's engineering docs.
1
+ ---
2
+ description: "The dsh desktop pet: an agentic pet plugin that serves the pet renderer over the web composition, drives it from in-process dsh events, and answers approvals and questions from the desktop."
3
+ kind: "package-bundle"
4
+ ---
5
+
6
+ # dsh-agentic-pet
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ `dsh-agentic-pet` is a desktop-pet plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) ecosystem: the pet lives on your desktop as a transparent always-on-top window, follows your agent sessions (idle / thinking / working / error), races the web GUI to answer approvals and user questions (first answer wins), collects a per-pet touch-affection ledger, and exposes expressive tools (`pet_say`, `pet_do`, `pet_digest`, `pet_interactions`, `pet_state`) so the model can speak and act through the pet. Multiple pet implementations can run side by side — a directory registry (`~/.dsh/pet-http.d/`) discovers every live pet and routes state, interactions, and ledgers per pet.
13
+
14
+ The pet itself is a dumb display with zero dsh knowledge. Everything that understands the runtime — event convergence, interaction waterfalls, multi-pet routing, the model tools — lives in the plugin's driver, and the pet only implements a small local HTTP control interface. Any pet implementation that speaks the same HTTP contract can be adopted without changing this plugin.
15
+
16
+ ## What's in this repo
17
+
18
+ | Path | What it is |
19
+ |---|---|
20
+ | `src/` | The plugin (Cordis bundle): `/pet` route, event driver, registry, `PetService` seam, model tools, settings-page routes |
21
+ | `client/` | The desktop sidebar settings page (client half) |
22
+ | `carrier/` | The Electron carrier **build artifacts** shipped with the package (`lib/`, `dist-renderer/`) |
23
+ | `carrier-src/` | The carrier **sources** (mirrored from the dev upstream; media assets live in [dsh-pet-assets](https://github.com/beyondgjc/dsh-pet-assets)) |
24
+ | `vendor/typert-plugin/` | Vendored typert decorator plugin used by the packaging config |
25
+ | `tests/` | Vitest specs (pure-function coverage of the registry routing and the `/status` field-matrix normalization) |
26
+
27
+ ## Install
28
+
29
+ From the DeepSeek Harness desktop app's plugin page, or:
30
+
31
+ ```bash
32
+ dsh plugin --profile <name> add dsh-agentic-pet
33
+ ```
34
+
35
+ The animation media ship as a separate package, `dsh-agentic-pet-assets`, and are pulled in automatically as a dependency.
36
+
37
+ ## Development
38
+
39
+ The TypeScript build still runs inside the dsh monorepo workspace (the bundled `@deepseek-ai/dsh-*` deps are not published to npm). The flow:
40
+
41
+ 1. In the monorepo: `pnpm run build` (plugin `lib/`) and `pnpm --filter @deepseek-ai/dsh-pet run build` (carrier `lib/` + `dist-renderer/`).
42
+ 2. Here: `scripts\sync-from-monorepo.cmd` — mirrors sources and build outputs into this repo.
43
+ 3. Commit here, then `npm publish` (assets package first; see [dsh-pet-assets/PUBLISH.md](../dsh-pet-assets/PUBLISH.md) for the release manual).
44
+
45
+ Tests: `npx vitest run tests/registry-service.spec.ts` runs self-contained (needs only `cordis` and `vitest`); the full suite including `tests/pet-app.spec.ts` runs in the monorepo workspace.
46
+
47
+ ## Documentation
48
+
49
+ - Control-plane contract (the frozen consumer API every pet implementation speaks): see the multi-pet guide in the project documentation.
50
+ - Known limitations and design notes live in the repo wiki and the project's engineering docs.
51
+
52
+
53
+ ## Credits & Licensing
54
+
55
+ - This project is a derivative of [PC2005-cloud/dsh-pet](https://github.com/PC2005-cloud/dsh-pet) — the upstream dsh-pet plugin by PC2005-cloud. Plugin code is licensed MIT.
56
+ - The character artwork (the "大肥鱼" whale-girl character under `carrier/assets` and `dsh-agentic-pet-assets`) is licensed **CC BY-NC-SA 4.0** (attribution · non-commercial · share-alike) by its original author — [original statement](https://www.bilibili.com/opus/1247156596114456581). Non-commercial use only; artwork derivatives must be shared under the same license.
package/README.zh.md CHANGED
@@ -1,50 +1,56 @@
1
- ---
2
- description: "dsh 桌面宠物:经由 web 组合层伺服宠物页面、由进程内 dsh 事件驱动、可从桌面应答审批与提问的 agentic 宠物插件。"
3
- kind: "package-bundle"
4
- ---
5
-
6
- # dsh-agentic-pet
7
-
8
- [English](README.md) | 中文
9
-
10
- ## 简介
11
-
12
- `dsh-agentic-pet` 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 生态的桌面宠物插件:宠物以透明置顶窗常驻桌面,跟随 agent 会话状态(idle / thinking / working / error),与 web 界面竞速应答审批与提问(先答者赢),维护每宠独立的触摸好感账本,并向模型暴露表达工具(`pet_say`、`pet_do`、`pet_digest`、`pet_interactions`、`pet_state`)——模型可以借宠物说话、做动作、感知被触摸。多只宠物实现可以并存:目录注册表(`~/.dsh/pet-http.d/`)发现全部在线宠物,状态、交互、账本按宠路由。
13
-
14
- 宠物本身是零 DSH 知识的纯显示端。理解运行时的一切——事件收敛、交互瀑布、多宠路由、模型工具——都在插件的 driver 里,宠物只实现一个小型本地 HTTP 控制接口。任何讲同一 HTTP 契约的宠物实现都能被采纳,插件零改动。
15
-
16
- ## 仓库结构
17
-
18
- | 路径 | 内容 |
19
- |---|---|
20
- | `src/` | 插件(Cordis bundle):`/pet` 路由、事件 driver、注册表、`PetService` 接缝、模型工具、设置页路由 |
21
- | `client/` | 桌面侧边栏设置页(client 半边) |
22
- | `carrier/` | 随包分发的 Electron 载体**构建产物**(`lib/`、`dist-renderer/`) |
23
- | `carrier-src/` | 载体**源码**(自开发上游镜像;素材在 [dsh-pet-assets](https://github.com/beyondgjc/dsh-pet-assets)) |
24
- | `vendor/typert-plugin/` | 打包配置使用的 typert 装饰器插件(vendored) |
25
- | `tests/` | Vitest 用例(注册表路由与 `/status` 字段矩阵的纯函数覆盖) |
26
-
27
- ## 安装
28
-
29
- 在 DeepSeek Harness 桌面端插件页安装,或:
30
-
31
- ```bash
32
- dsh plugin --profile <name> add dsh-agentic-pet
33
- ```
34
-
35
- 动画素材以独立包 `dsh-agentic-pet-assets` 分发,作为依赖自动带入。
36
-
37
- ## 开发
38
-
39
- TypeScript 构建仍在 dsh monorepo workspace 内进行(被打包的 `@deepseek-ai/dsh-*` 依赖未发布 npm)。流程:
40
-
41
- 1. monorepo 内:`pnpm run build`(插件 `lib/`)与 `pnpm --filter @deepseek-ai/dsh-pet run build`(载体 `lib/` + `dist-renderer/`)。
42
- 2. 本仓库:`scripts\sync-from-monorepo.cmd`——把源码与构建产物镜像进本仓库。
43
- 3. 本仓库提交,然后 `npm publish`(先素材包后插件包;发布手册见 [dsh-pet-assets/PUBLISH.md](../dsh-pet-assets/PUBLISH.md))。
44
-
45
- 测试:`npx vitest run tests/registry-service.spec.ts` 自持可跑(只需 `cordis` 与 `vitest`);含 `tests/pet-app.spec.ts` 的全量测试在 monorepo workspace 内跑。
46
-
47
- ## 文档
48
-
49
- - 控制面契约(所有宠物实现共同讲述的冻结消费方 API)见项目文档的多宠指南。
50
- - 已知边界与设计笔记见仓库 wiki 与项目工程文档。
1
+ ---
2
+ description: "dsh 桌面宠物:经由 web 组合层伺服宠物页面、由进程内 dsh 事件驱动、可从桌面应答审批与提问的 agentic 宠物插件。"
3
+ kind: "package-bundle"
4
+ ---
5
+
6
+ # dsh-agentic-pet
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 简介
11
+
12
+ `dsh-agentic-pet` 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 生态的桌面宠物插件:宠物以透明置顶窗常驻桌面,跟随 agent 会话状态(idle / thinking / working / error),与 web 界面竞速应答审批与提问(先答者赢),维护每宠独立的触摸好感账本,并向模型暴露表达工具(`pet_say`、`pet_do`、`pet_digest`、`pet_interactions`、`pet_state`)——模型可以借宠物说话、做动作、感知被触摸。多只宠物实现可以并存:目录注册表(`~/.dsh/pet-http.d/`)发现全部在线宠物,状态、交互、账本按宠路由。
13
+
14
+ 宠物本身是零 DSH 知识的纯显示端。理解运行时的一切——事件收敛、交互瀑布、多宠路由、模型工具——都在插件的 driver 里,宠物只实现一个小型本地 HTTP 控制接口。任何讲同一 HTTP 契约的宠物实现都能被采纳,插件零改动。
15
+
16
+ ## 仓库结构
17
+
18
+ | 路径 | 内容 |
19
+ |---|---|
20
+ | `src/` | 插件(Cordis bundle):`/pet` 路由、事件 driver、注册表、`PetService` 接缝、模型工具、设置页路由 |
21
+ | `client/` | 桌面侧边栏设置页(client 半边) |
22
+ | `carrier/` | 随包分发的 Electron 载体**构建产物**(`lib/`、`dist-renderer/`) |
23
+ | `carrier-src/` | 载体**源码**(自开发上游镜像;素材在 [dsh-pet-assets](https://github.com/beyondgjc/dsh-pet-assets)) |
24
+ | `vendor/typert-plugin/` | 打包配置使用的 typert 装饰器插件(vendored) |
25
+ | `tests/` | Vitest 用例(注册表路由与 `/status` 字段矩阵的纯函数覆盖) |
26
+
27
+ ## 安装
28
+
29
+ 在 DeepSeek Harness 桌面端插件页安装,或:
30
+
31
+ ```bash
32
+ dsh plugin --profile <name> add dsh-agentic-pet
33
+ ```
34
+
35
+ 动画素材以独立包 `dsh-agentic-pet-assets` 分发,作为依赖自动带入。
36
+
37
+ ## 开发
38
+
39
+ TypeScript 构建仍在 dsh monorepo workspace 内进行(被打包的 `@deepseek-ai/dsh-*` 依赖未发布 npm)。流程:
40
+
41
+ 1. monorepo 内:`pnpm run build`(插件 `lib/`)与 `pnpm --filter @deepseek-ai/dsh-pet run build`(载体 `lib/` + `dist-renderer/`)。
42
+ 2. 本仓库:`scripts\sync-from-monorepo.cmd`——把源码与构建产物镜像进本仓库。
43
+ 3. 本仓库提交,然后 `npm publish`(先素材包后插件包;发布手册见 [dsh-pet-assets/PUBLISH.md](../dsh-pet-assets/PUBLISH.md))。
44
+
45
+ 测试:`npx vitest run tests/registry-service.spec.ts` 自持可跑(只需 `cordis` 与 `vitest`);含 `tests/pet-app.spec.ts` 的全量测试在 monorepo workspace 内跑。
46
+
47
+ ## 文档
48
+
49
+ - 控制面契约(所有宠物实现共同讲述的冻结消费方 API)见项目文档的多宠指南。
50
+ - 已知边界与设计笔记见仓库 wiki 与项目工程文档。
51
+
52
+
53
+ ## 致谢与授权
54
+
55
+ - 本项目基于 [PC2005-cloud/dsh-pet](https://github.com/PC2005-cloud/dsh-pet) 衍生(上游 dsh-pet 插件,作者 PC2005-cloud)。插件代码以 MIT 许可发布。
56
+ - 角色形象("大肥鱼"鲸鱼娘,见 `carrier/assets` 与 `dsh-agentic-pet-assets`)的形象授权为 **CC BY-NC-SA 4.0**(署名 · 非商业 · 相同方式共享),[原作者声明](https://www.bilibili.com/opus/1247156596114456581)。仅限非商业使用;形象衍生须以相同方式共享。
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@ import { i as installPetDriver, n as installPetService } from "./service-Vj-lLpI
2
2
  import { createRequire } from "node:module";
3
3
  import { spawn } from "node:child_process";
4
4
  import { createHash } from "node:crypto";
5
- import { existsSync } from "node:fs";
5
+ import { existsSync, readFileSync } from "node:fs";
6
6
  import { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
7
7
  import { homedir } from "node:os";
8
8
  import { dirname, extname, join, normalize, resolve, sep } from "node:path";
@@ -535,6 +535,17 @@ function apply(ctx) {
535
535
  const candidate = String(require("electron"));
536
536
  if (existsSync(candidate)) return candidate;
537
537
  } catch {}
538
+ try {
539
+ let dir = dirname(fileURLToPath(import.meta.url));
540
+ for (let i = 0; i < 8; i += 1) {
541
+ const pkgDir = join(dir, "node_modules", "electron");
542
+ const binary = join(pkgDir, "dist", readFileSync(join(pkgDir, "path.txt"), "utf8").trim());
543
+ if (existsSync(binary)) return binary;
544
+ const parent = dirname(dir);
545
+ if (parent === dir) break;
546
+ dir = parent;
547
+ }
548
+ } catch {}
538
549
  return process.versions.electron !== void 0 ? process.execPath : void 0;
539
550
  };
540
551
  const spawnPetCarrier = (url) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-agentic-pet",
3
3
  "description": "The pet-surface bundle: serves the desktop pet renderer over the web composition, turning dsh into a surface the desktop pet attaches to as an authenticated client",
4
- "version": "0.3.0",
4
+ "version": "0.3.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },