@ao_zorin/zocket 1.0.0 → 1.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 +22 -22
- package/dist/zocket.js +2313 -0
- package/docs/AI_AUTODEPLOY.md +9 -13
- package/docs/GIT_NPM_RELEASE.md +44 -0
- package/docs/INSTALL.md +43 -158
- package/docs/SOURCES.md +29 -0
- package/package.json +49 -37
- package/scripts/install-zocket.ps1 +27 -69
- package/scripts/install-zocket.sh +144 -93
- package/bin/zocket-setup.cjs +0 -12
- package/bin/zocket.cjs +0 -174
- package/pyproject.toml +0 -29
- package/scripts/ai-autodeploy.py +0 -127
- package/zocket/__init__.py +0 -2
- package/zocket/__main__.py +0 -5
- package/zocket/audit.py +0 -76
- package/zocket/auth.py +0 -34
- package/zocket/autostart.py +0 -281
- package/zocket/backup.py +0 -33
- package/zocket/cli.py +0 -655
- package/zocket/config_store.py +0 -68
- package/zocket/crypto.py +0 -158
- package/zocket/harden.py +0 -136
- package/zocket/i18n.py +0 -216
- package/zocket/mcp_server.py +0 -249
- package/zocket/paths.py +0 -50
- package/zocket/runner.py +0 -108
- package/zocket/templates/index.html +0 -1062
- package/zocket/templates/login.html +0 -244
- package/zocket/vault.py +0 -331
- package/zocket/web.py +0 -490
package/docs/AI_AUTODEPLOY.md
CHANGED
|
@@ -6,22 +6,22 @@ This is the file you can send to an AI coding agent so it can deploy zocket end-
|
|
|
6
6
|
|
|
7
7
|
If this repo is already present locally:
|
|
8
8
|
```bash
|
|
9
|
-
|
|
9
|
+
bash scripts/install-zocket.sh --source local
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
If only the file is available, the script will
|
|
12
|
+
If only the file is available, the script will fetch and run the platform installer:
|
|
13
|
+
```bash
|
|
14
|
+
curl -fsSL https://raw.githubusercontent.com/aozorin/zocket/main/scripts/install-zocket.sh | bash
|
|
15
|
+
```
|
|
13
16
|
|
|
14
17
|
## Agent task prompt (copy/paste)
|
|
15
18
|
|
|
16
19
|
```text
|
|
17
20
|
Deploy zocket on this machine with secure defaults:
|
|
18
21
|
1) Detect OS and shell.
|
|
19
|
-
2) Run
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
--mcp-port 18002
|
|
23
|
-
--mcp-mode metadata
|
|
24
|
-
--autostart user (Linux/macOS) or enabled startup task (Windows)
|
|
22
|
+
2) Run installer:
|
|
23
|
+
- Linux/macOS: curl -fsSL https://raw.githubusercontent.com/aozorin/zocket/main/scripts/install-zocket.sh | bash
|
|
24
|
+
- Windows: irm https://raw.githubusercontent.com/aozorin/zocket/main/scripts/install-zocket.ps1 | iex
|
|
25
25
|
3) Verify:
|
|
26
26
|
- web panel on http://127.0.0.1:18001
|
|
27
27
|
- MCP SSE endpoint on http://127.0.0.1:18002/sse (Claude Code)
|
|
@@ -33,11 +33,7 @@ Deploy zocket on this machine with secure defaults:
|
|
|
33
33
|
## Optional production profile (Linux system services)
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
|
|
37
|
-
--repo-url https://github.com/your-org/zocket.git \
|
|
38
|
-
--repo-ref main \
|
|
39
|
-
--autostart system \
|
|
40
|
-
--zocket-home /var/lib/zocket
|
|
36
|
+
bash scripts/install-zocket.sh --source git --repo-url https://github.com/aozorin/zocket.git --repo-ref main --autostart system --zocket-home /var/lib/zocket
|
|
41
37
|
```
|
|
42
38
|
|
|
43
39
|
## Post-deploy checklist for agent
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Git + npm Release Guide
|
|
2
|
+
|
|
3
|
+
## 1) Initialize git project
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git init
|
|
7
|
+
git add .
|
|
8
|
+
git commit -m "feat: zocket initial release"
|
|
9
|
+
git branch -M main
|
|
10
|
+
git remote add origin git@github.com:your-org/zocket.git
|
|
11
|
+
git push -u origin main
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 2) Pre-release checks
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bash scripts/release-check.sh
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 3) Publish npm package
|
|
21
|
+
|
|
22
|
+
Update metadata in `package.json`:
|
|
23
|
+
- `name`
|
|
24
|
+
- `repository.url`
|
|
25
|
+
- `homepage`
|
|
26
|
+
- `bugs.url`
|
|
27
|
+
|
|
28
|
+
Then:
|
|
29
|
+
```bash
|
|
30
|
+
npm login
|
|
31
|
+
npm publish --access public
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 4) Tag release
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git tag -a v1.0.0 -m "zocket v1.0.0"
|
|
38
|
+
git push origin v1.0.0
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 5) Optional GitHub Release artifacts
|
|
42
|
+
|
|
43
|
+
Upload:
|
|
44
|
+
- npm package tarball from `npm pack`
|
package/docs/INSTALL.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
# Install Guide (Windows / Linux / macOS)
|
|
2
2
|
|
|
3
|
-
This guide installs **zocket** as:
|
|
3
|
+
This guide installs **zocket** (Node.js) as:
|
|
4
4
|
- local web panel on `127.0.0.1:18001`
|
|
5
5
|
- MCP SSE server on `127.0.0.1:18002/sse` (Claude Code)
|
|
6
6
|
- MCP streamable HTTP server on `127.0.0.1:18003/mcp` (Codex)
|
|
7
|
-
- optional MCP stdio server for local CLI use
|
|
8
7
|
|
|
9
8
|
## 1) Quick Install (recommended)
|
|
10
9
|
|
|
11
10
|
### Linux and macOS
|
|
12
11
|
```bash
|
|
13
|
-
curl -fsSL https://raw.githubusercontent.com/
|
|
12
|
+
curl -fsSL https://raw.githubusercontent.com/aozorin/zocket/main/scripts/install-zocket.sh | bash
|
|
14
13
|
```
|
|
15
14
|
|
|
16
15
|
If you run from a local clone:
|
|
@@ -20,7 +19,7 @@ bash scripts/install-zocket.sh --source local
|
|
|
20
19
|
|
|
21
20
|
### Windows (PowerShell)
|
|
22
21
|
```powershell
|
|
23
|
-
irm https://raw.githubusercontent.com/
|
|
22
|
+
irm https://raw.githubusercontent.com/aozorin/zocket/main/scripts/install-zocket.ps1 | iex
|
|
24
23
|
```
|
|
25
24
|
|
|
26
25
|
If you run from a local clone:
|
|
@@ -32,16 +31,15 @@ powershell -ExecutionPolicy Bypass -File .\scripts\install-zocket.ps1 -Source Lo
|
|
|
32
31
|
|
|
33
32
|
### Debian/Ubuntu and Debian-based
|
|
34
33
|
Installer auto-installs:
|
|
35
|
-
- `
|
|
36
|
-
- `
|
|
37
|
-
- `python3-pip`
|
|
34
|
+
- `nodejs`
|
|
35
|
+
- `npm`
|
|
38
36
|
- `git`
|
|
39
37
|
- `curl`
|
|
40
38
|
|
|
41
39
|
Equivalent manual install:
|
|
42
40
|
```bash
|
|
43
41
|
sudo apt-get update
|
|
44
|
-
sudo apt-get install -y
|
|
42
|
+
sudo apt-get install -y nodejs npm git curl
|
|
45
43
|
```
|
|
46
44
|
|
|
47
45
|
### Other Linux distros
|
|
@@ -52,192 +50,85 @@ Installer supports:
|
|
|
52
50
|
- `apk` (Alpine)
|
|
53
51
|
|
|
54
52
|
If your distro is unsupported, install manually:
|
|
55
|
-
-
|
|
56
|
-
- `
|
|
57
|
-
- `venv`
|
|
53
|
+
- Node.js `>=18`
|
|
54
|
+
- `npm`
|
|
58
55
|
- `git`
|
|
59
56
|
|
|
60
57
|
## 3) macOS details
|
|
61
58
|
|
|
62
59
|
Installer uses Homebrew when dependencies are missing:
|
|
63
60
|
```bash
|
|
64
|
-
brew install
|
|
61
|
+
brew install node git curl
|
|
65
62
|
```
|
|
66
63
|
|
|
67
64
|
## 4) Windows details
|
|
68
65
|
|
|
69
66
|
Requirements:
|
|
70
|
-
-
|
|
67
|
+
- Node.js 18+ (recommended from `nodejs.org` or `winget`)
|
|
71
68
|
- Git for Windows
|
|
72
69
|
|
|
73
|
-
|
|
70
|
+
Autostart (enabled by default):
|
|
74
71
|
```powershell
|
|
75
|
-
powershell -ExecutionPolicy Bypass -File .\scripts\install-zocket.ps1
|
|
72
|
+
powershell -ExecutionPolicy Bypass -File .\scripts\install-zocket.ps1
|
|
76
73
|
```
|
|
77
74
|
|
|
78
|
-
This creates scheduled
|
|
79
|
-
- `
|
|
80
|
-
- `ZocketMcpHttp`
|
|
81
|
-
|
|
82
|
-
## 5) NPM package usage
|
|
83
|
-
|
|
84
|
-
This repo now includes an npm wrapper package.
|
|
75
|
+
This creates scheduled task:
|
|
76
|
+
- `Zocket`
|
|
85
77
|
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
zocket setup
|
|
78
|
+
Disable autostart:
|
|
79
|
+
```powershell
|
|
80
|
+
powershell -ExecutionPolicy Bypass -File .\scripts\install-zocket.ps1 -EnableAutostart:$false
|
|
90
81
|
```
|
|
91
82
|
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
npm i -g github:your-org/zocket
|
|
95
|
-
```
|
|
83
|
+
## 5) NPM package usage
|
|
96
84
|
|
|
97
|
-
|
|
85
|
+
Global install from npm:
|
|
98
86
|
```bash
|
|
99
|
-
zocket
|
|
87
|
+
npm i -g @ao_zorin/zocket
|
|
100
88
|
```
|
|
101
89
|
|
|
102
90
|
Then use normal CLI:
|
|
103
91
|
```bash
|
|
104
92
|
zocket init
|
|
105
|
-
zocket
|
|
106
|
-
zocket mcp --transport sse --mode metadata --host 127.0.0.1 --port 18002
|
|
107
|
-
zocket mcp --transport streamable-http --mode metadata --host 127.0.0.1 --port 18003
|
|
93
|
+
zocket start --host 127.0.0.1 --web-port 18001 --mcp-port 18002 --mcp-stream-port 18003 --mode admin
|
|
108
94
|
```
|
|
109
95
|
|
|
110
96
|
## 6) Systemd hardening on Linux (production)
|
|
111
97
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
--service-user zocketd \
|
|
115
|
-
--zocket-home /var/lib/zocket \
|
|
116
|
-
--web-port 18001 \
|
|
117
|
-
--mcp-host 127.0.0.1 \
|
|
118
|
-
--mcp-port 18002 \
|
|
119
|
-
--mcp-mode metadata
|
|
120
|
-
```
|
|
98
|
+
If you install with `--autostart system`, the installer creates and enables:
|
|
99
|
+
- `zocket.service` (web + SSE + streamable HTTP)
|
|
121
100
|
|
|
122
101
|
Check:
|
|
123
102
|
```bash
|
|
124
|
-
systemctl status zocket
|
|
125
|
-
systemctl status zocket-mcp-http.service --no-pager
|
|
126
|
-
systemctl status zocket-mcp-http-streamable.service --no-pager
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### Optional: systemd unit for Codex (streamable HTTP on 18003)
|
|
130
|
-
|
|
131
|
-
Create `/etc/systemd/system/zocket-mcp-http-streamable.service`:
|
|
132
|
-
```ini
|
|
133
|
-
[Unit]
|
|
134
|
-
Description=Zocket MCP HTTP Streamable (system)
|
|
135
|
-
After=network-online.target
|
|
136
|
-
Wants=network-online.target
|
|
137
|
-
|
|
138
|
-
[Service]
|
|
139
|
-
Type=simple
|
|
140
|
-
User=zocketd
|
|
141
|
-
Group=zocketd
|
|
142
|
-
Environment=ZOCKET_HOME=/var/lib/zocket
|
|
143
|
-
ExecStart=/usr/bin/python3 -m zocket mcp --transport streamable-http --mode metadata --host 127.0.0.1 --port 18003
|
|
144
|
-
Restart=on-failure
|
|
145
|
-
RestartSec=2
|
|
146
|
-
NoNewPrivileges=true
|
|
147
|
-
PrivateTmp=true
|
|
148
|
-
ProtectSystem=strict
|
|
149
|
-
ProtectHome=read-only
|
|
150
|
-
ProtectKernelTunables=true
|
|
151
|
-
ProtectControlGroups=true
|
|
152
|
-
LockPersonality=true
|
|
153
|
-
MemoryDenyWriteExecute=true
|
|
154
|
-
ReadWritePaths=/var/lib/zocket
|
|
155
|
-
|
|
156
|
-
[Install]
|
|
157
|
-
WantedBy=multi-user.target
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Enable and start:
|
|
161
|
-
```bash
|
|
162
|
-
sudo systemctl daemon-reload
|
|
163
|
-
sudo systemctl enable --now zocket-mcp-http-streamable.service
|
|
103
|
+
systemctl status zocket.service --no-pager
|
|
164
104
|
```
|
|
165
105
|
|
|
166
106
|
### Linux user-level autostart (no root)
|
|
167
107
|
```bash
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
zocket autostart status --target both
|
|
108
|
+
systemctl --user enable --now zocket.service
|
|
109
|
+
systemctl --user status zocket.service --no-pager
|
|
171
110
|
```
|
|
172
111
|
|
|
173
|
-
### macOS launchd autostart (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
```xml
|
|
178
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
179
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
180
|
-
<plist version="1.0">
|
|
181
|
-
<dict>
|
|
182
|
-
<key>Label</key><string>dev.zocket.web</string>
|
|
183
|
-
<key>ProgramArguments</key>
|
|
184
|
-
<array>
|
|
185
|
-
<string>/Users/YOUR_USER/.local/share/zocket/venv/bin/python3</string>
|
|
186
|
-
<string>-m</string><string>zocket</string>
|
|
187
|
-
<string>web</string><string>--host</string><string>127.0.0.1</string>
|
|
188
|
-
<string>--port</string><string>18001</string>
|
|
189
|
-
</array>
|
|
190
|
-
<key>EnvironmentVariables</key>
|
|
191
|
-
<dict>
|
|
192
|
-
<key>ZOCKET_HOME</key><string>/Users/YOUR_USER/.zocket</string>
|
|
193
|
-
</dict>
|
|
194
|
-
<key>RunAtLoad</key><true/>
|
|
195
|
-
<key>KeepAlive</key><true/>
|
|
196
|
-
</dict>
|
|
197
|
-
</plist>
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
SSE MCP (`dev.zocket.mcp-sse.plist`):
|
|
201
|
-
```xml
|
|
202
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
203
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
204
|
-
<plist version="1.0">
|
|
205
|
-
<dict>
|
|
206
|
-
<key>Label</key><string>dev.zocket.mcp-sse</string>
|
|
207
|
-
<key>ProgramArguments</key>
|
|
208
|
-
<array>
|
|
209
|
-
<string>/Users/YOUR_USER/.local/share/zocket/venv/bin/python3</string>
|
|
210
|
-
<string>-m</string><string>zocket</string>
|
|
211
|
-
<string>mcp</string><string>--transport</string><string>sse</string>
|
|
212
|
-
<string>--mode</string><string>metadata</string>
|
|
213
|
-
<string>--host</string><string>127.0.0.1</string>
|
|
214
|
-
<string>--port</string><string>18002</string>
|
|
215
|
-
</array>
|
|
216
|
-
<key>EnvironmentVariables</key>
|
|
217
|
-
<dict>
|
|
218
|
-
<key>ZOCKET_HOME</key><string>/Users/YOUR_USER/.zocket</string>
|
|
219
|
-
</dict>
|
|
220
|
-
<key>RunAtLoad</key><true/>
|
|
221
|
-
<key>KeepAlive</key><true/>
|
|
222
|
-
</dict>
|
|
223
|
-
</plist>
|
|
224
|
-
```
|
|
112
|
+
### macOS launchd autostart (installed by script)
|
|
113
|
+
Installer creates and loads:
|
|
114
|
+
- `~/Library/LaunchAgents/dev.zocket.plist`
|
|
225
115
|
|
|
226
|
-
|
|
116
|
+
Manual example:
|
|
227
117
|
```xml
|
|
228
118
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
229
119
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
230
120
|
<plist version="1.0">
|
|
231
121
|
<dict>
|
|
232
|
-
<key>Label</key><string>dev.zocket
|
|
122
|
+
<key>Label</key><string>dev.zocket</string>
|
|
233
123
|
<key>ProgramArguments</key>
|
|
234
124
|
<array>
|
|
235
|
-
<string>/
|
|
236
|
-
<string
|
|
237
|
-
<string>mcp</string><string>--transport</string><string>streamable-http</string>
|
|
238
|
-
<string>--mode</string><string>metadata</string>
|
|
125
|
+
<string>/usr/local/bin/zocket</string>
|
|
126
|
+
<string>start</string>
|
|
239
127
|
<string>--host</string><string>127.0.0.1</string>
|
|
240
|
-
<string>--port</string><string>
|
|
128
|
+
<string>--web-port</string><string>18001</string>
|
|
129
|
+
<string>--mcp-port</string><string>18002</string>
|
|
130
|
+
<string>--mcp-stream-port</string><string>18003</string>
|
|
131
|
+
<string>--mode</string><string>admin</string>
|
|
241
132
|
</array>
|
|
242
133
|
<key>EnvironmentVariables</key>
|
|
243
134
|
<dict>
|
|
@@ -249,11 +140,9 @@ Streamable HTTP MCP (`dev.zocket.mcp-streamable.plist`):
|
|
|
249
140
|
</plist>
|
|
250
141
|
```
|
|
251
142
|
|
|
252
|
-
Load
|
|
143
|
+
Load service:
|
|
253
144
|
```bash
|
|
254
|
-
launchctl load ~/Library/LaunchAgents/dev.zocket.
|
|
255
|
-
launchctl load ~/Library/LaunchAgents/dev.zocket.mcp-sse.plist
|
|
256
|
-
launchctl load ~/Library/LaunchAgents/dev.zocket.mcp-streamable.plist
|
|
145
|
+
launchctl load ~/Library/LaunchAgents/dev.zocket.plist
|
|
257
146
|
```
|
|
258
147
|
|
|
259
148
|
### Windows autostart (Task Scheduler)
|
|
@@ -263,13 +152,9 @@ powershell -ExecutionPolicy Bypass -File .\scripts\install-zocket.ps1 -EnableAut
|
|
|
263
152
|
```
|
|
264
153
|
|
|
265
154
|
Or create manually:
|
|
266
|
-
- task `
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
- actions:
|
|
270
|
-
- `python -m zocket web --host 127.0.0.1 --port 18001`
|
|
271
|
-
- `python -m zocket mcp --transport sse --mode metadata --host 127.0.0.1 --port 18002`
|
|
272
|
-
- `python -m zocket mcp --transport streamable-http --mode metadata --host 127.0.0.1 --port 18003`
|
|
155
|
+
- task `Zocket` on logon
|
|
156
|
+
- action:
|
|
157
|
+
- `zocket start --host 127.0.0.1 --web-port 18001 --mcp-port 18002 --mcp-stream-port 18003 --mode admin`
|
|
273
158
|
|
|
274
159
|
## 7) First web open
|
|
275
160
|
|
|
@@ -284,5 +169,5 @@ Open `http://127.0.0.1:18001` and choose one:
|
|
|
284
169
|
curl -I http://127.0.0.1:18001/login
|
|
285
170
|
curl -I http://127.0.0.1:18002/sse
|
|
286
171
|
curl -I http://127.0.0.1:18003/mcp
|
|
287
|
-
zocket mcp --
|
|
172
|
+
zocket start --host 127.0.0.1 --web-port 18001 --mcp-port 18002 --mcp-stream-port 18003 --mode admin
|
|
288
173
|
```
|
package/docs/SOURCES.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# External References Used
|
|
2
|
+
|
|
3
|
+
Official docs used while preparing client/install instructions:
|
|
4
|
+
|
|
5
|
+
- OpenAI Codex CLI MCP docs:
|
|
6
|
+
- https://platform.openai.com/docs/codex/mcp
|
|
7
|
+
- https://developers.openai.com/codex/cli
|
|
8
|
+
- Claude Code MCP docs:
|
|
9
|
+
- https://docs.anthropic.com/en/docs/claude-code/mcp
|
|
10
|
+
- Claude Desktop MCP setup/help:
|
|
11
|
+
- https://support.claude.com/en/articles/12304248-setting-up-remote-mcp-servers-in-claude-desktop
|
|
12
|
+
- OpenCode docs:
|
|
13
|
+
- https://opencode.ai/docs/
|
|
14
|
+
- https://opencode.ai/docs/config
|
|
15
|
+
- https://opencode.ai/docs/providers
|
|
16
|
+
- https://opencode.ai/docs/mcp-servers
|
|
17
|
+
- Qwen Code docs:
|
|
18
|
+
- https://qwenlm.github.io/qwen-code-docs/getting-started/
|
|
19
|
+
- https://qwenlm.github.io/qwen-code-docs/advanced/model-providers/
|
|
20
|
+
- https://qwenlm.github.io/qwen-code-docs/advanced/mcp/
|
|
21
|
+
- Windsurf MCP docs:
|
|
22
|
+
- https://docs.windsurf.com/windsurf/cascade/mcp
|
|
23
|
+
- Antigravity MCP setup docs:
|
|
24
|
+
- https://docs.cloud.google.com/vertex-ai/generative-ai/docs/agent-engine/mcp/use-with-antigravity
|
|
25
|
+
- https://firebase.google.com/docs/studio/set-up-mcp-server
|
|
26
|
+
- Ollama docs:
|
|
27
|
+
- https://docs.ollama.com/
|
|
28
|
+
- Hugging Face local/openai-compatible docs:
|
|
29
|
+
- https://huggingface.co/docs/text-generation-inference/main/en/messages_api
|
package/package.json
CHANGED
|
@@ -1,52 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ao_zorin/zocket",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"private": false,
|
|
7
|
-
"type": "commonjs",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Local encrypted vault + web panel + MCP server for AI agent workflows",
|
|
5
|
+
"type": "module",
|
|
8
6
|
"bin": {
|
|
9
|
-
"zocket": "
|
|
10
|
-
|
|
7
|
+
"zocket": "dist/zocket.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsup",
|
|
11
|
+
"dev": "tsup --watch",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:watch": "vitest",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@anthropic-ai/sdk": "^0.78.0",
|
|
19
|
+
"@hono/node-server": "^1.13.0",
|
|
20
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
21
|
+
"commander": "^12.0.0",
|
|
22
|
+
"hono": "^4.0.0",
|
|
23
|
+
"proper-lockfile": "^4.1.2",
|
|
24
|
+
"zod": "^3.22.0"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"keytar": "^7.0.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"keytar": {
|
|
31
|
+
"optional": true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@anthropic-ai/tokenizer": "^0.0.4",
|
|
36
|
+
"@types/node": "^20.0.0",
|
|
37
|
+
"@types/proper-lockfile": "^4.1.4",
|
|
38
|
+
"js-tiktoken": "^1.0.21",
|
|
39
|
+
"tsup": "^8.0.0",
|
|
40
|
+
"typescript": "^5.0.0",
|
|
41
|
+
"vitest": "^2.0.0"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18.0.0"
|
|
11
45
|
},
|
|
12
46
|
"files": [
|
|
13
|
-
"
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE",
|
|
14
50
|
"docs/AI_AUTODEPLOY.md",
|
|
15
51
|
"docs/CLIENTS_MCP.md",
|
|
52
|
+
"docs/GIT_NPM_RELEASE.md",
|
|
16
53
|
"docs/INSTALL.md",
|
|
17
54
|
"docs/LOCAL_MODELS.md",
|
|
18
|
-
"
|
|
55
|
+
"docs/SOURCES.md",
|
|
19
56
|
"scripts/install-zocket.sh",
|
|
20
|
-
"scripts/install-zocket.ps1"
|
|
21
|
-
"zocket/*.py",
|
|
22
|
-
"zocket/templates/*.html",
|
|
23
|
-
"pyproject.toml",
|
|
24
|
-
"README.md",
|
|
25
|
-
"LICENSE"
|
|
26
|
-
],
|
|
27
|
-
"engines": {
|
|
28
|
-
"node": ">=18"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"test:python": "PYTHONPATH=. pytest -q",
|
|
32
|
-
"smoke:npm": "node ./bin/zocket.cjs --help"
|
|
33
|
-
},
|
|
34
|
-
"keywords": [
|
|
35
|
-
"mcp",
|
|
36
|
-
"model-context-protocol",
|
|
37
|
-
"secrets",
|
|
38
|
-
"vault",
|
|
39
|
-
"cli",
|
|
40
|
-
"agents",
|
|
41
|
-
"codex",
|
|
42
|
-
"claude"
|
|
57
|
+
"scripts/install-zocket.ps1"
|
|
43
58
|
],
|
|
59
|
+
"license": "MIT",
|
|
44
60
|
"repository": {
|
|
45
61
|
"type": "git",
|
|
46
|
-
"url": "https://github.com/aozorin/zocket.git"
|
|
47
|
-
},
|
|
48
|
-
"homepage": "https://github.com/aozorin/zocket#readme",
|
|
49
|
-
"bugs": {
|
|
50
|
-
"url": "https://github.com/aozorin/zocket/issues"
|
|
62
|
+
"url": "git+https://github.com/aozorin/zocket.git"
|
|
51
63
|
}
|
|
52
64
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
Param(
|
|
2
|
-
[ValidateSet("Auto", "Local", "Git", "
|
|
2
|
+
[ValidateSet("Auto", "Local", "Git", "Npm")]
|
|
3
3
|
[string]$Source = "Auto",
|
|
4
|
-
[string]$RepoUrl = "https://github.com/
|
|
4
|
+
[string]$RepoUrl = "https://github.com/aozorin/zocket.git",
|
|
5
5
|
[string]$RepoRef = "main",
|
|
6
|
-
[string]$InstallRoot = "$env:LOCALAPPDATA\zocket",
|
|
7
6
|
[string]$ZocketHome = "$env:USERPROFILE\.zocket",
|
|
8
7
|
[ValidateSet("en", "ru")]
|
|
9
8
|
[string]$Lang = "en",
|
|
@@ -11,105 +10,64 @@ Param(
|
|
|
11
10
|
[int]$McpPort = 18002,
|
|
12
11
|
[int]$McpStreamPort = 18003,
|
|
13
12
|
[ValidateSet("metadata", "admin")]
|
|
14
|
-
[string]$McpMode = "
|
|
15
|
-
[
|
|
13
|
+
[string]$McpMode = "admin",
|
|
14
|
+
[bool]$EnableAutostart = $true
|
|
16
15
|
)
|
|
17
16
|
|
|
18
17
|
$ErrorActionPreference = "Stop"
|
|
19
18
|
|
|
20
|
-
function
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
if (Get-Command python -ErrorAction SilentlyContinue) {
|
|
25
|
-
return @{Cmd = "python"; Prefix = @()}
|
|
19
|
+
function Ensure-Dir([string]$Path) {
|
|
20
|
+
if (-not (Test-Path -LiteralPath $Path)) {
|
|
21
|
+
New-Item -ItemType Directory -Path $Path | Out-Null
|
|
26
22
|
}
|
|
27
|
-
throw "Python 3.10+ not found. Install Python and rerun."
|
|
28
23
|
}
|
|
29
24
|
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
throw "Command failed: $Cmd $($Args -join ' ')"
|
|
25
|
+
function Ensure-Node {
|
|
26
|
+
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
|
27
|
+
throw "Node.js not found. Install Node.js 18+ and rerun."
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
function Ensure-Dir([string]$Path) {
|
|
38
|
-
if (-not (Test-Path -LiteralPath $Path)) {
|
|
39
|
-
New-Item -ItemType Directory -Path $Path | Out-Null
|
|
29
|
+
if (-not (Get-Command npm -ErrorAction SilentlyContinue)) {
|
|
30
|
+
throw "npm not found. Install Node.js 18+ (includes npm) and rerun."
|
|
40
31
|
}
|
|
41
32
|
}
|
|
42
33
|
|
|
34
|
+
Ensure-Node
|
|
35
|
+
|
|
43
36
|
$repoRoot = Split-Path -Parent $PSScriptRoot
|
|
44
37
|
if ($Source -eq "Auto") {
|
|
45
|
-
if (Test-Path -LiteralPath (Join-Path $repoRoot "
|
|
38
|
+
if (Test-Path -LiteralPath (Join-Path $repoRoot "package.json")) {
|
|
46
39
|
$Source = "Local"
|
|
47
40
|
} else {
|
|
48
|
-
$Source = "
|
|
41
|
+
$Source = "Npm"
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
44
|
|
|
52
|
-
Ensure-Dir $InstallRoot
|
|
53
|
-
$srcDir = Join-Path $InstallRoot "src"
|
|
54
|
-
|
|
55
|
-
$pkgSource = $null
|
|
56
45
|
if ($Source -eq "Local") {
|
|
57
|
-
|
|
46
|
+
npm i -g $repoRoot
|
|
58
47
|
} elseif ($Source -eq "Git") {
|
|
59
|
-
|
|
60
|
-
Run-Step "git" @("-C", $srcDir, "fetch", "--all", "--tags")
|
|
61
|
-
Run-Step "git" @("-C", $srcDir, "checkout", $RepoRef)
|
|
62
|
-
Run-Step "git" @("-C", $srcDir, "pull", "--ff-only")
|
|
63
|
-
} else {
|
|
64
|
-
if (Test-Path -LiteralPath $srcDir) {
|
|
65
|
-
Remove-Item -LiteralPath $srcDir -Recurse -Force
|
|
66
|
-
}
|
|
67
|
-
Run-Step "git" @("clone", "--depth", "1", "--branch", $RepoRef, $RepoUrl, $srcDir)
|
|
68
|
-
}
|
|
69
|
-
$pkgSource = $srcDir
|
|
48
|
+
npm i -g "git+$RepoUrl#$RepoRef"
|
|
70
49
|
} else {
|
|
71
|
-
|
|
50
|
+
npm i -g @ao_zorin/zocket
|
|
72
51
|
}
|
|
73
52
|
|
|
74
|
-
$
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
$zocketExe = Join-Path $venvDir "Scripts\zocket.exe"
|
|
78
|
-
|
|
79
|
-
Run-Step $py.Cmd ($py.Prefix + @("-m", "venv", $venvDir))
|
|
80
|
-
Run-Step $venvPy @("-m", "pip", "install", "--upgrade", "pip", "setuptools", "wheel")
|
|
81
|
-
|
|
82
|
-
if ($Source -eq "PyPI") {
|
|
83
|
-
Run-Step $venvPy @("-m", "pip", "install", "--upgrade", $pkgSource)
|
|
84
|
-
} else {
|
|
85
|
-
Run-Step $venvPy @("-m", "pip", "install", "--upgrade", $pkgSource)
|
|
53
|
+
$zocketBin = (Get-Command zocket).Source
|
|
54
|
+
if (-not $zocketBin) {
|
|
55
|
+
throw "zocket binary not found after install"
|
|
86
56
|
}
|
|
87
57
|
|
|
88
58
|
Ensure-Dir $ZocketHome
|
|
89
59
|
$env:ZOCKET_HOME = $ZocketHome
|
|
90
60
|
|
|
91
|
-
|
|
92
|
-
Run-Step $zocketExe @("init")
|
|
93
|
-
}
|
|
94
|
-
Run-Step $zocketExe @("config", "set-language", $Lang)
|
|
61
|
+
& $zocketBin init | Out-Null
|
|
95
62
|
|
|
96
63
|
if ($EnableAutostart) {
|
|
97
|
-
$
|
|
98
|
-
$
|
|
99
|
-
$
|
|
100
|
-
|
|
101
|
-
$webCmd = "`"$venvPy`" -m zocket web --host 127.0.0.1 --port $WebPort"
|
|
102
|
-
$mcpSseCmd = "`"$venvPy`" -m zocket mcp --transport sse --mode $McpMode --host 127.0.0.1 --port $McpPort"
|
|
103
|
-
$mcpStreamCmd = "`"$venvPy`" -m zocket mcp --transport streamable-http --mode $McpMode --host 127.0.0.1 --port $McpStreamPort"
|
|
104
|
-
|
|
105
|
-
schtasks /Create /F /SC ONLOGON /RL LIMITED /TN $webTask /TR $webCmd | Out-Null
|
|
106
|
-
schtasks /Create /F /SC ONLOGON /RL LIMITED /TN $mcpSseTask /TR $mcpSseCmd | Out-Null
|
|
107
|
-
schtasks /Create /F /SC ONLOGON /RL LIMITED /TN $mcpStreamTask /TR $mcpStreamCmd | Out-Null
|
|
64
|
+
$taskName = "Zocket"
|
|
65
|
+
$cmd = "\"$zocketBin\" start --host 127.0.0.1 --web-port $WebPort --mcp-port $McpPort --mcp-stream-port $McpStreamPort --mode $McpMode"
|
|
66
|
+
schtasks /Create /F /SC ONLOGON /RL LIMITED /TN $taskName /TR $cmd | Out-Null
|
|
108
67
|
}
|
|
109
68
|
|
|
110
69
|
Write-Output "zocket installed successfully."
|
|
111
|
-
Write-Output "
|
|
112
|
-
Write-Output "zocket: $zocketExe"
|
|
70
|
+
Write-Output "zocket: $zocketBin"
|
|
113
71
|
Write-Output "ZOCKET_HOME=$ZocketHome"
|
|
114
72
|
Write-Output "web panel: http://127.0.0.1:$WebPort"
|
|
115
73
|
Write-Output "mcp sse: http://127.0.0.1:$McpPort/sse"
|