openmagic 0.31.0 → 0.31.2
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 +15 -7
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/toolbar/index.global.js +56 -48
- package/dist/toolbar/index.global.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,17 +25,25 @@ No framework plugin. No IDE extension. No account. Bring your own API key.
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
<div align="center">
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
28
36
|
## Quick Start
|
|
29
37
|
|
|
30
38
|
```bash
|
|
31
39
|
# 1. Start your dev server as usual
|
|
32
40
|
npm run dev
|
|
33
41
|
|
|
34
|
-
# 2.
|
|
42
|
+
# 2. In your project folder, run OpenMagic (auto-detects your dev server)
|
|
35
43
|
npx openmagic@latest
|
|
36
44
|
```
|
|
37
45
|
|
|
38
|
-
A proxied version of your app opens with the AI toolbar overlaid. That is it.
|
|
46
|
+
Run `npx openmagic@latest` from your project folder so it can find your source files and dev server. A proxied version of your app opens with the AI toolbar overlaid. That is it.
|
|
39
47
|
|
|
40
48
|
---
|
|
41
49
|
|
|
@@ -77,7 +85,7 @@ OpenMagic is a single-port reverse proxy. It sits between your browser and your
|
|
|
77
85
|
+-----------------------+
|
|
78
86
|
```
|
|
79
87
|
|
|
80
|
-
1. **Proxy** -- All requests forward to your dev server. HTML responses get
|
|
88
|
+
1. **Proxy** -- All requests forward to your dev server. HTML responses get the toolbar `<script>` tag appended automatically.
|
|
81
89
|
2. **Toolbar** -- A Shadow DOM Web Component. Fully isolated from your app's styles.
|
|
82
90
|
3. **Server** -- Local Node.js process handling file I/O and proxying LLM calls. API keys never leave your machine.
|
|
83
91
|
4. **HMR** -- When the AI modifies source files, your dev server's hot module replacement picks up changes automatically.
|
|
@@ -129,7 +137,7 @@ Stop with `Ctrl+C`. No files modified. No dependencies added. No traces.
|
|
|
129
137
|
| `-p, --port <port>` | Dev server port to proxy | Auto-detect |
|
|
130
138
|
| `-l, --listen <port>` | OpenMagic proxy port | `4567` |
|
|
131
139
|
| `-r, --root <paths...>` | Project root directories | Current directory |
|
|
132
|
-
| `--host <host>` | Dev server host | `
|
|
140
|
+
| `--host <host>` | Dev server host | `localhost` |
|
|
133
141
|
| `--no-open` | Do not auto-open browser | `false` |
|
|
134
142
|
|
|
135
143
|
### Multi-Repo Support
|
|
@@ -145,7 +153,7 @@ Settings persist in `~/.openmagic/config.json` (your home directory, never in yo
|
|
|
145
153
|
```json
|
|
146
154
|
{
|
|
147
155
|
"provider": "anthropic",
|
|
148
|
-
"model": "claude-opus-4-6
|
|
156
|
+
"model": "claude-opus-4-6",
|
|
149
157
|
"apiKey": "sk-ant-..."
|
|
150
158
|
}
|
|
151
159
|
```
|
|
@@ -162,7 +170,7 @@ npx openmagic --port 3000
|
|
|
162
170
|
|
|
163
171
|
## Security
|
|
164
172
|
|
|
165
|
-
- **Localhost only** -- The proxy and WebSocket bind to `
|
|
173
|
+
- **Localhost only** -- The proxy and WebSocket bind to `localhost`. Not accessible from the network.
|
|
166
174
|
- **Session tokens** -- Each session generates a random token. The toolbar authenticates before accessing any API.
|
|
167
175
|
- **Path sandboxing** -- File operations are restricted to configured root directories. Symlinks that escape the root are rejected.
|
|
168
176
|
- **API keys stay local** -- Keys live in `~/.openmagic/config.json`. They are proxied through the local server, never exposed to the browser or any third party.
|
|
@@ -245,7 +253,7 @@ See the repo for project structure and contribution guidelines.
|
|
|
245
253
|
|
|
246
254
|
## License
|
|
247
255
|
|
|
248
|
-
MIT -- Copyright (c)
|
|
256
|
+
MIT -- Copyright (c) 2026 Khalid Almuraee. See [LICENSE](./LICENSE) for details.
|
|
249
257
|
|
|
250
258
|
---
|
|
251
259
|
|
package/dist/cli.js
CHANGED
|
@@ -1449,7 +1449,7 @@ async function handleLlmChat(params, onChunk, onDone, onError) {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
|
|
1451
1451
|
// src/server.ts
|
|
1452
|
-
var VERSION = "0.31.
|
|
1452
|
+
var VERSION = "0.31.1";
|
|
1453
1453
|
var __dirname = dirname2(fileURLToPath(import.meta.url));
|
|
1454
1454
|
function attachOpenMagic(httpServer, roots) {
|
|
1455
1455
|
function handleRequest(req, res) {
|
|
@@ -1991,7 +1991,7 @@ process.on("uncaughtException", (err) => {
|
|
|
1991
1991
|
});
|
|
1992
1992
|
var childProcesses = [];
|
|
1993
1993
|
var lastDetectedPort = null;
|
|
1994
|
-
var VERSION2 = "0.31.
|
|
1994
|
+
var VERSION2 = "0.31.1";
|
|
1995
1995
|
function ask(question) {
|
|
1996
1996
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
1997
1997
|
return new Promise((resolve3) => {
|