dsh-mobile-plugin 0.5.151 → 0.5.152
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/lib/mobile/stream.js +8 -0
- package/lib/panel/index.html +2 -2
- package/lib/relay/provider-lines.cjs +21 -1
- package/lib/remote/controller.cjs +2 -0
- package/lib/remote/host.cjs +6 -1
- package/lib/remote/transport.cjs +5 -2
- package/package.json +13 -14
package/lib/mobile/stream.js
CHANGED
|
@@ -46,6 +46,7 @@ const { cutEvent, createToolNameIndex } = require('./wire-cut.js');
|
|
|
46
46
|
const { createQuestionReplyTracker } = require('./question-reply.js');
|
|
47
47
|
const { createPresentedStats } = require('./presented-file-stats.js');
|
|
48
48
|
const { noteLiveEvent, drainLiveSteps, liveStepsOf, liveStepsTurnOf, liveTurnFactsOf, drainLiveTurnFacts, seedLiveTurnFacts, claimLiveWriter, releaseLiveWriter, attachLiveSteps, broadcastLiveSteps } = require('./live-steps.js');
|
|
49
|
+
// 2026-12-01:冷开一条正在跑的会话,内存直播副本丢了就从历史事件重建步骤快照。
|
|
49
50
|
const { readTurnEvents } = require('./session-changes.js');
|
|
50
51
|
const { foldTurnFacts, turnFactsSnapshot } = require('./turn-facts.js');
|
|
51
52
|
const { noteWorkflowEvent, abandonWorkflowLive, workflowRunsOf } = require('./workflow-live.js');
|
|
@@ -585,6 +586,13 @@ async function handleStream(ctx, req, res) {
|
|
|
585
586
|
for (const event of initial.events || []) {
|
|
586
587
|
if (typeof event.type === 'string' && event.type.startsWith('tool-workflow/')) noteWorkflowEvent(ctx, sessionId, event);
|
|
587
588
|
}
|
|
589
|
+
// 2026-12-01 用户报「中途进入正在跑的对话看不到过程入口」:插件进程重启过、或这一轮
|
|
590
|
+
// 的事件没经过开着的流时,直播副本是空的,开流那份快照也就什么都不发。这里把本轮历史
|
|
591
|
+
// 事件喂回直播逻辑重建(同一套 key / 摘要口径,后续增量才不会把同一步算两遍)。只在
|
|
592
|
+
// 副本确实为空时做 —— 副本在说明这一轮一直在被别的流接着,不该用历史覆盖它的实时态。
|
|
593
|
+
if (liveStepsOf(ctx, sessionId).length === 0) {
|
|
594
|
+
for (const event of initial.events || []) noteLiveEvent(ctx, sessionId, event, liveWriterId);
|
|
595
|
+
}
|
|
588
596
|
} catch (error) { logStream(sessionId, 'turn facts initial read failed', error); }
|
|
589
597
|
}
|
|
590
598
|
const openingFacts = liveTurnFactsOf(ctx, sessionId);
|