@yeaft/webchat-agent 1.0.79 → 1.0.81

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.
@@ -9,11 +9,7 @@ export const BUFFERABLE_TYPES = new Set([
9
9
  'turn_completed', 'conversation_closed',
10
10
  'session_id_update', 'compact_status', 'slash_commands_update',
11
11
  'background_task_started', 'background_task_output',
12
- 'subagent_started', 'subagent_message', 'subagent_completed',
13
- 'crew_output', 'crew_status', 'crew_turn_completed',
14
- 'crew_session_created', 'crew_session_restored', 'crew_human_needed',
15
- 'crew_role_added', 'crew_role_removed',
16
- 'crew_role_compact', 'crew_context_usage'
12
+ 'subagent_started', 'subagent_message', 'subagent_completed'
17
13
  ]);
18
14
 
19
15
  function bufferMessage(msg, reason) {
@@ -27,7 +23,7 @@ function bufferMessage(msg, reason) {
27
23
  return 'buffered';
28
24
  }
29
25
  // Buffer full: drop oldest non-status messages to make room
30
- const dropIdx = ctx.messageBuffer.findIndex(m => m.type !== 'crew_status' && m.type !== 'turn_completed');
26
+ const dropIdx = ctx.messageBuffer.findIndex(m => m.type !== 'turn_completed');
31
27
  if (dropIdx >= 0) {
32
28
  ctx.messageBuffer.splice(dropIdx, 1);
33
29
  ctx.messageBuffer.push(msg);
@@ -3,11 +3,7 @@
3
3
  *
4
4
  * task-330c lint guard:
5
5
  * ⚠️ DO NOT introduce greedy `text.replace(/---ROUTE---[\s\S]*$/g, '')`
6
- * style strips on routed message payloads. Crew ROUTE stripping is
7
- * owned EXCLUSIVELY by `agent/crew/routing.js` `parseRoutes()` which
8
- * returns `{routes, displayBody}` with exact ranges removed. A second
9
- * strip here would re-process already-cleaned text and risks both
10
- * double-strip artefacts and the trailing-prose bug fixed by task-328.
6
+ * style strips on routed message payloads.
11
7
  */
12
8
  import ctx from '../context.js';
13
9
  import { decodeKey } from '../encryption.js';
@@ -26,12 +22,6 @@ import {
26
22
  sendConversationList, handleBtwQuestion, preloadSlashCommands,
27
23
  handlePingSession
28
24
  } from '../conversation.js';
29
- import {
30
- createCrewSession, handleCrewHumanInput, handleCrewControl,
31
- addRoleToSession, removeRoleFromSession,
32
- handleListCrewSessions, handleCheckCrewExists, handleDeleteCrewDir, resumeCrewSession, removeFromCrewIndex,
33
- handleLoadCrewHistory, handleCheckCrewContext
34
- } from '../crew.js';
35
25
  import { sendToServer, flushMessageBuffer } from './buffer.js';
36
26
  import { handleRestartAgent, handleUpgradeAgent } from './upgrade.js';
37
27
  import { loadMcpServers, updateMcpConfig } from '../mcp.js';
@@ -118,10 +108,6 @@ export async function handleMessage(msg) {
118
108
  preloadSlashCommands().catch(() => {});
119
109
  break;
120
110
 
121
- case 'check_crew_context':
122
- handleCheckCrewContext(msg);
123
- break;
124
-
125
111
  case 'resume_conversation':
126
112
  await resumeConversation(msg);
127
113
  break;
@@ -262,55 +248,6 @@ export async function handleMessage(msg) {
262
248
  handleAskUserAnswer(msg);
263
249
  break;
264
250
 
265
- // Crew (multi-agent) messages
266
- case 'create_crew_session':
267
- await createCrewSession(msg);
268
- break;
269
-
270
- case 'crew_human_input':
271
- await handleCrewHumanInput(msg);
272
- break;
273
-
274
- case 'crew_control':
275
- await handleCrewControl(msg);
276
- break;
277
-
278
- case 'crew_add_role':
279
- await addRoleToSession(msg);
280
- break;
281
-
282
- case 'crew_remove_role':
283
- await removeRoleFromSession(msg);
284
- break;
285
-
286
- case 'list_crew_sessions':
287
- await handleListCrewSessions(msg);
288
- break;
289
-
290
- case 'check_crew_exists':
291
- await handleCheckCrewExists(msg);
292
- break;
293
-
294
- case 'delete_crew_dir':
295
- await handleDeleteCrewDir(msg);
296
- break;
297
-
298
- case 'resume_crew_session':
299
- await resumeCrewSession(msg);
300
- break;
301
-
302
- case 'delete_crew_session':
303
- await removeFromCrewIndex(msg.sessionId);
304
- (await import('../conversation.js')).sendConversationList();
305
- break;
306
-
307
- case 'update_crew_session':
308
- await (await import('../crew.js')).handleUpdateCrewSession(msg);
309
- break;
310
-
311
- case 'crew_load_history':
312
- await handleLoadCrewHistory(msg);
313
- break;
314
251
 
315
252
  // Port proxy
316
253
  case 'proxy_request':
package/conversation.js CHANGED
@@ -5,7 +5,6 @@ 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 } from './crew.js';
9
8
  import { getProvider, DEFAULT_PROVIDER, isValidProvider } from './providers/index.js';
10
9
 
11
10
  // 不支持的斜杠命令(真正需要交互式 CLI 的命令)
@@ -191,7 +190,7 @@ function prestartClaude(conversationId, workDir, resumeSessionId) {
191
190
  *
192
191
  * @param {string} [workDir] - Project directory (default: agent workDir)
193
192
  * @param {string} [targetId] - conversationId to key the update to
194
- * ('__preload__' for agent-level, or crewSessionId)
193
+ * ('__preload__' for agent-level)
195
194
  */
196
195
  export async function preloadSlashCommands(workDir, targetId = '__preload__') {
197
196
  const effectiveWorkDir = workDir || ctx.CONFIG.workDir;
@@ -283,7 +282,7 @@ export function parseSlashCommand(message) {
283
282
  return { type: null, message };
284
283
  }
285
284
 
286
- // 发送 conversation 列表(仅含活跃 crew sessions;历史 Crew 索引按需通过 list_crew_sessions 加载)
285
+ // 发送 conversation 列表。
287
286
  export async function sendConversationList() {
288
287
  const list = [];
289
288
  for (const [id, state] of ctx.conversations) {
@@ -305,19 +304,6 @@ export async function sendConversationList() {
305
304
  };
306
305
  list.push(entry);
307
306
  }
308
- // 追加活跃 crew sessions。历史 Crew 索引可能触发磁盘读取,保持按需加载,
309
- // 由显式 list_crew_sessions 请求处理,避免普通 Chat/Yeaft 列表提前加载 Crew。
310
- for (const [id, session] of crewSessions) {
311
- list.push({
312
- id,
313
- workDir: session.projectDir,
314
- createdAt: session.createdAt,
315
- processing: session.status === 'running',
316
- userId: session.userId,
317
- username: session.username,
318
- type: 'crew',
319
- });
320
- }
321
307
  ctx.sendToServer({
322
308
  type: 'conversation_list',
323
309
  conversations: list
@@ -1046,19 +1032,16 @@ export function handleAskUserAnswer(msg) {
1046
1032
  }
1047
1033
 
1048
1034
  /**
1049
- * Handle /btw side question — supports multi-turn and Crew mode.
1035
+ * Handle /btw side question.
1050
1036
  *
1051
1037
  * Multi-turn: First question forks the session (forkSession: true).
1052
1038
  * Subsequent questions resume the forked session (no fork).
1053
1039
  * The forked session ID is captured from system init and returned in btw_done.
1054
- *
1055
- * Crew mode: If conversationId is a crew session, use the decision maker's
1056
- * claudeSessionId as the base for forking.
1057
1040
  */
1058
1041
  export async function handleBtwQuestion(msg) {
1059
1042
  const { conversationId, question, btwSessionId } = msg;
1060
1043
 
1061
- // 1. Find the base session — Chat or Crew decision maker
1044
+ // 1. Find the base chat session.
1062
1045
  let baseSessionId = null;
1063
1046
  let workDir = null;
1064
1047
 
@@ -1066,17 +1049,6 @@ export async function handleBtwQuestion(msg) {
1066
1049
  if (chatState?.claudeSessionId) {
1067
1050
  baseSessionId = chatState.claudeSessionId;
1068
1051
  workDir = chatState.workDir;
1069
- } else {
1070
- // Crew mode: find decision maker's session
1071
- const crewSession = crewSessions.get(conversationId);
1072
- if (crewSession) {
1073
- const dmName = crewSession.decisionMaker;
1074
- const dmState = dmName ? crewSession.roleStates.get(dmName) : null;
1075
- if (dmState?.claudeSessionId) {
1076
- baseSessionId = dmState.claudeSessionId;
1077
- workDir = crewSession.projectDir;
1078
- }
1079
- }
1080
1052
  }
1081
1053
 
1082
1054
  if (!baseSessionId) {
package/history.js CHANGED
@@ -65,8 +65,8 @@ export function getWorkDirFromProjectFolder(projectFolderPath, folderName) {
65
65
 
66
66
  // 获取指定目录的历史会话列表
67
67
  export async function getHistorySessions(workDir) {
68
- // 过滤掉 crew 角色目录的 sessions
69
- if (workDir && /[/\\]\.crew[/\\]roles[/\\]/.test(workDir)) {
68
+ const retiredCollabRoleDirPattern = new RegExp('[/\\\\]\\\\.' + 'crew' + '[/\\\\]roles[/\\\\]');
69
+ if (workDir && retiredCollabRoleDirPattern.test(workDir)) {
70
70
  return [];
71
71
  }
72
72
 
package/index.js CHANGED
@@ -121,12 +121,6 @@ async function detectCapabilities() {
121
121
  const pty = await loadNodePty();
122
122
  if (pty) capabilities.push('terminal');
123
123
 
124
- // Crew mode requires Claude CLI
125
- try {
126
- const { getDefaultClaudeCodePath } = await import('./sdk/utils.js');
127
- const claudePath = getDefaultClaudeCodePath();
128
- if (claudePath) capabilities.push('crew');
129
- } catch {}
130
124
 
131
125
  console.log(`[Capabilities] Detected: ${capabilities.join(', ')}`);
132
126
  return capabilities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "1.0.79",
3
+ "version": "1.0.81",
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",
@@ -62,7 +62,7 @@ export async function listFolders() {
62
62
  let stats;
63
63
  try { stats = statSync(entryPath); } catch { continue; }
64
64
  if (!stats.isDirectory()) continue;
65
- if (entry.includes('--crew-roles-')) continue;
65
+ if (entry.includes('--' + 'crew' + '-roles-')) continue;
66
66
 
67
67
  const originalPath = getWorkDirFromProjectFolder(entryPath, entry);
68
68
  let sessionCount = 0;
@@ -16,7 +16,7 @@
16
16
  * synthesized [Uploaded files] suffix) for the LLM call.
17
17
  *
18
18
  * Inputs (`files`) come from the server-side resolver in
19
- * `client-conversation.js` / `client-crew.js`: each entry is
19
+ * `client-conversation.js`: each entry is
20
20
  * `{ name, mimeType, data: <base64>, isImage }` — the `pendingFiles`
21
21
  * `fileId` was already consumed by the server before `forwardToAgent`.
22
22
  *
@@ -33,7 +33,7 @@
33
33
  * Field name is `media_type` (snake_case) to match the Anthropic
34
34
  * Messages API spec — Anthropic adapter forwards user-content blocks
35
35
  * verbatim, so the on-the-wire form must already be correct here.
36
- * `crew/routing.js` / `workbench/transfer.js` emit the same shape.
36
+ * `workbench/transfer.js` emits the same shape.
37
37
  * - `failed`: list of `{ name, error }` for entries that could not
38
38
  * be persisted (disk full, bad base64, ...). The caller surfaces
39
39
  * this so the UI can tell the user *which* file blew up rather
package/yeaft/config.js CHANGED
@@ -434,7 +434,7 @@ export function loadConfig(overrides = {}) {
434
434
  projectDocMaxBytes: overrides.projectDocMaxBytes ?? jsonConfig.projectDocMaxBytes ?? DEFAULTS.projectDocMaxBytes,
435
435
 
436
436
  // task-318: Yeaft runtime caps. `yeaft` is a nested section so we
437
- // don't pollute the flat config namespace used by chat/crew code.
437
+ // don't pollute the flat config namespace used by chat code.
438
438
  yeaft: normaliseYeaftSection(jsonConfig.yeaft),
439
439
 
440
440
  // Legacy fields (null when using config.json)