@neuraiproject/neurai-depin-terminal 2.0.1 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuraiproject/neurai-depin-terminal",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Neurai DePIN terminal messaging client",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -271,24 +271,9 @@ export class ConfigManager {
271
271
  }
272
272
  }
273
273
 
274
- // Close readline before password input (uses raw mode)
275
- rl.close();
276
-
277
- // Get password and encrypt private key
278
- const password = await this.promptForPasswordCreation();
279
- process.stdout.write('Encrypting private key...');
280
- const encryptedPrivateKey = await this.encryptPrivateKey(privateKey, password);
281
- process.stdout.write('\r\x1b[K'); // Clear the "Encrypting..." line
282
- console.log('✓ Private key encrypted successfully\n');
283
-
284
- // Create new readline for remaining questions
285
- const rl2 = readline.createInterface({
286
- input: process.stdin,
287
- output: process.stdout
288
- });
289
-
274
+ // Collect polling interval
290
275
  const pollIntervalStr = await this.promptInput(
291
- rl2,
276
+ rl,
292
277
  `Polling interval in ms [${POLLING.DEFAULT_INTERVAL}]: `
293
278
  ) || String(POLLING.DEFAULT_INTERVAL);
294
279
 
@@ -296,7 +281,7 @@ export class ConfigManager {
296
281
  let timezone = '';
297
282
  while (!timezone) {
298
283
  const input = await this.promptInput(
299
- rl2,
284
+ rl,
300
285
  'Timezone offset (e.g., +1, -5, +5.5, UTC) [default: UTC]: '
301
286
  );
302
287
 
@@ -309,7 +294,17 @@ export class ConfigManager {
309
294
  }
310
295
  }
311
296
 
312
- rl2.close();
297
+ // Close readline before password input (uses raw mode)
298
+ rl.close();
299
+
300
+ // Get password and encrypt private key
301
+ const password = await this.promptForPasswordCreation();
302
+ process.stdout.write('Encrypting private key...');
303
+ const encryptedPrivateKey = await this.encryptPrivateKey(privateKey, password);
304
+ process.stdout.write('\r\x1b[K'); // Clear the "Encrypting..." line
305
+ console.log('✓ Private key encrypted successfully\n');
306
+
307
+
313
308
 
314
309
  // Build configuration object
315
310
  const config = {
package/src/utils.js CHANGED
@@ -221,8 +221,8 @@ export async function readPassword(prompt, maskChar = '*') {
221
221
  }
222
222
  }
223
223
 
224
- // DON'T pause stdin - leave it ready for next use
225
- // CharsmUI will manage its own resume/pause
224
+ // Pause stdin to ensure clean state for next consumer (e.g. readline)
225
+ stdin.pause();
226
226
  };
227
227
 
228
228
  // Ensure stdin is in correct initial state