devwing 0.1.14 → 0.1.16

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
@@ -2774,7 +2774,7 @@ function getVersion() {
2774
2774
  continue;
2775
2775
  }
2776
2776
  }
2777
- return "0.1.14";
2777
+ return "0.1.16";
2778
2778
  }
2779
2779
  var DEMO_USER2 = {
2780
2780
  id: "usr_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
@@ -3001,16 +3001,17 @@ var InteractiveSession = class {
3001
3001
  // ============================================================
3002
3002
  async checkAuthStatus() {
3003
3003
  try {
3004
+ const apiKey = await configManager.getApiKey();
3004
3005
  if (this.isDemo) {
3005
- this.isAuthenticated = true;
3006
- this.userProfile = { ...DEMO_USER2 };
3007
- const existing = await configManager.getApiKey();
3008
- if (!existing) {
3009
- await configManager.setApiKey("dw_sk_demo_4xK9mQzR2pLvBnWcYjEtHuFi");
3006
+ if (apiKey) {
3007
+ this.isAuthenticated = true;
3008
+ this.userProfile = { ...DEMO_USER2 };
3009
+ } else {
3010
+ this.isAuthenticated = false;
3011
+ this.userProfile = null;
3010
3012
  }
3011
3013
  return;
3012
3014
  }
3013
- const apiKey = await configManager.getApiKey();
3014
3015
  if (!apiKey) return;
3015
3016
  try {
3016
3017
  const profile = await apiClient.getProfile();
@@ -3344,21 +3345,12 @@ ${recent[recent.length - 1].content}`;
3344
3345
  async cmdLogin() {
3345
3346
  console.log();
3346
3347
  if (this.isDemo) {
3347
- if (this.isAuthenticated) {
3348
- const name = this.userProfile?.full_name || this.userProfile?.email || "you";
3349
- const plan = (this.userProfile?.subscription_plan || "free").toUpperCase();
3350
- logger.success(`Already logged in as ${chalk7.bold(name)} (${plan})`);
3351
- logger.info("Type /logout to switch accounts, or /status for details.");
3352
- return;
3353
- }
3354
3348
  await demoLoginCommand({ fromSession: true });
3355
3349
  } else {
3356
3350
  await loginCommand();
3357
3351
  }
3358
3352
  await this.checkAuthStatus();
3359
- if (this.isAuthenticated) {
3360
- this.rl.setPrompt(this.buildPrompt());
3361
- }
3353
+ this.rl.setPrompt(this.buildPrompt());
3362
3354
  }
3363
3355
  async cmdLogout() {
3364
3356
  console.log();
@@ -3367,8 +3359,7 @@ ${recent[recent.length - 1].content}`;
3367
3359
  } else {
3368
3360
  await logoutCommand();
3369
3361
  }
3370
- this.isAuthenticated = false;
3371
- this.userProfile = null;
3362
+ await this.checkAuthStatus();
3372
3363
  this.rl.setPrompt(this.buildPrompt());
3373
3364
  }
3374
3365
  async cmdStatus() {