@yeaft/webchat-agent 1.0.471 → 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 +12 -1
- package/index.js +17 -8
- package/local-runtime/version.json +1 -1
- package/package.json +1 -1
- package/yeaft/session.js +4 -0
- package/yeaft/web-bridge.js +2 -0
- package/yeaft/work-center/feature.js +10 -0
|
@@ -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
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.472"}
|
package/package.json
CHANGED
package/yeaft/session.js
CHANGED
|
@@ -50,6 +50,7 @@ import { seedDefaultVps } from './vp/seed-defaults.js';
|
|
|
50
50
|
import { topUpDefaultVps } from './vp/seed-topup.js';
|
|
51
51
|
import { archiveLegacyScopes } from './memory/seed-backfill.js';
|
|
52
52
|
import { createV2DreamScheduler, bootInitEmptyGroups, bootCatchUpStaleDream } from './dream/session-wiring.js';
|
|
53
|
+
import { isWorkCenterEnabled } from './work-center/feature.js';
|
|
53
54
|
import { openSegmentIndex } from './memory/index-db.js';
|
|
54
55
|
import { syncAll as syncSegmentIndex } from './memory/segment-sync.js';
|
|
55
56
|
import { backfillCanonicalContent } from './memory/content-backfill.js';
|
|
@@ -69,6 +70,7 @@ import { existsSync as existsSyncSafe, readFileSync as readFileSyncSafe, mkdirSy
|
|
|
69
70
|
* @property {object[]} [extraTools] — Additional ToolDef objects to register
|
|
70
71
|
* @property {object} [configOverrides] — Additional config overrides
|
|
71
72
|
* @property {Promise<Array>} [managedCliReady] — optional entrypoint-owned CLI setup
|
|
73
|
+
* @property {boolean} [workCenterEnabled] — override Work Center producer-tool registration
|
|
72
74
|
*/
|
|
73
75
|
|
|
74
76
|
/**
|
|
@@ -138,6 +140,7 @@ export async function loadSession(options = {}) {
|
|
|
138
140
|
serverMode = false,
|
|
139
141
|
dreamEnabled,
|
|
140
142
|
managedCliReady = null,
|
|
143
|
+
workCenterEnabled = isWorkCenterEnabled(),
|
|
141
144
|
} = options;
|
|
142
145
|
|
|
143
146
|
// ─── 1. Determine config + store directories ─────────────
|
|
@@ -408,6 +411,7 @@ export async function loadSession(options = {}) {
|
|
|
408
411
|
// ─── 8. Build tool registry ────────────────────────────
|
|
409
412
|
const taskManager = new TaskManager({ yeaftDir });
|
|
410
413
|
const toolRegistry = createFullRegistry();
|
|
414
|
+
if (!workCenterEnabled) toolRegistry.unregister('CreateWorkItem');
|
|
411
415
|
|
|
412
416
|
// Register any extra tools from caller
|
|
413
417
|
for (const tool of extraTools) {
|
package/yeaft/web-bridge.js
CHANGED
|
@@ -5125,6 +5125,7 @@ export async function ensureSessionLoaded(opts = {}) {
|
|
|
5125
5125
|
skipSkills: true,
|
|
5126
5126
|
serverMode: true,
|
|
5127
5127
|
managedCliReady: ctx.managedCliReady,
|
|
5128
|
+
workCenterEnabled: ctx.CONFIG?.workCenterEnabled === true,
|
|
5128
5129
|
});
|
|
5129
5130
|
claimRuntimeOwnership(session);
|
|
5130
5131
|
|
|
@@ -7660,6 +7661,7 @@ export async function resetYeaftSession() {
|
|
|
7660
7661
|
skipSkills: true,
|
|
7661
7662
|
serverMode: true,
|
|
7662
7663
|
managedCliReady: ctx.managedCliReady,
|
|
7664
|
+
workCenterEnabled: ctx.CONFIG?.workCenterEnabled === true,
|
|
7663
7665
|
});
|
|
7664
7666
|
claimRuntimeOwnership(session);
|
|
7665
7667
|
installYeaftRuntimeBridge(session);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Center is opt-in. Only the explicit string "true" enables the feature;
|
|
3
|
+
* missing, malformed, and legacy configurations remain disabled.
|
|
4
|
+
*
|
|
5
|
+
* @param {NodeJS.ProcessEnv|Record<string, string|undefined>} [env]
|
|
6
|
+
* @returns {boolean}
|
|
7
|
+
*/
|
|
8
|
+
export function isWorkCenterEnabled(env = process.env) {
|
|
9
|
+
return env?.YEAFT_WORK_CENTER_ENABLED === 'true';
|
|
10
|
+
}
|