@yeaft/webchat-agent 1.0.470 → 1.0.472
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/connection/message-router.js +14 -3
- package/index.js +17 -8
- package/local-runtime/server/handlers/agent-sync.js +2 -2
- package/local-runtime/server/ws-utils.js +1 -1
- package/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +2 -2
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +1 -1
- package/package.json +1 -1
- package/yeaft/config.js +2 -2
- package/yeaft/dream/session-wiring.js +1 -1
- package/yeaft/session.js +4 -0
- package/yeaft/web-bridge.js +2 -0
- package/yeaft/work-center/feature.js +10 -0
|
@@ -145,7 +145,7 @@ export async function handleMessage(msg) {
|
|
|
145
145
|
|
|
146
146
|
// ★ Phase 1: 通知 server 同步完成
|
|
147
147
|
const runtimeConfig = loadConfig({ dir: ctx.CONFIG?.yeaftDir });
|
|
148
|
-
sendToServer({ type: 'agent_sync_complete', dreamEnabled: runtimeConfig.dream?.enabled
|
|
148
|
+
sendToServer({ type: 'agent_sync_complete', dreamEnabled: runtimeConfig.dream?.enabled === true });
|
|
149
149
|
|
|
150
150
|
// ★ 发送 MCP servers 列表给 server(供前端 Settings > Tools tab 使用)
|
|
151
151
|
if (ctx.mcpServers.length > 0) {
|
|
@@ -360,7 +360,7 @@ export async function handleMessage(msg) {
|
|
|
360
360
|
if (!config.dream || typeof config.dream !== 'object' || Array.isArray(config.dream)) config.dream = {};
|
|
361
361
|
config.dream.enabled = enabled;
|
|
362
362
|
});
|
|
363
|
-
const persisted = loadConfig({ dir: ctx.CONFIG?.yeaftDir }).dream?.enabled
|
|
363
|
+
const persisted = loadConfig({ dir: ctx.CONFIG?.yeaftDir }).dream?.enabled === true;
|
|
364
364
|
if (persisted !== enabled) throw new Error('Dream setting was not persisted');
|
|
365
365
|
try {
|
|
366
366
|
setLiveDreamEnabled(persisted);
|
|
@@ -779,7 +779,18 @@ export async function handleMessage(msg) {
|
|
|
779
779
|
break;
|
|
780
780
|
|
|
781
781
|
case 'work_center_request':
|
|
782
|
-
|
|
782
|
+
if (ctx.CONFIG?.workCenterEnabled === true) {
|
|
783
|
+
await handleWorkCenterRequest(msg);
|
|
784
|
+
} else {
|
|
785
|
+
await sendToServer({
|
|
786
|
+
type: 'work_center_response',
|
|
787
|
+
requestId: typeof msg.requestId === 'string' ? msg.requestId : null,
|
|
788
|
+
op: typeof msg.op === 'string' ? msg.op : '',
|
|
789
|
+
ok: false,
|
|
790
|
+
error: 'Work Center is disabled',
|
|
791
|
+
_requestUserId: msg._requestUserId || null,
|
|
792
|
+
});
|
|
793
|
+
}
|
|
783
794
|
break;
|
|
784
795
|
|
|
785
796
|
// Expert roles definition (for ExpertPanel detail view)
|
package/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
} from './upgrade-command.js';
|
|
26
26
|
import { loadConfig as loadYeaftConfig } from './yeaft/config.js';
|
|
27
27
|
import { initYeaftDir } from './yeaft/init.js';
|
|
28
|
+
import { isWorkCenterEnabled } from './yeaft/work-center/feature.js';
|
|
28
29
|
import { updateBrowserRuntimeSettings } from './yeaft/config-api.js';
|
|
29
30
|
import { bootBrowserRuntime, shutdownBrowserRuntime } from './browser-runtime/index.js';
|
|
30
31
|
import {
|
|
@@ -138,6 +139,7 @@ const CONFIG = {
|
|
|
138
139
|
workDir: WORK_DIR,
|
|
139
140
|
yeaftDir: YEAFT_DIR,
|
|
140
141
|
telemetry: loadYeaftConfig({ dir: YEAFT_DIR }).telemetry,
|
|
142
|
+
workCenterEnabled: isWorkCenterEnabled(),
|
|
141
143
|
reconnectInterval: fileConfig.reconnectInterval,
|
|
142
144
|
agentSecret,
|
|
143
145
|
// 显式禁用的工具(非 MCP 相关)
|
|
@@ -175,9 +177,12 @@ async function detectCapabilities() {
|
|
|
175
177
|
// agent build can speak plaintext WS frames. New servers see this and
|
|
176
178
|
// flip `agent.encryptOutbound = false`, stopping outbound encryption
|
|
177
179
|
// to this peer. Old servers ignore the unknown capability token.
|
|
178
|
-
const capabilities = ['background_tasks', 'file_editor', 'ping_session', 'plaintext-ok', 'workbench_session_routes', '
|
|
180
|
+
const capabilities = ['background_tasks', 'file_editor', 'ping_session', 'plaintext-ok', 'workbench_session_routes', 'session_history_search', 'session_history_outline', 'session_history_window_prefetch', 'file_reference_resolution', 'yeaft_plugins', 'yeaft_managed_skills', 'settings_request_correlation'];
|
|
179
181
|
capabilities.push(getAgentUpgradeCapability());
|
|
180
|
-
if (
|
|
182
|
+
if (isWorkCenterEnabled()) {
|
|
183
|
+
capabilities.push('work_center', 'work_center_message_v2');
|
|
184
|
+
if (process.platform === 'linux') capabilities.push('work_item_attachments');
|
|
185
|
+
}
|
|
181
186
|
const pty = await loadNodePty();
|
|
182
187
|
if (pty) capabilities.push('terminal');
|
|
183
188
|
if (ctx.browserRuntime) {
|
|
@@ -467,12 +472,16 @@ process.on('SIGTERM', async () => {
|
|
|
467
472
|
} catch (err) {
|
|
468
473
|
console.warn(`[Agent] models.dev prime failed (will use config/defaults): ${err?.message || err}`);
|
|
469
474
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
475
|
+
if (isWorkCenterEnabled()) {
|
|
476
|
+
try {
|
|
477
|
+
const { bootWorkCenter } = await import('./yeaft/work-center/bridge.js');
|
|
478
|
+
await bootWorkCenter();
|
|
479
|
+
console.log('[Agent] Work Center watcher started');
|
|
480
|
+
} catch (err) {
|
|
481
|
+
console.warn(`[Agent] Work Center failed to start: ${err?.message || err}`);
|
|
482
|
+
}
|
|
483
|
+
} else {
|
|
484
|
+
console.log('[Agent] Work Center disabled; watcher not started');
|
|
476
485
|
}
|
|
477
486
|
connect();
|
|
478
487
|
})();
|
|
@@ -81,7 +81,7 @@ export async function handleAgentSync(agentId, agent, msg) {
|
|
|
81
81
|
// Phase 1: Agent 同步完成
|
|
82
82
|
case 'agent_sync_complete': {
|
|
83
83
|
agent.status = 'ready';
|
|
84
|
-
agent.dreamEnabled = msg.dreamEnabled
|
|
84
|
+
agent.dreamEnabled = msg.dreamEnabled === true;
|
|
85
85
|
if (agent._syncTimeout) {
|
|
86
86
|
clearTimeout(agent._syncTimeout);
|
|
87
87
|
delete agent._syncTimeout;
|
|
@@ -100,7 +100,7 @@ export async function handleAgentSync(agentId, agent, msg) {
|
|
|
100
100
|
type: 'dream_enabled_changed',
|
|
101
101
|
agentId,
|
|
102
102
|
requestId: msg.requestId,
|
|
103
|
-
enabled: msg.error ? agent.dreamEnabled
|
|
103
|
+
enabled: msg.error ? agent.dreamEnabled === true : msg.enabled !== false,
|
|
104
104
|
...(msg.error ? { error: msg.error } : {}),
|
|
105
105
|
};
|
|
106
106
|
await sendAgentSettingsReply(agentId, agent, 'dream', msg, payload);
|
|
@@ -173,7 +173,7 @@ export async function broadcastAgentList() {
|
|
|
173
173
|
...(agent.capabilityMetadataProvided === true ? { capabilityMetadataProvided: true } : {}),
|
|
174
174
|
version: agent.version || null,
|
|
175
175
|
upgradeAvailable: agent.upgradeAvailable || null,
|
|
176
|
-
dreamEnabled: agent.dreamEnabled
|
|
176
|
+
dreamEnabled: agent.dreamEnabled === true,
|
|
177
177
|
yeaftStatus: agent.yeaftStatus || null,
|
|
178
178
|
proxyPorts: agent.proxyPorts || [],
|
|
179
179
|
conversations: Array.from(agent.conversations.values()).filter(c =>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.472"}
|