psinetron-opencode-visualizer 1.0.4 → 1.0.5

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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -75
  3. package/index.ts +1 -1
  4. package/package.json +5 -2
  5. package/visualizer/person1/person1/rotations/east.png +0 -0
  6. package/visualizer/person1/person1/rotations/north-east.png +0 -0
  7. package/visualizer/person1/person1/rotations/north-west.png +0 -0
  8. package/visualizer/person1/person1/rotations/north.png +0 -0
  9. package/visualizer/person1/person1/rotations/south-east.png +0 -0
  10. package/visualizer/person1/person1/rotations/south-west.png +0 -0
  11. package/visualizer/person1/person1/rotations/south.png +0 -0
  12. package/visualizer/person1/person1/rotations/west.png +0 -0
  13. package/visualizer/person2/person2/rotations/east.png +0 -0
  14. package/visualizer/person2/person2/rotations/north-east.png +0 -0
  15. package/visualizer/person2/person2/rotations/north-west.png +0 -0
  16. package/visualizer/person2/person2/rotations/north.png +0 -0
  17. package/visualizer/person2/person2/rotations/south-east.png +0 -0
  18. package/visualizer/person2/person2/rotations/south-west.png +0 -0
  19. package/visualizer/person2/person2/rotations/south.png +0 -0
  20. package/visualizer/person2/person2/rotations/west.png +0 -0
  21. package/visualizer/person3/person3/rotations/east.png +0 -0
  22. package/visualizer/person3/person3/rotations/north-east.png +0 -0
  23. package/visualizer/person3/person3/rotations/north-west.png +0 -0
  24. package/visualizer/person3/person3/rotations/north.png +0 -0
  25. package/visualizer/person3/person3/rotations/south-east.png +0 -0
  26. package/visualizer/person3/person3/rotations/south-west.png +0 -0
  27. package/visualizer/person3/person3/rotations/south.png +0 -0
  28. package/visualizer/person3/person3/rotations/west.png +0 -0
  29. package/visualizer/person4/person4/rotations/east.png +0 -0
  30. package/visualizer/person4/person4/rotations/north-east.png +0 -0
  31. package/visualizer/person4/person4/rotations/north-west.png +0 -0
  32. package/visualizer/person4/person4/rotations/north.png +0 -0
  33. package/visualizer/person4/person4/rotations/south-east.png +0 -0
  34. package/visualizer/person4/person4/rotations/south-west.png +0 -0
  35. package/visualizer/person4/person4/rotations/south.png +0 -0
  36. package/visualizer/person4/person4/rotations/west.png +0 -0
  37. package/visualizer/person5/person5/rotations/east.png +0 -0
  38. package/visualizer/person5/person5/rotations/north-east.png +0 -0
  39. package/visualizer/person5/person5/rotations/north-west.png +0 -0
  40. package/visualizer/person5/person5/rotations/north.png +0 -0
  41. package/visualizer/person5/person5/rotations/south-east.png +0 -0
  42. package/visualizer/person5/person5/rotations/south-west.png +0 -0
  43. package/visualizer/person5/person5/rotations/south.png +0 -0
  44. package/visualizer/person5/person5/rotations/west.png +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fail
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,40 +1,60 @@
1
- # OpenCode Visualizer
1
+ # 👾 psinetron-opencode-visualizer
2
2
 
3
- Real-time pixel-art office scene that visualizes OpenCode AI agent sessions. Watch your agents walk, sit at desks, type on laptops, drink coffee, and react to events — all rendered in a charming retro pixel-art style.
3
+ [![MIT License](https://img.shields.io/github/license/psinetron/opencode-visualiser)](https://github.com/psinetron/opencode-visualiser/blob/main/LICENSE)
4
+ [![GitHub stars](https://img.shields.io/github/stars/psinetron/opencode-visualiser.svg)](https://github.com/psinetron/opencode-visualiser/stargazers)
5
+ [![NPM Version](https://img.shields.io/npm/v/psinetron-opencode-visualizer.svg)](https://www.npmjs.com/package/psinetron-opencode-visualizer)
4
6
 
5
- ![OpenCode Visualizer](visualizer/textures/background.png)
7
+ **Bringing the custom cruiser ethos to AI orchestration.** Turning raw OpenCode terminal logs into cozy 2D pixel office chaos. Watch your agents work, idle, and celebrate success in a bustling virtual office.
6
8
 
7
- ## Features
9
+ ---
8
10
 
9
- - **5 unique pixel-art characters** — each with distinct idle, working, and reaction animations
10
- - **12 animation states** — idle, walking, sitting, typing, drinking coffee, scratching head, yawning, error reactions, and more
11
- - **Persistent office layout** — 5 desks, a coffee zone, and a rest area with Y-sorted rendering
12
- - **Real-time WebSocket sync** — events stream from OpenCode sessions to the visualizer instantly
13
- - **Cross-platform standalone window** — automatically opens in Chrome app mode on macOS, Windows, and Linux; falls back to default browser
11
+ ## 🔥 Witness the Chaos
14
12
 
15
- ## Requirements
13
+ <img src="images/cover.png" width="100%" alt="OpenCode Visualizer" />
16
14
 
17
- - [OpenCode](https://opencode.ai)
18
- - [Bun](https://bun.sh) (runtime)
19
- - Chrome, Chromium, or Edge (for app-mode window; optional any browser works)
15
+ <!--
16
+ THIS IS THE MOST IMPORTANT PART FOR HYPE.
17
+ When you create your video-demo for X.com (MP4), convert it to a small GIF (e.g., using CapCut or online converters like ezgif) and place it here.
20
18
 
21
- ## Installation
19
+ For example, uncomment the line below when you have a GIF in your repo:
20
+
21
+ <img src="visualizer-demo.gif" width="100%" alt="OpenCode Visualizer Demo" />
22
+
23
+ *Placeholder for the awesome video demo you are going to record. It should show the JSON logs in the terminal transforming into the pixel art office.*
24
+ -->
25
+
26
+ ---
27
+
28
+ ## ✨ Features
29
+
30
+ - **Real-time Visualization:** Watch your OpenCode agents move around their office as they execute tools, search files, and write code.
31
+ - **Cozy Pixel Art Aesthetic:** A calming, gamified view of complex AI orchestration.
32
+ - **Mult-Agent Support:** Visualizes multiple agents (Explore, Scout, etc.) simultaneously in the same shared office space.
33
+ - **Customization (Skins):** Each agent has a custom skin saved in `.opencode/viz-skin.json`.
34
+ - **Unique Agent Animations:** Each of the 5 characters has its own set of unique idle, walk, work, and reaction animations.
35
+ - **Zero Friction Launch:** Pure Bun & TypeScript. Launches a cross-platform, isolated Chrome "app" window using native OS calls. No heavy Electron needed.
36
+
37
+ ---
38
+
39
+ ## 🚀 Installation
40
+
41
+ *Note: Requires [Bun](https://bun.sh) to be installed.*
22
42
 
23
43
  ### Via OpenCode UI (recommended)
24
44
 
25
- 1. Press `Cmd+P` (`Ctrl+P` on Windows/Linux) to open the command palette
45
+ 1. Press `Control+P` (`Ctrl+P` on Windows/Linux) to open the command palette
26
46
  2. Select **Install plugin**
27
- 3. Enter the package name: `slybeaver-opencode-visualizer`
47
+ 3. Enter the package name: `psinetron-opencode-visualizer`
28
48
 
29
49
  OpenCode will install the plugin and automatically add it to your project's `opencode.json`.
30
50
 
31
51
  ### Manual configuration
32
52
 
33
- Add the plugin to your OpenCode config (`opencode.json` or `opencode.jsonc`):
53
+ Add the plugin to your OpenCode config (`opencode.json`):
34
54
 
35
55
  ```json
36
56
  {
37
- "plugin": ["slybeaver-opencode-visualizer"]
57
+ "plugin": ["psinetron-opencode-visualizer"]
38
58
  }
39
59
  ```
40
60
 
@@ -46,68 +66,18 @@ Or install from a local path:
46
66
  }
47
67
  ```
48
68
 
49
- ## How It Works
50
69
 
51
- ```
52
- OpenCode session
53
- │ event hook
54
-
55
- Plugin (index.ts) ─── WebSocket ───► Bun Server (port 5173)
56
- │ broadcast
57
-
58
- Frontend (Canvas, 1024×768)
59
- Pixel-art office with animated agents
60
- ```
61
70
 
62
- 1. The plugin starts a Bun HTTP + WebSocket server on `localhost:5173`
63
- 2. It opens the visualizer in a Chrome app window (or your default browser)
64
- 3. OpenCode session events stream through WebSocket to the visualizer
65
- 4. The canvas renders agents navigating the office, sitting at desks, and animating in real time
71
+ ---
66
72
 
67
- ## Project Structure
73
+ ## 🎨 Customization (Skins)
68
74
 
69
- ```
70
- ├── index.ts # Plugin entry point (server + WebSocket + Chrome launcher)
71
- ├── opencode.json # OpenCode plugin manifest
72
- ├── package.json # npm metadata
73
- ├── visualizer/
74
- │ ├── index.html # SPA canvas app (all rendering logic in <script>)
75
- │ ├── textures/ # Background, desk, and coffee table sprites
76
- │ └── person1-5/ # Character sprites (8 rotation + 6-8 animation types each)
77
- │ └── personN/
78
- │ ├── rotations/ # Direction sprites (N, S, E, W, NE, NW, SE, SW)
79
- │ └── animations/ # Frame-by-frame animation sprites (idle, walk, sit, work, coffee, scratch, yawn)
80
- ```
75
+ The plugin automatically assigns a random pixel art skin to each agent and saves it to `.opencode/viz-skin.json` in your project folder. You can manually edit this file to change skins.
81
76
 
82
- ## Agent States
83
-
84
- | State | Description |
85
- |-------|-------------|
86
- | `idle` | Standing still, breathing animation |
87
- | `walking` | Walking to a destination |
88
- | `walking_to_desk` | Heading to an assigned desk |
89
- | `sitting` | Sitting down transition |
90
- | `working` | Typing on a laptop |
91
- | `drinking` | At the coffee zone |
92
- | `scratching` | Idle desk animation — scratching head |
93
- | `yawning` | Idle desk animation — yawning |
94
- | `error` | Reacting to an error |
95
- | `flash` | White flash on session diff |
96
- | `idle_rest` | Standing in the rest area |
97
- | `leaving` | Walking to the exit door |
98
-
99
- ## Development
100
-
101
- ```bash
102
- # Run the plugin (requires OpenCode)
103
- opencode
104
-
105
- # The visualizer runs at http://localhost:5173
106
- # Open it manually in any browser
107
- ```
77
+ Available skins: `person1`, `person2`, `person3`, `person4`, `person5`.
108
78
 
109
- No build step required — Bun runs TypeScript directly.
79
+ ---
110
80
 
111
- ## License
81
+ ## 📜 License
112
82
 
113
- MIT
83
+ MIT License. See LICENSE for more information. Built, not bought, by psinetron.
package/index.ts CHANGED
@@ -39,7 +39,7 @@ function resolveSkin(cwd: string): string {
39
39
 
40
40
  let ws: WebSocket | null = null
41
41
  let reconnectTimer: ReturnType<typeof setTimeout> | null = null
42
- const instanceId = `oc-${process.pid}-${Math.random().toString(36).slice(2, 8)}`
42
+ const instanceId = `oc-${process.pid}-${Math.random().toString(36).substring(2, 10)}`
43
43
 
44
44
  function connectToServer(skin: string): Promise<void> {
45
45
  return new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psinetron-opencode-visualizer",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "index.ts",
5
5
  "description": "OpenCode session visualizer — real-time pixel-art office scene with animated agents",
6
6
  "files": [
@@ -9,5 +9,8 @@
9
9
  ],
10
10
  "keywords": ["opencode", "opencode-plugin", "visualizer", "monitor"],
11
11
  "license": "MIT",
12
- "type": "module"
12
+ "type": "module",
13
+ "devDependencies": {
14
+ "@opencode-ai/plugin": "^0.1.0"
15
+ }
13
16
  }