{"versions":{"0.1.0":{"name":"dsh-desktop-pet","version":"0.1.0","description":"An optional desktop companion for deepseek-harness that shows ambient status via a small animated pet.","type":"module","license":"MIT","main":"lib/index.js","types":"lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"./client":"./lib/client.js","./cordis.patch.yml":"./cordis.patch.yml","./package.json":"./package.json"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"platform":"web","inject":["@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-ui-settings-plugins"]}},"scripts":{"prepublishOnly":"npm run build","build":"tsdown","typecheck":"tsc --noEmit","typecheck:client":"tsc -p tsconfig.client.json --noEmit","test":"vitest run","gen:assets":"node scripts/generate-assets.mjs"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1","clsx":"^2.0.0","koffi":"^3.1.0","sharp":"^0.35.3"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1"},"devDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-api-remotes":"^0.0.1-rc.1","@deepseek-ai/dsh-client-locale":"^0.0.1-rc.1","@deepseek-ai/dsh-client-runtime":"^0.0.1-rc.1","@deepseek-ai/dsh-client-ui-primitives":"^0.0.1-rc.1","@deepseek-ai/dsh-client-ui-settings":"^0.0.1-rc.1","@deepseek-ai/dsh-client-ui-settings-plugins":"^0.0.1-rc.3","@deepseek-ai/dsh-client-ui-slots":"^0.0.1-rc.1","@types/node":"^22.20.0","@types/react":"~18.3.1","lightningcss":"^1.33.0","tsdown":"^0.22.2","typescript":"^6.0.3","unrun":"^0.3.1","vitest":"^4.1.8"},"gitHead":"3a4db428ae3caa5201baca65fd971c7234262214","_id":"dsh-desktop-pet@0.1.0","_nodeVersion":"22.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-roEu/OBi/IWJMoQKACXL3jUPmYHLO/7jJZ0EbVkFk56k7uK6K6F7w9zz56Dg0+uPwpd0pDplgz96ithv5bu2xw==","shasum":"86675e6fc8ff7d050bd6e45a455642719b640e96","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-desktop-pet/-/dsh-desktop-pet-0.1.0.tgz","fileCount":12,"unpackedSize":182374,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHgINdrxaxn3qSE3HtEA7XodCDFgvFAzS3v+j4lwHXDuAiEA1JoBmfiaQk96mIOBjKjKGRsdL/EcycIap++rziaRj5c="}],"size":69177},"_npmUser":{"name":"anonymous","email":"sereinsu@outlook.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"sereinsu@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-desktop-pet_0.1.0_1786713026848_0.0893840972100084"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-14T13:10:26.995Z","publish_time":1786713026995,"_source_registry_name":"default","contributors":[]},"0.2.0":{"name":"dsh-desktop-pet","version":"0.2.0","description":"An optional desktop companion for deepseek-harness that shows ambient status via a small animated pet.","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sereinmono/dsh-desktop-pet.git"},"bugs":{"url":"https://github.com/sereinmono/dsh-desktop-pet/issues"},"homepage":"https://github.com/sereinmono/dsh-desktop-pet#readme","main":"lib/index.js","types":"lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"./client":"./lib/client.js","./cordis.patch.yml":"./cordis.patch.yml","./package.json":"./package.json"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"platform":"web","inject":["@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-ui-settings-plugins"]}},"scripts":{"prepublishOnly":"npm run build","postinstall":"node scripts/install-neutralino.mjs","build":"tsdown","typecheck":"tsc --noEmit","typecheck:client":"tsc -p tsconfig.client.json --noEmit","test":"vitest run","gen:assets":"node scripts/generate-assets.mjs"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1","clsx":"^2.0.0"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1"},"devDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-api-remotes":"^0.0.1-rc.1","@deepseek-ai/dsh-client-locale":"^0.0.1-rc.1","@deepseek-ai/dsh-client-runtime":"^0.0.1-rc.1","@deepseek-ai/dsh-client-ui-primitives":"^0.0.1-rc.1","@deepseek-ai/dsh-client-ui-settings":"^0.0.1-rc.1","@deepseek-ai/dsh-client-ui-settings-plugins":"^0.0.1-rc.3","@deepseek-ai/dsh-client-ui-slots":"^0.0.1-rc.1","@neutralinojs/lib":"^6.9.0","@types/node":"^22.20.0","@types/react":"~18.3.1","lightningcss":"^1.33.0","sharp":"^0.35.3","tsdown":"^0.22.2","typescript":"^6.0.3","unrun":"^0.3.1","vitest":"^4.1.8"},"gitHead":"955cbcebbdb280c20f76d267b12fc0fbf28b13ea","_id":"dsh-desktop-pet@0.2.0","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-1qR9n91AxbxWY8gSkpTBxPfcIBW7CkRZW5yOjpNcI1y5fzYBprV5fvrzBq+7fQlLUlJmzl5HuPOBaFG6s/LnDw==","shasum":"ef7800db7c3f13a8fcb0ad164de40405c06dd6c6","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-desktop-pet/-/dsh-desktop-pet-0.2.0.tgz","fileCount":17,"unpackedSize":254082,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/dsh-desktop-pet@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD5YJCDFhGzLhCfUEUgz84FlSry51U3Y56lkWx2ngqtCwIgXKiQrLHfTAGMV/WYnfeBRZJN9gln5V4LKQI0rnEZDNQ="}],"size":91917},"_npmUser":{"name":"anonymous","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9a75f3d3-a306-4a28-a22b-a7579e3c3b7a"}},"directories":{},"maintainers":[{"name":"anonymous","email":"sereinsu@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-desktop-pet_0.2.0_1789102322688_0.8783176475096757"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-09-11T04:52:02.894Z","publish_time":1789102322894,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.2.0"},"name":"dsh-desktop-pet","time":{"created":"2026-08-14T13:10:43.457Z","modified":"2026-09-11T04:52:10.880Z","0.1.0":"2026-08-14T13:10:26.995Z","0.2.0":"2026-09-11T04:52:02.894Z"},"readme":"# dsh-desktop-pet\n\nEnglish | [中文](README.zh.md)\n\nAn **optional desktop companion** for [deepseek-harness](https://github.com/deepseek-ai/deepseek-harness). It shows a small animated pet as an ambient status indicator: the pet relaxes when the harness is idle, \"thinks\" while the model reasons, \"works\" while tools run, waits when the harness needs input, and celebrates (or frowns) when a turn finishes.\n\nIt is **not** a second chat UI, a task manager, or a full desktop app. It is a status indicator.\n\n- **Plugin-first**: a normal deepseek-harness plugin — no separately launched daemon, browser, or desktop app.\n- **Zero network**: all assets ship with the plugin; no telemetry, CDN, or remote service.\n- **Zero added LLM cost**: event → state resolution is fully deterministic.\n- **Runtime-discovered pets**: pets under `assets/pets/` (bundled) and `~/.dsh/desktop-pet/pets/` (user-imported) are discovered at startup, so adding a pet is dropping a folder in — no rebuild.\n\n---\n\n## Installation\n\nThe plugin is a Cordis **bundle** that ships both a host half (the pet window)\nand a client half (the settings card). `dsh plugin add` installs it and, because\nthe manifest declares `dsh.bundle`, adds it to the profile's bundle list\nautomatically.\n\n### From npm\n\n```sh\ndsh plugin --profile <name> add dsh-desktop-pet\n```\n\n### From a local directory\n\nInstall the plugin directly from its source directory (the profile keeps it as\na `link:` dependency):\n\n```sh\ndsh plugin --profile <name> add /path/to/dsh-desktop-pet\n```\n\nOn Windows, for example:\n\n```sh\ndsh plugin --profile web add D:/deepseek-pet\n```\n\nYou can also run `dsh plugin --profile <name> add .` from inside the plugin\ndirectory.\n\n### From a tarball\n\nPack the plugin, then install the tarball:\n\n```sh\nnpm pack\ndsh plugin --profile <name> add /path/to/dsh-desktop-pet-0.2.0.tgz\n```\n\n### From a Git repository\n\n```sh\ndsh plugin --profile <name> add github:sereinmono/dsh-desktop-pet\n```\n\nIf the repository does not commit build artifacts, configure a `prepare`\nscript so `dsh plugin add` builds the plugin during install.\n\n### Run\n\n```sh\ndsh --profile <name>\n```\n\n> If you are running Harness from a source checkout, prefix the commands above\n> with `pnpm` — i.e. run `pnpm dsh plugin ...` and `pnpm dsh ...` from the\n> Harness repository.\n\n> The settings card requires Harness to expose the `desktop-pet` settings\n> namespace (via its `WEB_SETTINGS_NAMESPACES` allowlist). The pet window itself\n> does not depend on that allowlist.\n\n### Enable / disable\n\nSet `enabled: false` in the plugin's config, or remove the bundle from the\nprofile. The plugin then loads but shows nothing; removing it entirely leaves\nHarness fully functional.\n\n---\n\n## Adding a pet\n\nPets are plain folders following a fixed sprite-sheet format. Imported pets\nlive in the **user pets directory** (`~/.dsh/desktop-pet/pets/<id>/`), outside\nthe installed package, so they survive plugin upgrades. Three common ways to\nobtain one are covered in the dedicated guide, each with a copy-paste prompt\nand manual steps — and the settings card offers buttons for two of them\n(import from a folder, and import from Petdex):\n\n- **hatch-pet** — generate a pet with the skill, then drop its output folder into `~/.dsh/desktop-pet/pets/`.\n- **Import an existing folder** — copy a folder containing `pet.json` + `spritesheet.webp` into `~/.dsh/desktop-pet/pets/`.\n- **Petdex community** — download a community pet with `npx petdex install <slug>` and copy it in.\n\nSee **[Adding a Pet](docs/adding-a-pet.md)** for the full walkthrough, and the\n**[asset format reference](docs/adding-a-pet.md#asset-format-reference)** for the\nexact `pet.json` and sprite-sheet layout.\n\n---\n\n## Supported platforms\n\n| Platform | Status |\n|----------|--------|\n| Windows 11 | ✅ primary target (transparent overlay via Neutralinojs / WebView2) |\n| Linux (X11 / Wayland) | ✅ (Neutralinojs / WebKitGTK; **requires a compositor + WebKitGTK**) |\n| macOS | ⚠️ renderer is ready; needs a packaged runtime binary + manual verification |\n\nThe overlay is rendered by [Neutralinojs](https://neutralino.js.org), which uses the OS webview (WebView2 on Windows, WebKitGTK on Linux, WKWebView on macOS). Linux needs `libwebkit2gtk` (GNOME/KDE ship it; lightweight distros may need to install it) and a running compositor for per-pixel transparency.\n\n---\n\n## Configuration\n\nAll fields are optional and validated with a Schemastery schema (invalid values fail loudly at load). The user-editable fields (`enabled`, `petScale`, `petId`, `hideWhenIdle`) are exposed on the Web settings card.\n\n| Field | Default | Description |\n|-------|---------|-------------|\n| `enabled` | `true` | Master switch. |\n| `alwaysOnTop` | `true` | Keep the pet above other windows. |\n| `petScale` | `1` | Pet size, 0.5–4× in 0.25 steps. |\n| `petId` | `text` | Which pet to display (a directory name under `assets/pets/` or `~/.dsh/desktop-pet/pets/`). |\n| `hideWhenIdle` | `false` | Automatically hide the pet when it sleeps (no task), and show it again on activity. |\n| `animationEnabled` | `true` | Run the frame animation (static frame when false). |\n| `idleFrequencySec` | `20` | Seconds (≥8) between randomized idle variations. |\n| `clickThrough` | `false` | Pass pointer events through (not supported by Neutralino; ignored with a warning). |\n| `startSleeping` | `false` | Start in the sleeping state. |\n| `animationSpeed` | `1` | Global speed multiplier (0.25–4). |\n\nExample:\n\n```yaml\n- insert:\n    - id: desktop-pet\n      name: dsh-desktop-pet\n      config:\n        petScale: 1\n        petId: text\n        idleFrequencySec: 30\n```\n\nWindow position is persisted privately under `~/.dsh/desktop-pet/position.json` (best-effort; failures are ignored). It does not depend on any Harness storage service.\n\n### Developer mode\n\nWhen the core `ctx.commands` service is present, the plugin registers a `/pet <state>` command to simulate states without any LLM:\n\n```text\n/pet thinking\n/pet working\n/pet waiting_for_user\n/pet success\n/pet error\n/pet reset\n```\n\nValid states: `STARTING IDLE THINKING WORKING CODING RUNNING_COMMAND WAITING_FOR_USER SUCCESS ERROR SLEEPING`.\n\n---\n\n## Architecture\n\n```\nharness events / lifecycle\n        ↓  (the only harness-specific layer)\nintegration/  HarnessBridge · capability-detection · event-mapping\n        ↓  NormalizedEvent\ncore/         PetStateResolver · PetStateMachine · TaskStateRegistry\n        ↓  SemanticState\nrenderer/     AnimationController · PetWindow\n        ↓  frame directives (pose + frame index)\nrenderer/backend/  NeutralinoBackend   (spawns the Neutralino runtime)\n        ↓  WebSocket (official extension protocol)\nassets/neutralino/  frontend (canvas + sprite slicing)\n        ↑\nrenderer/codex-pet/  PetContract · PetLoader   (pet.json + sprite sheet)\n```\n\n- **`HarnessBridge`** is the only module that knows raw harness event names. Everything above it is harness-independent.\n- **Pet core** (`core/`) is a standalone library: testable with no harness, no window, no network.\n- **Backends** are platform-isolated behind `WindowBackend`; the renderer never sees platform details. The Neutralino backend drives a small frontend that loads the sprite sheet and draws frames — the host only sends `(pose, frameIndex)` directives.\n- **Client half** (`src/client/`) is a separate browser bundle registered through the harness module loader; the host and client halves communicate through the settings namespace.\n\n### Harness dependencies\n\nOnly the Cordis plugin lifecycle and these **core** services/events are used:\n\n- Plugin entry: `apply(ctx, config)` + `name` / `inject` / `Config`.\n- Lifecycle: `ctx.effect()`, `ctx.on()`, `ctx.logger(name)`.\n- Activity observation: `session/event`, `agent/status`.\n- Settings: the `desktop-pet` settings namespace (host-side), bound by the client card.\n- Optional (detected, not required): `ctx.agents`, `ctx.sessions`, `ctx.approval`, `ctx.commands`.\n\nNo non-core plugin is required. If an optional service is absent, the pet degrades gracefully (coarser states, no `/pet` command).\n\n### External dependencies\n\n| Package | Purpose | Runtime |\n|---------|---------|---------|\n| `@deepseek-ai/schemastery` | Config schema validation | Node ≥22 |\n| `clsx` | Class-name helper for the client card (inlined into the browser bundle) | build |\n\nPeer (type-only, not bundled): `@deepseek-ai/cordis`.\n\nThe Neutralino runtime binary (and the `@neutralinojs/lib` client library vendored\ninto `assets/neutralino/resources/`) are not runtime npm dependencies: the binary\nis downloaded for the current platform by the `postinstall` script into\n`runtime/` (git-ignored), and the client library is copied into the package's\nassets at build time. `sharp` remains a dev dependency only, used by\n`scripts/generate-assets.mjs` to build the placeholder pet.\n\nThe client bundle's `react` and `@deepseek-ai/dsh-client-*` imports are externalized:\nthey are provided at runtime by the harness module loader, so the plugin does not\nship them as runtime dependencies (they appear only as dev dependencies for type\nchecking and bundling).\n\n**Explicitly avoided**: Electron, Tauri, GLFW/SDL/raylib, game engines, GPU/OpenGL, Docker, databases, Redis, any external server, browser automation.\n\n### Event → state mapping\n\n| Normalized event (from harness) | Pet state (semantic → animation) |\n|----------------------------------|----------------------------------|\n| startup | `STARTING` → `waving` |\n| idle (`agent/status: idle`) | `IDLE` → `idle` |\n| `assistant/chunk` (text/reasoning/tool-call delta) | `THINKING` → `running` |\n| `tool/call` (editing tools) | `CODING` → `running` |\n| `tool/call` (shell/command tools) | `RUNNING_COMMAND` → `running` |\n| `tool/call` (other) | `WORKING` → `running` |\n| `approval/asked` / waiting | `WAITING_FOR_USER` → `waiting` |\n| `turn/end` reason `completed` | `SUCCESS` → `review` |\n| `turn/end` reason `error`/`aborted` | `ERROR` → `failed` |\n| long quiet period | `SLEEPING` → `idle` |\n\n`SUCCESS` / `ERROR` / `STARTING` are transient (default 2s) then return to `IDLE`. Concurrent agents are tracked per session/task and folded by priority `WAITING_FOR_USER > ERROR > WORKING > THINKING > SUCCESS > IDLE`.\n\n### Extending\n\n- **Adding a pet** — see [Adding a Pet](docs/adding-a-pet.md); no code change is required.\n- **Adding an animation state** — extend `SemanticState` in `src/core/types.ts`, its resolver mapping in `src/core/PetStateResolver.ts`, and its renderer pose in `SEMANTIC_TO_CODEX`.\n- **Adding a window backend** — implement `WindowBackend` (`src/renderer/backend/WindowBackend.ts`) and register it in `src/renderer/backend/selectBackend.ts`.\n\n---\n\n## Testing\n\n```sh\nnpm test               # vitest unit tests (core + loader + integration)\nnpm run typecheck      # tsc --noEmit (host half)\nnpm run typecheck:client # tsc -p tsconfig.client.json --noEmit (client half)\nnpm run build          # tsdown bundle (host + client)\nnpm run gen:assets     # regenerate the bundled text pet\n```\n\nThe pet core is tested without a harness or a display. The Neutralino overlay requires a real desktop session and is **not** exercised by the headless test suite — it needs manual verification on Windows/Linux. The frontend's pure layout math is unit-tested on the host.\n\n---\n\n## Publishing\n\nPublishing to npm is automated with GitHub Actions via **npm Trusted\nPublishing** (OIDC): GitHub mints an id token and npm publishes on its behalf,\nso the workflow needs no `NODE_AUTH_TOKEN` secret. A `v*` tag pushed to\n`master` triggers `npm ci → typecheck → test → build → npm publish\n--provenance`.\n\n**One-time setup on npm** (do this before the first tag push):\n\n1. The package must already exist on npm. Publish `0.1.0` once with a manual\n   token (`npm publish --access public`) — Trusted Publishing is configured per\n   package, so an npmjs package page must exist first.\n2. On the npmjs package page, enable **Trusted Publishing** and authorize this\n   repository: owner `sereinmono`, repository `dsh-desktop-pet`. Pin the\n   workflow `publish.yml` and branch `master` if the form offers it.\n\n**Release locally** — bump the version, tag, and push the tag:\n\n```sh\nnpm version patch   # or minor / major; creates vX.Y.Z tag\ngit push origin master --tags\n```\n\nThe workflow runs only when the tag's commit is on `master`; tags on other\nbranches are skipped. A manual backup entry is available at\nActions → Publish → Run workflow (the tag must still be on `master`).\n\n---\n\n## Known limitations\n\n- **Linux needs WebKitGTK + a compositor**; lightweight distros may need `libwebkit2gtk-4.0` installed manually.\n- **macOS is not yet verified** — the renderer is platform-neutral and the runtime binary is packaged by the installer, but it has not been manually tested.\n- **Click-through is not supported**: Neutralino transparent windows have no per-window pointer-passthrough API, so `clickThrough` is ignored (with a warning).\n- **Transparent-window dead zone** (Windows): the bottom ~20% of a Neutralino transparent window does not receive pointer input (upstream [neutralinojs#1482](https://github.com/neutralinojs/neutralinojs/issues/1482)). The pet is drawn in the top 75% of the window to keep drag/hover/click fully working.\n- The bundled placeholder is the `text` test pet only — original SVG-drawn text, with no OpenAI/Codex/DeepSeek character artwork or trademarks.\n- Overlay rendering (frameless/transparent/topmost/drag) has not been exercised by automated CI and needs a manual check on a real desktop.\n\n---\n\n## License\n\nMIT.","users":{}}