@drakonkat/ai-helper 1.0.4 → 1.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/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to **`ai-helper` (`aih`)** are documented in this file.
4
4
 
5
5
  ---
6
6
 
7
+ ## [1.1.0] - 2026-08-27
8
+
9
+ ### 🚀 New Features
10
+ - **Headroom Service Integration**: Added full background service management, live status, logs, and dashboard launching for `headroom` (`headroom proxy` on port `8787` with dashboard at `http://localhost:8787/dashboard`).
11
+ - **Cross-Platform Auto-Discovery**: Automatic discovery of externally launched `headroom` proxy processes via OS process table queries and TCP port 8787 listeners.
12
+
13
+ ---
14
+
7
15
  ## [1.0.4] - 2026-08-27
8
16
 
9
17
  ### 🐛 Bug Fixes
package/README.md CHANGED
@@ -34,6 +34,7 @@ When building, testing, and collaborating with local AI agents, coding assistant
34
34
  1. **`pxpipe`**: LLM & MCP protocol reverse proxy bridge (`npx pxpipe-proxy`).
35
35
  2. **`ocx`**: OpenCode interpreter and execution daemon (`ocx start`).
36
36
  3. **`agentmemory`**: Persistent long-term agent memory server (`npx @agentmemory/agentmemory`).
37
+ 4. **`headroom`**: LLM context optimization & compression proxy (`headroom proxy`).
37
38
 
38
39
  Manually opening separate terminal tabs for each service is messy, clutters your workspace, and easily leads to orphaned background processes and blocked ports.
39
40
 
@@ -82,6 +83,7 @@ bun add -g @drakonkat/ai-helper
82
83
  | **`pxpipe`** | `npx pxpipe-proxy` | [`http://localhost:47821`](http://localhost:47821) | AI LLM & MCP protocol reverse proxy bridge |
83
84
  | **`ocx`** | `ocx start` | [`http://localhost:10100`](http://localhost:10100) | OpenCode interpreter execution daemon |
84
85
  | **`agentmemory`** | `npx @agentmemory/agentmemory` | [`http://localhost:3113`](http://localhost:3113) | Persistent agent long-term memory server & viewer |
86
+ | **`headroom`** | `headroom proxy` | [`http://localhost:8787/dashboard`](http://localhost:8787/dashboard) | Context optimization & LLM compression proxy |
85
87
 
86
88
  ---
87
89
 
@@ -284,4 +286,3 @@ bun run build
284
286
  ## 📄 License
285
287
 
286
288
  Distributed under the **MIT License**. See [LICENSE](LICENSE) for more information.
287
-
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@drakonkat/ai-helper",
3
- "version": "1.0.4",
4
- "description": "Zero-config background service manager, auto-discovery daemon & dashboard launcher for AI agent ecosystems (pxpipe, ocx, agentmemory)",
3
+ "version": "1.1.0",
4
+ "description": "Zero-config background service manager, auto-discovery daemon & dashboard launcher for AI agent ecosystems (pxpipe, ocx, agentmemory, headroom)",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
7
7
  "type": "module",
@@ -45,6 +45,7 @@
45
45
  "pxpipe",
46
46
  "ocx",
47
47
  "agentmemory",
48
+ "headroom",
48
49
  "mcp",
49
50
  "npx",
50
51
  "service-manager",
package/src/config.js CHANGED
@@ -30,9 +30,18 @@ export const SERVICES = {
30
30
  command: "npx @agentmemory/agentmemory",
31
31
  stopCommand: "npx @agentmemory/agentmemory stop --force",
32
32
  description: "Long-term persistent agent memory service (@agentmemory/agentmemory)",
33
- defaultPort: 3113,
34
- defaultUrl: "http://localhost:3113",
35
- ports: [3111, 3112, 3113, 49134],
33
+ defaultPort: 3113,
34
+ defaultUrl: "http://localhost:3113",
35
+ ports: [3111, 3112, 3113, 49134],
36
+ },
37
+ headroom: {
38
+ id: "headroom",
39
+ name: "headroom",
40
+ command: "headroom proxy",
41
+ description: "Context optimization & LLM proxy (headroom proxy)",
42
+ defaultPort: 8787,
43
+ defaultUrl: "http://localhost:8787/dashboard",
44
+ ports: [8787],
36
45
  },
37
46
  };
38
47
 
@@ -40,4 +49,4 @@ export const SERVICE_IDS = Object.keys(SERVICES);
40
49
 
41
50
  export const APP_NAME = "ai-helper";
42
51
  export const CLI_NAME = "aih";
43
- export const VERSION = "1.0.4";
52
+ export const VERSION = "1.1.0";
package/src/index.js CHANGED
@@ -25,7 +25,7 @@ function printHelp() {
25
25
  ${bold("COMMANDS:")}
26
26
  ${yellow("status")}, ${yellow("ps")} Show status, PID, uptime, and web dashboard URLs
27
27
  ${yellow("open")}, ${yellow("dash")} [services...] Open web dashboard(s) directly in your default browser
28
- ${yellow("start")}, ${yellow("up")} [services...] Start all or specified services (pxpipe, ocx, agentmemory)
28
+ ${yellow("start")}, ${yellow("up")} [services...] Start all or specified services (pxpipe, ocx, agentmemory, headroom)
29
29
  ${yellow("stop")}, ${yellow("down")} [services...] Stop all or specified services
30
30
  ${yellow("restart")} [services...] Restart all or specified services
31
31
  ${yellow("logs")} <service> [-n 50] [-f] View or stream live logs for a service
@@ -323,4 +323,3 @@ main().catch(err => {
323
323
  console.error(red(`[aih] Fatal error: ${err?.message || err}`));
324
324
  process.exit(1);
325
325
  });
326
-
@@ -246,12 +246,12 @@ export async function discoverRunningProcesses() {
246
246
  if (process.platform === "win32") {
247
247
  try {
248
248
  const script = `
249
- $procs = Get-CimInstance Win32_Process | Where-Object {
250
- $_.ProcessId -ne ${currentPid} -and
251
- $_.CommandLine -and
252
- ($_.CommandLine -match 'pxpipe-proxy|ocx|agentmemory|iii') -and
253
- ($_.CommandLine -notmatch 'ai-helper|\\baih(\\.exe)?\\b|bin\\\\cli\\.js|Get-CimInstance|Where-Object|Select-Object')
254
- } | Select-Object ProcessId, ParentProcessId, Name, CommandLine, CreationDate
249
+ $procs = Get-CimInstance Win32_Process | Where-Object {
250
+ $_.ProcessId -ne ${currentPid} -and
251
+ $_.CommandLine -and
252
+ ($_.CommandLine -match 'pxpipe-proxy|ocx|agentmemory|iii|headroom') -and
253
+ ($_.CommandLine -notmatch 'ai-helper|\\baih(\\.exe)?\\b|bin\\\\cli\\.js|Get-CimInstance|Where-Object|Select-Object')
254
+ } | Select-Object ProcessId, ParentProcessId, Name, CommandLine, CreationDate
255
255
 
256
256
  $ports = Get-NetTCPConnection -State Listen -ErrorAction SilentlyContinue | Select-Object LocalPort, OwningProcess
257
257
 
@@ -345,32 +345,49 @@ export async function discoverRunningProcesses() {
345
345
  (cmd.includes("agentmemory") && !cmd.includes("mcp") && !cmd.includes("aih ")))
346
346
  ) {
347
347
  const webPort = ports.find(p => p === 3113 || p === 43210 || (p > 1000 && p < 65000));
348
- if (!discovered.agentmemory || cmd.includes("agentmemory/agentmemory") || cmd.includes("dist\\cli.mjs")) {
349
- discovered.agentmemory = {
348
+ if (!discovered.agentmemory || cmd.includes("agentmemory/agentmemory") || cmd.includes("dist\\cli.mjs")) {
349
+ discovered.agentmemory = {
350
+ pid,
351
+ command: cmd,
352
+ startedAt,
353
+ port: webPort || 3113,
354
+ url: `http://localhost:${webPort || 3113}`,
355
+ };
356
+ }
357
+ }
358
+
359
+ // 4. headroom
360
+ if (cmd.includes("headroom proxy") || (cmd.includes("headroom") && !cmd.includes("aih "))) {
361
+ const webPort = ports.find(p => p === 8787 || (p > 1000 && p < 65000));
362
+ if (!discovered.headroom || cmd.includes("headroom proxy")) {
363
+ discovered.headroom = {
350
364
  pid,
351
365
  command: cmd,
352
366
  startedAt,
353
- port: webPort || 3113,
354
- url: `http://localhost:${webPort || 3113}`,
367
+ port: webPort || 8787,
368
+ url: `http://localhost:${webPort || 8787}/dashboard`,
355
369
  };
356
370
  }
357
371
  }
358
- }
359
-
360
- for (const p of procList) {
361
- const ports = pidToPorts[p.ProcessId] || [];
362
- if (ports.length > 0) {
363
- if (ports.includes(47821) && discovered.pxpipe) {
364
- discovered.pxpipe.url = "http://localhost:47821";
365
- }
366
- if (ports.includes(10100) && discovered.ocx) {
367
- discovered.ocx.url = "http://localhost:10100";
368
- }
369
- if (ports.includes(3113) && discovered.agentmemory) {
370
- discovered.agentmemory.url = "http://localhost:3113";
372
+ }
373
+
374
+ for (const p of procList) {
375
+ const ports = pidToPorts[p.ProcessId] || [];
376
+ if (ports.length > 0) {
377
+ if (ports.includes(47821) && discovered.pxpipe) {
378
+ discovered.pxpipe.url = "http://localhost:47821";
379
+ }
380
+ if (ports.includes(10100) && discovered.ocx) {
381
+ discovered.ocx.url = "http://localhost:10100";
382
+ }
383
+ if (ports.includes(3113) && discovered.agentmemory) {
384
+ discovered.agentmemory.url = "http://localhost:3113";
385
+ }
386
+ if (ports.includes(8787) && discovered.headroom) {
387
+ discovered.headroom.url = "http://localhost:8787/dashboard";
371
388
  }
372
- }
373
- }
389
+ }
390
+ }
374
391
  } catch {}
375
392
  } else {
376
393
  try {
@@ -395,18 +412,22 @@ export async function discoverRunningProcesses() {
395
412
  if (!discovered.ocx) discovered.ocx = { pid, command: cmd, url: "http://localhost:10100" };
396
413
  }
397
414
 
398
- const isMcpShim = cmd.includes("agentmemory-mcp") || cmd.includes("@agentmemory/mcp") || cmd.includes("agentmemory mcp");
399
- if (
400
- !isMcpShim &&
401
- (cmd.includes("@agentmemory/agentmemory") ||
402
- cmd.includes("iii-config.yaml") ||
403
- cmd.includes("iii") ||
404
- (cmd.includes("agentmemory") && !cmd.includes("mcp")))
405
- ) {
406
- if (!discovered.agentmemory) discovered.agentmemory = { pid, command: cmd, url: "http://localhost:3113" };
415
+ const isMcpShim = cmd.includes("agentmemory-mcp") || cmd.includes("@agentmemory/mcp") || cmd.includes("agentmemory mcp");
416
+ if (
417
+ !isMcpShim &&
418
+ (cmd.includes("@agentmemory/agentmemory") ||
419
+ cmd.includes("iii-config.yaml") ||
420
+ cmd.includes("iii") ||
421
+ (cmd.includes("agentmemory") && !cmd.includes("mcp")))
422
+ ) {
423
+ if (!discovered.agentmemory) discovered.agentmemory = { pid, command: cmd, url: "http://localhost:3113" };
424
+ }
425
+
426
+ if (cmd.includes("headroom proxy") || (cmd.includes("headroom") && !cmd.includes("aih "))) {
427
+ if (!discovered.headroom) discovered.headroom = { pid, command: cmd, url: "http://localhost:8787/dashboard" };
407
428
  }
408
- }
409
- } catch {}
429
+ }
430
+ } catch {}
410
431
  }
411
432
 
412
433
  return discovered;