@yeaft/webchat-agent 1.0.419 → 1.0.422

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.
@@ -12,7 +12,7 @@ import { handleProxyHttpRequest, handleProxyWsOpen, handleProxyWsMessage, handle
12
12
  import {
13
13
  handleReadFile, handleWriteFile, handleListDirectory,
14
14
  handleGitStatus, handleGitDiff, handleGitAdd, handleGitReset, handleGitRestore, handleGitCommit, handleGitPush,
15
- handleFileSearch, handleCreateFile, handleDeleteFiles, handleMoveFiles, handleCopyFiles, handleUploadToDir, handleTransferFiles
15
+ handleFileSearch, handleResolveFileReferences, handleCreateFile, handleDeleteFiles, handleMoveFiles, handleCopyFiles, handleUploadToDir, handleTransferFiles
16
16
  } from '../workbench.js';
17
17
  import { handleListHistorySessions, handleListFolders, handleListModels } from '../history.js';
18
18
  import {
@@ -288,6 +288,10 @@ export async function handleMessage(msg) {
288
288
  await handleFileSearch(msg);
289
289
  break;
290
290
 
291
+ case 'resolve_file_references':
292
+ await handleResolveFileReferences(msg);
293
+ break;
294
+
291
295
  case 'create_file':
292
296
  await handleCreateFile(msg);
293
297
  break;
package/index.js CHANGED
@@ -161,7 +161,7 @@ async function detectCapabilities() {
161
161
  // agent build can speak plaintext WS frames. New servers see this and
162
162
  // flip `agent.encryptOutbound = false`, stopping outbound encryption
163
163
  // to this peer. Old servers ignore the unknown capability token.
164
- const capabilities = ['background_tasks', 'file_editor', 'ping_session', 'plaintext-ok', 'workbench_session_routes', SAFE_REMOTE_UPGRADE_CAPABILITY, 'work_center', 'work_center_message_v2', 'session_history_search', 'session_history_outline', 'session_history_window_prefetch', 'yeaft_plugins'];
164
+ const capabilities = ['background_tasks', 'file_editor', 'ping_session', 'plaintext-ok', 'workbench_session_routes', SAFE_REMOTE_UPGRADE_CAPABILITY, 'work_center', 'work_center_message_v2', 'session_history_search', 'session_history_outline', 'session_history_window_prefetch', 'file_reference_resolution', 'yeaft_plugins'];
165
165
  if (process.platform === 'linux') capabilities.push('work_item_attachments');
166
166
  const pty = await loadNodePty();
167
167
  if (pty) capabilities.push('terminal');
@@ -44,9 +44,9 @@ EMAIL_CODE_EXPIRES_IN=300000
44
44
  # Agents must provide this secret to connect
45
45
  AGENT_SECRET=agent-shared-secret
46
46
 
47
- # Browser Runtime (disabled by default)
47
+ # Browser Runtime routes are enabled by default; set false to disable them globally.
48
48
  # Production deployments should configure endpoint-scoped TURN credentials.
49
- # BROWSER_RUNTIME_ENABLED=false
49
+ # BROWSER_RUNTIME_ENABLED=true
50
50
  # BROWSER_STUN_URLS=stun:stun.example.com:3478
51
51
  # BROWSER_TURN_URLS=turn:turn.example.com:3478,turns:turn.example.com:443?transport=tcp
52
52
  # BROWSER_TURN_SECRET=replace-with-coturn-rest-api-secret
@@ -119,11 +119,13 @@ export const CONFIG = {
119
119
  // Agent authentication (global fallback — per-user agent_secret is preferred)
120
120
  agentSecret: process.env.AGENT_SECRET || DEFAULT_AGENT_SECRET,
121
121
 
122
- // Browser Runtime stays fail-closed until the Server rollout gate is enabled.
122
+ // Browser setup/viewer routes are available by default; an administrator can
123
+ // still disable the entire surface explicitly. Downloads remain opt-in in the
124
+ // Workbench and all lifecycle/signaling routes stay owner-scoped.
123
125
  // TURN credentials use the standard time-limited HMAC username scheme; Web and
124
126
  // Agent endpoints receive separately scoped usernames from the route ledger.
125
127
  browserRuntime: {
126
- enabled: process.env.BROWSER_RUNTIME_ENABLED === 'true',
128
+ enabled: process.env.BROWSER_RUNTIME_ENABLED !== 'false',
127
129
  iceTransportPolicy: process.env.BROWSER_ICE_TRANSPORT_POLICY === 'relay' ? 'relay' : 'all',
128
130
  stunUrls: commaList(process.env.BROWSER_STUN_URLS),
129
131
  turnUrls: commaList(process.env.BROWSER_TURN_URLS),
@@ -169,7 +169,7 @@ export async function handleAgentFileTerminal(agentId, agent, rawMsg) {
169
169
  'terminal_created', 'terminal_output', 'terminal_closed', 'terminal_error',
170
170
  ]);
171
171
  const oneShotTypes = new Set([
172
- 'file_content', 'file_saved', 'directory_listing', 'file_op_result',
172
+ 'file_content', 'file_references_resolved', 'file_saved', 'directory_listing', 'file_op_result',
173
173
  'git_status_result', 'git_diff_result', 'git_op_result', 'file_search_result',
174
174
  ]);
175
175
  if (!terminalTypes.has(msg.type) && !oneShotTypes.has(msg.type)) return false;
@@ -40,6 +40,7 @@ async function denyWorkbenchRoute(client, msg) {
40
40
  const RESPONSE_TYPES = Object.freeze({
41
41
  terminal_create: ['terminal_created', 'terminal_error'],
42
42
  read_file: ['file_content'],
43
+ resolve_file_references: ['file_references_resolved'],
43
44
  write_file: ['file_saved'],
44
45
  list_directory: ['directory_listing'],
45
46
  git_status: ['git_status_result'],
@@ -190,6 +191,7 @@ export async function handleClientWorkbench(clientId, client, msg, checkAgentAcc
190
191
  break;
191
192
  }
192
193
 
194
+ case 'resolve_file_references':
193
195
  case 'read_file': {
194
196
  const fileAgentId = msg.agentId || client.currentAgent;
195
197
  if (!fileAgentId) { console.warn('[Server] read_file: no agentId'); return; }
@@ -200,7 +202,7 @@ export async function handleClientWorkbench(clientId, client, msg, checkAgentAcc
200
202
  return;
201
203
  }
202
204
  const fileConvId = resolved.conversationId || msg.conversationId || client.currentConversation || '_explorer';
203
- console.log(`[Server] Forwarding read_file to agent ${fileAgentId}, conv=${fileConvId}, path=${msg.filePath}`);
205
+ console.log(`[Server] Forwarding ${msg.type} to agent ${fileAgentId}, conv=${fileConvId}${msg.filePath ? `, path=${msg.filePath}` : ''}`);
204
206
  await forwardCorrelatedWorkbenchRequest({
205
207
  agentId: fileAgentId,
206
208
  clientId,
@@ -228,7 +228,7 @@ export function handleWebConnection(ws, url, req = {}) {
228
228
  const WORKBENCH_TYPES = new Set([
229
229
  ...CLIENT_BROWSER_TYPES,
230
230
  'terminal_create', 'terminal_input', 'terminal_resize', 'terminal_close',
231
- 'read_file', 'write_file', 'create_file', 'delete_files', 'move_files', 'copy_files', 'upload_to_dir', 'file_search',
231
+ 'read_file', 'resolve_file_references', 'write_file', 'create_file', 'delete_files', 'move_files', 'copy_files', 'upload_to_dir', 'file_search',
232
232
  'git_status', 'git_diff', 'git_add', 'git_reset', 'git_restore', 'git_commit', 'git_push',
233
233
  'proxy_update_ports', 'update_file_tabs', 'restore_file_tabs'
234
234
  ]);
@@ -1 +1 @@
1
- {"version":"1.0.419"}
1
+ {"version":"1.0.422"}