devwing 0.1.18 → 0.1.20

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/dist/index.js CHANGED
@@ -543,8 +543,6 @@ async function loginCommand() {
543
543
  return;
544
544
  }
545
545
  }
546
- logger.printBanner();
547
- logger.newline();
548
546
  const { method } = await inquirer5.prompt([
549
547
  {
550
548
  type: "list",
@@ -569,7 +567,6 @@ async function loginCommand() {
569
567
  if (error.message) {
570
568
  logger.error(error.message);
571
569
  }
572
- process.exit(1);
573
570
  }
574
571
  }
575
572
  async function loginWithEmail() {
@@ -779,7 +776,6 @@ async function logoutCommand() {
779
776
  } catch (error) {
780
777
  logger.error("Logout failed");
781
778
  logger.error(error.message || "Unknown error");
782
- process.exit(1);
783
779
  }
784
780
  }
785
781
  async function statusCommand() {
@@ -822,7 +818,6 @@ async function statusCommand() {
822
818
  } catch (error) {
823
819
  logger.error("Failed to check status");
824
820
  logger.error(error.message || "Unknown error");
825
- process.exit(1);
826
821
  }
827
822
  }
828
823
  function showQuickStart() {
@@ -2761,6 +2756,7 @@ function isDemoMode() {
2761
2756
  }
2762
2757
  var __sessionFile = fileURLToPath(import.meta.url);
2763
2758
  var __sessionDir = dirname(__sessionFile);
2759
+ var sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2764
2760
  function getVersion() {
2765
2761
  const paths = [
2766
2762
  join(__sessionDir, "../package.json"),
@@ -2775,7 +2771,7 @@ function getVersion() {
2775
2771
  continue;
2776
2772
  }
2777
2773
  }
2778
- return "0.1.18";
2774
+ return "0.1.20";
2779
2775
  }
2780
2776
  var DEMO_USER2 = {
2781
2777
  id: "usr_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
@@ -2905,6 +2901,22 @@ var InteractiveSession = class {
2905
2901
  }
2906
2902
  });
2907
2903
  }
2904
+ resetStdin() {
2905
+ try {
2906
+ if (typeof process.stdin.setRawMode === "function") {
2907
+ try {
2908
+ process.stdin.setRawMode(false);
2909
+ } catch {
2910
+ }
2911
+ }
2912
+ process.stdin.removeAllListeners("keypress");
2913
+ process.stdin.removeAllListeners("data");
2914
+ if (process.stdin.isPaused()) {
2915
+ process.stdin.resume();
2916
+ }
2917
+ } catch {
2918
+ }
2919
+ }
2908
2920
  recreateReadline() {
2909
2921
  this.createReadline();
2910
2922
  this.rl.prompt();
@@ -3056,6 +3068,8 @@ var InteractiveSession = class {
3056
3068
  } catch (error) {
3057
3069
  logger.error(error.message || "Command failed");
3058
3070
  }
3071
+ this.resetStdin();
3072
+ await sleep2(80);
3059
3073
  this.recreateReadline();
3060
3074
  }
3061
3075
  // ============================================================
@@ -3080,6 +3094,8 @@ var InteractiveSession = class {
3080
3094
  } catch (error) {
3081
3095
  logger.error(error.message || "Command failed");
3082
3096
  }
3097
+ this.resetStdin();
3098
+ await sleep2(80);
3083
3099
  this.recreateReadline();
3084
3100
  return;
3085
3101
  }
@@ -3157,6 +3173,7 @@ ${recent[recent.length - 1].content}`;
3157
3173
  // ============================================================
3158
3174
  exitSession() {
3159
3175
  if (this.sigintTimer) clearTimeout(this.sigintTimer);
3176
+ this.resetStdin();
3160
3177
  console.log();
3161
3178
  console.log(chalk7.dim(" Goodbye! Happy coding."));
3162
3179
  console.log();