dsh-device-fleet 0.1.0-dev.30 → 0.1.0-dev.31

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/client.js CHANGED
@@ -1373,12 +1373,25 @@ window.__ModuleLoader__.load({
1373
1373
  return () => clearInterval(timer);
1374
1374
  }, [roomId]);
1375
1375
 
1376
- // Only route Chat input into the Room while this view is open.
1376
+ // Only route Chat input into the Room while this view is active. Post a
1377
+ // heartbeat so a hidden view cannot leave a stale route, and stop on unmount.
1377
1378
  useEffect(() => {
1378
1379
  if (!roomId) return undefined;
1379
- const body = JSON.stringify({ roomId, focused: true });
1380
- void fetch('/device-fleet/room/focus', { method: 'POST', headers: { 'content-type': 'application/json' }, body }).catch(() => {})
1380
+ let stopped = false;
1381
+ const report = (focused) => {
1382
+ if (stopped) return;
1383
+ void fetch('/device-fleet/room/focus', {
1384
+ method: 'POST',
1385
+ headers: { 'content-type': 'application/json' },
1386
+ body: JSON.stringify({ roomId, focused }),
1387
+ keepalive: true,
1388
+ }).catch(() => {})
1389
+ }
1390
+ report(true)
1391
+ const timer = setInterval(() => report(true), 5000)
1381
1392
  return () => {
1393
+ stopped = true
1394
+ clearInterval(timer)
1382
1395
  void fetch('/device-fleet/room/focus', {
1383
1396
  method: 'POST',
1384
1397
  headers: { 'content-type': 'application/json' },
@@ -157,4 +157,9 @@ dsh plugin --profile desktop add dsh-device-fleet@dev
157
157
  ## 0.1.0-dev.29(@补全面板 + host 房间发言)
158
158
 
159
159
  - 房间 Dock 读取 DSH 输入框草稿(标准 `useInput` 钩子),输入 `@` 时在输入框上方弹出补全面板,顶部标注「可发送给:所有人 / 指定 agent」,列出 Room 成员并可点击插入 `@name`;
160
- - host agent 在 Chat 的 assistant 消息会同步写入 Room 日志(只读记录,不唤醒参与者),房间页左侧出现 host 气泡与 host 头像。
160
+ - host agent 在 Chat 的 assistant 消息会同步写入 Room 日志(只读记录,不唤醒参与者),房间页左侧出现 host 气泡与 host 头像。
161
+ ## 0.1.0-dev.30(按视图路由输入 + @agent 快捷 chip)
162
+
163
+ - 修复:只有「房间」Conversation View 打开时,DSH 输入框消息才路由给 Room 参与者;在 Chat 页和 host 说话不再唤醒 worker-c(房间页 mount/unmount 向 Host 上报 focus);
164
+ - Room Dock 常驻显示「可发送给 @host @worker-c …」chip,点击通过 inputActions/execCommand 插入 @name,避免与 DSH 原生 @ 文件补全冲突;
165
+ - DSH 原生 `@` 会先弹文件/文件夹补全(系统行为,插件不能替换该 popup)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-device-fleet",
3
- "version": "0.1.0-dev.30",
3
+ "version": "0.1.0-dev.31",
4
4
  "description": "DeepSeek Harness device fleet: enroll devices, direct-call remote tools, shared Rooms with lazy-woken agents, and delegated subagents across devices.",
5
5
  "type": "module",
6
6
  "main": "src/plugin/index.js",
@@ -228,8 +228,10 @@ export function apply(ctx, profileConfig) {
228
228
  stateFile: join(state.dataDir, 'rooms.json'),
229
229
  })
230
230
  // User input is routed to a Room only while its Conversation View is open;
231
- // normal Chat with the host agent must not wake participants.
232
- const focusedRooms = new Set()
231
+ // normal Chat with the host agent must not wake participants. Focus expires so
232
+ // a hidden/unmounted view cannot leave a stale route.
233
+ const focusedRooms = new Map()
234
+ const ROOM_FOCUS_TTL_MS = 20_000
233
235
 
234
236
  // Client approval panel data plane (dev.9). Optional service: host-only
235
237
  // deployments simply do not expose the panel routes.
@@ -335,7 +337,7 @@ export function apply(ctx, profileConfig) {
335
337
  closeRoom: ({ roomId, reason } = {}) => rooms.close({ roomId, reason: reason ?? 'closed by user' }),
336
338
  setRoomFocus: ({ roomId, focused } = {}) => {
337
339
  if (typeof roomId !== 'string' || roomId === '') throw Object.assign(new Error('roomId is required'), { code: 'bad-request' })
338
- if (focused === true) focusedRooms.add(roomId)
340
+ if (focused === true) focusedRooms.set(roomId, Date.now())
339
341
  else focusedRooms.delete(roomId)
340
342
  return { roomId, focused: focused === true }
341
343
  },
@@ -455,6 +457,10 @@ export function apply(ctx, profileConfig) {
455
457
  const room = rooms.rooms.get(session.id)
456
458
  if (!room) return
457
459
  if (!focusedRooms.has(session.id)) return
460
+ if (Date.now() - focusedRooms.get(session.id) > ROOM_FOCUS_TTL_MS) {
461
+ focusedRooms.delete(session.id)
462
+ return
463
+ }
458
464
  const message = event.data
459
465
  if (message?.source?.kind && message.source.kind !== 'user') return
460
466
  const text = (Array.isArray(message?.content) ? message.content : [])