@lightcone-ai/daemon 0.9.50 → 0.9.51

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,8 +41,11 @@ export class XhsAdapter {
41
41
  returnByValue: true,
42
42
  });
43
43
  const url = result.result?.value ?? '';
44
- console.error(`[XhsAdapter] checkLoginStatus url=${url}`);
45
- return url.includes('creator.xiaohongshu.com/publish/publish');
44
+ const profileDir = process.env.XHS_PROFILE_DIR ?? '(not set)';
45
+ console.error(`[XhsAdapter] checkLoginStatus url=${url} profileDir=${profileDir}`);
46
+ const loggedIn = url.includes('creator.xiaohongshu.com/publish/publish');
47
+ // Return URL in result so callers can report it for debugging
48
+ return { loggedIn, url, profileDir };
46
49
  }
47
50
 
48
51
  async publishImageText({ title, text, tags = [], images = [] }) {
@@ -152,13 +152,13 @@ server.tool(
152
152
  const label = PLATFORM_LABELS[platform] ?? platform;
153
153
  try {
154
154
  const adapter = await getAdapter(platform);
155
- const loggedIn = await adapter.checkLoginStatus();
155
+ const { loggedIn, url, profileDir } = await adapter.checkLoginStatus();
156
156
  if (loggedIn) {
157
157
  return { content: [{ type: 'text', text: `✓ ${label} 已登录,可以发布内容。` }] };
158
158
  } else {
159
159
  closeSession(platform);
160
160
  return {
161
- content: [{ type: 'text', text: `${label} 未登录或登录已过期。请在「连接外部账号」中重新扫码连接。` }],
161
+ content: [{ type: 'text', text: `${label} 未登录或登录已过期。\n调试信息: 最终URL=${url}\nprofileDir=${profileDir}\n请在「连接外部账号」中重新扫码连接。` }],
162
162
  isError: true,
163
163
  };
164
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.9.50",
3
+ "version": "0.9.51",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {