higherup 1.0.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 ADDED
@@ -0,0 +1,192 @@
1
+ # @higherup/cli
2
+
3
+ **Give AI agents full access to your development machine.**
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.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ # Install globally from npm
11
+ npm install -g higherup-agent
12
+
13
+ # Or clone and build locally
14
+ git clone https://github.com/higherup/agent
15
+ cd agent
16
+ npm install
17
+ npm run build
18
+ npm link
19
+ ```
20
+
21
+ ## Quick Start
22
+
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):
28
+
29
+ ```bash
30
+ higherup config --token YOUR_API_TOKEN
31
+ ```
32
+
33
+ 4. **Connect your workspace**:
34
+
35
+ ```bash
36
+ higherup connect -w YOUR_WORKSPACE_ID -p /path/to/your/project
37
+ ```
38
+
39
+ 5. **Enable autonomous mode** (optional - removes all restrictions):
40
+
41
+ ```bash
42
+ higherup connect -w YOUR_WORKSPACE_ID -p . --autonomous
43
+ ```
44
+
45
+ ## Commands
46
+
47
+ ### `higherup connect`
48
+
49
+ Connect a local workspace to Higherup.
50
+
51
+ ```bash
52
+ higherup connect [options]
53
+
54
+ 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)
60
+ ```
61
+
62
+ ### `higherup config`
63
+
64
+ Manage agent configuration.
65
+
66
+ ```bash
67
+ # Save your API token
68
+ higherup config --token YOUR_API_TOKEN
69
+
70
+ # Set default workspace
71
+ higherup config --workspace YOUR_WORKSPACE_ID
72
+
73
+ # Show current configuration
74
+ higherup config --show
75
+ ```
76
+
77
+ ### `higherup status`
78
+
79
+ Check active agent sessions.
80
+
81
+ ```bash
82
+ higherup status
83
+ ```
84
+
85
+ ## Capabilities
86
+
87
+ When connected, AI agents can:
88
+
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) |
97
+
98
+ ## Autonomous Mode
99
+
100
+ Enable `--autonomous` to remove all restrictions:
101
+
102
+ - ✅ No command blocking
103
+ - ✅ Full system access
104
+ - ✅ Unrestricted file operations
105
+ - ✅ Complete AI control
106
+
107
+ ```bash
108
+ higherup connect -w WORKSPACE_ID -p . --autonomous
109
+ ```
110
+
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
120
+
121
+ - **macOS**: Built-in `screencapture` (may need Screen Recording permission)
122
+ - **Windows**: PowerShell (built-in)
123
+ - **Linux**: `scrot` or `imagemagick` (`import` command)
124
+
125
+ ```bash
126
+ # Linux: Install screen capture tools
127
+ sudo apt install scrot # Debian/Ubuntu
128
+ sudo dnf install scrot # Fedora
129
+ ```
130
+
131
+ ## How It Works
132
+
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
138
+
139
+ ## Supported AI Platforms
140
+
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
148
+
149
+ ## Requirements
150
+
151
+ - Node.js 18+
152
+ - macOS, Linux, or Windows
153
+
154
+ ## Environment Variables
155
+
156
+ ```bash
157
+ # API endpoint (defaults to Higherup service)
158
+ HIGHERUP_API_URL=https://pltlcpqtivuvyeuywvql.supabase.co/functions/v1/agent-relay
159
+
160
+ # Your API token (alternative to --token flag)
161
+ HIGHERUP_API_TOKEN=your_token_here
162
+ ```
163
+
164
+ ## API Integration
165
+
166
+ Once connected, AI platforms can control your machine via:
167
+
168
+ - **REST API** - Standard HTTP endpoints
169
+ - **WebSocket** - Real-time streaming
170
+ - **MCP Protocol** - Native AI assistant integration
171
+
172
+ See [API Documentation](https://higherup.ai/api) for details.
173
+
174
+ ## Troubleshooting
175
+
176
+ ### Connection Issues
177
+ - Ensure your API token is correct (regenerate from dashboard if needed)
178
+ - Check that the workspace ID matches your dashboard
179
+ - Verify your firewall allows outbound HTTPS connections
180
+
181
+ ### Screen Capture Not Working
182
+ - macOS: Grant Screen Recording permission in System Preferences
183
+ - Linux: Install `scrot` or `imagemagick`
184
+ - Windows: Should work out of the box with PowerShell
185
+
186
+ ### Permission Errors
187
+ - The agent can only access files within the specified workspace path
188
+ - Ensure you have read/write permissions for the workspace directory
189
+
190
+ ## License
191
+
192
+ MIT
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Higherup CLI Entry Point
5
+ * This file is the npm package binary entry point
6
+ */
7
+
8
+ import('../dist/agent.js').catch((err) => {
9
+ console.error('Failed to load Higherup agent:', err.message);
10
+ console.error('');
11
+ console.error('If you are developing locally, run: npm run dev');
12
+ console.error('Otherwise, make sure to build first: npm run build');
13
+ process.exit(1);
14
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Higherup Local Agent
3
+ *
4
+ * This agent runs on your local PC and connects to the Higherup service,
5
+ * enabling secure remote command execution, file operations, and screen capture
6
+ * from cloud-based AI coding platforms.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
package/dist/agent.js ADDED
@@ -0,0 +1,639 @@
1
+ /**
2
+ * Higherup Local Agent
3
+ *
4
+ * This agent runs on your local PC and connects to the Higherup service,
5
+ * enabling secure remote command execution, file operations, and screen capture
6
+ * from cloud-based AI coding platforms.
7
+ */
8
+ import { Command } from 'commander';
9
+ import chalk from 'chalk';
10
+ import ora from 'ora';
11
+ import * as fs from 'fs/promises';
12
+ import * as path from 'path';
13
+ import * as os from 'os';
14
+ import { spawn } from 'child_process';
15
+ import { exec } from 'child_process';
16
+ import { promisify } from 'util';
17
+ const execAsync = promisify(exec);
18
+ // Configuration
19
+ const API_BASE_URL = process.env.HIGHERUP_API_URL || 'https://pltlcpqtivuvyeuywvql.supabase.co/functions/v1/agent-relay';
20
+ const CONFIG_DIR = path.join(os.homedir(), '.higherup');
21
+ const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
22
+ const POLL_INTERVAL = 2000; // 2 seconds
23
+ // Colors for terminal output
24
+ const colors = {
25
+ success: chalk.green,
26
+ error: chalk.red,
27
+ info: chalk.cyan,
28
+ warning: chalk.yellow,
29
+ command: chalk.magenta,
30
+ file: chalk.blue,
31
+ dim: chalk.gray,
32
+ bold: chalk.bold,
33
+ };
34
+ class HigherupAgent {
35
+ workspacePath = '';
36
+ workspaceId = '';
37
+ sessionId = '';
38
+ apiToken = '';
39
+ agentName = 'local';
40
+ isRunning = false;
41
+ commandCount = 0;
42
+ pollTimer = null;
43
+ autonomousMode = false;
44
+ constructor() { }
45
+ async connect(workspacePath, workspaceId, apiToken, agentName, autonomous) {
46
+ this.workspacePath = path.resolve(workspacePath);
47
+ this.workspaceId = workspaceId;
48
+ this.apiToken = apiToken;
49
+ this.agentName = agentName || `${os.hostname()}-${os.platform()}`;
50
+ this.autonomousMode = autonomous || false;
51
+ const spinner = ora('Connecting to Higherup service...').start();
52
+ try {
53
+ // Validate workspace path
54
+ const stats = await fs.stat(this.workspacePath);
55
+ if (!stats.isDirectory()) {
56
+ spinner.fail('Invalid workspace path: must be a directory');
57
+ throw new Error('Invalid workspace path');
58
+ }
59
+ // Register with the relay service
60
+ const response = await this.apiCall('register', {
61
+ workspace_id: this.workspaceId,
62
+ agent_name: this.agentName,
63
+ capabilities: [
64
+ 'command_execute',
65
+ 'file_read',
66
+ 'file_write',
67
+ 'file_list',
68
+ 'screen_capture',
69
+ 'system_info',
70
+ ],
71
+ autonomous_mode: this.autonomousMode,
72
+ });
73
+ if (!response.success) {
74
+ throw new Error(response.error || 'Registration failed');
75
+ }
76
+ this.sessionId = response.session_id;
77
+ spinner.succeed('Connected to Higherup service!');
78
+ this.printBanner();
79
+ this.isRunning = true;
80
+ // Start polling for commands
81
+ this.startPolling();
82
+ // Start heartbeat
83
+ this.startHeartbeat();
84
+ // Handle shutdown
85
+ process.on('SIGINT', () => this.disconnect());
86
+ process.on('SIGTERM', () => this.disconnect());
87
+ }
88
+ catch (error) {
89
+ spinner.fail(`Failed to connect: ${error.message}`);
90
+ throw error;
91
+ }
92
+ }
93
+ async apiCall(action, body) {
94
+ const url = `${API_BASE_URL}?action=${action}`;
95
+ const response = await fetch(url, {
96
+ method: 'POST',
97
+ headers: {
98
+ 'Content-Type': 'application/json',
99
+ 'x-api-token': this.apiToken,
100
+ },
101
+ body: JSON.stringify(body),
102
+ });
103
+ return response.json();
104
+ }
105
+ startPolling() {
106
+ this.pollTimer = setInterval(async () => {
107
+ if (!this.isRunning)
108
+ return;
109
+ try {
110
+ const response = await this.apiCall('poll', {
111
+ session_id: this.sessionId,
112
+ });
113
+ if (response.commands && response.commands.length > 0) {
114
+ for (const cmd of response.commands) {
115
+ await this.processCommand(cmd);
116
+ }
117
+ }
118
+ }
119
+ catch (error) {
120
+ console.error(colors.error('Polling error:'), error);
121
+ }
122
+ }, POLL_INTERVAL);
123
+ }
124
+ startHeartbeat() {
125
+ setInterval(async () => {
126
+ if (!this.isRunning)
127
+ return;
128
+ try {
129
+ await this.apiCall('heartbeat', {
130
+ session_id: this.sessionId,
131
+ });
132
+ }
133
+ catch (error) {
134
+ console.error(colors.dim('Heartbeat failed'));
135
+ }
136
+ }, 30000); // Every 30 seconds
137
+ }
138
+ printBanner() {
139
+ console.log('\n');
140
+ console.log(colors.bold(' ╔═══════════════════════════════════════════╗'));
141
+ console.log(colors.bold(' ║') + colors.info(' HIGHERUP LOCAL AGENT ') + colors.bold('║'));
142
+ console.log(colors.bold(' ╚═══════════════════════════════════════════╝'));
143
+ console.log('');
144
+ console.log(colors.dim(` Workspace: ${this.workspacePath}`));
145
+ console.log(colors.dim(` Agent: ${this.agentName}`));
146
+ console.log(colors.dim(` Session: ${this.sessionId}`));
147
+ if (this.autonomousMode) {
148
+ console.log(colors.warning(' Mode: AUTONOMOUS (unrestricted)'));
149
+ }
150
+ console.log('');
151
+ console.log(colors.info(' Listening for commands... Press Ctrl+C to stop.\n'));
152
+ }
153
+ async processCommand(cmd) {
154
+ const commandText = cmd.command_text;
155
+ // Check for internal commands
156
+ if (commandText.startsWith('__INTERNAL_')) {
157
+ await this.handleInternalCommand(cmd);
158
+ }
159
+ else if (commandText.startsWith('__STREAM__')) {
160
+ await this.executeStreamingCommand(cmd);
161
+ }
162
+ else {
163
+ await this.executeCommand(cmd);
164
+ }
165
+ }
166
+ async handleInternalCommand(cmd) {
167
+ const commandText = cmd.command_text;
168
+ try {
169
+ if (commandText.startsWith('__INTERNAL_FILE_READ__')) {
170
+ await this.handleFileRead(cmd);
171
+ }
172
+ else if (commandText.startsWith('__INTERNAL_FILE_WRITE__')) {
173
+ await this.handleFileWrite(cmd);
174
+ }
175
+ else if (commandText.startsWith('__INTERNAL_FILE_LIST__')) {
176
+ await this.handleFileList(cmd);
177
+ }
178
+ else if (commandText.startsWith('__INTERNAL_SCREEN_CAPTURE__')) {
179
+ await this.handleScreenCapture(cmd);
180
+ }
181
+ else if (commandText.startsWith('__INTERNAL_SCREEN_STREAM_START__')) {
182
+ await this.handleScreenStreamStart(cmd);
183
+ }
184
+ else if (commandText.startsWith('__INTERNAL_SYSTEM_INFO__')) {
185
+ await this.handleSystemInfo(cmd);
186
+ }
187
+ else {
188
+ await this.reportResult(cmd.id, `Unknown internal command: ${commandText}`, -1, 0);
189
+ }
190
+ }
191
+ catch (error) {
192
+ await this.reportResult(cmd.id, error.message, -1, 0);
193
+ }
194
+ }
195
+ async handleFileRead(cmd) {
196
+ const match = cmd.command_text.match(/__INTERNAL_FILE_READ__\s+(.+?)(?:\s+--encoding=(\w+))?$/);
197
+ if (!match) {
198
+ await this.reportResult(cmd.id, 'Invalid file read command', -1, 0);
199
+ return;
200
+ }
201
+ const filePath = path.resolve(this.workspacePath, match[1].trim());
202
+ const encoding = (match[2] || 'utf8');
203
+ console.log(colors.file(`[FILE READ] ${filePath}`));
204
+ // Security check - ensure file is within workspace
205
+ if (!filePath.startsWith(this.workspacePath)) {
206
+ await this.reportResult(cmd.id, 'Access denied: Path outside workspace', -1, 0);
207
+ return;
208
+ }
209
+ try {
210
+ const content = await fs.readFile(filePath, encoding);
211
+ const stats = await fs.stat(filePath);
212
+ const result = JSON.stringify({
213
+ success: true,
214
+ content,
215
+ path: match[1].trim(),
216
+ size: stats.size,
217
+ modified_at: stats.mtime.toISOString(),
218
+ });
219
+ await this.reportResult(cmd.id, result, 0, 0);
220
+ console.log(colors.success(` ✓ Read ${stats.size} bytes`));
221
+ }
222
+ catch (error) {
223
+ await this.reportResult(cmd.id, JSON.stringify({ success: false, error: error.message }), -1, 0);
224
+ }
225
+ }
226
+ async handleFileWrite(cmd) {
227
+ const match = cmd.command_text.match(/__INTERNAL_FILE_WRITE__\s+(.+)$/);
228
+ if (!match) {
229
+ await this.reportResult(cmd.id, 'Invalid file write command', -1, 0);
230
+ return;
231
+ }
232
+ const filePath = path.resolve(this.workspacePath, match[1].trim());
233
+ // Security check
234
+ if (!filePath.startsWith(this.workspacePath)) {
235
+ await this.reportResult(cmd.id, 'Access denied: Path outside workspace', -1, 0);
236
+ return;
237
+ }
238
+ console.log(colors.file(`[FILE WRITE] ${filePath}`));
239
+ try {
240
+ // Content is stored in cmd.output as JSON
241
+ const data = JSON.parse(cmd.output || '{}');
242
+ const { content, encoding = 'utf8', create_dirs = true } = data;
243
+ if (create_dirs) {
244
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
245
+ }
246
+ await fs.writeFile(filePath, content, encoding);
247
+ const stats = await fs.stat(filePath);
248
+ await this.reportResult(cmd.id, JSON.stringify({
249
+ success: true,
250
+ path: match[1].trim(),
251
+ size: stats.size,
252
+ }), 0, 0);
253
+ console.log(colors.success(` ✓ Wrote ${stats.size} bytes`));
254
+ }
255
+ catch (error) {
256
+ await this.reportResult(cmd.id, JSON.stringify({ success: false, error: error.message }), -1, 0);
257
+ }
258
+ }
259
+ async handleFileList(cmd) {
260
+ const match = cmd.command_text.match(/__INTERNAL_FILE_LIST__\s+(.+?)(?:\s+--recursive=(true|false))?(?:\s+--hidden=(true|false))?$/);
261
+ if (!match) {
262
+ await this.reportResult(cmd.id, 'Invalid file list command', -1, 0);
263
+ return;
264
+ }
265
+ const dirPath = path.resolve(this.workspacePath, match[1].trim());
266
+ const recursive = match[2] === 'true';
267
+ const includeHidden = match[3] === 'true';
268
+ console.log(colors.file(`[FILE LIST] ${dirPath}`));
269
+ // Security check
270
+ if (!dirPath.startsWith(this.workspacePath)) {
271
+ await this.reportResult(cmd.id, 'Access denied: Path outside workspace', -1, 0);
272
+ return;
273
+ }
274
+ try {
275
+ const files = await this.listDirectory(dirPath, recursive, includeHidden);
276
+ await this.reportResult(cmd.id, JSON.stringify({
277
+ success: true,
278
+ path: match[1].trim(),
279
+ files,
280
+ }), 0, 0);
281
+ console.log(colors.success(` ✓ Listed ${files.length} items`));
282
+ }
283
+ catch (error) {
284
+ await this.reportResult(cmd.id, JSON.stringify({ success: false, error: error.message }), -1, 0);
285
+ }
286
+ }
287
+ async listDirectory(dirPath, recursive, includeHidden) {
288
+ const entries = await fs.readdir(dirPath, { withFileTypes: true });
289
+ const files = [];
290
+ for (const entry of entries) {
291
+ if (!includeHidden && entry.name.startsWith('.'))
292
+ continue;
293
+ const fullPath = path.join(dirPath, entry.name);
294
+ const relativePath = path.relative(this.workspacePath, fullPath);
295
+ const item = {
296
+ name: entry.name,
297
+ path: relativePath,
298
+ type: entry.isDirectory() ? 'directory' : 'file',
299
+ };
300
+ if (entry.isFile()) {
301
+ try {
302
+ const stats = await fs.stat(fullPath);
303
+ item.size = stats.size;
304
+ item.modified_at = stats.mtime.toISOString();
305
+ }
306
+ catch {
307
+ // Ignore stat errors
308
+ }
309
+ }
310
+ files.push(item);
311
+ if (recursive && entry.isDirectory()) {
312
+ try {
313
+ const subFiles = await this.listDirectory(fullPath, true, includeHidden);
314
+ files.push(...subFiles);
315
+ }
316
+ catch {
317
+ // Ignore subdirectory errors
318
+ }
319
+ }
320
+ }
321
+ return files;
322
+ }
323
+ async handleScreenCapture(cmd) {
324
+ const match = cmd.command_text.match(/--display=(\d+)/);
325
+ const display = match ? parseInt(match[1]) : 0;
326
+ console.log(colors.info(`[SCREEN CAPTURE] Display ${display}`));
327
+ try {
328
+ let imagePath;
329
+ const tempFile = path.join(os.tmpdir(), `higherup-screen-${Date.now()}.png`);
330
+ if (os.platform() === 'darwin') {
331
+ // macOS
332
+ await execAsync(`screencapture -x -D ${display + 1} "${tempFile}"`);
333
+ }
334
+ else if (os.platform() === 'win32') {
335
+ // Windows - use PowerShell
336
+ const psScript = `
337
+ Add-Type -AssemblyName System.Windows.Forms
338
+ $screen = [System.Windows.Forms.Screen]::AllScreens[${display}]
339
+ $bitmap = New-Object System.Drawing.Bitmap($screen.Bounds.Width, $screen.Bounds.Height)
340
+ $graphics = [System.Drawing.Graphics]::FromImage($bitmap)
341
+ $graphics.CopyFromScreen($screen.Bounds.Location, [System.Drawing.Point]::Empty, $screen.Bounds.Size)
342
+ $bitmap.Save("${tempFile.replace(/\\/g, '\\\\')}")
343
+ `;
344
+ await execAsync(`powershell -Command "${psScript}"`);
345
+ }
346
+ else {
347
+ // Linux - use scrot or import
348
+ try {
349
+ await execAsync(`scrot "${tempFile}"`);
350
+ }
351
+ catch {
352
+ await execAsync(`import -window root "${tempFile}"`);
353
+ }
354
+ }
355
+ imagePath = tempFile;
356
+ // Read the image and convert to base64
357
+ const imageBuffer = await fs.readFile(imagePath);
358
+ const base64Image = imageBuffer.toString('base64');
359
+ // Clean up temp file
360
+ await fs.unlink(imagePath).catch(() => { });
361
+ await this.reportResult(cmd.id, JSON.stringify({
362
+ success: true,
363
+ image: base64Image,
364
+ format: 'png',
365
+ display,
366
+ }), 0, 0);
367
+ console.log(colors.success(` ✓ Captured screen (${Math.round(base64Image.length / 1024)} KB)`));
368
+ }
369
+ catch (error) {
370
+ console.log(colors.error(` ✗ Screen capture failed: ${error.message}`));
371
+ await this.reportResult(cmd.id, JSON.stringify({
372
+ success: false,
373
+ error: error.message,
374
+ hint: 'Screen capture may require additional permissions or tools (scrot on Linux)'
375
+ }), -1, 0);
376
+ }
377
+ }
378
+ async handleScreenStreamStart(cmd) {
379
+ // Screen streaming would require WebSocket - just acknowledge for now
380
+ await this.reportResult(cmd.id, JSON.stringify({
381
+ success: true,
382
+ message: 'Screen streaming initiated. Use WebSocket for continuous frames.',
383
+ }), 0, 0);
384
+ }
385
+ async handleSystemInfo(cmd) {
386
+ console.log(colors.info('[SYSTEM INFO]'));
387
+ try {
388
+ const cpus = os.cpus();
389
+ const systemInfo = {
390
+ success: true,
391
+ os: os.platform(),
392
+ os_release: os.release(),
393
+ os_type: os.type(),
394
+ arch: os.arch(),
395
+ hostname: os.hostname(),
396
+ username: os.userInfo().username,
397
+ home_dir: os.homedir(),
398
+ cpu: {
399
+ model: cpus[0]?.model || 'Unknown',
400
+ cores: cpus.length,
401
+ speed: cpus[0]?.speed || 0,
402
+ },
403
+ memory: {
404
+ total: os.totalmem(),
405
+ free: os.freemem(),
406
+ used: os.totalmem() - os.freemem(),
407
+ },
408
+ uptime: os.uptime(),
409
+ workspace: {
410
+ path: this.workspacePath,
411
+ id: this.workspaceId,
412
+ },
413
+ agent: {
414
+ name: this.agentName,
415
+ session: this.sessionId,
416
+ autonomous: this.autonomousMode,
417
+ },
418
+ };
419
+ await this.reportResult(cmd.id, JSON.stringify(systemInfo), 0, 0);
420
+ console.log(colors.success(' ✓ System info collected'));
421
+ }
422
+ catch (error) {
423
+ await this.reportResult(cmd.id, JSON.stringify({ success: false, error: error.message }), -1, 0);
424
+ }
425
+ }
426
+ async executeStreamingCommand(cmd) {
427
+ const command = cmd.command_text.replace('__STREAM__ ', '');
428
+ console.log(colors.command(`\n[STREAM] $ ${command}`));
429
+ // For streaming, we execute normally but could implement chunk reporting
430
+ await this.executeShellCommand(cmd, command);
431
+ }
432
+ async executeCommand(cmd) {
433
+ console.log(colors.command(`\n[CMD] $ ${cmd.command_text}`));
434
+ await this.executeShellCommand(cmd, cmd.command_text);
435
+ }
436
+ async executeShellCommand(cmd, command) {
437
+ const startTime = Date.now();
438
+ // Security check for dangerous commands (unless autonomous mode)
439
+ if (!this.autonomousMode) {
440
+ const dangerousPatterns = ['rm -rf /', 'mkfs', 'dd if=', ':(){:|:&};:'];
441
+ for (const pattern of dangerousPatterns) {
442
+ if (command.includes(pattern)) {
443
+ console.log(colors.error(` ✗ Blocked dangerous command pattern: ${pattern}`));
444
+ await this.reportResult(cmd.id, 'Command blocked: Contains dangerous pattern. Enable autonomous mode to run.', -1, 0);
445
+ return;
446
+ }
447
+ }
448
+ }
449
+ // Determine shell based on platform
450
+ const isWindows = os.platform() === 'win32';
451
+ const shell = isWindows ? 'cmd.exe' : '/bin/bash';
452
+ const shellArgs = isWindows ? ['/c', command] : ['-c', command];
453
+ try {
454
+ const result = await new Promise((resolve) => {
455
+ let output = '';
456
+ const childProcess = spawn(shell, shellArgs, {
457
+ cwd: this.workspacePath,
458
+ env: { ...process.env, FORCE_COLOR: '1' },
459
+ stdio: ['pipe', 'pipe', 'pipe'],
460
+ });
461
+ childProcess.stdout.on('data', (data) => {
462
+ const text = data.toString();
463
+ output += text;
464
+ process.stdout.write(colors.dim(text));
465
+ });
466
+ childProcess.stderr.on('data', (data) => {
467
+ const text = data.toString();
468
+ output += text;
469
+ process.stderr.write(colors.error(text));
470
+ });
471
+ childProcess.on('close', (exitCode) => {
472
+ resolve({ output, exitCode: exitCode ?? -1 });
473
+ });
474
+ childProcess.on('error', (error) => {
475
+ resolve({ output: error.message, exitCode: -1 });
476
+ });
477
+ });
478
+ const duration = Date.now() - startTime;
479
+ this.commandCount++;
480
+ const status = result.exitCode === 0 ? colors.success('✓') : colors.error('✗');
481
+ console.log(colors.dim(`\n[Completed in ${duration}ms] ${status} Exit code: ${result.exitCode}\n`));
482
+ await this.reportResult(cmd.id, result.output.slice(-10000), result.exitCode, duration);
483
+ }
484
+ catch (error) {
485
+ console.log(colors.error(`\n[ERROR] ${error.message}\n`));
486
+ await this.reportResult(cmd.id, error.message, -1, Date.now() - startTime);
487
+ }
488
+ }
489
+ async reportResult(commandId, output, exitCode, duration) {
490
+ await this.apiCall('result', {
491
+ command_id: commandId,
492
+ output,
493
+ exit_code: exitCode,
494
+ duration,
495
+ });
496
+ }
497
+ async disconnect() {
498
+ console.log(colors.warning('\n\nDisconnecting from Higherup service...'));
499
+ this.isRunning = false;
500
+ if (this.pollTimer) {
501
+ clearInterval(this.pollTimer);
502
+ }
503
+ try {
504
+ await this.apiCall('disconnect', {
505
+ session_id: this.sessionId,
506
+ workspace_id: this.workspaceId,
507
+ });
508
+ }
509
+ catch (error) {
510
+ // Ignore disconnect errors
511
+ }
512
+ console.log(colors.success('Disconnected. Goodbye!\n'));
513
+ console.log(colors.dim(`Session stats: ${this.commandCount} commands executed\n`));
514
+ process.exit(0);
515
+ }
516
+ }
517
+ // CLI Setup
518
+ async function loadConfig() {
519
+ try {
520
+ await fs.mkdir(CONFIG_DIR, { recursive: true });
521
+ const data = await fs.readFile(CONFIG_FILE, 'utf-8');
522
+ return JSON.parse(data);
523
+ }
524
+ catch {
525
+ return {};
526
+ }
527
+ }
528
+ async function saveConfig(config) {
529
+ await fs.mkdir(CONFIG_DIR, { recursive: true });
530
+ await fs.writeFile(CONFIG_FILE, JSON.stringify(config, null, 2));
531
+ }
532
+ const program = new Command();
533
+ program
534
+ .name('higherup')
535
+ .description('Higherup Local Agent - Give AI agents full access to your development environment')
536
+ .version('1.0.0');
537
+ program
538
+ .command('connect')
539
+ .description('Connect to Higherup service')
540
+ .requiredOption('-w, --workspace <id>', 'Workspace ID to connect')
541
+ .requiredOption('-p, --path <path>', 'Local workspace path', '.')
542
+ .option('-t, --token <token>', 'API token (or use HIGHERUP_API_TOKEN env var)')
543
+ .option('-n, --name <name>', 'Agent name for identification')
544
+ .option('--autonomous', 'Enable autonomous mode (unrestricted access)')
545
+ .action(async (options) => {
546
+ const config = await loadConfig();
547
+ const apiToken = options.token || process.env.HIGHERUP_API_TOKEN || config.apiToken;
548
+ if (!apiToken) {
549
+ console.error(colors.error('Error: API token is required'));
550
+ console.log(colors.info('\nProvide token via:'));
551
+ console.log(' --token <token>');
552
+ console.log(' HIGHERUP_API_TOKEN environment variable');
553
+ console.log(' or run: higherup config --token <token>');
554
+ process.exit(1);
555
+ }
556
+ const agent = new HigherupAgent();
557
+ try {
558
+ await agent.connect(options.path, options.workspace, apiToken, options.name, options.autonomous);
559
+ }
560
+ catch (error) {
561
+ console.error(colors.error(`\nFailed to connect: ${error.message}`));
562
+ process.exit(1);
563
+ }
564
+ });
565
+ program
566
+ .command('config')
567
+ .description('Configure default settings')
568
+ .option('-t, --token <token>', 'Set default API token')
569
+ .option('-w, --workspace <id>', 'Set default workspace')
570
+ .option('--show', 'Show current configuration')
571
+ .action(async (options) => {
572
+ const config = await loadConfig();
573
+ if (options.show) {
574
+ console.log(colors.bold('\nHigherup Configuration:'));
575
+ console.log(colors.dim(`Config file: ${CONFIG_FILE}\n`));
576
+ console.log(` API Token: ${config.apiToken ? colors.success('Set') : colors.warning('Not set')}`);
577
+ console.log(` Default Workspace: ${config.defaultWorkspace || colors.dim('Not set')}`);
578
+ console.log('');
579
+ return;
580
+ }
581
+ if (options.token) {
582
+ config.apiToken = options.token;
583
+ console.log(colors.success('✓ API token saved'));
584
+ }
585
+ if (options.workspace) {
586
+ config.defaultWorkspace = options.workspace;
587
+ console.log(colors.success('✓ Default workspace saved'));
588
+ }
589
+ if (options.token || options.workspace) {
590
+ await saveConfig(config);
591
+ }
592
+ else {
593
+ console.log('Use --help to see available options');
594
+ }
595
+ });
596
+ program
597
+ .command('status')
598
+ .description('Check connection status')
599
+ .option('-t, --token <token>', 'API token')
600
+ .action(async (options) => {
601
+ const config = await loadConfig();
602
+ const apiToken = options.token || process.env.HIGHERUP_API_TOKEN || config.apiToken;
603
+ if (!apiToken) {
604
+ console.error(colors.error('Error: API token is required'));
605
+ process.exit(1);
606
+ }
607
+ const spinner = ora('Checking status...').start();
608
+ try {
609
+ const response = await fetch(`${API_BASE_URL}?action=status`, {
610
+ method: 'POST',
611
+ headers: {
612
+ 'Content-Type': 'application/json',
613
+ 'x-api-token': apiToken,
614
+ },
615
+ body: JSON.stringify({}),
616
+ });
617
+ const data = await response.json();
618
+ spinner.stop();
619
+ if (data.active_sessions && data.active_sessions.length > 0) {
620
+ console.log(colors.success('\n✓ Connected sessions:\n'));
621
+ for (const session of data.active_sessions) {
622
+ console.log(` ${colors.bold(session.agent_name || 'Agent')}`);
623
+ console.log(colors.dim(` Workspace: ${session.workspaces?.name || session.workspace_id}`));
624
+ console.log(colors.dim(` Connected: ${new Date(session.connected_at).toLocaleString()}`));
625
+ console.log('');
626
+ }
627
+ }
628
+ else {
629
+ console.log(colors.warning('\n⚠ No active sessions'));
630
+ console.log(colors.dim('Run: higherup connect -w <workspace-id> -p <path>\n'));
631
+ }
632
+ }
633
+ catch (error) {
634
+ spinner.fail(`Failed to check status: ${error.message}`);
635
+ process.exit(1);
636
+ }
637
+ });
638
+ program.parse();
639
+ //# sourceMappingURL=ag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AC9F,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC;gBAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC;YACtD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,2BAA2B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "higherup",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "Give AI agents full access to your development machine - command execution, file operations, screen capture, and autonomous mode",
6
+ "main": "dist/agent.js",
7
+ "bin": {
8
+ "higherup": "./bin/higherup.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node dist/agent.js",
12
+ "dev": "tsx src/agent.ts",
13
+ "build": "tsc && chmod +x bin/higherup.js",
14
+ "prepublishOnly": "npm run build",
15
+ "postinstall": "echo '✓ Higherup agent installed. Run: higherup connect --help'",
16
+ "test": "echo \"No tests yet\" && exit 0"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "bin",
21
+ "README.md"
22
+ ],
23
+ "keywords": [
24
+ "higherup",
25
+ "ai",
26
+ "agent",
27
+ "mcp",
28
+ "screen-capture",
29
+ "remote-control",
30
+ "autonomous",
31
+ "cli",
32
+ "lovable",
33
+ "claude",
34
+ "gpt",
35
+ "automation",
36
+ "development"
37
+ ],
38
+ "author": "Higherup",
39
+ "license": "MIT",
40
+ "homepage": "https://higherup.ai",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/hnibbo/HUagent"
44
+ },
45
+ "bugs": {
46
+ "url": "https://github.com/hnibbo/HUagent/issues"
47
+ },
48
+ "engines": {
49
+ "node": ">=18.0.0"
50
+ },
51
+ "dependencies": {
52
+ "chalk": "^5.4.1",
53
+ "commander": "^12.1.0",
54
+ "ora": "^8.1.0"
55
+ },
56
+ "devDependencies": {
57
+ "@types/node": "^20.17.9",
58
+ "tsx": "^4.19.0",
59
+ "typescript": "^5.6.0"
60
+ }
61
+ }
62
+