@clawlabz/clawskin 1.0.4 → 1.1.1
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/CHANGELOG.md +145 -85
- package/README.md +46 -90
- package/docs/TECHNICAL.md +134 -0
- package/docs/images/screenshot.png +0 -0
- package/package.json +1 -1
- package/public/_redirects +0 -1
- package/public/app.html +414 -18
- package/public/index.html +41 -53
- package/public/js/app/GatewayClient.js +3 -0
- package/public/js/pets/Pet.js +105 -6
- package/public/js/pets/PetManager.js +66 -0
- package/public/js/scenes/CafeScene.js +102 -32
- package/public/js/scenes/HackerScene.js +29 -2
- package/public/js/scenes/OfficeScene.js +125 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,98 +1,158 @@
|
|
|
1
1
|
# ClawSkin Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.0] - 2026-03-02
|
|
4
|
+
|
|
5
|
+
### Agent Chat Panel + Weather System + Interactive Easter Eggs
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Agent Chat Panel** (`app.html`, `GatewayClient.js`)
|
|
12
|
+
- Chat panel below character editor for direct messaging with the selected agent
|
|
13
|
+
- Supports send (`chat.send`) and history loading (`chat.history`)
|
|
14
|
+
- Real-time streaming display (delta → typing indicator → final message)
|
|
15
|
+
- Per-agent session isolation via independent sessionKey
|
|
16
|
+
- Only visible in Live mode; auto-hidden in Demo mode
|
|
17
|
+
|
|
18
|
+
- **Weather Cycling System** (`OfficeScene.js`, `CafeScene.js`, `HackerScene.js`)
|
|
19
|
+
- Click window / LED panel to cycle through weather states
|
|
20
|
+
- Office: ☀️ Sunny → 🌙 Night (moon + stars) → 🌧️ Rain (lightning) → ❄️ Snow
|
|
21
|
+
- Café: 🌧️ Rain → ☀️ Sunny → ❄️ Snow → 🌫️ Fog
|
|
22
|
+
- Hacker Den: 💜 Neon → 🔴 Red Alert → 💚 Matrix → 🌑 Blackout
|
|
23
|
+
- Weather affects global ambience (night darkening, lightning flash, snow on windowsill)
|
|
24
|
+
|
|
25
|
+
- **Pet Click Reactions** (`Pet.js`, `PetManager.js`)
|
|
26
|
+
- Click a pet to trigger a random speech bubble (unique phrases per pet type)
|
|
27
|
+
- Cat: "Purrr~", "💕", "(=^・ω・^=)" / Dog: "Woof!", "*tail wag*", "💖"
|
|
28
|
+
- Robot: "BOOP", "⚡" / Bird: "Tweet!", "🎵" / Hamster: "Squeak!", "🥜"
|
|
29
|
+
- Bubbles fade out smoothly; pets pause wandering during interaction
|
|
30
|
+
|
|
31
|
+
- **Treat Dropping** (`Pet.js`, `PetManager.js`)
|
|
32
|
+
- Click empty floor to drop a random treat (🍖🦴🐟🥜🌾🍪)
|
|
33
|
+
- Nearest pet within 200px walks over to eat it
|
|
34
|
+
- Type-specific reactions: "TREAT!! 🦴", "*chomp*", "Yummy fish!"
|
|
35
|
+
|
|
36
|
+
- **Interactive Decoration Easter Eggs** (`app.html`)
|
|
37
|
+
- Click clock → show current time
|
|
38
|
+
- Click bookshelf → random programmer quote
|
|
39
|
+
- Click whiteboard → random sprint note
|
|
40
|
+
- Click arcade cabinet → "INSERT COIN", "HIGH SCORE: 99999", etc.
|
|
41
|
+
- Click menu board → random café menu item
|
|
42
|
+
- Click plant → wiggle reaction "🌱 *wiggle*", "🌵 Don't touch!"
|
|
43
|
+
|
|
44
|
+
### Improved
|
|
45
|
+
|
|
46
|
+
- **Editor panel layout** — RANDOM button moved to header bar, removed redundant SAVE button
|
|
47
|
+
- **Panel scroll behavior** — Panel itself non-scrollable; chat area fills remaining space with independent scroll
|
|
48
|
+
- **Panel width** 280px → 360px, chat font 5px → 8px for better readability
|
|
49
|
+
- **UI scale threshold** — No zoom below 2560px to prevent bloated HUD on normal screens
|
|
50
|
+
|
|
51
|
+
### Files Changed
|
|
52
|
+
|
|
53
|
+
| File | Change | Description |
|
|
54
|
+
|------|--------|-------------|
|
|
55
|
+
| `public/app.html` | Modified | Chat panel CSS/HTML/JS, weather/pet/decoration click handlers, UI scale fix |
|
|
56
|
+
| `public/js/app/GatewayClient.js` | Modified | Added `sendChat()` method |
|
|
57
|
+
| `public/js/pets/Pet.js` | Modified | Added hitTest, react, goToTreat, eatTreat, bubble rendering |
|
|
58
|
+
| `public/js/pets/PetManager.js` | Modified | Added handleClick, dropTreat, treat management |
|
|
59
|
+
| `public/js/scenes/OfficeScene.js` | Modified | 4 weather states + cycleWeather + getWindowRect |
|
|
60
|
+
| `public/js/scenes/CafeScene.js` | Modified | 4 weather states + cycleWeather + getWindowRect |
|
|
61
|
+
| `public/js/scenes/HackerScene.js` | Modified | 4 mood states + cycleWeather + getWindowRect |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
3
65
|
## [0.2.0] - 2026-03-01
|
|
4
66
|
|
|
5
|
-
###
|
|
67
|
+
### 3/4 RPG Perspective + Movement Overhaul + Independent Pet System
|
|
6
68
|
|
|
7
|
-
|
|
69
|
+
Major update addressing three core issues: characters occluded by furniture, unnatural movement, and pets bound to characters.
|
|
8
70
|
|
|
9
71
|
---
|
|
10
72
|
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- 5
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
- `
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
- Phase
|
|
46
|
-
- Phase
|
|
47
|
-
- Phase
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
| `js/
|
|
68
|
-
| `js/
|
|
69
|
-
| `js/app/
|
|
70
|
-
| `js/
|
|
71
|
-
| `js/
|
|
72
|
-
| `js/pets/
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `index.html` | 修改 | 添加 Pet/PetManager script 标签 |
|
|
76
|
-
| `app.html` | 修改 | 添加 Pet/PetManager script 标签 |
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- **Independent Pet System** (`js/pets/Pet.js`, `js/pets/PetManager.js`)
|
|
76
|
+
- Pets are no longer bound to agents; they have their own AI behavior loop
|
|
77
|
+
- 5 pet types: Cat (walk), Dog (walk), Robot (walk), Bird (fly), Hamster (crawl)
|
|
78
|
+
- Autonomous movement: random walk, rub against agents, interact with other pets, nap in place
|
|
79
|
+
- Bird flight with sine-wave bobbing + wing-flap animation
|
|
80
|
+
- Hamster occasional speed bursts
|
|
81
|
+
- Pet config persisted to localStorage; defaults to cat + dog
|
|
82
|
+
|
|
83
|
+
- **POI Wandering System** (`AgentSlot.js`)
|
|
84
|
+
- Idle agents have 25% chance to visit POIs (water cooler, bookshelf, window, plant)
|
|
85
|
+
- 15% chance to walk to a colleague's desk for social interaction
|
|
86
|
+
- Emoji bubbles on POI arrival (☕ 🌤️ 📖 👋 🌿)
|
|
87
|
+
- Expanded roaming range to full canvas area
|
|
88
|
+
|
|
89
|
+
- **New Pet Sprites** (`SpriteGenerator.js`)
|
|
90
|
+
- `_drawBird()`: Blue body, orange beak/claws, 2-frame wing-flap animation
|
|
91
|
+
- `_drawHamster()`: Wheat-colored, pink cheek pouches, round ears, 2-frame tail wiggle
|
|
92
|
+
|
|
93
|
+
### Improved
|
|
94
|
+
|
|
95
|
+
- **3/4 Top-Down Perspective** — Classic RPG view (Stardew Valley / Pokémon style)
|
|
96
|
+
- Characters stand behind desks (lower Y = further back visually)
|
|
97
|
+
- Desks in front of characters (higher Y = closer to viewer)
|
|
98
|
+
- Upper body fully visible, no longer occluded by furniture
|
|
99
|
+
|
|
100
|
+
- **Furniture Sprite Redraw** (`SpriteGenerator.js`)
|
|
101
|
+
- Desk: 3/4 view with visible top surface + front face, wood grain detail, 48×20px
|
|
102
|
+
- Monitor → Laptop: keyboard base + tilted screen, Apple-style logo, 20×16px
|
|
103
|
+
- Chair: visible seat cushion + backrest + casters, 16×18px
|
|
104
|
+
|
|
105
|
+
- **Three-Phase Render Pipeline** (`ClawSkinApp.js`)
|
|
106
|
+
- Phase 1: Render all chairs (always visible)
|
|
107
|
+
- Phase 2: Y-sorted character rendering (depth sort)
|
|
108
|
+
- Phase 3: Render all desks + laptops + cups (always visible)
|
|
109
|
+
- Phase 4: Render independent pets
|
|
110
|
+
|
|
111
|
+
- **Smooth Movement** (`AgentSlot.js`)
|
|
112
|
+
- All movement uses linear interpolation (lerp), no more teleporting
|
|
113
|
+
- Returning to desk is also a smooth walk
|
|
114
|
+
- Movement speed increased: 0.06–0.08 (from 0.04–0.06)
|
|
115
|
+
- Natural sine-wave sway while walking
|
|
116
|
+
|
|
117
|
+
### Fixed
|
|
118
|
+
|
|
119
|
+
- Fixed desks/chairs disappearing when agents wander — furniture now always renders
|
|
120
|
+
- Fixed pets teleporting with agents — pets fully decoupled
|
|
121
|
+
- Fixed agents snapping back to desk — now smooth walk-back
|
|
122
|
+
- Fixed character occlusion in multi-agent scenes — introduced Y-sort depth sorting
|
|
123
|
+
|
|
124
|
+
### Files Changed
|
|
125
|
+
|
|
126
|
+
| File | Change | Description |
|
|
127
|
+
|------|--------|-------------|
|
|
128
|
+
| `js/sprites/SpriteGenerator.js` | Modified | Redrawn furniture sprites (3/4 view), added bird/hamster sprites |
|
|
129
|
+
| `js/scenes/OfficeScene.js` | Modified | Recalculated workstation coords, adjusted renderDesk order |
|
|
130
|
+
| `js/app/ClawSkinApp.js` | Modified | Three-phase render pipeline, PetManager integration |
|
|
131
|
+
| `js/app/AgentSlot.js` | Rewritten | Lerp smooth movement, POI wandering, social behavior |
|
|
132
|
+
| `js/character/CharacterSprite.js` | Modified | Removed pet rendering code |
|
|
133
|
+
| `js/pets/Pet.js` | **New** | Independent pet entity class |
|
|
134
|
+
| `js/pets/PetManager.js` | **New** | Pet collection manager |
|
|
135
|
+
| `app.html` | Modified | Added Pet/PetManager script tags |
|
|
136
|
+
| `index.html` | Modified | Added Pet/PetManager script tags |
|
|
77
137
|
|
|
78
138
|
---
|
|
79
139
|
|
|
80
140
|
## [0.1.0] - 2026-02-28
|
|
81
141
|
|
|
82
|
-
###
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
- 32×32
|
|
86
|
-
- 5
|
|
87
|
-
- 4
|
|
88
|
-
- 3
|
|
89
|
-
- 3
|
|
90
|
-
- 8
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
- Demo
|
|
94
|
-
-
|
|
95
|
-
- Gateway WebSocket
|
|
96
|
-
-
|
|
97
|
-
- localStorage
|
|
98
|
-
-
|
|
142
|
+
### Initial Release
|
|
143
|
+
|
|
144
|
+
- Pure Canvas 2D rendering, zero external dependencies
|
|
145
|
+
- 32×32 pixel character procedural generation (16-frame animation)
|
|
146
|
+
- 5 skin tones × 7 hair colors × 5 hairstyles × 5 outfit types
|
|
147
|
+
- 4 accessories: glasses, hat, headphones, cap
|
|
148
|
+
- 3 pets: cat, dog, robot
|
|
149
|
+
- 3 scenes: Office, Hacker Den, Cozy Café
|
|
150
|
+
- 8 state animations: idle, typing, thinking, executing, browsing, error, sleeping, waving
|
|
151
|
+
- Dialogue bubble system with typewriter effect
|
|
152
|
+
- Character editor UI
|
|
153
|
+
- Demo mode (simulated state cycling)
|
|
154
|
+
- Multi-agent support (auto workstation layout)
|
|
155
|
+
- Gateway WebSocket connection (OpenClaw protocol)
|
|
156
|
+
- Click agent to open editor
|
|
157
|
+
- localStorage config persistence
|
|
158
|
+
- Embeddable iframe page
|
package/README.md
CHANGED
|
@@ -1,134 +1,90 @@
|
|
|
1
1
|
# 🎨 ClawSkin
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Give your AI agent a pixel life.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
ClawSkin turns your AI assistant into a living pixel character — sitting at a desk, typing code, sipping coffee, petting a cat. Watch your agent work in real-time, or just enjoy the cozy vibes.
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="docs/images/screenshot.png" alt="ClawSkin — Pixel agents working in an office" width="720">
|
|
9
|
+
</p>
|
|
6
10
|
|
|
7
11
|
<p align="center">
|
|
8
12
|
<img src="https://img.shields.io/badge/Canvas_2D-Procedural-blue" alt="Canvas 2D">
|
|
9
|
-
<img src="https://img.shields.io/badge/JavaScript-ES6+-yellow?logo=javascript&logoColor=white" alt="JavaScript">
|
|
10
13
|
<img src="https://img.shields.io/badge/Dependencies-0-brightgreen" alt="Zero Dependencies">
|
|
11
14
|
<img src="https://img.shields.io/badge/Build-None-brightgreen" alt="Zero Build">
|
|
12
15
|
<img src="https://img.shields.io/github/license/clawlabz/clawskin" alt="License">
|
|
13
16
|
</p>
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
---
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
- 🏠 **3 Scenes** — Office, Hacker Den, Cozy Café (each with ambient animations and particles)
|
|
19
|
-
- 🎬 **8 State Animations** — idle, thinking, typing, executing, browsing, error, wave, sleeping
|
|
20
|
-
- 💬 **Dialogue Bubbles** — Typewriter effect with emoji support
|
|
21
|
-
- 👥 **Multi-Agent** — Display multiple AI agents simultaneously with independent states
|
|
22
|
-
- 🐾 **Pixel Pets** — Cats, dogs, robots, birds, hamsters with autonomous AI behavior
|
|
23
|
-
- 🎮 **Demo Mode** — Runs standalone without any backend connection
|
|
24
|
-
- 📦 **Zero Dependencies** — Pure static files, just Node.js to serve
|
|
20
|
+
## What is this?
|
|
25
21
|
|
|
26
|
-
|
|
22
|
+
A pixel companion that mirrors what your AI agent is doing — **in real-time**.
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
git clone https://github.com/clawlabz/clawskin.git
|
|
30
|
-
cd clawskin
|
|
31
|
-
npm start
|
|
32
|
-
# → http://localhost:3000
|
|
33
|
-
```
|
|
24
|
+
When your agent thinks, the character scratches its head. When it writes code, the character types furiously. When it browses the web, it stares at the screen. When it sleeps... it sleeps. 💤
|
|
34
25
|
|
|
35
|
-
|
|
26
|
+
> Zero dependencies. Zero build tools. Just pixels.
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
> Browsers block WebSocket connections from `file://` pages due to origin restrictions.
|
|
39
|
-
> The built-in server runs on `http://localhost` which Gateway accepts. Zero dependencies — just Node.js.
|
|
28
|
+
## ✨ Highlights
|
|
40
29
|
|
|
41
|
-
|
|
30
|
+
🧑🎨 **Customize Everything** — Mix skin tones, hairstyles, outfits, and accessories. 2,500+ unique looks.
|
|
42
31
|
|
|
43
|
-
|
|
44
|
-
npm start # Default: localhost:3000, opens browser
|
|
45
|
-
npm start -- --no-open # Don't open browser
|
|
46
|
-
npm start -- --port 8080 # Custom port
|
|
47
|
-
npm start -- --host 0.0.0.0 # Expose to network (see Security below)
|
|
48
|
-
```
|
|
32
|
+
🏠 **3 Cozy Scenes** — Office, Hacker Den, and Café. Each with ambient weather, particles, and hidden easter eggs.
|
|
49
33
|
|
|
50
|
-
|
|
34
|
+
🐾 **Pixel Pets** — Cats, dogs, birds, hamsters, and robots that wander around, nap, and react when you click them.
|
|
51
35
|
|
|
52
|
-
|
|
53
|
-
clawSkin/
|
|
54
|
-
├── public/
|
|
55
|
-
│ ├── index.html # Landing page (demo + customization)
|
|
56
|
-
│ ├── app.html # Full-screen app (main product)
|
|
57
|
-
│ ├── css/
|
|
58
|
-
│ └── js/
|
|
59
|
-
│ ├── app/ # ClawSkinApp, GatewayClient, Settings
|
|
60
|
-
│ ├── scenes/ # Office / Hacker / Café scenes
|
|
61
|
-
│ ├── character/ # Sprite rendering + animations
|
|
62
|
-
│ ├── sprites/ # Procedural sprite generator
|
|
63
|
-
│ ├── pets/ # Pet entity + manager
|
|
64
|
-
│ ├── state/ # Agent state sync + demo mode
|
|
65
|
-
│ └── ui/ # Character editor + scene picker
|
|
66
|
-
├── serve.cjs # Zero-dependency HTTP server
|
|
67
|
-
└── docs/
|
|
68
|
-
└── ARCHITECTURE.md # Detailed architecture doc
|
|
69
|
-
```
|
|
36
|
+
💬 **Chat with Your Agent** — Click an agent to open a chat panel. Talk to them directly from the pixel world.
|
|
70
37
|
|
|
71
|
-
|
|
38
|
+
🌦️ **Weather System** — Click the window to cycle through sunny, rainy, snowy, and night modes.
|
|
72
39
|
|
|
73
|
-
|
|
74
|
-
Layer 5: Accessory — glasses / hat / headphones
|
|
75
|
-
Layer 4: Hair — 5 styles with color variants
|
|
76
|
-
Layer 3: Outfit — hoodie / suit / lab coat / ...
|
|
77
|
-
Layer 2: Expression — happy / thinking / confused / sleepy
|
|
78
|
-
Layer 1: Body — base 32×32 pixel humanoid + skin tone
|
|
79
|
-
Layer 0: Shadow
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Agent State Mapping
|
|
40
|
+
🎯 **Easter Eggs Everywhere** — Click the clock, bookshelf, plants, arcade machine... everything has a surprise.
|
|
83
41
|
|
|
84
|
-
|
|
85
|
-
|-------------|-------------------------|
|
|
86
|
-
| `idle` | Sitting, drinking coffee, petting cat |
|
|
87
|
-
| `thinking` | Thought bubble "..." |
|
|
88
|
-
| `writing` | Fast typing, screen flickers |
|
|
89
|
-
| `executing` | Walks to server rack |
|
|
90
|
-
| `browsing` | Staring at screen, occasional clicks |
|
|
91
|
-
| `error` | ❌ above head, frustrated expression |
|
|
92
|
-
| `heartbeat` | Waves at window |
|
|
93
|
-
| `sleeping` | Head on desk 💤 |
|
|
42
|
+
🍖 **Feed Your Pets** — Click the floor to drop a treat. Watch the nearest pet run over and munch it.
|
|
94
43
|
|
|
95
|
-
##
|
|
96
|
-
|
|
97
|
-
ClawSkin is designed to run locally as a companion UI. Here are the security considerations:
|
|
44
|
+
## 🚀 Quick Start
|
|
98
45
|
|
|
99
|
-
|
|
46
|
+
**One command, zero install:**
|
|
100
47
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
48
|
+
```bash
|
|
49
|
+
npx @clawlabz/clawskin
|
|
50
|
+
```
|
|
104
51
|
|
|
105
|
-
|
|
52
|
+
That's it. Opens at `http://localhost:3000` with a live demo.
|
|
106
53
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
- **Device identity** — An Ed25519 keypair is generated and stored in `localStorage` for Gateway device pairing. The private key is stored as base64url in plaintext. This is a known tradeoff: `localStorage` is accessible to any JavaScript on the same origin. For a locally-run pixel companion, this is acceptable. If you need stronger protection, use the browser in a dedicated profile.
|
|
54
|
+
<details>
|
|
55
|
+
<summary>Or clone the repo</summary>
|
|
110
56
|
|
|
111
|
-
|
|
57
|
+
```bash
|
|
58
|
+
git clone https://github.com/clawlabz/clawskin.git
|
|
59
|
+
cd clawskin
|
|
60
|
+
npm start
|
|
61
|
+
```
|
|
62
|
+
</details>
|
|
112
63
|
|
|
113
|
-
|
|
114
|
-
- For remote connections, use `wss://` (e.g. via Tailscale Serve) to encrypt traffic.
|
|
64
|
+
To connect to your AI agent, click **⚡ CONNECT** and enter your [OpenClaw Gateway](https://github.com/anthropics/openclaw) URL.
|
|
115
65
|
|
|
116
66
|
## 🔗 Part of the Claw Ecosystem
|
|
117
67
|
|
|
118
68
|
```
|
|
119
|
-
ClawSkin
|
|
120
|
-
|
|
69
|
+
ClawSkin → ClawArena → ClawGenesis
|
|
70
|
+
Pixel companion AI battle game AI civilization
|
|
121
71
|
```
|
|
122
72
|
|
|
123
|
-
ClawSkin characters can be reused as avatars
|
|
73
|
+
ClawSkin characters can be reused as avatars across the Claw ecosystem.
|
|
74
|
+
|
|
75
|
+
## 📖 Documentation
|
|
76
|
+
|
|
77
|
+
- [Technical Architecture](docs/TECHNICAL.md) — render pipeline, state mapping, Gateway protocol
|
|
78
|
+
- [Architecture Overview](docs/ARCHITECTURE.md) — system design
|
|
79
|
+
- [Changelog](CHANGELOG.md) — version history
|
|
80
|
+
- [Roadmap](docs/ROADMAP.md) — what's next
|
|
124
81
|
|
|
125
82
|
## 🤝 Contributing
|
|
126
83
|
|
|
127
|
-
Contributions
|
|
84
|
+
Contributions welcome! Ideas:
|
|
128
85
|
|
|
129
|
-
Ideas for contributions:
|
|
130
86
|
- 🎨 New scenes (bedroom, spaceship, garden...)
|
|
131
|
-
- 👕 New
|
|
87
|
+
- 👕 New outfits, hairstyles, accessories
|
|
132
88
|
- 🐾 New pet companions
|
|
133
89
|
- 🌐 i18n support
|
|
134
90
|
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# ClawSkin Technical Documentation
|
|
2
|
+
|
|
3
|
+
## Architecture
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
clawSkin/
|
|
7
|
+
├── public/
|
|
8
|
+
│ ├── index.html # Landing page (demo + customization)
|
|
9
|
+
│ ├── app.html # Full-screen app (main product)
|
|
10
|
+
│ └── js/
|
|
11
|
+
│ ├── app/ # ClawSkinApp, GatewayClient, Settings
|
|
12
|
+
│ ├── scenes/ # Office / Hacker / Café scenes
|
|
13
|
+
│ ├── character/ # Sprite rendering + animations
|
|
14
|
+
│ ├── sprites/ # Procedural sprite generator
|
|
15
|
+
│ ├── pets/ # Pet entity + manager
|
|
16
|
+
│ ├── state/ # Agent state sync + demo mode
|
|
17
|
+
│ └── ui/ # Character editor + scene picker
|
|
18
|
+
├── serve.cjs # Zero-dependency HTTP server
|
|
19
|
+
└── docs/
|
|
20
|
+
└── TECHNICAL.md # This file
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Character Layer System
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Layer 5: Accessory — glasses / hat / headphones
|
|
27
|
+
Layer 4: Hair — 5 styles with color variants
|
|
28
|
+
Layer 3: Outfit — hoodie / suit / lab coat / ...
|
|
29
|
+
Layer 2: Expression — happy / thinking / confused / sleepy
|
|
30
|
+
Layer 1: Body — base 32×32 pixel humanoid + skin tone
|
|
31
|
+
Layer 0: Shadow
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Agent State Mapping
|
|
35
|
+
|
|
36
|
+
| Agent State | Pixel Character Behavior |
|
|
37
|
+
|-------------|-------------------------|
|
|
38
|
+
| `idle` | Sitting, drinking coffee, petting cat |
|
|
39
|
+
| `thinking` | Thought bubble "..." |
|
|
40
|
+
| `writing` | Fast typing, screen flickers |
|
|
41
|
+
| `executing` | Walks to server rack |
|
|
42
|
+
| `browsing` | Staring at screen, occasional clicks |
|
|
43
|
+
| `error` | ❌ above head, frustrated expression |
|
|
44
|
+
| `heartbeat` | Waves at window |
|
|
45
|
+
| `sleeping` | Head on desk 💤 |
|
|
46
|
+
|
|
47
|
+
## Render Pipeline
|
|
48
|
+
|
|
49
|
+
Three-phase rendering with painter's algorithm (back to front):
|
|
50
|
+
|
|
51
|
+
1. **Scene Background** — walls, floor, windows, ambient weather effects, decorations
|
|
52
|
+
2. **Workstation Layer** (per agent, Y-sorted):
|
|
53
|
+
- Chairs (behind character)
|
|
54
|
+
- Characters (depth-sorted by Y)
|
|
55
|
+
- Desks + laptops + cups (in front of character)
|
|
56
|
+
3. **Overlay Layer**:
|
|
57
|
+
- Pets (independent wander, Y-sorted)
|
|
58
|
+
- Name tags + speech bubbles (always on top)
|
|
59
|
+
|
|
60
|
+
## Weather System
|
|
61
|
+
|
|
62
|
+
Each scene supports weather cycling via window/panel click:
|
|
63
|
+
|
|
64
|
+
| Scene | States |
|
|
65
|
+
|-------|--------|
|
|
66
|
+
| Office | Sunny → Night (moon + stars) → Rain (lightning) → Snow |
|
|
67
|
+
| Café | Rain → Sunny → Snow → Fog |
|
|
68
|
+
| Hacker Den | Neon Purple → Red Alert → Matrix Green → Blackout |
|
|
69
|
+
|
|
70
|
+
Weather affects: window content, global ambient overlay, particle systems.
|
|
71
|
+
|
|
72
|
+
## Pet AI Behavior
|
|
73
|
+
|
|
74
|
+
Decision cycle runs every 3–11 seconds:
|
|
75
|
+
|
|
76
|
+
| Roll | Action |
|
|
77
|
+
|------|--------|
|
|
78
|
+
| < 0.25 | Walk toward a random agent (rub legs) |
|
|
79
|
+
| < 0.40 | Walk toward another pet |
|
|
80
|
+
| < 0.60 | Random walk within floor bounds |
|
|
81
|
+
| < 0.60 + sleepChance | Sleep in place |
|
|
82
|
+
| else | Idle |
|
|
83
|
+
|
|
84
|
+
Pet types: Cat (walk), Dog (walk), Robot (walk), Bird (fly + sine bob), Hamster (crawl + speed bursts)
|
|
85
|
+
|
|
86
|
+
Collision detection against desk obstacles with axis-aligned sliding.
|
|
87
|
+
|
|
88
|
+
## Gateway Protocol
|
|
89
|
+
|
|
90
|
+
ClawSkin connects to OpenClaw Gateway via WebSocket (protocol v3).
|
|
91
|
+
|
|
92
|
+
### Connection Flow
|
|
93
|
+
1. Open WebSocket → receive `connect.challenge` event
|
|
94
|
+
2. Send `connect` RPC with client info + auth token
|
|
95
|
+
3. On success → discover agents via `sessions.list`
|
|
96
|
+
4. Route incoming events by `sessionKey` pattern: `agent:<agentId>:<platform>:...`
|
|
97
|
+
|
|
98
|
+
### Key RPC Methods
|
|
99
|
+
- `connect` — authenticate and establish session
|
|
100
|
+
- `sessions.list` — discover active agent sessions
|
|
101
|
+
- `chat.send` — send message to agent (requires `idempotencyKey`)
|
|
102
|
+
- `chat.history` — fetch conversation history
|
|
103
|
+
- `agent.identity.get` — get agent metadata
|
|
104
|
+
- `status` / `health` — server status
|
|
105
|
+
|
|
106
|
+
### Event Types
|
|
107
|
+
- `chat` (states: `delta`, `final`, `aborted`, `error`) — streaming chat responses
|
|
108
|
+
- `agent` (streams: `tool`, `lifecycle`, `compaction`) — agent activity events
|
|
109
|
+
- `presence` — connection status
|
|
110
|
+
|
|
111
|
+
## Security
|
|
112
|
+
|
|
113
|
+
### Local Server (`serve.cjs`)
|
|
114
|
+
- Binds to `127.0.0.1` by default — only accessible from your machine
|
|
115
|
+
- `/api/config` returns Gateway URL from `~/.openclaw/openclaw.json` (tokens never served)
|
|
116
|
+
- Security headers: CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy
|
|
117
|
+
|
|
118
|
+
### Browser Storage
|
|
119
|
+
- Settings persisted in `localStorage` (Gateway URL, scene, character config)
|
|
120
|
+
- Gateway auth token stored in `localStorage` after manual entry
|
|
121
|
+
- Ed25519 device identity keypair for Gateway pairing (base64url in localStorage)
|
|
122
|
+
|
|
123
|
+
### WebSocket
|
|
124
|
+
- Requests read-only scopes (`operator.read`, `operator.events`)
|
|
125
|
+
- Use `wss://` for remote connections (e.g. via Tailscale Serve)
|
|
126
|
+
|
|
127
|
+
## CLI Options
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm start # Default: localhost:3000, opens browser
|
|
131
|
+
npm start -- --no-open # Don't open browser
|
|
132
|
+
npm start -- --port 8080 # Custom port
|
|
133
|
+
npm start -- --host 0.0.0.0 # Expose to network
|
|
134
|
+
```
|
|
Binary file
|
package/package.json
CHANGED
package/public/_redirects
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/ /app.html 302
|