openrune 0.1.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.
Files changed (36) hide show
  1. package/.claude-plugin/marketplace.json +17 -0
  2. package/.claude-plugin/plugin.json +24 -0
  3. package/LICENSE +21 -0
  4. package/README.md +257 -0
  5. package/bin/rune.js +718 -0
  6. package/bootstrap.js +4 -0
  7. package/channel/rune-channel.ts +467 -0
  8. package/electron-builder.yml +61 -0
  9. package/finder-extension/FinderSync.swift +47 -0
  10. package/finder-extension/RuneFinderSync.appex/Contents/Info.plist +27 -0
  11. package/finder-extension/RuneFinderSync.appex/Contents/MacOS/RuneFinderSync +0 -0
  12. package/finder-extension/main.swift +5 -0
  13. package/package.json +53 -0
  14. package/renderer/index.html +12 -0
  15. package/renderer/src/App.tsx +43 -0
  16. package/renderer/src/features/chat/activity-block.tsx +152 -0
  17. package/renderer/src/features/chat/chat-header.tsx +58 -0
  18. package/renderer/src/features/chat/chat-input.tsx +190 -0
  19. package/renderer/src/features/chat/chat-panel.tsx +150 -0
  20. package/renderer/src/features/chat/markdown-renderer.tsx +26 -0
  21. package/renderer/src/features/chat/message-bubble.tsx +79 -0
  22. package/renderer/src/features/chat/message-list.tsx +178 -0
  23. package/renderer/src/features/chat/types.ts +32 -0
  24. package/renderer/src/features/chat/use-chat.ts +251 -0
  25. package/renderer/src/features/terminal/terminal-panel.tsx +132 -0
  26. package/renderer/src/global.d.ts +29 -0
  27. package/renderer/src/globals.css +92 -0
  28. package/renderer/src/hooks/use-ipc.ts +24 -0
  29. package/renderer/src/lib/markdown.ts +83 -0
  30. package/renderer/src/lib/utils.ts +6 -0
  31. package/renderer/src/main.tsx +10 -0
  32. package/renderer/tsconfig.json +16 -0
  33. package/renderer/vite.config.ts +23 -0
  34. package/src/main.ts +782 -0
  35. package/src/preload.ts +58 -0
  36. package/tsconfig.json +14 -0
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "rune",
4
+ "description": "Rune — File-based AI Agent Desktop App plugins",
5
+ "owner": {
6
+ "name": "gilhyun",
7
+ "email": "gilhyun@github.com"
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "rune-channel",
12
+ "description": "Rune desktop app channel for Claude Code",
13
+ "source": "./",
14
+ "category": "development"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "rune-channel",
3
+ "version": "0.1.0",
4
+ "description": "Rune desktop app channel for Claude Code — bridges Claude Code with the Rune AI agent UI",
5
+ "author": {
6
+ "name": "gilhyun",
7
+ "url": "https://github.com/gilhyun"
8
+ },
9
+ "homepage": "https://github.com/gilhyun/Rune",
10
+ "repository": "https://github.com/gilhyun/Rune",
11
+ "license": "MIT",
12
+ "keywords": ["rune", "channel", "mcp", "desktop", "agent"],
13
+ "mcpServers": {
14
+ "rune-channel": {
15
+ "command": "node",
16
+ "args": ["${CLAUDE_PLUGIN_ROOT}/dist/rune-channel.js"]
17
+ }
18
+ },
19
+ "channels": [
20
+ {
21
+ "server": "rune-channel"
22
+ }
23
+ ]
24
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 gilhyun
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 ADDED
@@ -0,0 +1,257 @@
1
+ <p align="center">
2
+ <img src="rune-logo.png" width="180" />
3
+ </p>
4
+
5
+ <h1 align="center">Rune</h1>
6
+
7
+ <p align="center">
8
+ <strong>File-based AI Agent Desktop App</strong><br/>
9
+ Drop a <code>.rune</code> file in any folder. Double-click to open. Chat with your AI agent.
10
+ </p>
11
+
12
+ <p align="center">
13
+ <img src="https://img.shields.io/badge/powered_by-Claude_Code-blueviolet" alt="Claude Code" />
14
+ <img src="https://img.shields.io/badge/platform-macOS-blue" alt="platform" />
15
+ <img src="https://img.shields.io/badge/license-MIT-green" alt="license" />
16
+ </p>
17
+
18
+ ---
19
+
20
+ ## What is Rune?
21
+
22
+ Rune turns any folder into an AI workspace. Each `.rune` file is an independent AI agent with its own chat history, role, and context — all powered by [Claude Code](https://docs.anthropic.com/en/docs/claude-code).
23
+
24
+ - **File-based** — One `.rune` file = one agent. Move it, share it, version it with git.
25
+ - **Folder-aware** — The agent knows your project. It can read files, run commands, and write code.
26
+ - **Real-time activity** — See every tool call, permission request, and agent action as it happens via Claude Code hooks.
27
+ - **Desktop-native** — Lightweight Electron app with built-in terminal. No browser needed.
28
+ - **Right-click to create** — macOS Quick Action lets you create agents from Finder.
29
+
30
+ ---
31
+
32
+ ## Why Rune?
33
+
34
+ Most AI tools lose context when you close the window. Rune doesn't — because your agent lives in your folder.
35
+
36
+ **Persistent context** — Your agent remembers everything. Close the app, reopen it next week — the conversation and context are right where you left off.
37
+
38
+ **Portable** — The `.rune` file is just a file. Copy it to another machine, share it with a teammate, or check it into git. Your agent goes wherever the file goes.
39
+
40
+ **Multiple agents per folder** — Need a code reviewer AND a backend developer in the same project? Create two `.rune` files. Each agent has its own role, history, and expertise — working side by side in the same folder.
41
+
42
+ **No setup per project** — No config files, no extensions, no workspace settings. Drop a `.rune` file and you're ready.
43
+
44
+ <p align="center">
45
+ <img src="demo.gif" width="100%" alt="Rune demo" />
46
+ </p>
47
+
48
+ ---
49
+
50
+ ## Quick Start
51
+
52
+ ### Prerequisites
53
+
54
+ - **Node.js** 18+
55
+ - **Claude Code CLI** — `npm install -g @anthropic-ai/claude-code`
56
+
57
+ ### 1. Install
58
+
59
+ ```bash
60
+ npm install -g openrune
61
+ ```
62
+
63
+ ### 2. Create your first agent
64
+
65
+ ```bash
66
+ cd ~/my-project
67
+ rune new myagent
68
+ ```
69
+
70
+ Or right-click any folder in Finder → Quick Actions → **New Rune**
71
+
72
+ <p align="center">
73
+ <img src="Screenshot.png" width="500" alt="Right-click to create a Rune agent" />
74
+ </p>
75
+
76
+ ### 3. Open and chat
77
+
78
+ **Double-click** the `.rune` file, or:
79
+
80
+ ```bash
81
+ rune open myagent.rune
82
+ ```
83
+
84
+ ---
85
+
86
+ ## Features
87
+
88
+ ### Chat UI
89
+
90
+ - **Markdown rendering** — Code blocks, tables, lists with syntax highlighting.
91
+ - **File attachment** — Drag and drop files or click to attach. The agent reads them from your filesystem.
92
+ - **Stream cancellation** — Stop a response mid-stream.
93
+ - **Chat history** — Persisted in the `.rune` file. Clear anytime.
94
+
95
+ ### Real-time Activity Monitoring
96
+
97
+ Rune uses [Claude Code hooks](https://docs.anthropic.com/en/docs/claude-code/hooks) to capture all agent activity in real-time:
98
+
99
+ - **Tool calls** — See when the agent reads files, edits code, runs commands.
100
+ - **Tool results** — See the output of each action.
101
+ - **Permission requests** — Get notified when the agent needs approval.
102
+ - **Session events** — Track when sessions start, stop, or encounter errors.
103
+
104
+ No more guessing what the agent is doing — everything is visible in the chat panel.
105
+
106
+ ### Built-in Terminal
107
+
108
+ Toggle the terminal panel to see raw Claude Code output or run your own commands alongside the agent.
109
+
110
+ ### Agent Roles
111
+
112
+ ```bash
113
+ # General assistant
114
+ rune new assistant
115
+
116
+ # Specialized agents
117
+ rune new designer --role "UI/UX design expert"
118
+ rune new backend --role "Backend developer, Node.js specialist"
119
+ rune new reviewer --role "Code reviewer, focused on security and performance"
120
+ ```
121
+
122
+ ### The `.rune` File
123
+
124
+ A `.rune` file is just JSON:
125
+
126
+ ```json
127
+ {
128
+ "name": "myagent",
129
+ "role": "General assistant",
130
+ "icon": "bot",
131
+ "createdAt": "2025-01-01T00:00:00Z",
132
+ "history": []
133
+ }
134
+ ```
135
+
136
+ Edit the `role` field anytime to change the agent's behavior.
137
+
138
+ ---
139
+
140
+ ## CLI Commands
141
+
142
+ | Command | Description |
143
+ |---------|-------------|
144
+ | `rune install` | Build app, register file association, install Quick Action |
145
+ | `rune new <name>` | Create a `.rune` file in the current directory |
146
+ | `rune new <name> --role "..."` | Create with a custom role |
147
+ | `rune open <file.rune>` | Open a `.rune` file |
148
+ | `rune list` | List `.rune` files in the current directory |
149
+ | `rune uninstall` | Remove Rune integration (keeps your `.rune` files) |
150
+
151
+ ---
152
+
153
+ ## Architecture
154
+
155
+ ```
156
+ User ↔ Chat UI (React)
157
+ ↕ IPC
158
+ Electron Main Process
159
+ ↕ HTTP + SSE
160
+ MCP Channel (rune-channel) Claude Code Hooks
161
+ ↕ MCP ↕ HTTP POST
162
+ Claude Code CLI ──────────────→ rune-channel /hook
163
+ ```
164
+
165
+ **Two paths for data:**
166
+
167
+ 1. **Chat input** → MCP channel → Claude Code (user messages)
168
+ 2. **Claude Code hooks** → rune-channel → SSE → Chat UI (activity monitoring)
169
+
170
+ The hooks approach ensures Rune sees everything Claude does, without relying on the agent to self-report.
171
+
172
+ ---
173
+
174
+ ## Development
175
+
176
+ ### Setup
177
+
178
+ ```bash
179
+ git clone https://github.com/gilhyun/Rune.git
180
+ cd Rune
181
+ npm install
182
+ ```
183
+
184
+ ### Build & Run
185
+
186
+ ```bash
187
+ # Build and launch
188
+ npm start
189
+
190
+ # Build only
191
+ npm run build
192
+ ```
193
+
194
+ ### Project Structure
195
+
196
+ ```
197
+ Rune/
198
+ bin/rune.js # CLI tool (install, new, open, list)
199
+ src/
200
+ main.ts # Electron main process
201
+ preload.ts # Preload bridge (IPC security)
202
+ channel/
203
+ rune-channel.ts # MCP channel + hooks HTTP endpoint
204
+ renderer/
205
+ src/
206
+ App.tsx # Root React component
207
+ features/
208
+ chat/ # Chat UI (input, messages, activity blocks)
209
+ terminal/ # Built-in terminal (xterm.js + node-pty)
210
+ hooks/ # IPC hooks
211
+ lib/ # Utilities
212
+ ```
213
+
214
+ ### Hooks Configuration
215
+
216
+ Rune automatically sets up Claude Code hooks in `~/.claude/settings.json`. The hooks only fire when `RUNE_CHANNEL_PORT` is set, so they don't affect standalone Claude Code usage.
217
+
218
+ Captured events: `PreToolUse`, `PostToolUse`, `PermissionRequest`, `UserPromptSubmit`, `Stop`, `Notification`, `SessionStart`, `SessionEnd`.
219
+
220
+ ---
221
+
222
+ ## Important Notice
223
+
224
+ > **Rune is currently in early development.** The MCP channel (`rune-channel`) loads via Claude Code's `--dangerously-load-development-channels` flag. This is a development-only feature and may change in future Claude Code releases. Use at your own discretion.
225
+
226
+ ---
227
+
228
+ ## Troubleshooting
229
+
230
+ ### "Channel disconnected"
231
+
232
+ The Claude Code CLI isn't running. It should start automatically via the terminal. If not:
233
+
234
+ ```bash
235
+ cd /your/project/folder
236
+ RUNE_CHANNEL_PORT=<port> claude --permission-mode auto --enable-auto-mode
237
+ ```
238
+
239
+ ### Quick Action doesn't appear
240
+
241
+ Open **System Settings** → **Privacy & Security** → **Extensions** → **Finder** and enable **New Rune**.
242
+
243
+ ---
244
+
245
+ ## Platform Support
246
+
247
+ | Platform | Status |
248
+ |----------|--------|
249
+ | macOS | Supported |
250
+ | Windows | Coming soon |
251
+ | Linux | Coming soon |
252
+
253
+ ---
254
+
255
+ ## License
256
+
257
+ MIT