higherup 1.0.1 → 2.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.
package/README.md CHANGED
@@ -1,62 +1,128 @@
1
- # Higherup
1
+ # Higherup Agent
2
2
 
3
- **Give AI agents full access to your development machine.**
3
+ <div align="center">
4
4
 
5
- A CLI agent that connects your local environment to Higherup, enabling AI platforms to execute commands, manage files, capture screens, and work autonomously.
5
+ **Connect AI coding assistants to your local development environment**
6
6
 
7
- ## Installation
7
+ [![npm version](https://img.shields.io/npm/v/higherup.svg)](https://www.npmjs.com/package/higherup)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ [Quick Start](#quick-start) • [Features](#features) • [Documentation](#documentation) • [Troubleshooting](#troubleshooting)
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## What is Higherup?
17
+
18
+ Higherup is a lightweight CLI agent that bridges cloud-based AI coding platforms with your local development environment. It enables AI assistants like Claude, GPT, and others to:
19
+
20
+ - ✅ Execute commands in your terminal
21
+ - ✅ Read and write files in your workspace
22
+ - ✅ Capture screenshots for visual debugging
23
+ - ✅ Monitor system resources
24
+ - ✅ Work autonomously with full access (optional)
25
+
26
+ **Perfect for:** AI-assisted development, remote pair programming, automated workflows, and autonomous coding agents.
27
+
28
+ ## Quick Start
29
+
30
+ ### Installation
8
31
 
9
32
  ```bash
10
- # Install globally from npm
33
+ # Install globally via npm
11
34
  npm install -g higherup
12
35
 
13
- # Or clone and build locally
14
- git clone https://github.com/hnibbo/HUagent
15
- cd agent
16
- npm install
17
- npm run build
18
- npm link
36
+ # Verify installation
37
+ higherup --version
19
38
  ```
20
39
 
21
- ## Quick Start
40
+ ### First-Time Setup
41
+
42
+ 1. **Create an account** at [higherup.ai](https://higherup.ai)
43
+ 2. **Create a workspace** in the dashboard
44
+ 3. **Copy your credentials:**
45
+ - Workspace ID (e.g., `ws_abc123...`)
46
+ - API Token (e.g., `hup_xyz789...`)
22
47
 
23
- 1. **Sign up** at [higherup.ai](https://higherup.ai) and create a workspace
24
- 2. **Copy your credentials** from the dashboard:
25
- - Workspace ID
26
- - API Token
27
- 3. **Configure the agent** (one-time setup):
48
+ 4. **Save your API token** (one-time):
28
49
 
29
50
  ```bash
30
51
  higherup config --token YOUR_API_TOKEN
31
52
  ```
32
53
 
33
- 4. **Connect your workspace**:
54
+ 5. **Connect your project:**
34
55
 
35
56
  ```bash
36
- higherup connect -w YOUR_WORKSPACE_ID -p /path/to/your/project
57
+ cd /path/to/your/project
58
+ higherup connect --workspace YOUR_WORKSPACE_ID
37
59
  ```
38
60
 
39
- 5. **Enable autonomous mode** (optional - removes all restrictions):
61
+ That's it! Your agent is now listening for commands from AI platforms.
40
62
 
41
- ```bash
42
- higherup connect -w YOUR_WORKSPACE_ID -p . --autonomous
43
- ```
63
+ ## Features
64
+
65
+ ### 🚀 Core Capabilities
66
+
67
+ | Feature | Description | Command Example |
68
+ |---------|-------------|-----------------|
69
+ | **Command Execution** | Run any shell command | `npm install`, `git status` |
70
+ | **File Operations** | Read, write, copy, move, delete | Read `package.json`, create files |
71
+ | **Directory Listing** | Browse project structure | List files recursively |
72
+ | **Screen Capture** | Take screenshots | Capture browser, IDE, terminal |
73
+ | **System Info** | Get OS, CPU, memory details | Check available resources |
74
+ | **Process Management** | List running processes | Monitor active services |
75
+ | **File Search** | Find content across files | Search for functions, imports |
76
+
77
+ ### 🎯 Advanced Features
78
+
79
+ - **Auto-Reconnection**: Automatically reconnects on network issues
80
+ - **Workspace Sandboxing**: Restricts operations to your project directory
81
+ - **Real-time Stats**: Monitor commands executed, uptime, bandwidth
82
+ - **Keyboard Shortcuts**: Quick access to help, stats, and quit
83
+ - **Streaming Output**: See command results in real-time
84
+ - **Autonomous Mode**: Remove all restrictions for full AI control
44
85
 
45
86
  ## Commands
46
87
 
47
88
  ### `higherup connect`
48
89
 
49
- Connect a local workspace to Higherup.
90
+ Start the agent and connect to Higherup service.
50
91
 
51
92
  ```bash
52
93
  higherup connect [options]
53
94
 
54
95
  Options:
55
- -w, --workspace <id> Workspace ID from dashboard (required)
56
- -p, --path <path> Local workspace path (default: current directory)
57
- -t, --token <token> API token (or use config/env var)
58
- -n, --name <name> Custom agent name for identification
59
- --autonomous Enable autonomous mode (unrestricted access)
96
+ -w, --workspace <id> Workspace ID (required)
97
+ -p, --path <path> Project path (default: current directory)
98
+ -t, --token <token> API token (or use config)
99
+ -n, --name <name> Custom agent name
100
+ --autonomous Enable unrestricted access
101
+ --auto-reconnect Auto-reconnect on disconnect (default: true)
102
+
103
+ Examples:
104
+ # Connect current directory
105
+ higherup connect -w ws_abc123
106
+
107
+ # Connect specific project
108
+ higherup connect -w ws_abc123 -p ~/projects/my-app
109
+
110
+ # Autonomous mode (full access)
111
+ higherup connect -w ws_abc123 --autonomous
112
+
113
+ # Custom agent name
114
+ higherup connect -w ws_abc123 -n "macbook-pro-dev"
115
+ ```
116
+
117
+ ### `higherup quick`
118
+
119
+ Interactive workspace selection (if you have multiple workspaces).
120
+
121
+ ```bash
122
+ higherup quick
123
+
124
+ # Prompts you to select from available workspaces
125
+ # Then connects automatically
60
126
  ```
61
127
 
62
128
  ### `higherup config`
@@ -64,132 +130,347 @@ Options:
64
130
  Manage agent configuration.
65
131
 
66
132
  ```bash
67
- # Save your API token
133
+ # Save API token
68
134
  higherup config --token YOUR_API_TOKEN
69
135
 
70
136
  # Set default workspace
71
- higherup config --workspace YOUR_WORKSPACE_ID
137
+ higherup config --workspace ws_abc123
72
138
 
73
- # Show current configuration
139
+ # Set default path
140
+ higherup config --path ~/projects/main
141
+
142
+ # View current config
74
143
  higherup config --show
144
+
145
+ # Set log level (debug, info, warn, error)
146
+ higherup config --log-level debug
75
147
  ```
76
148
 
77
149
  ### `higherup status`
78
150
 
79
- Check active agent sessions.
151
+ Check active sessions and connection status.
80
152
 
81
153
  ```bash
82
- higherup status
154
+ higherup status [options]
155
+
156
+ Options:
157
+ -v, --verbose Show detailed session info
158
+ -w, --workspace Filter by workspace ID
159
+
160
+ Examples:
161
+ higherup status
162
+ higherup status --verbose
83
163
  ```
84
164
 
85
- ## Capabilities
165
+ ### `higherup logs`
86
166
 
87
- When connected, AI agents can:
167
+ View agent logs for debugging.
88
168
 
89
- | Capability | Description |
90
- |------------|-------------|
91
- | `command_execute` | Run any shell command |
92
- | `file_read` | Read file contents |
93
- | `file_write` | Create/modify files |
94
- | `file_list` | List directory contents |
95
- | `screen_capture` | Take screenshots |
96
- | `system_info` | Get machine details (OS, CPU, memory) |
169
+ ```bash
170
+ higherup logs [options]
97
171
 
98
- ## Autonomous Mode
172
+ Options:
173
+ -n, --lines <number> Number of lines to show (default: 50)
174
+ -f, --follow Follow log output
175
+ --clear Clear all logs
176
+
177
+ Examples:
178
+ higherup logs
179
+ higherup logs -n 100
180
+ higherup logs --follow
181
+ ```
99
182
 
100
- Enable `--autonomous` to remove all restrictions:
183
+ ### `higherup doctor`
101
184
 
102
- - No command blocking
103
- - ✅ Full system access
104
- - ✅ Unrestricted file operations
105
- - ✅ Complete AI control
185
+ Diagnose common issues and check system requirements.
106
186
 
107
187
  ```bash
108
- higherup connect -w WORKSPACE_ID -p . --autonomous
188
+ higherup doctor
189
+
190
+ # Checks:
191
+ # - Node.js version
192
+ # - Network connectivity
193
+ # - API token validity
194
+ # - Screen capture tools
195
+ # - File permissions
109
196
  ```
110
197
 
111
- ## Security
112
-
113
- - All connections use HTTPS encryption
114
- - Path traversal attacks are blocked automatically
115
- - Operations are restricted to your workspace directory only
116
- - Dangerous command patterns blocked by default (unless autonomous)
117
- - API tokens can be regenerated at any time
118
-
119
- ## Screen Capture Requirements
198
+ ### `higherup init`
120
199
 
121
- - **macOS**: Built-in `screencapture` (may need Screen Recording permission)
122
- - **Windows**: PowerShell (built-in)
123
- - **Linux**: `scrot` or `imagemagick` (`import` command)
200
+ Initialize Higherup in the current directory.
124
201
 
125
202
  ```bash
126
- # Linux: Install screen capture tools
127
- sudo apt install scrot # Debian/Ubuntu
128
- sudo dnf install scrot # Fedora
203
+ higherup init
204
+
205
+ # Creates .higherup/ directory with:
206
+ # - config.json
207
+ # - .gitignore entry
208
+ # - README with setup instructions
129
209
  ```
130
210
 
131
- ## How It Works
211
+ ## Keyboard Shortcuts
132
212
 
133
- 1. Agent registers with Higherup using your API token
134
- 2. Polls the server for pending commands every 2 seconds
135
- 3. Executes commands locally in your workspace directory
136
- 4. Reports results back to the server
137
- 5. AI platforms receive command output in real-time
213
+ While the agent is running, use these shortcuts:
138
214
 
139
- ## Supported AI Platforms
215
+ - `h` - Show help
216
+ - `s` - Show session statistics
217
+ - `q` - Quit gracefully
218
+ - `Ctrl+C` - Force quit
140
219
 
141
- Works with any AI assistant that integrates with Higherup:
142
- - Claude (via MCP protocol)
143
- - GPT/ChatGPT
144
- - Lovable
145
- - Bolt
146
- - Cursor
147
- - Other AI platforms via the Higherup API
220
+ ## Security
148
221
 
149
- ## Requirements
222
+ ### Workspace Sandboxing
150
223
 
151
- - Node.js 18+
152
- - macOS, Linux, or Windows
224
+ All file operations are restricted to your workspace directory. Path traversal attempts are automatically blocked:
153
225
 
154
- ## Environment Variables
226
+ ```bash
227
+ # ✅ Allowed
228
+ /workspace/src/app.js
229
+
230
+ # ❌ Blocked
231
+ /workspace/../../../etc/passwd
232
+ ```
233
+
234
+ ### Autonomous Mode
235
+
236
+ By default, the agent has safety restrictions. Enable `--autonomous` to remove all limits:
155
237
 
156
238
  ```bash
157
- # API endpoint (defaults to Higherup service)
158
- HIGHERUP_API_URL=https://pltlcpqtivuvyeuywvql.supabase.co/functions/v1/agent-relay
239
+ higherup connect -w ws_abc123 --autonomous
240
+ ```
159
241
 
160
- # Your API token (alternative to --token flag)
161
- HIGHERUP_API_TOKEN=your_token_here
242
+ **⚠️ Warning:** Autonomous mode gives AI complete control. Only use with trusted AI platforms.
243
+
244
+ ### API Token Security
245
+
246
+ - Tokens are stored in `~/.higherup/config.json` (chmod 600)
247
+ - Never commit tokens to version control
248
+ - Regenerate tokens if compromised
249
+ - Use environment variables in CI/CD:
250
+
251
+ ```bash
252
+ export HIGHERUP_API_TOKEN=your_token
253
+ higherup connect -w ws_abc123
162
254
  ```
163
255
 
164
- ## API Integration
256
+ ## Platform Requirements
165
257
 
166
- Once connected, AI platforms can control your machine via:
258
+ ### Supported Operating Systems
167
259
 
168
- - **REST API** - Standard HTTP endpoints
169
- - **WebSocket** - Real-time streaming
170
- - **MCP Protocol** - Native AI assistant integration
260
+ - macOS (10.15+)
261
+ - Linux (Ubuntu, Debian, Fedora, Arch)
262
+ - Windows (10/11)
171
263
 
172
- See [API Documentation](https://higherup.ai/api) for details.
264
+ ### Dependencies
265
+
266
+ - **Node.js**: 18.0.0 or higher
267
+ - **Screen Capture** (optional):
268
+ - macOS: Built-in `screencapture`
269
+ - Windows: Built-in PowerShell
270
+ - Linux: `scrot` or `imagemagick`
271
+
272
+ ```bash
273
+ # Install screen capture on Linux
274
+ sudo apt install scrot # Debian/Ubuntu
275
+ sudo dnf install scrot # Fedora
276
+ sudo pacman -S scrot # Arch
277
+ ```
173
278
 
174
279
  ## Troubleshooting
175
280
 
176
281
  ### Connection Issues
177
282
 
283
+ **Problem:** `Failed to connect: Network error`
284
+
285
+ **Solutions:**
178
286
  ```bash
179
- # Check if agent can reach the server
287
+ # 1. Check internet connection
288
+ ping higherup.ai
289
+
290
+ # 2. Verify API endpoint
180
291
  curl https://pltlcpqtivuvyeuywvql.supabase.co/functions/v1/agent-relay
292
+
293
+ # 3. Check firewall settings
294
+ # Ensure port 443 (HTTPS) is open
295
+
296
+ # 4. Try with verbose logging
297
+ higherup connect -w ws_abc123 --log-level debug
298
+ ```
299
+
300
+ ### Authentication Errors
301
+
302
+ **Problem:** `Invalid API token` or `Unauthorized`
303
+
304
+ **Solutions:**
305
+ ```bash
306
+ # 1. Verify token is correct
307
+ higherup config --show
308
+
309
+ # 2. Regenerate token in dashboard
310
+ # Then update config:
311
+ higherup config --token NEW_TOKEN
312
+
313
+ # 3. Check token hasn't expired
181
314
  ```
182
315
 
183
316
  ### Screen Capture Not Working
184
317
 
185
- macOS: Grant Screen Recording permission in System Preferences
186
- Linux: Install `scrot` or `imagemagick`
318
+ **Problem:** Screenshots fail or return black screen
319
+
320
+ **Solutions:**
321
+
322
+ **macOS:**
323
+ ```bash
324
+ # Grant Screen Recording permission:
325
+ # System Preferences → Security & Privacy → Screen Recording
326
+ # Add Terminal or your terminal app
327
+ ```
328
+
329
+ **Linux:**
330
+ ```bash
331
+ # Install required tools
332
+ sudo apt install scrot imagemagick
333
+
334
+ # Test manually
335
+ scrot test.png
336
+ ```
337
+
338
+ **Windows:**
339
+ ```powershell
340
+ # Ensure PowerShell execution policy allows scripts
341
+ Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
342
+ ```
187
343
 
188
344
  ### Permission Errors
189
345
 
190
- Ensure your API token is valid and has access to the workspace.
346
+ **Problem:** `EACCES: permission denied`
347
+
348
+ **Solutions:**
349
+ ```bash
350
+ # 1. Check workspace permissions
351
+ ls -la /path/to/workspace
352
+
353
+ # 2. Ensure you own the directory
354
+ sudo chown -R $USER:$USER /path/to/workspace
355
+
356
+ # 3. Check if workspace path is correct
357
+ pwd
358
+ ```
359
+
360
+ ### High CPU/Memory Usage
361
+
362
+ **Problem:** Agent consuming too many resources
363
+
364
+ **Solutions:**
365
+ ```bash
366
+ # 1. Check stats
367
+ # Press 's' while agent is running
368
+
369
+ # 2. Reduce poll interval (edit config)
370
+ # 3. Disable file watching if enabled
371
+ # 4. Close unnecessary processes
372
+ ```
373
+
374
+ ## Environment Variables
375
+
376
+ ```bash
377
+ # API Configuration
378
+ HIGHERUP_API_URL=https://pltlcpqtivuvyeuywvql.supabase.co/functions/v1/agent-relay
379
+ HIGHERUP_API_TOKEN=your_token_here
380
+
381
+ # Agent Settings
382
+ HIGHERUP_WORKSPACE_ID=ws_abc123
383
+ HIGHERUP_AGENT_NAME=my-custom-name
384
+ HIGHERUP_LOG_LEVEL=info # debug, info, warn, error
385
+
386
+ # Performance
387
+ HIGHERUP_POLL_INTERVAL=2000 # milliseconds
388
+ HIGHERUP_MAX_RETRIES=5
389
+ ```
390
+
391
+ ## Examples
392
+
393
+ ### Basic Development Workflow
394
+
395
+ ```bash
396
+ # 1. Start agent in your project
397
+ cd ~/projects/my-app
398
+ higherup connect -w ws_abc123
399
+
400
+ # 2. AI can now:
401
+ # - Run tests: npm test
402
+ # - Install packages: npm install lodash
403
+ # - Read files: cat src/app.js
404
+ # - Make changes: edit files
405
+ # - Check git status: git status
406
+ ```
407
+
408
+ ### CI/CD Integration
409
+
410
+ ```yaml
411
+ # .github/workflows/ai-review.yml
412
+ name: AI Code Review
413
+ on: [pull_request]
414
+
415
+ jobs:
416
+ review:
417
+ runs-on: ubuntu-latest
418
+ steps:
419
+ - uses: actions/checkout@v2
420
+ - uses: actions/setup-node@v2
421
+ with:
422
+ node-version: '18'
423
+ - run: npm install -g higherup
424
+ - run: |
425
+ higherup connect \
426
+ --workspace ${{ secrets.HIGHERUP_WORKSPACE }} \
427
+ --token ${{ secrets.HIGHERUP_TOKEN }} \
428
+ --autonomous
429
+ ```
430
+
431
+ ### Docker Usage
432
+
433
+ ```dockerfile
434
+ FROM node:18-alpine
435
+
436
+ # Install agent
437
+ RUN npm install -g higherup
438
+
439
+ # Set working directory
440
+ WORKDIR /app
441
+
442
+ # Copy project
443
+ COPY . .
444
+
445
+ # Start agent on container start
446
+ CMD ["higherup", "connect", "-w", "${WORKSPACE_ID}", "--autonomous"]
447
+ ```
448
+
449
+ ## API Integration
450
+
451
+ For platform developers integrating with Higherup:
452
+
453
+ - **REST API**: [https://higherup.ai/api/docs](https://higherup.ai/api/docs)
454
+ - **WebSocket**: Real-time command streaming
455
+ - **MCP Protocol**: Native AI assistant integration
456
+
457
+ ## Contributing
458
+
459
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
460
+
461
+ ## Support
462
+
463
+ - 📚 [Documentation](https://higherup.ai/docs)
464
+ - 💬 [Discord Community](https://discord.gg/higherup)
465
+ - 🐛 [Report Issues](https://github.com/hnibbo/HUagent/issues)
466
+ - 📧 [Email Support](mailto:support@higherup.ai)
191
467
 
192
468
  ## License
193
469
 
194
- MIT
470
+ MIT © Higherup
471
+
472
+ ---
195
473
 
474
+ <div align="center">
475
+ Made with ❤️ by the Higherup team
476
+ </div>
package/dist/agent.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Higherup Local Agent
2
+ * Higherup Local Agent v2.0
3
3
  *
4
4
  * This agent runs on your local PC and connects to the Higherup service,
5
5
  * enabling secure remote command execution, file operations, and screen capture