claude-remote-cli 1.1.0 → 1.1.2
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
|
-
import {
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import * as service from '../server/service.js';
|
|
6
6
|
import { DEFAULTS } from '../server/config.js';
|
|
7
|
-
const
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
// Parse CLI flags
|
|
9
9
|
const args = process.argv.slice(2);
|
|
10
10
|
if (args.includes('--help') || args.includes('-h')) {
|
|
@@ -26,7 +26,7 @@ Options:
|
|
|
26
26
|
process.exit(0);
|
|
27
27
|
}
|
|
28
28
|
if (args.includes('--version') || args.includes('-v')) {
|
|
29
|
-
const pkg =
|
|
29
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf-8'));
|
|
30
30
|
console.log(pkg.version);
|
|
31
31
|
process.exit(0);
|
|
32
32
|
}
|
package/dist/server/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
14
14
|
const __dirname = path.dirname(__filename);
|
|
15
15
|
// When run via CLI bin, config lives in ~/.config/claude-remote-cli/
|
|
16
16
|
// When run directly (development), fall back to local config.json
|
|
17
|
-
const CONFIG_PATH = process.env.CLAUDE_REMOTE_CONFIG || path.join(__dirname, '..', 'config.json');
|
|
17
|
+
const CONFIG_PATH = process.env.CLAUDE_REMOTE_CONFIG || path.join(__dirname, '..', '..', 'config.json');
|
|
18
18
|
function parseTTL(ttl) {
|
|
19
19
|
if (typeof ttl !== 'string')
|
|
20
20
|
return 24 * 60 * 60 * 1000;
|
|
@@ -89,7 +89,7 @@ async function main() {
|
|
|
89
89
|
const app = express();
|
|
90
90
|
app.use(express.json());
|
|
91
91
|
app.use(cookieParser());
|
|
92
|
-
app.use(express.static(path.join(__dirname, '..', 'public')));
|
|
92
|
+
app.use(express.static(path.join(__dirname, '..', '..', 'public')));
|
|
93
93
|
const requireAuth = (req, res, next) => {
|
|
94
94
|
const token = req.cookies && req.cookies.token;
|
|
95
95
|
if (!token || !authenticatedTokens.has(token)) {
|