@lightcone-ai/daemon 0.9.50 → 0.9.52
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
|
-
|
|
45
|
-
|
|
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
package/src/agent-manager.js
CHANGED
|
@@ -585,6 +585,15 @@ export class AgentManager {
|
|
|
585
585
|
? content.map(c => c.text ?? c.content ?? JSON.stringify(c)).join('').slice(0, 1000)
|
|
586
586
|
: JSON.stringify(content ?? event).slice(0, 1000);
|
|
587
587
|
console.log(`[AgentManager][${displayName}] <tool_result> id=${event.tool_use_id ?? '?'} → ${resultStr}`);
|
|
588
|
+
} else if (event.type === 'user') {
|
|
589
|
+
// Tool results come back as user-turn messages in stream-json
|
|
590
|
+
const toolResults = (event.message?.content ?? []).filter(c => c.type === 'tool_result');
|
|
591
|
+
for (const tr of toolResults) {
|
|
592
|
+
const resultStr = Array.isArray(tr.content)
|
|
593
|
+
? tr.content.map(c => c.text ?? c.content ?? JSON.stringify(c)).join('').slice(0, 1000)
|
|
594
|
+
: JSON.stringify(tr.content ?? tr).slice(0, 1000);
|
|
595
|
+
console.log(`[AgentManager][${displayName}] <tool_result> id=${tr.tool_use_id ?? '?'} → ${resultStr}`);
|
|
596
|
+
}
|
|
588
597
|
} else if (event.type === 'result') {
|
|
589
598
|
console.log(`[AgentManager][${displayName}] turn done (stop_reason=${event.stop_reason ?? '?'})`);
|
|
590
599
|
connection.send({ type: 'agent:activity', agentId, teamId, activity: 'online', detail: '', entries: [] });
|