reepoe 1.1.3 → 1.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/bin/reepoe.js CHANGED
@@ -107,19 +107,22 @@ async function makeQuery(query) {
107
107
  }
108
108
  }
109
109
 
110
- // Load activation to get user email for per-user metrics
110
+ // Load activation to get user email and API URL
111
111
  let userEmail = null;
112
+ let apiBase = `http://localhost:${port}`;
112
113
  const activationPath = path.join(os.homedir(), '.reepoe', 'activation.json');
113
114
  if (fs.existsSync(activationPath)) {
114
115
  try {
115
116
  const activation = JSON.parse(fs.readFileSync(activationPath, 'utf8'));
116
117
  userEmail = activation.email;
118
+ // Use API base from activation (for cloud environments)
119
+ apiBase = activation.api_base || `http://localhost:${port}`;
117
120
  } catch (e) {
118
- // No activation or invalid - metrics will be aggregate only
121
+ // No activation or invalid - use localhost
119
122
  }
120
123
  }
121
124
 
122
- const url = `http://localhost:${port}/query`;
125
+ const url = `${apiBase}/query`;
123
126
 
124
127
  try {
125
128
  console.log(`\nšŸ¤– ReePoe processing: "${query}"\n`);
package/bin/start.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * ReePoe Start - Starts ReePoe server in background
3
+ * ReePoe Start - Hybrid local/cloud startup
4
4
  */
5
5
 
6
6
  const { spawn } = require('child_process');
@@ -9,6 +9,15 @@ const fs = require('fs');
9
9
  const os = require('os');
10
10
  const axios = require('axios');
11
11
 
12
+ // Detect cloud environment
13
+ function isCloudEnvironment() {
14
+ return !!(
15
+ process.env.REPL_ID || // Replit
16
+ process.env.CODESPACE_NAME || // GitHub Codespaces
17
+ process.env.GITPOD_WORKSPACE_ID // Gitpod
18
+ );
19
+ }
20
+
12
21
  // Get binary path
13
22
  function getBinaryPath() {
14
23
  const platform = os.platform();
@@ -23,7 +32,8 @@ function getBinaryPath() {
23
32
  binaryName = 'reepoe-windows.exe';
24
33
  }
25
34
 
26
- return path.join(__dirname, '../binaries', binaryName);
35
+ const binaryPath = path.join(__dirname, '../binaries', binaryName);
36
+ return fs.existsSync(binaryPath) ? binaryPath : null;
27
37
  }
28
38
 
29
39
  // Check if server is already running
@@ -181,6 +191,19 @@ async function main() {
181
191
  console.log('ā„¹ļø No configuration found, using defaults');
182
192
  }
183
193
 
194
+ // Detect cloud environment
195
+ const isCloud = isCloudEnvironment();
196
+
197
+ if (isCloud) {
198
+ // Cloud environment - skip local server
199
+ console.log('\nā˜ļø Cloud environment detected');
200
+ console.log('šŸ“” Using production ReePoe API: https://reepoe-api.onrender.com\n');
201
+ console.log('āœ… Ready to use!');
202
+ console.log('\nšŸ’” Try:');
203
+ console.log(' reepoe query "test query"\n');
204
+ return;
205
+ }
206
+
184
207
  // Check if already running
185
208
  const running = await isServerRunning(port);
186
209
  if (running) {
@@ -193,9 +216,9 @@ async function main() {
193
216
  // Get binary path
194
217
  const binaryPath = getBinaryPath();
195
218
 
196
- if (!fs.existsSync(binaryPath)) {
197
- console.error(`āŒ ReePoe binary not found: ${binaryPath}`);
198
- console.error(' Try reinstalling: npm install -g @reepoe/plugin');
219
+ if (!binaryPath) {
220
+ console.error(`āŒ ReePoe binary not found for ${os.platform()}-${os.arch()}`);
221
+ console.error(' Try reinstalling: npm install -g reepoe');
199
222
  process.exit(1);
200
223
  }
201
224
 
@@ -231,12 +231,20 @@ class ActivationClient {
231
231
  fs.mkdirSync(configDir, { recursive: true, mode: 0o700 });
232
232
  }
233
233
 
234
+ // Detect cloud environment
235
+ const isCloud = !!(
236
+ process.env.REPL_ID ||
237
+ process.env.CODESPACE_NAME ||
238
+ process.env.GITPOD_WORKSPACE_ID
239
+ );
240
+
234
241
  const data = {
235
242
  email: activationData.user?.email || activationData.email,
236
243
  token: activationData.token,
237
244
  activated_at: activationData.user?.activated_at || new Date().toISOString(),
238
245
  expires_at: activationData.user?.expires_at,
239
- status: activationData.user?.status || 'active'
246
+ status: activationData.user?.status || 'active',
247
+ api_base: isCloud ? 'https://reepoe-api.onrender.com' : 'http://localhost:8000'
240
248
  };
241
249
 
242
250
  fs.writeFileSync(this.activationFile, JSON.stringify(data, null, 2), { mode: 0o600 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reepoe",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "ReePoe AI Code Manager - Install in any codebase for instant AI agent integration",
5
5
  "keywords": [
6
6
  "ai",