@yeaft/webchat-agent 1.0.208 → 1.0.209

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.
@@ -30,7 +30,7 @@ import { getLlmConfig, updateLlmConfig, getYeaftSettings, updateYeaftSettings, g
30
30
  import { loadConfig } from '../yeaft/config.js';
31
31
  import { discoverLlmModels } from '../llm-model-discovery.js';
32
32
  import { fetchModelsDev } from '../yeaft/llm/models-dev.js';
33
- import { handleYeaftSessionSend, handleYeaftAskUserAnswer, handleYeaftSubAgentPrompt, handleYeaftTaskCancel, handleYeaftModeSwitch, handleYeaftModelSwitch, resetYeaftSession, refreshLiveSessionConfig, handleYeaftLoadHistory, handleYeaftSearchHistory, handleYeaftLoadHistoryWindow, handleYeaftLoadMoreHistory, handleYeaftAbortThread, handleYeaftAbortAll, handleYeaftAbortTurn, handleYeaftVpSubscribe, handleYeaftVpCreate, handleYeaftVpUpdate, handleYeaftVpDelete, handleYeaftVpRead, handleYeaftListSessions, handleYeaftCreateSession, handleYeaftRenameSession, handleYeaftUpdateSession, handleYeaftUpdateSessionConfig, handleYeaftArchiveSession, handleYeaftDeleteSession, handleYeaftSessionAddMember, handleYeaftSessionRemoveMember, handleYeaftSessionSetDefaultVp, handleYeaftScanWorkdirSessions, handleYeaftRestoreSession, handleYeaftDreamTrigger, handleYeaftFetchToolStats, handleYeaftFetchDebugHistory, handleYeaftMcpList, handleYeaftMcpAdd, handleYeaftMcpRemove, handleYeaftMcpReload, broadcastLanguageChange, broadcastYeaftSessionSnapshotEager, preloadYeaftSkillSlashCommands } from '../yeaft/web-bridge.js';
33
+ import { handleYeaftSessionSend, handleYeaftAskUserAnswer, handleYeaftSubAgentPrompt, handleYeaftTaskCancel, handleYeaftModeSwitch, handleYeaftModelSwitch, resetYeaftSession, refreshLiveSessionConfig, handleYeaftLoadHistory, handleYeaftLoadHistoryOutline, handleYeaftSearchHistory, handleYeaftLoadHistoryWindow, handleYeaftLoadMoreHistory, handleYeaftAbortThread, handleYeaftAbortAll, handleYeaftAbortTurn, handleYeaftVpSubscribe, handleYeaftVpCreate, handleYeaftVpUpdate, handleYeaftVpDelete, handleYeaftVpRead, handleYeaftListSessions, handleYeaftCreateSession, handleYeaftRenameSession, handleYeaftUpdateSession, handleYeaftUpdateSessionConfig, handleYeaftArchiveSession, handleYeaftDeleteSession, handleYeaftSessionAddMember, handleYeaftSessionRemoveMember, handleYeaftSessionSetDefaultVp, handleYeaftScanWorkdirSessions, handleYeaftRestoreSession, handleYeaftDreamTrigger, handleYeaftFetchToolStats, handleYeaftFetchDebugHistory, handleYeaftMcpList, handleYeaftMcpAdd, handleYeaftMcpRemove, handleYeaftMcpReload, broadcastLanguageChange, broadcastYeaftSessionSnapshotEager, preloadYeaftSkillSlashCommands } from '../yeaft/web-bridge.js';
34
34
  import { startYeaftStatusRefresh, forceRefreshYeaftStatus } from '../yeaft/status-cache.js';
35
35
  import { handleWorkCenterRequest } from '../yeaft/work-center/bridge.js';
36
36
 
@@ -505,6 +505,10 @@ export async function handleMessage(msg) {
505
505
  await handleYeaftLoadHistory(msg);
506
506
  break;
507
507
 
508
+ case 'yeaft_load_history_outline':
509
+ await handleYeaftLoadHistoryOutline(msg);
510
+ break;
511
+
508
512
  case 'yeaft_search_history':
509
513
  await handleYeaftSearchHistory(msg);
510
514
  break;
package/index.js CHANGED
@@ -128,7 +128,7 @@ async function detectCapabilities() {
128
128
  // agent build can speak plaintext WS frames. New servers see this and
129
129
  // flip `agent.encryptOutbound = false`, stopping outbound encryption
130
130
  // to this peer. Old servers ignore the unknown capability token.
131
- const capabilities = ['background_tasks', 'file_editor', 'ping_session', 'plaintext-ok', 'work_center', 'session_history_search'];
131
+ const capabilities = ['background_tasks', 'file_editor', 'ping_session', 'plaintext-ok', 'work_center', 'session_history_search', 'session_history_outline'];
132
132
  if (process.platform === 'linux') capabilities.push('work_item_attachments');
133
133
  const pty = await loadNodePty();
134
134
  if (pty) capabilities.push('terminal');
@@ -609,6 +609,24 @@ export async function handleAgentOutput(agentId, agent, msg) {
609
609
  break;
610
610
  }
611
611
 
612
+ case 'yeaft_history_outline': {
613
+ const targetClient = msg._requestClientId ? webClients.get(msg._requestClientId) : null;
614
+ if (targetClient?.authenticated && (CONFIG.skipAuth || targetClient.userId === agent.ownerId)) {
615
+ await sendToWebClient(targetClient, {
616
+ type: 'yeaft_history_outline',
617
+ agentId,
618
+ requestId: msg.requestId ?? null,
619
+ sessionId: msg.sessionId ?? null,
620
+ results: Array.isArray(msg.results) ? msg.results : [],
621
+ hasMore: !!msg.hasMore,
622
+ nextBeforeSeq: msg.nextBeforeSeq ?? null,
623
+ totalCount: Number.isFinite(msg.totalCount) ? msg.totalCount : null,
624
+ ...(msg.error ? { error: msg.error } : {}),
625
+ });
626
+ }
627
+ break;
628
+ }
629
+
612
630
  case 'yeaft_history_search_result': {
613
631
  const targetClient = msg._requestClientId ? webClients.get(msg._requestClientId) : null;
614
632
  if (targetClient?.authenticated && (CONFIG.skipAuth || targetClient.userId === agent.ownerId)) {
@@ -914,6 +914,24 @@ export async function handleClientConversation(clientId, client, msg, checkAgent
914
914
  break;
915
915
  }
916
916
 
917
+ case 'yeaft_load_history_outline': {
918
+ const outlineAgentId = msg.agentId;
919
+ const outlineSessionId = typeof msg.sessionId === 'string' ? msg.sessionId : '';
920
+ if (!outlineAgentId || !outlineSessionId) return;
921
+ if (!await checkAgentAccess(outlineAgentId)) return;
922
+ if (!CONFIG.skipAuth && !yeaftSessionDb.getForAgent(client.userId, outlineAgentId, outlineSessionId)) return;
923
+ await forwardToAgent(outlineAgentId, {
924
+ type: 'yeaft_load_history_outline',
925
+ sessionId: outlineSessionId,
926
+ requestId: typeof msg.requestId === 'string' ? msg.requestId : null,
927
+ limit: typeof msg.limit === 'number' ? msg.limit : 50,
928
+ beforeSeq: typeof msg.beforeSeq === 'number' ? msg.beforeSeq : null,
929
+ includeTotal: msg.includeTotal !== false,
930
+ _requestClientId: clientId,
931
+ });
932
+ break;
933
+ }
934
+
917
935
  case 'yeaft_search_history': {
918
936
  const searchAgentId = msg.agentId;
919
937
  const searchSessionId = typeof msg.sessionId === 'string' ? msg.sessionId : '';
@@ -305,7 +305,7 @@ async function handleAgentMessage(agentId, msg, ws) {
305
305
  'proxy_response_end', 'proxy_ports_update', 'proxy_ws_opened', 'proxy_ws_message',
306
306
  'proxy_ws_closed', 'proxy_ws_error', 'restart_agent_ack', 'upgrade_agent_ack',
307
307
  'directory_listing', 'folders_list', 'models_list', 'yeaft_output', 'yeaft_session_output', 'session_output', 'yeaft_asset_put',
308
- 'yeaft_history_chunk', 'yeaft_history_search_result', 'yeaft_history_window', 'slash_commands_update', 'agent_metrics',
308
+ 'yeaft_history_chunk', 'yeaft_history_outline', 'yeaft_history_search_result', 'yeaft_history_window', 'slash_commands_update', 'agent_metrics',
309
309
  'file_content', 'file_saved', 'file_op_result', 'file_search_result',
310
310
  'git_status_result', 'git_diff_result', 'git_op_result'
311
311
  ]);
@@ -1 +1 @@
1
- {"version":"1.0.208"}
1
+ {"version":"1.0.209"}