@plexor-dev/claude-code-plugin 0.1.0-beta.26 → 0.1.0-beta.28

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.
@@ -90,8 +90,7 @@ function main() {
90
90
  if (newEnabled) {
91
91
  // Enable routing - need API key from config
92
92
  if (apiKey) {
93
- // Default to staging for now - will change to production later
94
- const apiUrl = config.settings?.apiUrl || 'https://staging.api.plexor.dev';
93
+ const apiUrl = config.settings?.apiUrl || 'https://api.plexor.dev';
95
94
  const useStaging = apiUrl.includes('staging');
96
95
  routingUpdated = settingsManager.enablePlexorRouting(apiKey, { useStaging });
97
96
  } else {
@@ -18,8 +18,7 @@ const { settingsManager } = require('../lib/settings-manager');
18
18
 
19
19
  const CONFIG_PATH = path.join(process.env.HOME, '.plexor', 'config.json');
20
20
  const PLEXOR_DIR = path.join(process.env.HOME, '.plexor');
21
- // Default to staging for now - will change to production later
22
- const DEFAULT_API_URL = 'https://staging.api.plexor.dev';
21
+ const DEFAULT_API_URL = 'https://api.plexor.dev';
23
22
 
24
23
  function loadConfig() {
25
24
  try {
@@ -80,20 +79,6 @@ function validateApiKey(apiUrl, apiKey) {
80
79
  });
81
80
  }
82
81
 
83
- async function promptForApiKey() {
84
- const rl = readline.createInterface({
85
- input: process.stdin,
86
- output: process.stdout
87
- });
88
-
89
- return new Promise((resolve) => {
90
- rl.question('Enter your Plexor API key: ', (answer) => {
91
- rl.close();
92
- resolve(answer.trim());
93
- });
94
- });
95
- }
96
-
97
82
  async function main() {
98
83
  const args = process.argv.slice(2);
99
84
  let apiKey = args[0];
package/lib/constants.js CHANGED
@@ -11,8 +11,7 @@ const CACHE_PATH = path.join(PLEXOR_DIR, 'cache.json');
11
11
 
12
12
  const SESSION_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes
13
13
 
14
- // Default to staging for now - will change to production later
15
- const DEFAULT_API_URL = 'https://staging.api.plexor.dev';
14
+ const DEFAULT_API_URL = 'https://api.plexor.dev';
16
15
  const DEFAULT_TIMEOUT = 5000;
17
16
 
18
17
  module.exports = {
@@ -38,7 +38,10 @@ class ClaudeSettingsManager {
38
38
  const data = fs.readFileSync(this.settingsPath, 'utf8');
39
39
  return JSON.parse(data);
40
40
  } catch (err) {
41
- // Return empty object if file doesn't exist or parse error
41
+ // Log unexpected errors (not ENOENT which is handled above)
42
+ if (err.code !== 'ENOENT') {
43
+ console.warn('Warning: Failed to load Claude settings:', err.message);
44
+ }
42
45
  return {};
43
46
  }
44
47
  }
@@ -55,7 +58,7 @@ class ClaudeSettingsManager {
55
58
  fs.mkdirSync(this.claudeDir, { recursive: true });
56
59
  }
57
60
 
58
- fs.writeFileSync(this.settingsPath, JSON.stringify(settings, null, 2));
61
+ fs.writeFileSync(this.settingsPath, JSON.stringify(settings, null, 2), { mode: 0o600 });
59
62
  return true;
60
63
  } catch (err) {
61
64
  console.error('Failed to save Claude settings:', err.message);
@@ -74,9 +77,8 @@ class ClaudeSettingsManager {
74
77
  * @returns {boolean} success status
75
78
  */
76
79
  enablePlexorRouting(apiKey, options = {}) {
77
- // Default to staging for now - will change to production later
78
- // TODO: Auto-detect staging keys (plx_protodemo_*, plx_staging_*) vs production
79
- const { useStaging = true } = options;
80
+ // Default to production. Use useStaging: true for staging keys.
81
+ const { useStaging = false } = options;
80
82
  const apiUrl = useStaging ? PLEXOR_STAGING_URL : PLEXOR_PROD_URL;
81
83
 
82
84
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexor-dev/claude-code-plugin",
3
- "version": "0.1.0-beta.26",
3
+ "version": "0.1.0-beta.28",
4
4
  "description": "LLM cost optimization plugin for Claude Code - Save up to 90% on AI costs",
5
5
  "main": "lib/constants.js",
6
6
  "bin": {