dsh-sidenote 0.4.4 → 0.4.5

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/client.js CHANGED
@@ -4,8 +4,31 @@ window.__ModuleLoader__.load({
4
4
  var module = { exports: {} };
5
5
  var exports = module.exports;
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ //#region \0rolldown/runtime.js
8
+ var __create = Object.create;
9
+ var __defProp = Object.defineProperty;
10
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
+ var __getOwnPropNames = Object.getOwnPropertyNames;
12
+ var __getProtoOf = Object.getPrototypeOf;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
16
+ key = keys[i];
17
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: ((k) => from[k]).bind(null, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
25
+ value: mod,
26
+ enumerable: true
27
+ }) : target, mod));
28
+ //#endregion
7
29
  let react = require("react");
8
30
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
31
+ _deepseek_ai_dsh_client_ui_primitives = __toESM(_deepseek_ai_dsh_client_ui_primitives, 1);
9
32
  let react_jsx_runtime = require("react/jsx-runtime");
10
33
  let react_dom_client = require("react-dom/client");
11
34
  //#region src/client/sidechat/native.ts
@@ -863,6 +886,22 @@ window.__ModuleLoader__.load({
863
886
  };
864
887
  }
865
888
  //#endregion
889
+ //#region src/client/host/currentSession.ts
890
+ /**
891
+ * 当前(在屏)会话 id 的双版本探测:0.1.5 的 SessionListState 带 `current`
892
+ * 字段;0.1.7 移除了它(列表只剩 ids/byId/phase),改为会话视图 DOM 的
893
+ * `[data-conversation-session]` 属性携带。两源皆空 → ''(调用方按既有
894
+ * 降级语义处理:守卫拒绝、工具条不弹、按钮不渲染)。
895
+ */
896
+ function currentSessionIdOf(ctx) {
897
+ try {
898
+ const current = ctx.sessions.list.getSnapshot().current;
899
+ if (typeof current === "string" && current !== "") return current;
900
+ } catch {}
901
+ if (typeof document === "undefined") return "";
902
+ return document.querySelector("[data-conversation-session]")?.dataset.conversationSession ?? "";
903
+ }
904
+ //#endregion
866
905
  //#region src/client/sidechat/metaStore.ts
867
906
  const KEY_PREFIX$1 = "dsh-sidenote:side-meta:v1:";
868
907
  /**
@@ -1130,7 +1169,7 @@ window.__ModuleLoader__.load({
1130
1169
  /** 直连腿:聚焦既有(三级数据源)或铸造新开。 */
1131
1170
  function openOrFocusDirect(ctx, sessionId, draftText) {
1132
1171
  try {
1133
- if (ctx.sessions.list.getSnapshot().current !== sessionId) return false;
1172
+ if (currentSessionIdOf(ctx) !== sessionId) return false;
1134
1173
  const hasDraft = draftText !== void 0 && draftText !== "";
1135
1174
  const live = lastLiveSideChat(sessionId);
1136
1175
  if (live !== void 0) {
@@ -1240,7 +1279,7 @@ window.__ModuleLoader__.load({
1240
1279
  function sideChatTargetTitle(ctx, sessionId) {
1241
1280
  try {
1242
1281
  if (directLeg(ctx)) {
1243
- if (ctx.sessions.list.getSnapshot().current !== sessionId) return void 0;
1282
+ if (currentSessionIdOf(ctx) !== sessionId) return void 0;
1244
1283
  const live = lastLiveSideChat(sessionId);
1245
1284
  if (live !== void 0) return live.readTitle();
1246
1285
  const metas = sideChatMetasOf(sessionId);
@@ -1269,7 +1308,7 @@ window.__ModuleLoader__.load({
1269
1308
  */
1270
1309
  function reopenSideChat(ctx, sessionId, childId, opts) {
1271
1310
  if (directLeg(ctx)) try {
1272
- if (ctx.sessions.list.getSnapshot().current !== sessionId) return false;
1311
+ if (currentSessionIdOf(ctx) !== sessionId) return false;
1273
1312
  if (sideChatMetasOf(sessionId).length > 0) return false;
1274
1313
  sidebarRightOf(ctx).openTab(SIDE_TAB_TYPE, { params: {
1275
1314
  parentSessionId: sessionId,
@@ -2171,6 +2210,15 @@ ${entries.map((entry) => {
2171
2210
  }
2172
2211
  //#endregion
2173
2212
  //#region src/client/sidechat/lifecycle.ts
2213
+ /** 0.1.7+ 显式持有 Session generation;旧宿主无 retain 时保持原行为。 */
2214
+ function retainSession(ctx, sessionId, signal) {
2215
+ const retain = ctx.sessions.retain;
2216
+ if (typeof retain !== "function") return void 0;
2217
+ return retain.call(ctx.sessions, sessionId, {
2218
+ source: "dsh-sidenote",
2219
+ ...signal === void 0 ? {} : { signal }
2220
+ });
2221
+ }
2174
2222
  /**
2175
2223
  * 主线忙碌判定(busy-fork 路由)。2026-09-22 实证的宿主 fork 语义缺口:fork
2176
2224
  * 一个 turn 在飞的会话,会把在飞消息以「未认领的 inbox splice」形态遗传
@@ -2205,9 +2253,9 @@ ${entries.map((entry) => {
2205
2253
  return purgingChildren.has(childId);
2206
2254
  }
2207
2255
  /** 读父会话当前最大节点 seq(折叠边界;读不到不阻断)。 */
2208
- function readMaxNodeSeq(ctx, sessionId) {
2256
+ function readMaxNodeSeq(ctx, sessionId, binding) {
2209
2257
  try {
2210
- const snap = chatSourceOf(ctx, ctx.sessions.binding(sessionId))?.getLegacy();
2258
+ const snap = chatSourceOf(ctx, binding ?? ctx.sessions.binding(sessionId))?.getLegacy();
2211
2259
  let max = -1;
2212
2260
  for (const node of snap?.nodes ?? []) {
2213
2261
  const seq = node.seq;
@@ -2314,19 +2362,28 @@ ${entries.map((entry) => {
2314
2362
  if (purgingChildren.has(childId)) return;
2315
2363
  purgingChildren.add(childId);
2316
2364
  let settled = false;
2365
+ let retained;
2317
2366
  const offs = [];
2367
+ const releaseRetained = () => {
2368
+ retained?.release();
2369
+ retained = void 0;
2370
+ };
2318
2371
  const markPurged = () => {
2319
2372
  updateTabMeta(ctx, parentSessionId, tabId, (cur) => ({
2320
2373
  ...cur,
2321
2374
  inheritedPurged: true
2322
2375
  }));
2323
2376
  };
2324
- const disarm = () => {
2325
- if (settled) return;
2377
+ const stop = () => {
2378
+ if (settled) return false;
2326
2379
  settled = true;
2327
2380
  for (const off of offs) off();
2328
2381
  purgingChildren.delete(childId);
2329
- markPurged();
2382
+ releaseRetained();
2383
+ return true;
2384
+ };
2385
+ const disarm = () => {
2386
+ if (stop()) markPurged();
2330
2387
  };
2331
2388
  /**
2332
2389
  * 子会话投影里「fork 后新增」的用户消息文本(无 = ''):seq ≤ fork 边界的
@@ -2334,7 +2391,7 @@ ${entries.map((entry) => {
2334
2391
  */
2335
2392
  const freshUserText = () => {
2336
2393
  try {
2337
- const nodes = chatSourceOf(ctx, ctx.sessions.binding(childId))?.getLegacy()?.nodes ?? [];
2394
+ const nodes = chatSourceOf(ctx, retained?.binding ?? ctx.sessions.binding(childId))?.getLegacy()?.nodes ?? [];
2338
2395
  for (let i = nodes.length - 1; i >= 0; i -= 1) {
2339
2396
  const n = nodes[i];
2340
2397
  if (n?.kind !== "user" && n?.kind !== "steering") continue;
@@ -2345,13 +2402,18 @@ ${entries.map((entry) => {
2345
2402
  return "";
2346
2403
  };
2347
2404
  try {
2348
- const binding = ctx.sessions.binding(childId);
2405
+ retained = retainSession(ctx, childId);
2406
+ if (retained !== void 0) retained.ready.catch((error) => {
2407
+ if (!stop()) return;
2408
+ console.warn("[dsh-sidenote] 遗传 turn 监护打开子会话失败:", childId, error);
2409
+ });
2410
+ const binding = retained?.binding ?? ctx.sessions.binding(childId);
2349
2411
  const session = binding?.session;
2350
2412
  const cancelFace = session;
2351
2413
  const chat = binding === void 0 ? void 0 : chatSourceOf(ctx, binding);
2352
2414
  if (session === void 0 || typeof cancelFace?.cancel !== "function" || chat === void 0) {
2353
2415
  console.warn("[dsh-sidenote] 子会话 cancel/chat 面缺席,遗传 turn 监护未启用:", childId, "session:", session !== void 0, "chat:", chat !== void 0);
2354
- purgingChildren.delete(childId);
2416
+ stop();
2355
2417
  return;
2356
2418
  }
2357
2419
  const cancelChild = cancelFace.cancel;
@@ -2369,15 +2431,23 @@ ${entries.map((entry) => {
2369
2431
  }
2370
2432
  settled = true;
2371
2433
  for (const off of offs) off();
2372
- cancelChild.call(session).catch((error) => console.warn("[dsh-sidenote] 遗传 turn 取消失败:", error)).finally(() => {
2434
+ let cancellation;
2435
+ try {
2436
+ cancellation = cancelChild.call(session);
2437
+ } catch (error) {
2438
+ cancellation = Promise.reject(error);
2439
+ }
2440
+ cancellation.catch((error) => console.warn("[dsh-sidenote] 遗传 turn 取消失败:", error)).finally(() => {
2373
2441
  purgingChildren.delete(childId);
2374
2442
  markPurged();
2375
2443
  advanceBoundaryPastTail(ctx, parentSessionId, tabId, childId);
2376
2444
  reconcileChildQueueAfterCancel(ctx, childId, expectedPrefix);
2445
+ releaseRetained();
2377
2446
  });
2378
2447
  }));
2379
- } catch {
2380
- purgingChildren.delete(childId);
2448
+ } catch (error) {
2449
+ stop();
2450
+ console.warn("[dsh-sidenote] 遗传 turn 监护初始化失败:", error);
2381
2451
  }
2382
2452
  }
2383
2453
  /**
@@ -2390,19 +2460,35 @@ ${entries.map((entry) => {
2390
2460
  * 两者皆无(主线积压、用户的快手第二条)→ 留在队列里不动(保守不删用户文字)。
2391
2461
  */
2392
2462
  function reconcileChildQueueAfterCancel(ctx, childId, expectedPrefix) {
2463
+ let retained;
2464
+ try {
2465
+ retained = retainSession(ctx, childId);
2466
+ } catch {}
2393
2467
  let attempts = 0;
2468
+ let finished = false;
2469
+ const finish = () => {
2470
+ if (finished) return;
2471
+ finished = true;
2472
+ retained?.release();
2473
+ retained = void 0;
2474
+ };
2394
2475
  const tick = () => {
2395
2476
  attempts += 1;
2396
2477
  try {
2397
- const session = ctx.sessions.binding(childId)?.session;
2478
+ const session = (retained?.binding ?? ctx.sessions.binding(childId))?.session;
2398
2479
  const snap = session?.getSnapshot?.();
2399
- if (session === void 0 || snap === void 0 || snap === null || typeof session.updateQueue !== "function" || typeof session.prompt !== "function") return;
2480
+ if (session === void 0 || snap === void 0 || snap === null || typeof session.updateQueue !== "function" || typeof session.prompt !== "function") {
2481
+ finish();
2482
+ return;
2483
+ }
2400
2484
  if (snap.running === true) {
2401
2485
  if (attempts < 8) setTimeout(tick, 400);
2486
+ else finish();
2402
2487
  return;
2403
2488
  }
2404
2489
  const updateQueue = session.updateQueue.bind(session);
2405
2490
  const prompt = session.prompt.bind(session);
2491
+ const tasks = [];
2406
2492
  for (const item of snap.queue ?? []) {
2407
2493
  if (typeof item?.id !== "string") continue;
2408
2494
  const text = typeof item.text === "string" ? item.text : contentTextOf(item.content);
@@ -2411,12 +2497,16 @@ ${entries.map((entry) => {
2411
2497
  if (!isLeak && !isUserReal) continue;
2412
2498
  const itemId = item.id;
2413
2499
  const content = item.content;
2414
- updateQueue(itemId, { kind: "remove" }).then(() => {
2500
+ tasks.push(updateQueue(itemId, { kind: "remove" }).then(() => {
2415
2501
  if (!isUserReal) return void 0;
2416
2502
  return prompt(content, "queue");
2417
- }).catch((error) => console.warn("[dsh-sidenote] 取消后队列和解失败:", error));
2503
+ }).catch((error) => console.warn("[dsh-sidenote] 取消后队列和解失败:", error)));
2418
2504
  }
2419
- } catch {}
2505
+ if (tasks.length === 0) finish();
2506
+ else Promise.allSettled(tasks).then(finish);
2507
+ } catch {
2508
+ finish();
2509
+ }
2420
2510
  };
2421
2511
  setTimeout(tick, 300);
2422
2512
  }
@@ -2427,20 +2517,34 @@ ${entries.map((entry) => {
2427
2517
  * turn 会短暂可见,属可接受降级)。
2428
2518
  */
2429
2519
  function advanceBoundaryPastTail(ctx, parentSessionId, tabId, childId) {
2520
+ let retained;
2521
+ try {
2522
+ retained = retainSession(ctx, childId);
2523
+ } catch {}
2430
2524
  let attempts = 0;
2525
+ let finished = false;
2526
+ const finish = () => {
2527
+ if (finished) return;
2528
+ finished = true;
2529
+ retained?.release();
2530
+ retained = void 0;
2531
+ };
2431
2532
  const tick = () => {
2432
2533
  attempts += 1;
2433
2534
  try {
2434
- const max = (ctx.sessions.binding(childId)?.session.getSnapshot())?.running === true ? void 0 : readMaxNodeSeq(ctx, childId);
2535
+ const binding = retained?.binding ?? ctx.sessions.binding(childId);
2536
+ const max = (binding?.session.getSnapshot())?.running === true ? void 0 : readMaxNodeSeq(ctx, childId, binding);
2435
2537
  if (max !== void 0) {
2436
2538
  updateTabMeta(ctx, parentSessionId, tabId, (cur) => ({
2437
2539
  ...cur,
2438
2540
  boundarySeq: Math.max(cur.boundarySeq ?? -1, max)
2439
2541
  }));
2542
+ finish();
2440
2543
  return;
2441
2544
  }
2442
2545
  } catch {}
2443
2546
  if (attempts < 8) setTimeout(tick, 400);
2547
+ else finish();
2444
2548
  };
2445
2549
  setTimeout(tick, 300);
2446
2550
  }
@@ -2482,7 +2586,7 @@ ${entries.map((entry) => {
2482
2586
  ...snapshotOnly ? { snapshotOnly: true } : {},
2483
2587
  ...leakedPromptPrefix !== void 0 ? { leakedPromptPrefix } : {}
2484
2588
  }));
2485
- try {
2589
+ if (typeof owner.workspaces.unarchiveSession !== "function") try {
2486
2590
  await owner.workspaces.archiveSession(forked);
2487
2591
  } catch (error) {
2488
2592
  console.warn("[dsh-sidenote] 归档侧边会话失败(会话列表可能短暂可见):", error);
@@ -2579,6 +2683,17 @@ ${entries.map((entry) => {
2579
2683
  } catch {}
2580
2684
  }
2581
2685
  /**
2686
+ * 0.1.7 自愈:旧版本插件把侧边子会话归档隐藏,ArchivedSessionGate 会拒跑它
2687
+ * 的模型步(turn/end blocked)。面板挂载时对 childId 幂等 unarchive;
2688
+ * 旧宿主无此 API 时 no-op。
2689
+ */
2690
+ function unarchiveSideSession(ctx, sessionId) {
2691
+ if (sessionId === void 0) return;
2692
+ const unarchive = ctx.workspaces.unarchiveSession;
2693
+ if (typeof unarchive !== "function") return;
2694
+ unarchive.call(ctx.workspaces, sessionId).catch(() => {});
2695
+ }
2696
+ /**
2582
2697
  * 打开非 staged 会话的事件窗口(off-face:open() 在 concrete Session 上是
2583
2698
  * public 且幂等,但不在 SessionFace 契约上——契约面只有 staged 会话会被
2584
2699
  * 运行时自动 open)。feature-check + 吞错,运行时若移除则降级为只发不收。
@@ -2974,6 +3089,38 @@ ${entries.map((entry) => {
2974
3089
  };
2975
3090
  }
2976
3091
  //#endregion
3092
+ //#region src/client/host/icons.ts
3093
+ const EmptyIcon = () => null;
3094
+ const iconExports = _deepseek_ai_dsh_client_ui_primitives;
3095
+ /** Prefer the weight-named 0.1.7 export, then fall back to the legacy size-named export. */
3096
+ function resolveIcon(exports, modernName, legacyName) {
3097
+ return exports[modernName] ?? exports[legacyName] ?? EmptyIcon;
3098
+ }
3099
+ const icon = (modernName, legacyName) => resolveIcon(iconExports, modernName, legacyName);
3100
+ const IconNewChatOutline16 = icon("IconNewChatOutlineRegular", "IconNewChatOutline16");
3101
+ const IconCheckOutline16 = icon("IconCheckOutlineRegular", "IconCheckOutline16");
3102
+ const IconListPenOutline16 = icon("IconListPenOutlineRegular", "IconListPenOutline16");
3103
+ const IconEditOutline16 = icon("IconEditOutlineRegular", "IconEditOutline16");
3104
+ const IconTrashOutline16 = icon("IconTrashOutlineRegular", "IconTrashOutline16");
3105
+ const IconPlayOutline16 = icon("IconPlayOutlineRegular", "IconPlayOutline16");
3106
+ const IconCordisPluginOutline14 = icon("IconCordisPluginOutlineRegular", "IconCordisPluginOutline14");
3107
+ const IconBranchOutline16 = icon("IconBranchOutlineRegular", "IconBranchOutline16");
3108
+ const IconShareOutline16 = icon("IconShareOutlineRegular", "IconShareOutline16");
3109
+ const IconChevronDownOutline14 = icon("IconChevronDownOutlineRegular", "IconChevronDownOutline14");
3110
+ const IconCloseOutline16 = icon("IconCloseOutlineRegular", "IconCloseOutline16");
3111
+ const IconRightUpOutline16 = icon("IconRightUpOutlineRegular", "IconRightUpOutline16");
3112
+ const IconSearchOutline16 = icon("IconSearchOutlineRegular", "IconSearchOutline16");
3113
+ const IconGlobeOutline14 = icon("IconGlobeOutlineRegular", "IconGlobeOutline14");
3114
+ const IconCodeOutline16 = icon("IconCodeOutlineRegular", "IconCodeOutline16");
3115
+ const IconChecklistOutline14 = icon("IconChecklistOutlineRegular", "IconChecklistOutline14");
3116
+ const IconThinkOutline16 = icon("IconThinkOutlineRegular", "IconThinkOutline16");
3117
+ const IconInspectOutline12 = icon("IconInspectOutlineRegular", "IconInspectOutline12");
3118
+ const IconPaperclipOutline16 = icon("IconPaperclipOutlineRegular", "IconPaperclipOutline16");
3119
+ const IconStopFill16 = icon("IconStopFillRegular", "IconStopFill16");
3120
+ const IconSendOutline16 = icon("IconSendOutlineRegular", "IconSendOutline16");
3121
+ const IconWarningOutline16 = icon("IconWarningOutlineRegular", "IconWarningOutline16");
3122
+ const IconQuestionOutline14 = icon("IconQuestionOutlineRegular", "IconQuestionOutline14");
3123
+ //#endregion
2977
3124
  //#region src/client/bridge.ts
2978
3125
  const sideChatBridge = { current: null };
2979
3126
  //#endregion
@@ -3122,95 +3269,95 @@ ${entries.map((entry) => {
3122
3269
  document.head.appendChild(tag);
3123
3270
  }
3124
3271
  var sidechat_module_css_default = {
3125
- "input": "_5KEEsG_input",
3272
+ "pendingOptionActive": "_5KEEsG_pendingOptionActive",
3126
3273
  "sendButton": "_5KEEsG_sendButton",
3127
- "body": "_5KEEsG_body",
3274
+ "composerCard": "_5KEEsG_composerCard",
3275
+ "modelLabel": "_5KEEsG_modelLabel",
3276
+ "transcript": "_5KEEsG_transcript",
3277
+ "toolLocations": "_5KEEsG_toolLocations",
3278
+ "densityToggle": "_5KEEsG_densityToggle",
3279
+ "dotRunning": "_5KEEsG_dotRunning",
3280
+ "dotPending": "_5KEEsG_dotPending",
3281
+ "pendingCard": "_5KEEsG_pendingCard",
3282
+ "headerSide": "_5KEEsG_headerSide",
3283
+ "pendingActions": "_5KEEsG_pendingActions",
3284
+ "userRow": "_5KEEsG_userRow",
3285
+ "input": "_5KEEsG_input",
3286
+ "snapshotText": "_5KEEsG_snapshotText",
3287
+ "writeNotice": "_5KEEsG_writeNotice",
3128
3288
  "empty": "_5KEEsG_empty",
3129
- "flowRowError": "_5KEEsG_flowRowError",
3289
+ "composer": "_5KEEsG_composer",
3290
+ "slashItemActive": "_5KEEsG_slashItemActive",
3291
+ "root": "_5KEEsG_root",
3292
+ "toolBody": "_5KEEsG_toolBody",
3130
3293
  "sentChipRow": "_5KEEsG_sentChipRow",
3131
- "todoText": "_5KEEsG_todoText",
3132
- "slashItem": "_5KEEsG_slashItem",
3133
- "slashItemDetail": "_5KEEsG_slashItemDetail",
3134
- "noticeRow": "_5KEEsG_noticeRow",
3294
+ "modelSelect": "_5KEEsG_modelSelect",
3135
3295
  "pendingTitle": "_5KEEsG_pendingTitle",
3296
+ "toolGenericBody": "_5KEEsG_toolGenericBody",
3297
+ "stopButton": "_5KEEsG_stopButton",
3298
+ "toolBodyText": "_5KEEsG_toolBodyText",
3299
+ "pendingBtnGhost": "_5KEEsG_pendingBtnGhost",
3300
+ "pendingBtnPrimary": "_5KEEsG_pendingBtnPrimary",
3301
+ "streamingHint": "_5KEEsG_streamingHint",
3302
+ "writeNoticeClose": "_5KEEsG_writeNoticeClose",
3303
+ "toolError": "_5KEEsG_toolError",
3304
+ "pendingBar": "_5KEEsG_pendingBar",
3305
+ "densityRow": "_5KEEsG_densityRow",
3306
+ "slashItemDetail": "_5KEEsG_slashItemDetail",
3307
+ "pendingQuestion": "_5KEEsG_pendingQuestion",
3308
+ "attachButton": "_5KEEsG_attachButton",
3309
+ "assistantBody": "_5KEEsG_assistantBody",
3310
+ "body": "_5KEEsG_body",
3311
+ "slashGroupTitle": "_5KEEsG_slashGroupTitle",
3312
+ "errorRow": "_5KEEsG_errorRow",
3313
+ "slashItemName": "_5KEEsG_slashItemName",
3136
3314
  "userBubble": "_5KEEsG_userBubble",
3315
+ "attachImg": "_5KEEsG_attachImg",
3316
+ "snapshotBody": "_5KEEsG_snapshotBody",
3317
+ "pendingOption": "_5KEEsG_pendingOption",
3137
3318
  "toolCard": "_5KEEsG_toolCard",
3138
- "slashMenu": "_5KEEsG_slashMenu",
3139
- "stateDetail": "_5KEEsG_stateDetail",
3140
- "pendingQHeader": "_5KEEsG_pendingQHeader",
3141
- "densityToggle": "_5KEEsG_densityToggle",
3142
- "pendingActions": "_5KEEsG_pendingActions",
3143
- "reflowButton": "_5KEEsG_reflowButton",
3144
- "todoDot": "_5KEEsG_todoDot",
3145
- "assistantBody": "_5KEEsG_assistantBody",
3146
- "reasoning": "_5KEEsG_reasoning",
3147
- "composerCard": "_5KEEsG_composerCard",
3148
- "pendingQText": "_5KEEsG_pendingQText",
3149
- "userRow": "_5KEEsG_userRow",
3150
- "pendingCard": "_5KEEsG_pendingCard",
3151
- "pendingBar": "_5KEEsG_pendingBar",
3152
3319
  "parentStrip": "_5KEEsG_parentStrip",
3153
- "assistantRow": "_5KEEsG_assistantRow",
3154
- "todoItem": "_5KEEsG_todoItem",
3155
- "stopButton": "_5KEEsG_stopButton",
3156
- "pendingOption": "_5KEEsG_pendingOption",
3157
- "todoBody": "_5KEEsG_todoBody",
3158
- "errorRow": "_5KEEsG_errorRow",
3159
- "root": "_5KEEsG_root",
3320
+ "pendingCustom": "_5KEEsG_pendingCustom",
3321
+ "attachRail": "_5KEEsG_attachRail",
3160
3322
  "stateScreen": "_5KEEsG_stateScreen",
3161
- "snapshotBody": "_5KEEsG_snapshotBody",
3162
- "toolBodyText": "_5KEEsG_toolBodyText",
3163
- "dotRunning": "_5KEEsG_dotRunning",
3164
- "modelLabel": "_5KEEsG_modelLabel",
3165
- "attachThumb": "_5KEEsG_attachThumb",
3166
- "toolGenericBody": "_5KEEsG_toolGenericBody",
3167
- "emptyIcon": "_5KEEsG_emptyIcon",
3168
- "rowActions": "_5KEEsG_rowActions",
3169
- "emptyText": "_5KEEsG_emptyText",
3323
+ "nativeHost": "_5KEEsG_nativeHost",
3170
3324
  "emptyTitle": "_5KEEsG_emptyTitle",
3171
- "streamingHint": "_5KEEsG_streamingHint",
3172
- "toolError": "_5KEEsG_toolError",
3325
+ "attachThumb": "_5KEEsG_attachThumb",
3326
+ "sentChip": "_5KEEsG_sentChip",
3173
3327
  "dotIdle": "_5KEEsG_dotIdle",
3174
- "inheritedBody": "_5KEEsG_inheritedBody",
3328
+ "rowActions": "_5KEEsG_rowActions",
3329
+ "todoDot": "_5KEEsG_todoDot",
3330
+ "composerFoot": "_5KEEsG_composerFoot",
3175
3331
  "rowPreview": "_5KEEsG_rowPreview",
3176
- "headerSide": "_5KEEsG_headerSide",
3332
+ "inheritedBody": "_5KEEsG_inheritedBody",
3333
+ "todoBody": "_5KEEsG_todoBody",
3177
3334
  "actionGroup": "_5KEEsG_actionGroup",
3178
- "pendingBtnPrimary": "_5KEEsG_pendingBtnPrimary",
3179
- "pendingOptionActive": "_5KEEsG_pendingOptionActive",
3180
- "snapshotText": "_5KEEsG_snapshotText",
3181
- "slashGroupTitle": "_5KEEsG_slashGroupTitle",
3182
- "composerChips": "_5KEEsG_composerChips",
3183
- "composer": "_5KEEsG_composer",
3184
- "nativeHost": "_5KEEsG_nativeHost",
3185
- "transcript": "_5KEEsG_transcript",
3335
+ "stateDetail": "_5KEEsG_stateDetail",
3336
+ "pendingQText": "_5KEEsG_pendingQText",
3337
+ "reasoning": "_5KEEsG_reasoning",
3338
+ "flowRowError": "_5KEEsG_flowRowError",
3186
3339
  "toolHead": "_5KEEsG_toolHead",
3187
- "attachButton": "_5KEEsG_attachButton",
3188
- "pendingQuestion": "_5KEEsG_pendingQuestion",
3189
- "pendingCustom": "_5KEEsG_pendingCustom",
3190
- "pendingDesc": "_5KEEsG_pendingDesc",
3191
- "writeNoticeClose": "_5KEEsG_writeNoticeClose",
3192
- "flowRow": "_5KEEsG_flowRow",
3193
- "pendingOptionDesc": "_5KEEsG_pendingOptionDesc",
3194
- "dotPending": "_5KEEsG_dotPending",
3195
- "sidechat-pulse": "_5KEEsG_sidechat-pulse",
3196
- "attachImg": "_5KEEsG_attachImg",
3197
- "sentChip": "_5KEEsG_sentChip",
3198
- "slashItemActive": "_5KEEsG_slashItemActive",
3340
+ "slashItem": "_5KEEsG_slashItem",
3199
3341
  "toolRunning": "_5KEEsG_toolRunning",
3200
- "toolLocations": "_5KEEsG_toolLocations",
3201
3342
  "reasoningBody": "_5KEEsG_reasoningBody",
3202
- "slashItemName": "_5KEEsG_slashItemName",
3203
- "composerFoot": "_5KEEsG_composerFoot",
3204
- "attachRail": "_5KEEsG_attachRail",
3205
- "pendingHead": "_5KEEsG_pendingHead",
3206
- "toolBody": "_5KEEsG_toolBody",
3343
+ "reflowButton": "_5KEEsG_reflowButton",
3344
+ "todoItem": "_5KEEsG_todoItem",
3207
3345
  "jumpBottom": "_5KEEsG_jumpBottom",
3208
- "modelSelect": "_5KEEsG_modelSelect",
3209
3346
  "attachRemove": "_5KEEsG_attachRemove",
3210
- "densityRow": "_5KEEsG_densityRow",
3347
+ "pendingQHeader": "_5KEEsG_pendingQHeader",
3348
+ "pendingOptionDesc": "_5KEEsG_pendingOptionDesc",
3349
+ "todoText": "_5KEEsG_todoText",
3350
+ "emptyText": "_5KEEsG_emptyText",
3351
+ "sidechat-pulse": "_5KEEsG_sidechat-pulse",
3352
+ "pendingDesc": "_5KEEsG_pendingDesc",
3353
+ "noticeRow": "_5KEEsG_noticeRow",
3211
3354
  "pendingReason": "_5KEEsG_pendingReason",
3212
- "pendingBtnGhost": "_5KEEsG_pendingBtnGhost",
3213
- "writeNotice": "_5KEEsG_writeNotice"
3355
+ "pendingHead": "_5KEEsG_pendingHead",
3356
+ "composerChips": "_5KEEsG_composerChips",
3357
+ "emptyIcon": "_5KEEsG_emptyIcon",
3358
+ "flowRow": "_5KEEsG_flowRow",
3359
+ "assistantRow": "_5KEEsG_assistantRow",
3360
+ "slashMenu": "_5KEEsG_slashMenu"
3214
3361
  };
3215
3362
  //#endregion
3216
3363
  //#region src/client/chat/ToolCard.tsx
@@ -3225,14 +3372,14 @@ ${entries.map((entry) => {
3225
3372
  /** ToolCallKind → 图标(宿主 ui-tool 同族映射;primitives 图标全集见 icons/index.d.ts)。 */
3226
3373
  function kindIcon(kind) {
3227
3374
  switch (kind) {
3228
- case "read": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconListPenOutline16, { size: 14 });
3229
- case "edit": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, { size: 14 });
3230
- case "delete": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, { size: 14 });
3231
- case "move": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRightUpOutline16, { size: 14 });
3232
- case "search": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSearchOutline16, { size: 14 });
3233
- case "execute": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlayOutline16, { size: 14 });
3234
- case "fetch": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconGlobeOutline14, { size: 14 });
3235
- default: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCordisPluginOutline14, { size: 14 });
3375
+ case "read": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconListPenOutline16, { size: 14 });
3376
+ case "edit": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutline16, { size: 14 });
3377
+ case "delete": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconTrashOutline16, { size: 14 });
3378
+ case "move": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRightUpOutline16, { size: 14 });
3379
+ case "search": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSearchOutline16, { size: 14 });
3380
+ case "execute": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPlayOutline16, { size: 14 });
3381
+ case "fetch": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconGlobeOutline14, { size: 14 });
3382
+ default: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCordisPluginOutline14, { size: 14 });
3236
3383
  }
3237
3384
  }
3238
3385
  /** 折叠态读取 hook(viewState store 的 React 绑定,L2 侧)。 */
@@ -3242,7 +3389,7 @@ ${entries.map((entry) => {
3242
3389
  function ToolCard(props) {
3243
3390
  const { model, rowKey, fold } = props;
3244
3391
  const open = useFoldOpen(fold, rowKey);
3245
- const icon = model.kind === "terminal" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlayOutline16, { size: 14 }) : model.kind === "diff" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, { size: 14 }) : model.kind === "read" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCodeOutline16, { size: 14 }) : model.kind === "todo" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChecklistOutline14, { size: 14 }) : model.kind === "generic" ? kindIcon(model.icon) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCordisPluginOutline14, { size: 14 });
3392
+ const icon = model.kind === "terminal" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPlayOutline16, { size: 14 }) : model.kind === "diff" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutline16, { size: 14 }) : model.kind === "read" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCodeOutline16, { size: 14 }) : model.kind === "todo" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChecklistOutline14, { size: 14 }) : model.kind === "generic" ? kindIcon(model.icon) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCordisPluginOutline14, { size: 14 });
3246
3393
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3247
3394
  className: sidechat_module_css_default.flowRow,
3248
3395
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
@@ -3389,7 +3536,7 @@ ${entries.map((entry) => {
3389
3536
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3390
3537
  className: sidechat_module_css_default.flowRow,
3391
3538
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
3392
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconThinkOutline16, { size: 14 }),
3539
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconThinkOutline16, { size: 14 }),
3393
3540
  title: t("thinking"),
3394
3541
  open,
3395
3542
  expandable: true,
@@ -3425,7 +3572,7 @@ ${entries.map((entry) => {
3425
3572
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3426
3573
  className: sidechat_module_css_default.flowRow,
3427
3574
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
3428
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutline16, { size: 14 }),
3575
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconBranchOutline16, { size: 14 }),
3429
3576
  title: t("inheritedLabel", { n: props.count }),
3430
3577
  open,
3431
3578
  expandable: true,
@@ -3467,7 +3614,7 @@ ${entries.map((entry) => {
3467
3614
  children: [
3468
3615
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3469
3616
  className: sidechat_module_css_default.emptyIcon,
3470
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconNewChatOutline16, { size: 32 })
3617
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNewChatOutline16, { size: 32 })
3471
3618
  }),
3472
3619
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3473
3620
  className: sidechat_module_css_default.emptyTitle,
@@ -3488,7 +3635,7 @@ ${entries.map((entry) => {
3488
3635
  children: [
3489
3636
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3490
3637
  className: sidechat_module_css_default.emptyIcon,
3491
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconNewChatOutline16, { size: 32 })
3638
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNewChatOutline16, { size: 32 })
3492
3639
  }),
3493
3640
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3494
3641
  className: sidechat_module_css_default.emptyTitle,
@@ -3529,7 +3676,7 @@ ${entries.map((entry) => {
3529
3676
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3530
3677
  className: sidechat_module_css_default.flowRow,
3531
3678
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
3532
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutline16, { size: 14 }),
3679
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconBranchOutline16, { size: 14 }),
3533
3680
  title: takenAt !== null ? t("snapshotLabelAt", { at: takenAt }) : t("snapshotLabel"),
3534
3681
  open,
3535
3682
  expandable: true,
@@ -3662,7 +3809,7 @@ ${entries.map((entry) => {
3662
3809
  setDone(false);
3663
3810
  }, 1600);
3664
3811
  },
3665
- children: done ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, { size: 12 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconShareOutline16, { size: 12 })
3812
+ children: done ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutline16, { size: 12 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconShareOutline16, { size: 12 })
3666
3813
  });
3667
3814
  }
3668
3815
  const MessageRow = (0, react.memo)(function MessageRow({ message, question, fold, reflow, parentSessionId, sideTitle }) {
@@ -3846,7 +3993,7 @@ ${entries.map((entry) => {
3846
3993
  items.push({
3847
3994
  id: `${group.id}/${m.id}`,
3848
3995
  label: m.name,
3849
- ...selected ? { icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, { size: 12 }) } : {}
3996
+ ...selected ? { icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutline16, { size: 12 }) } : {}
3850
3997
  });
3851
3998
  }
3852
3999
  }
@@ -3862,7 +4009,7 @@ ${entries.map((entry) => {
3862
4009
  onClick: () => {
3863
4010
  open ? setOpen(false) : openMenu();
3864
4011
  },
3865
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("modelLabel", { name: props.modelName ?? t("modelFollowsMain") }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 12 })]
4012
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("modelLabel", { name: props.modelName ?? t("modelFollowsMain") }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, { size: 12 })]
3866
4013
  }),
3867
4014
  items,
3868
4015
  onClose: () => {
@@ -3927,9 +4074,9 @@ ${entries.map((entry) => {
3927
4074
  setOpen(!open);
3928
4075
  },
3929
4076
  children: [
3930
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconInspectOutline12, { size: 12 }),
4077
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconInspectOutline12, { size: 12 }),
3931
4078
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: presetLabel(effective) }),
3932
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 12 })
4079
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, { size: 12 })
3933
4080
  ]
3934
4081
  }),
3935
4082
  items,
@@ -4129,7 +4276,7 @@ ${entries.map((entry) => {
4129
4276
  onClick: () => {
4130
4277
  fileInputRef.current?.click();
4131
4278
  },
4132
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPaperclipOutline16, { size: 14 })
4279
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPaperclipOutline16, { size: 14 })
4133
4280
  }),
4134
4281
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4135
4282
  ref: fileInputRef,
@@ -4163,7 +4310,7 @@ ${entries.map((entry) => {
4163
4310
  onClick: () => {
4164
4311
  session?.cancel().catch(() => {});
4165
4312
  },
4166
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconStopFill16, { size: 12 })
4313
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStopFill16, { size: 12 })
4167
4314
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4168
4315
  type: "button",
4169
4316
  className: sidechat_module_css_default.sendButton,
@@ -4173,7 +4320,7 @@ ${entries.map((entry) => {
4173
4320
  onClick: () => {
4174
4321
  composer.submit();
4175
4322
  },
4176
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSendOutline16, { size: 14 })
4323
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSendOutline16, { size: 14 })
4177
4324
  })
4178
4325
  ]
4179
4326
  })
@@ -4478,7 +4625,7 @@ ${entries.map((entry) => {
4478
4625
  children: [
4479
4626
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4480
4627
  className: sidechat_module_css_default.pendingHead,
4481
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutline16, { size: 14 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4628
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconWarningOutline16, { size: 14 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4482
4629
  className: sidechat_module_css_default.pendingTitle,
4483
4630
  children: t("pendingApprovalTitle")
4484
4631
  })]
@@ -4556,7 +4703,7 @@ ${entries.map((entry) => {
4556
4703
  children: [
4557
4704
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4558
4705
  className: sidechat_module_css_default.pendingHead,
4559
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconQuestionOutline14, { size: 14 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4706
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconQuestionOutline14, { size: 14 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4560
4707
  className: sidechat_module_css_default.pendingTitle,
4561
4708
  children: item.planReview ? t("pendingPlanReview") : t("pendingQuestionTitle")
4562
4709
  })]
@@ -4657,6 +4804,7 @@ ${entries.map((entry) => {
4657
4804
  const meta = parseSideChatMeta(tab.meta);
4658
4805
  const childId = meta.childId;
4659
4806
  const [forkError, setForkError] = (0, react.useState)(null);
4807
+ const [, refreshBinding] = (0, react.useState)(0);
4660
4808
  const forkStarted = (0, react.useRef)(false);
4661
4809
  const prevChildId = (0, react.useRef)(childId);
4662
4810
  (0, react.useEffect)(() => {
@@ -4685,12 +4833,31 @@ ${entries.map((entry) => {
4685
4833
  tab.id,
4686
4834
  childId
4687
4835
  ]);
4836
+ (0, react.useEffect)(() => {
4837
+ if (childId === void 0) return;
4838
+ let acquired;
4839
+ try {
4840
+ acquired = retainSession(ctx, childId);
4841
+ } catch (error) {
4842
+ console.warn("[dsh-sidenote] 侧边会话 retain 失败:", childId, error);
4843
+ return;
4844
+ }
4845
+ if (acquired === void 0) return;
4846
+ const reference = acquired;
4847
+ let released = false;
4848
+ unarchiveSideSession(ctx, childId);
4849
+ refreshBinding((value) => value + 1);
4850
+ reference.ready.catch((error) => {
4851
+ if (!released) console.warn("[dsh-sidenote] 侧边会话打开失败:", childId, error);
4852
+ });
4853
+ return () => {
4854
+ released = true;
4855
+ reference.release();
4856
+ };
4857
+ }, [ctx, childId]);
4688
4858
  const listSnap = (0, react.useSyncExternalStore)((0, react.useCallback)((notify) => ctx.sessions.list.subscribe(notify), [ctx]), () => ctx.sessions.list.getSnapshot());
4689
4859
  const listed = childId !== void 0 && listSnap.byId?.[childId] !== void 0;
4690
4860
  const session = (childId === void 0 ? void 0 : ctx.sessions.binding(childId))?.session;
4691
- (0, react.useEffect)(() => {
4692
- openSessionWindow(session);
4693
- }, [session]);
4694
4861
  (0, react.useEffect)(() => {
4695
4862
  if (meta.forkedMidTurn !== true || meta.inheritedPurged === true) return;
4696
4863
  if (childId === void 0 || session === void 0) return;
@@ -4706,6 +4873,9 @@ ${entries.map((entry) => {
4706
4873
  scope.sessionId,
4707
4874
  tab.id
4708
4875
  ]);
4876
+ (0, react.useEffect)(() => {
4877
+ openSessionWindow(session);
4878
+ }, [session]);
4709
4879
  const phase = phaseOf({
4710
4880
  childId,
4711
4881
  forkError,
@@ -5178,7 +5348,7 @@ ${entries.map((entry) => {
5178
5348
  guide: [{
5179
5349
  order: 60,
5180
5350
  title: () => t("menuTitle"),
5181
- icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconNewChatOutline16, { size: props.size ?? 16 })
5351
+ icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNewChatOutline16, { size: props.size ?? 16 })
5182
5352
  }]
5183
5353
  });
5184
5354
  const disposeBody = ctx.slots.inject("sidebar.right.pane.tab", () => ctx.slots.register({
@@ -5219,8 +5389,9 @@ ${entries.map((entry) => {
5219
5389
  */
5220
5390
  function HeaderSideButton({ ctx }) {
5221
5391
  useLocaleTick();
5222
- const sessionId = (0, react.useSyncExternalStore)((notify) => ctx.sessions.list.subscribe(notify), () => ctx.sessions.list.getSnapshot()).current;
5223
- if (sessionId === void 0 || !canForkFrom(ctx, sessionId)) return null;
5392
+ (0, react.useSyncExternalStore)((notify) => ctx.sessions.list.subscribe(notify), () => ctx.sessions.list.getSnapshot());
5393
+ const sessionId = currentSessionIdOf(ctx);
5394
+ if (sessionId === "" || !canForkFrom(ctx, sessionId)) return null;
5224
5395
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
5225
5396
  type: "button",
5226
5397
  className: sidechat_module_css_default.headerSide,
@@ -5229,7 +5400,7 @@ ${entries.map((entry) => {
5229
5400
  onClick: () => {
5230
5401
  openOrFocusSideChat(ctx, sessionId);
5231
5402
  },
5232
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconNewChatOutline16, { size: 13 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("headerSide") })]
5403
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNewChatOutline16, { size: 13 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("headerSide") })]
5233
5404
  });
5234
5405
  }
5235
5406
  function registerHeaderEntry(ctx) {
@@ -5568,14 +5739,14 @@ ${entries.map((entry) => {
5568
5739
  ctx.effect(() => bs.registerTab({
5569
5740
  id: SIDE_TAB_TYPE,
5570
5741
  title: () => t("menuTitle"),
5571
- icon: (size) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconNewChatOutline16, { size }),
5742
+ icon: (size) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNewChatOutline16, { size }),
5572
5743
  order: 60,
5573
5744
  available: (availableCtx, scope) => canForkFrom(availableCtx, scope.sessionId),
5574
5745
  createTab: (state) => {
5575
5746
  const titles = collectSideTabs(state).map((tab) => tab.title);
5576
5747
  if (nativeSidebarHost(ctx)) {
5577
- const current = ctx.sessions.list.getSnapshot().current;
5578
- if (current !== void 0) for (const live of liveSideChatsOf(current)) titles.push(live.readTitle());
5748
+ const current = currentSessionIdOf(ctx);
5749
+ if (current !== "") for (const live of liveSideChatsOf(current)) titles.push(live.readTitle());
5579
5750
  }
5580
5751
  return { tab: {
5581
5752
  id: mintSideTabId(),
@@ -6066,43 +6237,43 @@ ${entries.map((entry) => {
6066
6237
  document.head.appendChild(tag);
6067
6238
  }
6068
6239
  var annotate_module_css_default = {
6240
+ "chipClearAll": "_SVViG_chipClearAll",
6241
+ "badge": "_SVViG_badge",
6242
+ "editorFooter": "_SVViG_editorFooter",
6243
+ "hintClose": "_SVViG_hintClose",
6244
+ "sentCardQuote": "_SVViG_sentCardQuote",
6069
6245
  "chipRow": "_SVViG_chipRow",
6246
+ "chipRemove": "_SVViG_chipRemove",
6070
6247
  "chipNumber": "_SVViG_chipNumber",
6071
- "hintClose": "_SVViG_hintClose",
6072
- "cancelButton": "_SVViG_cancelButton",
6073
- "toolbarButton": "_SVViG_toolbarButton",
6248
+ "editorError": "_SVViG_editorError",
6249
+ "editorAskRow": "_SVViG_editorAskRow",
6074
6250
  "badgeSent": "_SVViG_badgeSent",
6251
+ "hint": "_SVViG_hint",
6252
+ "toolbarBelow": "_SVViG_toolbarBelow",
6253
+ "chipNote": "_SVViG_chipNote",
6254
+ "saveButton": "_SVViG_saveButton",
6255
+ "chip": "_SVViG_chip",
6075
6256
  "chipWrap": "_SVViG_chipWrap",
6076
- "sentCardTitle": "_SVViG_sentCardTitle",
6257
+ "sentChipRow": "_SVViG_sentChipRow",
6258
+ "deleteButton": "_SVViG_deleteButton",
6259
+ "cancelButton": "_SVViG_cancelButton",
6260
+ "toolbarButton": "_SVViG_toolbarButton",
6261
+ "sentChip": "_SVViG_sentChip",
6077
6262
  "editorTarget": "_SVViG_editorTarget",
6078
- "toolbar": "_SVViG_toolbar",
6079
- "chip": "_SVViG_chip",
6080
- "chipRemove": "_SVViG_chipRemove",
6081
- "editorInput": "_SVViG_editorInput",
6082
- "highlight": "_SVViG_highlight",
6083
- "dshSidenoteHintIn": "_SVViG_dshSidenoteHintIn",
6084
- "chipText": "_SVViG_chipText",
6085
- "editorEdit": "_SVViG_editorEdit",
6086
- "chipClearAll": "_SVViG_chipClearAll",
6087
- "editorError": "_SVViG_editorError",
6088
- "sentCardQuote": "_SVViG_sentCardQuote",
6089
- "editorSpacer": "_SVViG_editorSpacer",
6090
- "editorFooter": "_SVViG_editorFooter",
6091
- "badge": "_SVViG_badge",
6092
- "editorTextarea": "_SVViG_editorTextarea",
6093
- "saveButton": "_SVViG_saveButton",
6094
- "chipPanel": "_SVViG_chipPanel",
6095
6263
  "confirmButton": "_SVViG_confirmButton",
6096
- "editorAskRow": "_SVViG_editorAskRow",
6097
- "sentCardNote": "_SVViG_sentCardNote",
6098
- "chipNote": "_SVViG_chipNote",
6099
6264
  "editorAsk": "_SVViG_editorAsk",
6100
- "toolbarBelow": "_SVViG_toolbarBelow",
6101
- "sentChip": "_SVViG_sentChip",
6102
- "deleteButton": "_SVViG_deleteButton",
6265
+ "sentCardTitle": "_SVViG_sentCardTitle",
6103
6266
  "editorNew": "_SVViG_editorNew",
6104
- "hint": "_SVViG_hint",
6105
- "sentChipRow": "_SVViG_sentChipRow"
6267
+ "chipPanel": "_SVViG_chipPanel",
6268
+ "editorEdit": "_SVViG_editorEdit",
6269
+ "editorTextarea": "_SVViG_editorTextarea",
6270
+ "highlight": "_SVViG_highlight",
6271
+ "editorSpacer": "_SVViG_editorSpacer",
6272
+ "editorInput": "_SVViG_editorInput",
6273
+ "chipText": "_SVViG_chipText",
6274
+ "toolbar": "_SVViG_toolbar",
6275
+ "dshSidenoteHintIn": "_SVViG_dshSidenoteHintIn",
6276
+ "sentCardNote": "_SVViG_sentCardNote"
6106
6277
  };
6107
6278
  //#endregion
6108
6279
  //#region src/client/annotate/hint.tsx
@@ -6218,7 +6389,8 @@ ${entries.map((entry) => {
6218
6389
  useLocaleTick();
6219
6390
  const selectionState = (0, react.useSyncExternalStore)((0, react.useCallback)((cb) => controller.subscribe(cb), [controller]), () => controller.getSnapshot());
6220
6391
  (0, react.useSyncExternalStore)((0, react.useCallback)((cb) => store.subscribe(cb), [store]), () => store.getSnapshot());
6221
- const currentSessionId = (0, react.useSyncExternalStore)((0, react.useCallback)((cb) => ctx.sessions.list.subscribe(cb), [ctx]), () => ctx.sessions.list.getSnapshot()).current ?? "";
6392
+ (0, react.useSyncExternalStore)((0, react.useCallback)((cb) => ctx.sessions.list.subscribe(cb), [ctx]), () => ctx.sessions.list.getSnapshot());
6393
+ const currentSessionId = currentSessionIdOf(ctx);
6222
6394
  const [editor, setEditor] = (0, react.useState)(null);
6223
6395
  const [sideDraft, setSideDraft] = (0, react.useState)(null);
6224
6396
  const [, setGeometryTick] = (0, react.useState)(0);
@@ -6514,7 +6686,7 @@ ${entries.map((entry) => {
6514
6686
  title: t("confirmTitle"),
6515
6687
  "aria-label": t("confirmAskAria"),
6516
6688
  onClick: save,
6517
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, { size: 14 })
6689
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutline16, { size: 14 })
6518
6690
  })]
6519
6691
  }),
6520
6692
  failed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -6684,7 +6856,7 @@ ${entries.map((entry) => {
6684
6856
  title: t("confirmTitle"),
6685
6857
  "aria-label": t("saveNoteAria"),
6686
6858
  onClick: save,
6687
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, { size: 14 })
6859
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutline16, { size: 14 })
6688
6860
  })]
6689
6861
  });
6690
6862
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -6719,7 +6891,7 @@ ${entries.map((entry) => {
6719
6891
  title: t("deleteNote"),
6720
6892
  "aria-label": t("deleteNote"),
6721
6893
  onClick: props.onDelete,
6722
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, { size: 14 })
6894
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconTrashOutline16, { size: 14 })
6723
6895
  }),
6724
6896
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: annotate_module_css_default.editorSpacer }),
6725
6897
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
@@ -6793,7 +6965,7 @@ ${entries.map((entry) => {
6793
6965
  onClick: () => {
6794
6966
  setExpanded((open) => !open);
6795
6967
  },
6796
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconListPenOutline16, { size: 12 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(active.length === 1 ? "chipOne" : "chipMany", { n: active.length }) })]
6968
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconListPenOutline16, { size: 12 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(active.length === 1 ? "chipOne" : "chipMany", { n: active.length }) })]
6797
6969
  }), expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
6798
6970
  className: annotate_module_css_default.chipPanel,
6799
6971
  children: [active.map((annotation) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
@@ -6819,7 +6991,7 @@ ${entries.map((entry) => {
6819
6991
  onClick: () => {
6820
6992
  store.remove(annotation.id);
6821
6993
  },
6822
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, { size: 12 })
6994
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCloseOutline16, { size: 12 })
6823
6995
  })
6824
6996
  ]
6825
6997
  }, annotation.id)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
@@ -6883,7 +7055,7 @@ ${entries.map((entry) => {
6883
7055
  onClick: () => {
6884
7056
  setExpanded((open) => !open);
6885
7057
  },
6886
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconShareOutline16, { size: 12 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(items.length === 1 ? "reflowChipOne" : "reflowChipMany", { n: items.length }) })]
7058
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconShareOutline16, { size: 12 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(items.length === 1 ? "reflowChipOne" : "reflowChipMany", { n: items.length }) })]
6887
7059
  }), expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
6888
7060
  className: annotate_module_css_default.chipPanel,
6889
7061
  children: items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
@@ -6904,7 +7076,7 @@ ${entries.map((entry) => {
6904
7076
  onClick: () => {
6905
7077
  reflow.remove(item.id);
6906
7078
  },
6907
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, { size: 12 })
7079
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCloseOutline16, { size: 12 })
6908
7080
  })]
6909
7081
  }, item.id))
6910
7082
  })]
@@ -6959,13 +7131,7 @@ ${entries.map((entry) => {
6959
7131
  window.clearTimeout(swallowTimer);
6960
7132
  swallowTimer = window.setTimeout(clearSwallow, 2e3);
6961
7133
  };
6962
- const currentSessionId = () => {
6963
- try {
6964
- return ctx.sessions.list.getSnapshot().current ?? "";
6965
- } catch {
6966
- return "";
6967
- }
6968
- };
7134
+ const currentSessionId = () => currentSessionIdOf(ctx);
6969
7135
  /**
6970
7136
  * 异步提交(Workitem_06):inject 尝试(有界等待,见 tryInjectReflows)
6971
7137
  * 在拼稿前——成功项以 plugin-source 事件进父会话日志(不进消息前缀),
@@ -7227,7 +7393,7 @@ ${entries.map((entry) => {
7227
7393
  ctx.effect(() => {
7228
7394
  try {
7229
7395
  const store = createAnnotationStore();
7230
- const controller = createSelectionController(() => ctx.sessions.list.getSnapshot().current ?? "");
7396
+ const controller = createSelectionController(() => currentSessionIdOf(ctx));
7231
7397
  const host = document.createElement("div");
7232
7398
  host.dataset.dshSidenote = "";
7233
7399
  document.body.appendChild(host);