@lightcone-ai/daemon 0.9.44 → 0.9.46

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.
@@ -41,7 +41,7 @@ export class XhsAdapter {
41
41
  returnByValue: true,
42
42
  });
43
43
  const url = result.result?.value ?? '';
44
- return url.includes('creator.xiaohongshu.com/publish');
44
+ return url.includes('creator.xiaohongshu.com/publish/publish');
45
45
  }
46
46
 
47
47
  async publishImageText({ title, text, tags = [], images = [] }) {
@@ -53,7 +53,7 @@ export class XhsAdapter {
53
53
 
54
54
  // Check if we got redirected away (login expired)
55
55
  const urlAfterNav = await this._getUrl();
56
- if (!urlAfterNav.includes('creator.xiaohongshu.com/publish')) {
56
+ if (!urlAfterNav.includes('creator.xiaohongshu.com/publish/publish')) {
57
57
  throw new Error(`LOGIN_EXPIRED: 跳转到了 ${urlAfterNav},请重新扫码连接小红书`);
58
58
  }
59
59
 
@@ -120,7 +120,7 @@ export class XhsAdapter {
120
120
  await sleep(3000);
121
121
 
122
122
  const urlAfterNav = await this._getUrl();
123
- if (!urlAfterNav.includes('creator.xiaohongshu.com/publish')) {
123
+ if (!urlAfterNav.includes('creator.xiaohongshu.com/publish/publish')) {
124
124
  throw new Error(`LOGIN_EXPIRED: 跳转到了 ${urlAfterNav},请重新扫码连接小红书`);
125
125
  }
126
126
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.9.44",
3
+ "version": "0.9.46",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -273,8 +273,11 @@ export class BrowserLoginSession {
273
273
  if (this._loginCheckTimer) { clearInterval(this._loginCheckTimer); this._loginCheckTimer = null; }
274
274
  }
275
275
 
276
- close() {
276
+ async close() {
277
277
  this._stopTimers();
278
+ // Use CDP Browser.close for graceful shutdown so Chrome flushes cookies to disk
279
+ try { await this.send('Browser.close', {}, 3000); } catch {}
280
+ await sleep(1000);
278
281
  if (this._ws) { try { this._ws.close(); } catch {} this._ws = null; }
279
282
  if (this._proc) { try { this._proc.kill('SIGKILL'); } catch {} this._proc = null; }
280
283
  }