agentgate 0.1.3 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgate",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "API gateway for AI agents with human-in-the-loop write approval",
6
6
  "main": "src/index.js",
package/src/cli.js CHANGED
@@ -24,6 +24,10 @@ Options:
24
24
  -p, --port <port> Port to run server on (default: 3050, or PORT env)
25
25
  -h, --help Show this help message
26
26
 
27
+ Environment:
28
+ PORT Server port (default: 3050)
29
+ AGENTGATE_DATA_DIR Data directory (default: ~/.agentgate/)
30
+
27
31
  Examples:
28
32
  agentgate start
29
33
  agentgate start --port 8080
package/src/lib/db.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import Database from 'better-sqlite3';
2
2
  import { nanoid } from 'nanoid';
3
- import { fileURLToPath } from 'url';
4
- import { dirname, join } from 'path';
3
+ import { join } from 'path';
4
+ import { homedir } from 'os';
5
+ import { mkdirSync } from 'fs';
5
6
  import bcrypt from 'bcrypt';
6
7
 
7
- const __dirname = dirname(fileURLToPath(import.meta.url));
8
- const dbPath = join(__dirname, '../../data.db');
8
+ // Data directory: AGENTGATE_DATA_DIR env var, or ~/.agentgate/
9
+ const dataDir = process.env.AGENTGATE_DATA_DIR || join(homedir(), '.agentgate');
10
+ mkdirSync(dataDir, { recursive: true });
11
+ const dbPath = join(dataDir, 'data.db');
9
12
 
10
13
  const db = new Database(dbPath);
11
14