@whaletech/pet 0.2.0
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/README.md +71 -0
- package/dist/main.js +4802 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @whaletech/pet
|
|
2
|
+
|
|
3
|
+
Terminal pet companion. ASCII art, mood system, AI chat, all in your terminal.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install -g @whaletech/pet
|
|
7
|
+
pet
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## What it does
|
|
11
|
+
|
|
12
|
+
- Hatch a random pet (16 species, 5 rarities, shiny variants)
|
|
13
|
+
- Feed, pet, and put it to sleep
|
|
14
|
+
- Chat with it (powered by DeepSeek)
|
|
15
|
+
- Mood changes based on how you take care of it
|
|
16
|
+
- Hidden story system unlocked through perfect care
|
|
17
|
+
- Cosmetics: hats, eyes, rarity upgrades
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
**Client** (this npm package): React + Ink terminal UI, runs on Node >= 20.
|
|
22
|
+
|
|
23
|
+
**Server** (self-hosted): Bun + SQLite backend handling state, AI chat, and payments. Deploy separately.
|
|
24
|
+
|
|
25
|
+
The client connects to `https://pet.whaletech.ai` by default. Override with:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
WHALE_API_URL=http://localhost:3001 pet
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Development
|
|
32
|
+
|
|
33
|
+
Requires [Bun](https://bun.sh).
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Run client (dev)
|
|
37
|
+
bun src/main.tsx
|
|
38
|
+
|
|
39
|
+
# Run server
|
|
40
|
+
bun src/server.ts
|
|
41
|
+
|
|
42
|
+
# Build for npm
|
|
43
|
+
bun run build
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Server deployment
|
|
47
|
+
|
|
48
|
+
The server needs these files:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
src/server.ts
|
|
52
|
+
src/core/types.ts
|
|
53
|
+
src/core/petState.ts
|
|
54
|
+
src/payment/wechatpay.ts
|
|
55
|
+
certs/wechatpay/
|
|
56
|
+
.env
|
|
57
|
+
tsconfig.json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Copy `.env.example` to `.env` and fill in your keys.
|
|
61
|
+
|
|
62
|
+
## Commands
|
|
63
|
+
|
|
64
|
+
| Command | Effect |
|
|
65
|
+
|---------|--------|
|
|
66
|
+
| feed / 喂食 | +25 belly |
|
|
67
|
+
| pet / 摸摸 | +affinity |
|
|
68
|
+
| sleep / 睡觉 | full energy |
|
|
69
|
+
| talk / 说话 | chat with your pet |
|
|
70
|
+
| help / 帮助 | show commands |
|
|
71
|
+
| english / 中文 | switch language |
|