@yeaft/webchat-agent 1.0.36 → 1.0.37

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/conversation.js CHANGED
@@ -5,7 +5,7 @@ import ctx from './context.js';
5
5
  import { query } from './sdk/index.js';
6
6
  import { loadSessionHistory } from './history.js';
7
7
  import { startClaudeQuery } from './claude.js';
8
- import { crewSessions, loadCrewIndex } from './crew.js';
8
+ import { crewSessions } from './crew.js';
9
9
  import { getProvider, DEFAULT_PROVIDER, isValidProvider } from './providers/index.js';
10
10
 
11
11
  // 不支持的斜杠命令(真正需要交互式 CLI 的命令)
@@ -283,7 +283,7 @@ export function parseSlashCommand(message) {
283
283
  return { type: null, message };
284
284
  }
285
285
 
286
- // 发送 conversation 列表(含活跃 crew sessions + 索引中已停止的 crew sessions)
286
+ // 发送 conversation 列表(仅含活跃 crew sessions;历史 Crew 索引按需通过 list_crew_sessions 加载)
287
287
  export async function sendConversationList() {
288
288
  const list = [];
289
289
  for (const [id, state] of ctx.conversations) {
@@ -305,10 +305,9 @@ export async function sendConversationList() {
305
305
  };
306
306
  list.push(entry);
307
307
  }
308
- // 追加活跃 crew sessions
309
- const activeCrewIds = new Set();
308
+ // 追加活跃 crew sessions。历史 Crew 索引可能触发磁盘读取,保持按需加载,
309
+ // 由显式 list_crew_sessions 请求处理,避免普通 Chat/Yeaft 列表提前加载 Crew。
310
310
  for (const [id, session] of crewSessions) {
311
- activeCrewIds.add(id);
312
311
  list.push({
313
312
  id,
314
313
  workDir: session.projectDir,
@@ -319,25 +318,6 @@ export async function sendConversationList() {
319
318
  type: 'crew',
320
319
  });
321
320
  }
322
- // 追加索引中已停止的 crew sessions(不重复)
323
- try {
324
- const index = await loadCrewIndex();
325
- for (const entry of index) {
326
- if (!activeCrewIds.has(entry.sessionId)) {
327
- list.push({
328
- id: entry.sessionId,
329
- workDir: entry.projectDir,
330
- createdAt: entry.createdAt,
331
- processing: false,
332
- userId: entry.userId,
333
- username: entry.username,
334
- type: 'crew'
335
- });
336
- }
337
- }
338
- } catch (e) {
339
- console.warn('[sendConversationList] Failed to load crew index:', e.message);
340
- }
341
321
  ctx.sendToServer({
342
322
  type: 'conversation_list',
343
323
  conversations: list
package/crew/session.js CHANGED
@@ -325,18 +325,20 @@ export async function handleListCrewSessions(msg) {
325
325
  ? index.filter(e => !e.agentId || e.agentId === agentId)
326
326
  : index;
327
327
 
328
- for (const entry of filtered) {
328
+ const sessions = filtered.map(entry => {
329
329
  const active = crewSessions.get(entry.sessionId);
330
- if (active) {
331
- entry.status = active.status;
332
- }
333
- }
330
+ return {
331
+ ...entry,
332
+ active: !!active,
333
+ status: active ? active.status : 'stopped'
334
+ };
335
+ });
334
336
 
335
337
  ctx.sendToServer({
336
338
  type: 'crew_sessions_list',
337
339
  requestId,
338
340
  _requestClientId,
339
- sessions: filtered
341
+ sessions
340
342
  });
341
343
  }
342
344
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "Remote worker agent for Yeaft Web Code Agent — connects the native Yeaft engine, CLI providers, and workbench tools",
5
5
  "main": "index.js",
6
6
  "type": "module",