@khorsheed/dsh-client-message-tools 0.3.0 → 0.3.2

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
@@ -4059,12 +4059,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4059
4059
  }
4060
4060
  //#endregion
4061
4061
  //#region lib/typert.remote-client.js
4062
- const _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema = object({
4062
+ let _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema$value;
4063
+ const _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema = () => _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema$value ??= object({
4063
4064
  "sessionId": intersection(string(), unknown()).readonly(),
4064
4065
  "targetSeq": number().readonly(),
4065
4066
  "text": string().readonly()
4066
4067
  });
4067
- const _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema = union([object({
4068
+ let _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema$value;
4069
+ const _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema = () => _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema$value ??= union([object({
4068
4070
  "ok": literal(true).readonly(),
4069
4071
  "value": object({
4070
4072
  "replacementSeq": number().readonly(),
@@ -4080,11 +4082,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4080
4082
  object({ "code": literal("empty-text").readonly() })
4081
4083
  ]).readonly()
4082
4084
  })]);
4083
- const _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema = object({
4085
+ let _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema$value;
4086
+ const _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema = () => _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema$value ??= object({
4084
4087
  "sessionId": intersection(string(), unknown()).readonly(),
4085
4088
  "targetSeq": number().readonly()
4086
4089
  });
4087
- const _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema = union([object({
4090
+ let _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema$value;
4091
+ const _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema = () => _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema$value ??= union([object({
4088
4092
  "ok": literal(true).readonly(),
4089
4093
  "value": object({ "restoredSeq": number().readonly() }).readonly()
4090
4094
  }), object({
@@ -4096,11 +4100,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4096
4100
  object({ "code": literal("not-withdrawn").readonly() })
4097
4101
  ]).readonly()
4098
4102
  })]);
4099
- const _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema = object({
4103
+ let _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema$value;
4104
+ const _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema = () => _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema$value ??= object({
4100
4105
  "sessionId": intersection(string(), unknown()).readonly(),
4101
4106
  "targetSeq": number().readonly()
4102
4107
  });
4103
- const _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema = union([object({
4108
+ let _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema$value;
4109
+ const _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema = () => _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema$value ??= union([object({
4104
4110
  "ok": literal(true).readonly(),
4105
4111
  "value": object({
4106
4112
  "replacementSeq": number().readonly(),
@@ -4131,17 +4137,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4131
4137
  codec: {
4132
4138
  mode: "strict",
4133
4139
  typeSymbol: "@khorsheed/dsh-client-message-tools/types#MessageToolsEditRequest",
4134
- schema: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema
4140
+ create: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema,
4141
+ schema: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema()
4135
4142
  }
4136
4143
  }],
4137
4144
  result: {
4138
4145
  mode: "strict",
4139
4146
  typeSymbol: "@khorsheed/dsh-client-message-tools/types#MessageToolsEditResult",
4140
- schema: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema
4147
+ create: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema,
4148
+ schema: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema()
4141
4149
  },
4142
4150
  sourceLocation: {
4143
4151
  "file": "packages/message-tools/src/index.ts",
4144
- "line": 135,
4152
+ "line": 140,
4145
4153
  "column": 9
4146
4154
  }
4147
4155
  },
@@ -4158,17 +4166,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4158
4166
  codec: {
4159
4167
  mode: "strict",
4160
4168
  typeSymbol: "@khorsheed/dsh-client-message-tools/types#MessageToolsRestoreRequest",
4161
- schema: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema
4169
+ create: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema,
4170
+ schema: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema()
4162
4171
  }
4163
4172
  }],
4164
4173
  result: {
4165
4174
  mode: "strict",
4166
4175
  typeSymbol: "@khorsheed/dsh-client-message-tools/types#MessageToolsRestoreResult",
4167
- schema: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema
4176
+ create: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema,
4177
+ schema: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema()
4168
4178
  },
4169
4179
  sourceLocation: {
4170
4180
  "file": "packages/message-tools/src/index.ts",
4171
- "line": 97,
4181
+ "line": 102,
4172
4182
  "column": 9
4173
4183
  }
4174
4184
  },
@@ -4185,17 +4195,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4185
4195
  codec: {
4186
4196
  mode: "strict",
4187
4197
  typeSymbol: "@khorsheed/dsh-client-message-tools/types#MessageToolsWithdrawRequest",
4188
- schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema
4198
+ create: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema,
4199
+ schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema()
4189
4200
  }
4190
4201
  }],
4191
4202
  result: {
4192
4203
  mode: "strict",
4193
4204
  typeSymbol: "@khorsheed/dsh-client-message-tools/types#MessageToolsWithdrawResult",
4194
- schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema
4205
+ create: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema,
4206
+ schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema()
4195
4207
  },
4196
4208
  sourceLocation: {
4197
4209
  "file": "packages/message-tools/src/index.ts",
4198
- "line": 63,
4210
+ "line": 68,
4199
4211
  "column": 9
4200
4212
  }
4201
4213
  }
@@ -4217,6 +4229,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4217
4229
  getSnapshot: () => void 0,
4218
4230
  subscribe: () => () => {}
4219
4231
  }),
4232
+ turnDataSource: () => ({
4233
+ getSnapshot: () => [],
4234
+ subscribe: () => () => {}
4235
+ }),
4220
4236
  processSource: () => ({
4221
4237
  getSnapshot: () => void 0,
4222
4238
  subscribe: () => () => {}
@@ -4270,10 +4286,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4270
4286
  }
4271
4287
  }
4272
4288
  //#endregion
4273
- //#region ../../node_modules/.pnpm/@deepseek-ai+dsh-session@0.1.5-rc.1_@deepseek-ai+cordis@4.0.2_@deepseek-ai+dsh-scope@0._19a3f679910325ead5ac78e2fac662f7/node_modules/@deepseek-ai/dsh-session/lib/types/surface.js
4289
+ //#region ../../node_modules/.pnpm/@deepseek-ai+dsh-session@0.1.7-rc.2_@deepseek-ai+cordis@4.0.4_@deepseek-ai+dsh-scope@0._96480dbecf47e43f89b841d272151264/node_modules/@deepseek-ai/dsh-session/lib/types/surface.js
4274
4290
  /** Runtime counterpart of the message-producing event union. */
4275
4291
  const SURFACE_EVENT_TYPES = /* @__PURE__ */ new Set([
4276
4292
  "system/message",
4293
+ "developer/message",
4277
4294
  "user/message",
4278
4295
  "assistant/message",
4279
4296
  "tool/result"
@@ -4299,17 +4316,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4299
4316
  }
4300
4317
  /**
4301
4318
  * Model-facing frame preceding a replayed assistant text in a restore: the
4302
- * replay lands as a user-role message (assistant/message cannot carry a
4303
- * plugin source, and the session turn/step trace forbids ad-hoc assistant
4304
- * appends), so the frame keeps the role honest for the model.
4319
+ * replay lands as a user-role message (assistant/message requires the model
4320
+ * source, and the session turn/step trace forbids ad-hoc assistant
4321
+ * appends), so the frame keeps the role honest for the model. On hosts whose
4322
+ * session fold carries the S12 `user/message` projection the frame never
4323
+ * reaches the model — the projection strips it and corrects the role at
4324
+ * derivation time; everywhere else it is the role-honesty device.
4305
4325
  */
4306
4326
  const RESTORED_ASSISTANT_NOTICE = "(以下是先前被撤回、现随恢复放回的助手回复)";
4307
- /** Read the op discriminator off a message source (absent on legacy events). */
4327
+ /** Read the op discriminator off a message source (absent on plain withdrawal/restore events). */
4308
4328
  function messageToolsOp(source) {
4309
4329
  const op = source?.op;
4310
4330
  return op === "edit" || op === "edit-trigger" || op === "restore-assistant" ? op : void 0;
4311
4331
  }
4312
4332
  /**
4333
+ * Whether a durable source belongs to message-tools, in every form the log
4334
+ * can hold: the current producer-owned kind (`message-tools`), the V3→V4
4335
+ * migrated kind (`plugin:message-tools` — released V3 files rewritten once by
4336
+ * the official migration), and the released V3 wrapper a pre-V4 host still
4337
+ * serves verbatim (`{ kind: 'plugin', plugin: 'message-tools' }`).
4338
+ * @param source - the persisted message source to test.
4339
+ * @returns true when the source names this producer.
4340
+ */
4341
+ function isMessageToolsSource(source) {
4342
+ if (typeof source !== "object" || source === null) return false;
4343
+ const record = source;
4344
+ return record.kind === "message-tools" || record.kind === `plugin:message-tools` || record.kind === "plugin" && record.plugin === "message-tools";
4345
+ }
4346
+ /**
4313
4347
  * Strip the model-facing restore frame from a replayed assistant text for
4314
4348
  * DISPLAY: the frame belongs to the model context (role honesty), never to
4315
4349
  * the transcript row. Texts without the frame pass through unchanged.
@@ -4322,13 +4356,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4322
4356
  }
4323
4357
  /**
4324
4358
  * Whether the event is a message-tools WITHDRAWAL replacement: a
4325
- * `user/message` surface replacement whose source carries this plugin's tag
4326
- * and no `op` discriminator (legacy and current withdrawals both).
4359
+ * `user/message` surface replacement whose source names this producer
4360
+ * (any durable form — see {@link isMessageToolsSource}) with no `op`
4361
+ * discriminator.
4327
4362
  * @param event - the session event to test.
4328
4363
  * @returns the event narrowed to a withdrawal replacement when matched.
4329
4364
  */
4330
4365
  function isMessageToolsReplacement(event) {
4331
- return event.type === "user/message" && isReplacementSurfaceEvent(event) && event.data.source.kind === "plugin" && event.data.source.plugin === "message-tools" && messageToolsOp(event.data.source) === void 0;
4366
+ return event.type === "user/message" && isReplacementSurfaceEvent(event) && isMessageToolsSource(event.data.source) && messageToolsOp(event.data.source) === void 0;
4332
4367
  }
4333
4368
  /**
4334
4369
  * Whether the event is a message-tools EDIT replacement: a `user/message`
@@ -4337,7 +4372,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4337
4372
  * @returns the event narrowed to an edit replacement when matched.
4338
4373
  */
4339
4374
  function isMessageToolsEdit(event) {
4340
- return event.type === "user/message" && isReplacementSurfaceEvent(event) && event.data.source.kind === "plugin" && event.data.source.plugin === "message-tools" && messageToolsOp(event.data.source) === "edit";
4375
+ return event.type === "user/message" && isReplacementSurfaceEvent(event) && isMessageToolsSource(event.data.source) && messageToolsOp(event.data.source) === "edit";
4341
4376
  }
4342
4377
  /**
4343
4378
  * Whether the event is a message-tools restore: an append-surface
@@ -4346,7 +4381,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4346
4381
  * @returns the event narrowed to a message-tools restore when matched.
4347
4382
  */
4348
4383
  function isMessageToolsRestore(event) {
4349
- return event.type === "user/message" && event.surfaceOp === "append" && event.data.source.kind === "plugin" && event.data.source.plugin === "message-tools" && messageToolsOp(event.data.source) === void 0;
4384
+ return event.type === "user/message" && event.surfaceOp === "append" && isMessageToolsSource(event.data.source) && messageToolsOp(event.data.source) === void 0;
4350
4385
  }
4351
4386
  /**
4352
4387
  * Whether the event is a message-tools ASSISTANT-text restore replay: an
@@ -4356,7 +4391,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4356
4391
  * @returns the event narrowed to a restore-assistant replay when matched.
4357
4392
  */
4358
4393
  function isMessageToolsRestoreAssistant(event) {
4359
- return event.type === "user/message" && event.surfaceOp === "append" && event.data.source.kind === "plugin" && event.data.source.plugin === "message-tools" && messageToolsOp(event.data.source) === "restore-assistant";
4394
+ return event.type === "user/message" && event.surfaceOp === "append" && isMessageToolsSource(event.data.source) && messageToolsOp(event.data.source) === "restore-assistant";
4360
4395
  }
4361
4396
  //#endregion
4362
4397
  //#region src/client/withdrawn-node.ts
@@ -4395,7 +4430,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4395
4430
  },
4396
4431
  start: (_context, match) => {
4397
4432
  const event = match.event;
4398
- if (!isMessageToolsReplacement(event)) throw new Error("message-tools-withdrawn start requires a message-tools replacement event");
4433
+ if (event.type !== "user/message" || !isMessageToolsReplacement(event)) throw new Error("message-tools-withdrawn start requires a message-tools replacement event");
4399
4434
  return {
4400
4435
  seq: event.seq,
4401
4436
  hiddenStartSeq: event.surfaceOp.startSeq
@@ -4422,7 +4457,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4422
4457
  },
4423
4458
  start: (_context, match) => {
4424
4459
  const event = match.event;
4425
- if (!isMessageToolsEdit(event)) throw new Error("message-tools-edited start requires a message-tools edit replacement event");
4460
+ if (event.type !== "user/message" || !isMessageToolsEdit(event)) throw new Error("message-tools-edited start requires a message-tools edit replacement event");
4426
4461
  return {
4427
4462
  seq: event.seq,
4428
4463
  time: event.time,
@@ -4452,6 +4487,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4452
4487
  pairs.sort((left, right) => left[0] - right[0]);
4453
4488
  return pairs.flat();
4454
4489
  }
4490
+ /**
4491
+ * Fold one message's content blocks into the gallery slot's image input, in
4492
+ * source order. Only `type: 'image'` blocks with an attachment qualify; a
4493
+ * withdrawn user message must keep its images visible in the divider replay
4494
+ * (they are exactly what the withdrawal hid).
4495
+ */
4496
+ function imageSources(blocks) {
4497
+ const images = [];
4498
+ for (const block of blocks) {
4499
+ const b = block;
4500
+ if (b.type === "image" && b.attachment !== void 0) images.push({ attachment: b.attachment });
4501
+ }
4502
+ return images;
4503
+ }
4455
4504
  /** Join text blocks into one plain string. */
4456
4505
  function joinText(blocks) {
4457
4506
  return blocks.filter((block) => block.type === "text" && typeof block.text === "string").map((block) => block.text).join("");
@@ -4464,7 +4513,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4464
4513
  }
4465
4514
  /**
4466
4515
  * The restore-row Definition: one single-event Context per message-tools
4467
- * user-message restore event (append-surface, plugin-tagged), replaying the
4516
+ * user-message restore event (append-surface, producer-tagged), replaying the
4468
4517
  * withdrawn message's content at the tail.
4469
4518
  */
4470
4519
  const restoredMessageDefinition = {
@@ -4479,7 +4528,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4479
4528
  },
4480
4529
  start: (_context, match) => {
4481
4530
  const event = match.event;
4482
- if (!isMessageToolsRestore(event)) throw new Error("message-tools-restored start requires a message-tools restore event");
4531
+ if (event.type !== "user/message" || !isMessageToolsRestore(event)) throw new Error("message-tools-restored start requires a message-tools restore event");
4483
4532
  return {
4484
4533
  seq: event.seq,
4485
4534
  time: event.time,
@@ -4510,7 +4559,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4510
4559
  },
4511
4560
  start: (_context, match) => {
4512
4561
  const event = match.event;
4513
- if (!isMessageToolsRestoreAssistant(event)) throw new Error("message-tools-restored-assistant start requires a restore-assistant replay event");
4562
+ if (event.type !== "user/message" || !isMessageToolsRestoreAssistant(event)) throw new Error("message-tools-restored-assistant start requires a restore-assistant replay event");
4514
4563
  return {
4515
4564
  seq: event.seq,
4516
4565
  time: event.time,
@@ -4525,7 +4574,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4525
4574
  * Count the user-visible messages hidden by one withdrawn span. This mirrors
4526
4575
  * {@link collectWithdrawnEntries}: context injections, tool calls, turn tails,
4527
4576
  * and other UI chrome are not counted as “messages”, while restored/edited
4528
- * rows and reasoning-only assistant steps are.
4577
+ * rows, reasoning-only assistant steps, and image-only user messages are.
4529
4578
  * @param nodes - every materialized chat node.
4530
4579
  * @param startSeq - first hidden seq (inclusive).
4531
4580
  * @param endSeq - the divider's seq (exclusive).
@@ -4535,12 +4584,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4535
4584
  return collectWithdrawnEntries(nodes, startSeq, endSeq).length;
4536
4585
  }
4537
4586
  /**
4538
- * Collect the read-only replay of one withdrawn span: user originals and
4539
- * assistant text, in anchor order. Other kinds carry no user-readable text
4540
- * and are skipped. Assistant-step data is kind-keyed (`data.blocks`, with
4541
- * `data.finalNode.blocks` once settled — `conversation-nodes/assistant.ts`),
4542
- * not type-keyed like message content. Reads the live node store — call from
4543
- * event handlers.
4587
+ * Collect the read-only replay of one withdrawn span: user originals (text
4588
+ * and attached images alike) and assistant text, in anchor order. Other kinds
4589
+ * carry no user-readable content and are skipped. Assistant-step data is
4590
+ * kind-keyed (`data.blocks`, with `data.finalNode.blocks` once settled —
4591
+ * `conversation-nodes/assistant.ts`), not type-keyed like message content.
4592
+ * Reads the live node store — call from event handlers.
4544
4593
  * @param nodes - every materialized chat node.
4545
4594
  * @param startSeq - first hidden seq (inclusive).
4546
4595
  * @param endSeq - the divider's seq (exclusive).
@@ -4551,18 +4600,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4551
4600
  const entries = [];
4552
4601
  for (const node of inSpan) {
4553
4602
  if (node.kind === "user" || node.kind === "steering" || node.kind === "message-tools-edited") {
4554
- const text = joinText(node.data.content ?? []);
4555
- if (text !== "") entries.push({
4603
+ const content = node.data.content ?? [];
4604
+ const text = joinText(content);
4605
+ const images = imageSources(content);
4606
+ if (text !== "" || images.length > 0) entries.push({
4556
4607
  kind: "user",
4557
- text
4608
+ text,
4609
+ images
4558
4610
  });
4559
4611
  continue;
4560
4612
  }
4561
4613
  if (node.kind === "message-tools-restored") {
4562
- const text = node.data.text ?? "";
4563
- if (text !== "") entries.push({
4614
+ const data = node.data;
4615
+ const text = data.text ?? "";
4616
+ const images = imageSources(data.content ?? []);
4617
+ if (text !== "" || images.length > 0) entries.push({
4564
4618
  kind: "user",
4565
- text
4619
+ text,
4620
+ images
4566
4621
  });
4567
4622
  continue;
4568
4623
  }
@@ -4570,7 +4625,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4570
4625
  const text = node.data.text ?? "";
4571
4626
  if (text !== "") entries.push({
4572
4627
  kind: "assistant",
4573
- text
4628
+ text,
4629
+ images: []
4574
4630
  });
4575
4631
  continue;
4576
4632
  }
@@ -4579,7 +4635,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4579
4635
  const text = joinAssistantText(data.finalNode?.blocks ?? data.blocks ?? []);
4580
4636
  if (text !== "") entries.push({
4581
4637
  kind: "assistant",
4582
- text
4638
+ text,
4639
+ images: []
4583
4640
  });
4584
4641
  }
4585
4642
  }
@@ -4628,6 +4685,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4628
4685
  //#endregion
4629
4686
  //#region src/client/dom-hider.ts
4630
4687
  /**
4688
+ * The main-view session: host 0.1.6-alpha.2 dropped SessionListState.current
4689
+ * for the retainedBy.mainView count on each summary (the label is ui-session's
4690
+ * declaration merge, read here as a plain duck-typed count so this package
4691
+ * needs no ui-session edge), with the legacy field as the older-host fallback.
4692
+ */
4693
+ const mainSessionId = (list) => Object.values(list.byId ?? {}).find((session) => (session.retainedBy?.mainView ?? 0) > 0)?.id ?? list.current;
4694
+ /**
4631
4695
  * Flow keys of every chat node inside a hidden span. The withdrawal divider
4632
4696
  * itself (`message-tools-withdrawn`, anchored at the span's exclusive end) is
4633
4697
  * never included — it is the marker that must stay visible. Restore events
@@ -4648,8 +4712,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4648
4712
  if (node.kind === "message-tools-withdrawn") continue;
4649
4713
  if (node.kind === "context") {
4650
4714
  const data = node.data;
4651
- const source = data.source;
4652
- if (source?.kind === "plugin" && source.plugin === "message-tools" || restoredSeqs.has(data.seq ?? -1) || messageToolsOp(data.source) === "edit-trigger") {
4715
+ if (isMessageToolsSource(data.source) || restoredSeqs.has(data.seq ?? -1) || messageToolsOp(data.source) === "edit-trigger") {
4653
4716
  keys.push(node.key);
4654
4717
  continue;
4655
4718
  }
@@ -4772,7 +4835,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4772
4835
  });
4773
4836
  };
4774
4837
  const bindCurrent = () => {
4775
- const current = ctx.sessions.list.getSnapshot().current;
4838
+ const current = mainSessionId(ctx.sessions.list.getSnapshot());
4776
4839
  if (current === activeSession && stopSession !== void 0) return;
4777
4840
  stopSession?.();
4778
4841
  stopSession = void 0;
@@ -5004,7 +5067,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5004
5067
  return true;
5005
5068
  }
5006
5069
  //#endregion
5007
- //#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-store@0.1.5-rc.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-client-store/lib/index.js
5070
+ //#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-store@0.1.7-rc.2_@deepseek-ai+cordis@4.0.4/node_modules/@deepseek-ai/dsh-client-store/lib/index.js
5008
5071
  /**
5009
5072
  * Shallow equality for selector slices (zustand/shallow semantics; travels
5010
5073
  * with the engine so hook consumers need no zustand dependency).
@@ -5017,6 +5080,88 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5017
5080
  }
5018
5081
  //#endregion
5019
5082
  //#region src/client/icons.tsx
5083
+ const IconCheckOutlineMedium = ({ size = 16, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
5084
+ width: size,
5085
+ height: size,
5086
+ className,
5087
+ viewBox: "0 0 16 16",
5088
+ fill: "none",
5089
+ xmlns: "http://www.w3.org/2000/svg",
5090
+ "aria-hidden": "true",
5091
+ strokeWidth: 1.3,
5092
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
5093
+ d: "M2.25 8.5L5.49732 11.7473C5.90519 12.1552 6.57263 12.1344 6.95426 11.7018L13.75 4",
5094
+ stroke: "currentColor"
5095
+ })
5096
+ });
5097
+ const IconChevronDownOutlineMedium = ({ size = 14, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
5098
+ width: size,
5099
+ height: size,
5100
+ className,
5101
+ viewBox: "0 0 16 16",
5102
+ fill: "none",
5103
+ xmlns: "http://www.w3.org/2000/svg",
5104
+ "aria-hidden": "true",
5105
+ strokeWidth: 1.3,
5106
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
5107
+ d: "M4 6L7.29289 9.29289C7.68342 9.68342 8.31658 9.68342 8.70711 9.29289L12 6",
5108
+ stroke: "currentColor"
5109
+ })
5110
+ });
5111
+ const IconChevronRightOutlineMedium = ({ size = 14, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
5112
+ width: size,
5113
+ height: size,
5114
+ className,
5115
+ viewBox: "0 0 16 16",
5116
+ fill: "none",
5117
+ xmlns: "http://www.w3.org/2000/svg",
5118
+ "aria-hidden": "true",
5119
+ strokeWidth: 1.3,
5120
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
5121
+ d: "M6 12L9.29289 8.70711C9.68342 8.31658 9.68342 7.68342 9.29289 7.29289L6 4",
5122
+ stroke: "currentColor"
5123
+ })
5124
+ });
5125
+ const IconCopyOutlineMedium = ({ size = 16, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
5126
+ width: size,
5127
+ height: size,
5128
+ className,
5129
+ viewBox: "0 0 16 16",
5130
+ fill: "none",
5131
+ xmlns: "http://www.w3.org/2000/svg",
5132
+ "aria-hidden": "true",
5133
+ strokeWidth: 1.3,
5134
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
5135
+ x: "1.52075",
5136
+ y: "4.07373",
5137
+ width: "10.3932",
5138
+ height: "10.3932",
5139
+ rx: "2",
5140
+ stroke: "currentColor"
5141
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
5142
+ d: "M11.9792 1.53296C13.36 1.53296 14.4792 2.65225 14.4792 4.03296V9.42847C14.4792 10.3756 13.9521 11.1987 13.1755 11.6228V10.3298C13.3652 10.0787 13.4792 9.7674 13.4792 9.42847V4.03296C13.4792 3.20453 12.8077 2.53296 11.9792 2.53296H6.58374C6.27966 2.53301 5.99684 2.6235 5.7605 2.77905H4.42358C4.85652 2.03463 5.66056 1.53304 6.58374 1.53296H11.9792Z",
5143
+ fill: "currentColor"
5144
+ })]
5145
+ });
5146
+ const IconEditOutlineMedium = ({ size = 16, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
5147
+ width: size,
5148
+ height: size,
5149
+ className,
5150
+ viewBox: "0 0 16 16",
5151
+ fill: "none",
5152
+ xmlns: "http://www.w3.org/2000/svg",
5153
+ "aria-hidden": "true",
5154
+ strokeWidth: 1.3,
5155
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
5156
+ d: "M8.85596 2.69971H4.19971C3.37141 2.69971 2.69992 3.37146 2.69971 4.19971V11.8003C2.69992 12.6285 3.37141 13.3003 4.19971 13.3003H11.8003C12.6283 13.2999 13.3001 12.6283 13.3003 11.8003V7.89893H14.3003V11.8003C14.3001 13.1806 13.1806 14.2999 11.8003 14.3003H4.19971C2.81913 14.3003 1.69992 13.1808 1.69971 11.8003V4.19971C1.69992 2.81918 2.81913 1.69971 4.19971 1.69971H8.85596V2.69971Z",
5157
+ fill: "currentColor"
5158
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
5159
+ d: "M7.7849 8.23878L13.888 2.13574",
5160
+ stroke: "currentColor"
5161
+ })]
5162
+ });
5163
+ //#endregion
5164
+ //#region src/client/icons-local.tsx
5020
5165
  /**
5021
5166
  * Undo arrow (withdraw/restore), rotate-ccw style: a near-full circle arc
5022
5167
  * (~290°, opening at the top) with a corner arrowhead at its left end
@@ -5026,7 +5171,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5026
5171
  * @param props - size and className.
5027
5172
  * @returns the icon element.
5028
5173
  */
5029
- const IconUndoOutline16 = ({ size = 16, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
5174
+ const IconUndoOutlineMedium = ({ size = 16, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
5030
5175
  width: size,
5031
5176
  height: size,
5032
5177
  className,
@@ -5058,7 +5203,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5058
5203
  }
5059
5204
  //#endregion
5060
5205
  //#region \0dsh-css:src/client/ModelChip.module.css.mjs
5061
- const css$3 = ".he-h5G_chip{align-items:center;gap:6px;display:flex;position:relative}.he-h5G_trigger{height:28px;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));cursor:pointer;background:0 0;border:none;border-radius:24px;align-items:center;gap:4px;padding:0 8px;font-size:13px;font-weight:500;display:inline-flex}.he-h5G_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.he-h5G_trigger:disabled{cursor:default;opacity:.6}.he-h5G_triggerEffort{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed))}.he-h5G_menu{z-index:20;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));min-width:220px;max-height:320px;box-shadow:0 4px 16px var(--dsw-alias-shadow,var(--dsw-alias-border-l2,#0000001f));border-radius:8px;padding:4px;position:absolute;bottom:calc(100% + 4px);left:0;overflow-y:auto}.he-h5G_group+.he-h5G_group{margin-top:4px}.he-h5G_groupTitle{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));padding:4px 8px;font-size:12px;line-height:18px}.he-h5G_option{width:100%;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;font-size:13px;line-height:20px;display:flex}.he-h5G_option:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.he-h5G_option:disabled{cursor:default;opacity:.6}.he-h5G_check{width:16px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));flex:none;display:inline-flex}.he-h5G_empty{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));padding:8px;font-size:13px}.he-h5G_selectFailed{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));white-space:nowrap;font-size:12px}";
5206
+ const css$3 = ".IO2TjW_chip{align-items:center;gap:6px;display:flex;position:relative}.IO2TjW_trigger{height:28px;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));cursor:pointer;background:0 0;border:none;border-radius:24px;align-items:center;gap:4px;padding:0 8px;font-size:13px;font-weight:500;display:inline-flex}.IO2TjW_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.IO2TjW_trigger:disabled{cursor:default;opacity:.6}.IO2TjW_triggerEffort{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed))}.IO2TjW_menu{z-index:20;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));min-width:220px;max-height:320px;box-shadow:0 4px 16px var(--dsw-alias-shadow,var(--dsw-alias-border-l2,#0000001f));border-radius:8px;padding:4px;position:absolute;bottom:calc(100% + 4px);left:0;overflow-y:auto}.IO2TjW_group+.IO2TjW_group{margin-top:4px}.IO2TjW_groupTitle{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));padding:4px 8px;font-size:12px;line-height:18px}.IO2TjW_option{width:100%;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;font-size:13px;line-height:20px;display:flex}.IO2TjW_option:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.IO2TjW_option:disabled{cursor:default;opacity:.6}.IO2TjW_check{width:16px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));flex:none;display:inline-flex}.IO2TjW_empty{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));padding:8px;font-size:13px}.IO2TjW_selectFailed{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));white-space:nowrap;font-size:12px}";
5062
5207
  const tagId$3 = "@khorsheed/dsh-client-message-tools/ModelChip.module.css";
5063
5208
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
5064
5209
  const tag = document.createElement("style");
@@ -5068,16 +5213,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5068
5213
  document.head.appendChild(tag);
5069
5214
  }
5070
5215
  var ModelChip_module_css_default = {
5071
- "triggerEffort": "he-h5G_triggerEffort",
5072
- "option": "he-h5G_option",
5073
- "empty": "he-h5G_empty",
5074
- "selectFailed": "he-h5G_selectFailed",
5075
- "groupTitle": "he-h5G_groupTitle",
5076
- "chip": "he-h5G_chip",
5077
- "trigger": "he-h5G_trigger",
5078
- "menu": "he-h5G_menu",
5079
- "group": "he-h5G_group",
5080
- "check": "he-h5G_check"
5216
+ "trigger": "IO2TjW_trigger",
5217
+ "option": "IO2TjW_option",
5218
+ "chip": "IO2TjW_chip",
5219
+ "empty": "IO2TjW_empty",
5220
+ "check": "IO2TjW_check",
5221
+ "groupTitle": "IO2TjW_groupTitle",
5222
+ "triggerEffort": "IO2TjW_triggerEffort",
5223
+ "selectFailed": "IO2TjW_selectFailed",
5224
+ "group": "IO2TjW_group",
5225
+ "menu": "IO2TjW_menu"
5081
5226
  };
5082
5227
  //#endregion
5083
5228
  //#region src/client/ModelChip.tsx
@@ -5168,7 +5313,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5168
5313
  className: ModelChip_module_css_default.triggerEffort,
5169
5314
  children: effortLabel
5170
5315
  }),
5171
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})
5316
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutlineMedium, {})
5172
5317
  ]
5173
5318
  }),
5174
5319
  open && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -5204,7 +5349,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5204
5349
  children: level.label
5205
5350
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5206
5351
  className: ModelChip_module_css_default.check,
5207
- children: effectiveEffort === level.effort ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {}) : null
5352
+ children: effectiveEffort === level.effort ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutlineMedium, {}) : null
5208
5353
  })]
5209
5354
  }, level.key))]
5210
5355
  }),
@@ -5229,7 +5374,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5229
5374
  children: model.name
5230
5375
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5231
5376
  className: ModelChip_module_css_default.check,
5232
- children: selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {}) : null
5377
+ children: selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutlineMedium, {}) : null
5233
5378
  })]
5234
5379
  }, model.id);
5235
5380
  })]
@@ -5250,7 +5395,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5250
5395
  }
5251
5396
  //#endregion
5252
5397
  //#region \0dsh-css:src/client/UserMessageView.module.css.mjs
5253
- const css$2 = ".kCWYAa_userRow{flex-direction:column;align-items:flex-end;gap:6px;display:flex}.kCWYAa_userStack{flex-direction:column;align-items:flex-end;gap:8px;min-width:0;max-width:min(525px,82%);display:flex}.kCWYAa_bubble{background:var(--dsw-specific-bubble,var(--dsw-alias-bg-layer-1));max-width:100%;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));border-radius:22px;padding:10px 16px;font-size:16px;line-height:24px}.kCWYAa_textRun{white-space:pre-wrap;word-break:break-word;font-size:inherit;line-height:inherit}.kCWYAa_refChip{color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));white-space:nowrap;vertical-align:baseline;background:#6187d838;border-radius:6px;margin:0 2px;padding:0 8px;font-size:.85em;line-height:1.6;display:inline-block}.kCWYAa_actions{align-items:center;gap:10px;height:28px;display:flex}.kCWYAa_action{width:28px;height:28px;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));cursor:pointer;background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}.kCWYAa_action:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary))}.kCWYAa_editor{border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));border-radius:8px;flex-direction:column;gap:8px;width:100%;padding:12px;display:flex}.kCWYAa_editorInput{border:1px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1,var(--dsw-alias-label-primary-dimmed)));resize:none;width:100%;max-height:240px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));font:inherit;background:0 0;border-radius:6px;outline:none;padding:8px;overflow-y:auto}.kCWYAa_editorActions{justify-content:flex-end;align-items:center;gap:8px;display:flex}.kCWYAa_editorTrailing{align-items:center;margin-right:auto;display:flex}.kCWYAa_actionError{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));align-self:flex-end;padding:2px 4px;font-size:13px;line-height:20px}.kCWYAa_editedLabel{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));align-self:flex-end;font-size:12px;line-height:18px}";
5398
+ const css$2 = ".uq6O-a_userRow{flex-direction:column;align-items:flex-end;gap:6px;display:flex}.uq6O-a_userStack{flex-direction:column;align-items:flex-end;gap:8px;min-width:0;max-width:min(525px,82%);display:flex}.uq6O-a_bubble{background:var(--dsw-specific-bubble,var(--dsw-alias-bg-layer-1));max-width:100%;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));border-radius:22px;padding:10px 16px;font-size:16px;line-height:24px}.uq6O-a_textRun{white-space:pre-wrap;word-break:break-word;font-size:inherit;line-height:inherit}.uq6O-a_refChip{color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));white-space:nowrap;vertical-align:baseline;background:#6187d838;border-radius:6px;margin:0 2px;padding:0 8px;font-size:.85em;line-height:1.6;display:inline-block}.uq6O-a_actions{align-items:center;gap:10px;height:28px;display:flex}.uq6O-a_action{width:28px;height:28px;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));cursor:pointer;background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}.uq6O-a_action:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary))}.uq6O-a_editor{border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));border-radius:8px;flex-direction:column;gap:8px;width:100%;padding:12px;display:flex}.uq6O-a_editorInput{border:1px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1,var(--dsw-alias-label-primary-dimmed)));resize:none;width:100%;max-height:240px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));font:inherit;background:0 0;border-radius:6px;outline:none;padding:8px;overflow-y:auto}.uq6O-a_editorActions{justify-content:flex-end;align-items:center;gap:8px;display:flex}.uq6O-a_editorTrailing{align-items:center;margin-right:auto;display:flex}.uq6O-a_actionError{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));align-self:flex-end;padding:2px 4px;font-size:13px;line-height:20px}.uq6O-a_editedLabel{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));align-self:flex-end;font-size:12px;line-height:18px}";
5254
5399
  const tagId$2 = "@khorsheed/dsh-client-message-tools/UserMessageView.module.css";
5255
5400
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
5256
5401
  const tag = document.createElement("style");
@@ -5260,19 +5405,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5260
5405
  document.head.appendChild(tag);
5261
5406
  }
5262
5407
  var UserMessageView_module_css_default = {
5263
- "actionError": "kCWYAa_actionError",
5264
- "textRun": "kCWYAa_textRun",
5265
- "userStack": "kCWYAa_userStack",
5266
- "action": "kCWYAa_action",
5267
- "bubble": "kCWYAa_bubble",
5268
- "editorInput": "kCWYAa_editorInput",
5269
- "editorTrailing": "kCWYAa_editorTrailing",
5270
- "editedLabel": "kCWYAa_editedLabel",
5271
- "userRow": "kCWYAa_userRow",
5272
- "editorActions": "kCWYAa_editorActions",
5273
- "actions": "kCWYAa_actions",
5274
- "refChip": "kCWYAa_refChip",
5275
- "editor": "kCWYAa_editor"
5408
+ "bubble": "uq6O-a_bubble",
5409
+ "editor": "uq6O-a_editor",
5410
+ "editorTrailing": "uq6O-a_editorTrailing",
5411
+ "textRun": "uq6O-a_textRun",
5412
+ "actions": "uq6O-a_actions",
5413
+ "actionError": "uq6O-a_actionError",
5414
+ "action": "uq6O-a_action",
5415
+ "editedLabel": "uq6O-a_editedLabel",
5416
+ "userRow": "uq6O-a_userRow",
5417
+ "editorActions": "uq6O-a_editorActions",
5418
+ "userStack": "uq6O-a_userStack",
5419
+ "editorInput": "uq6O-a_editorInput",
5420
+ "refChip": "uq6O-a_refChip"
5276
5421
  };
5277
5422
  //#endregion
5278
5423
  //#region src/client/UserMessageView.tsx
@@ -5374,7 +5519,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5374
5519
  className: UserMessageView_module_css_default.action,
5375
5520
  "aria-label": copied ? t("copied") : t("copy"),
5376
5521
  onClick: onCopy,
5377
- children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCopyOutline16, {})
5522
+ children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutlineMedium, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopyOutlineMedium, {})
5378
5523
  })
5379
5524
  });
5380
5525
  }
@@ -5552,7 +5697,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5552
5697
  setFailed(null);
5553
5698
  setEditing(true);
5554
5699
  },
5555
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, {})
5700
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutlineMedium, {})
5556
5701
  })
5557
5702
  }),
5558
5703
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
@@ -5567,7 +5712,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5567
5712
  setAcknowledged(false);
5568
5713
  setConfirming(true);
5569
5714
  },
5570
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUndoOutline16, {})
5715
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUndoOutlineMedium, {})
5571
5716
  })
5572
5717
  })
5573
5718
  ]
@@ -5599,7 +5744,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5599
5744
  });
5600
5745
  //#endregion
5601
5746
  //#region \0dsh-css:src/client/RestoredMessageView.module.css.mjs
5602
- const css$1 = ".hDMXAG_restoredLabel{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));align-items:center;gap:4px;font-size:12px;line-height:18px;display:inline-flex}.hDMXAG_restoredAssistantRow{color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));flex-direction:column;align-items:flex-start;gap:4px;display:flex}";
5747
+ const css$1 = ".MHYySG_restoredLabel{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));align-items:center;gap:4px;font-size:12px;line-height:18px;display:inline-flex}.MHYySG_restoredAssistantRow{color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));flex-direction:column;align-items:flex-start;gap:4px;display:flex}";
5603
5748
  const tagId$1 = "@khorsheed/dsh-client-message-tools/RestoredMessageView.module.css";
5604
5749
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
5605
5750
  const tag = document.createElement("style");
@@ -5609,8 +5754,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5609
5754
  document.head.appendChild(tag);
5610
5755
  }
5611
5756
  var RestoredMessageView_module_css_default = {
5612
- "restoredAssistantRow": "hDMXAG_restoredAssistantRow",
5613
- "restoredLabel": "hDMXAG_restoredLabel"
5757
+ "restoredAssistantRow": "MHYySG_restoredAssistantRow",
5758
+ "restoredLabel": "MHYySG_restoredLabel"
5614
5759
  };
5615
5760
  //#endregion
5616
5761
  //#region src/client/RestoredMessageView.tsx
@@ -5642,7 +5787,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5642
5787
  className: RestoredMessageView_module_css_default.restoredAssistantRow,
5643
5788
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5644
5789
  className: RestoredMessageView_module_css_default.restoredLabel,
5645
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUndoOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("restored.assistant") })]
5790
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUndoOutlineMedium, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("restored.assistant") })]
5646
5791
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, {
5647
5792
  text: data.text,
5648
5793
  labels
@@ -5651,7 +5796,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5651
5796
  }
5652
5797
  //#endregion
5653
5798
  //#region \0dsh-css:src/client/WithdrawnDividerView.module.css.mjs
5654
- const css = ".JtQ9hG_row{padding:2px 0}.JtQ9hG_marker{width:100%;min-width:0;height:24px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;padding:0;display:flex}.JtQ9hG_marker:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.JtQ9hG_leading{width:16px;height:16px;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));flex:none;justify-content:center;align-items:center;margin-right:6px;display:inline-flex}.JtQ9hG_title{color:var(--dsw-alias-label-primary-dimmed,var(--dsw-alias-label-tertiary));flex:none;font-size:14px;line-height:24px}.JtQ9hG_badge{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));flex:none;align-items:center;gap:4px;margin-left:10px;font-size:12px;line-height:18px;display:inline-flex}.JtQ9hG_body{padding:4px 0 4px 22px}.JtQ9hG_empty{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));font-size:13px;line-height:20px}.JtQ9hG_textRun{white-space:pre-wrap;word-break:break-word;font-size:inherit;line-height:inherit}.JtQ9hG_entryUser,.JtQ9hG_entryAssistant{color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));padding:4px 0;font-size:14px;line-height:22px}.JtQ9hG_entryKind{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));margin-bottom:2px;font-size:12px;line-height:18px}.JtQ9hG_entryUser{border-left:2px solid var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed));padding-left:8px}.JtQ9hG_entryAssistant{border-left:2px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));padding-left:8px}.JtQ9hG_restoreRow{align-items:center;gap:8px;padding-top:8px;display:flex}.JtQ9hG_restoreFailed{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));font-size:12px}";
5799
+ const css = ".Hb4H5q_row{padding:2px 0}.Hb4H5q_marker{width:100%;min-width:0;height:24px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;padding:0;display:flex}.Hb4H5q_marker:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.Hb4H5q_leading{width:16px;height:16px;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));flex:none;justify-content:center;align-items:center;margin-right:6px;display:inline-flex}.Hb4H5q_title{color:var(--dsw-alias-label-primary-dimmed,var(--dsw-alias-label-tertiary));flex:none;font-size:14px;line-height:24px}.Hb4H5q_badge{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));flex:none;align-items:center;gap:4px;margin-left:10px;font-size:12px;line-height:18px;display:inline-flex}.Hb4H5q_body{padding:4px 0 4px 22px}.Hb4H5q_empty{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));font-size:13px;line-height:20px}.Hb4H5q_textRun{white-space:pre-wrap;word-break:break-word;font-size:inherit;line-height:inherit}.Hb4H5q_entryUser,.Hb4H5q_entryAssistant{color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));padding:4px 0;font-size:14px;line-height:22px}.Hb4H5q_entryKind{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));margin-bottom:2px;font-size:12px;line-height:18px}.Hb4H5q_entryUser{border-left:2px solid var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed));padding-left:8px}.Hb4H5q_entryImages{margin-top:4px}.Hb4H5q_entryAssistant{border-left:2px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));padding-left:8px}.Hb4H5q_restoreRow{align-items:center;gap:8px;padding-top:8px;display:flex}.Hb4H5q_restoreFailed{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));font-size:12px}";
5655
5800
  const tagId = "@khorsheed/dsh-client-message-tools/WithdrawnDividerView.module.css";
5656
5801
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
5657
5802
  const tag = document.createElement("style");
@@ -5661,19 +5806,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5661
5806
  document.head.appendChild(tag);
5662
5807
  }
5663
5808
  var WithdrawnDividerView_module_css_default = {
5664
- "textRun": "JtQ9hG_textRun",
5665
- "badge": "JtQ9hG_badge",
5666
- "entryUser": "JtQ9hG_entryUser",
5667
- "entryAssistant": "JtQ9hG_entryAssistant",
5668
- "entryKind": "JtQ9hG_entryKind",
5669
- "restoreRow": "JtQ9hG_restoreRow",
5670
- "body": "JtQ9hG_body",
5671
- "leading": "JtQ9hG_leading",
5672
- "restoreFailed": "JtQ9hG_restoreFailed",
5673
- "marker": "JtQ9hG_marker",
5674
- "title": "JtQ9hG_title",
5675
- "row": "JtQ9hG_row",
5676
- "empty": "JtQ9hG_empty"
5809
+ "textRun": "Hb4H5q_textRun",
5810
+ "empty": "Hb4H5q_empty",
5811
+ "entryImages": "Hb4H5q_entryImages",
5812
+ "title": "Hb4H5q_title",
5813
+ "restoreFailed": "Hb4H5q_restoreFailed",
5814
+ "body": "Hb4H5q_body",
5815
+ "badge": "Hb4H5q_badge",
5816
+ "marker": "Hb4H5q_marker",
5817
+ "row": "Hb4H5q_row",
5818
+ "entryAssistant": "Hb4H5q_entryAssistant",
5819
+ "entryUser": "Hb4H5q_entryUser",
5820
+ "leading": "Hb4H5q_leading",
5821
+ "entryKind": "Hb4H5q_entryKind",
5822
+ "restoreRow": "Hb4H5q_restoreRow"
5677
5823
  };
5678
5824
  //#endregion
5679
5825
  //#region src/client/WithdrawnDividerView.tsx
@@ -5681,7 +5827,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5681
5827
  * Withdrawal divider row ('message-tools-withdrawn' keyed renderer), redone
5682
5828
  * in the official compaction-marker visual language: one dim clickable row
5683
5829
  * (chevron +「已撤回 N 条消息」), expanding in place to a read-only replay of
5684
- * the withdrawn span (user originals + assistant text) with a「恢复到对话
5830
+ * the withdrawn span (user originals — text and attached images — plus
5831
+ * assistant text) with a「恢复到对话
5685
5832
  * 末尾」action. The restore tail-replays the span's replayable entries (user
5686
5833
  * messages + assistant text) — the surface fold is positional, so in-place
5687
5834
  * restoration is impossible — and the divider carries a「已恢复」badge while
@@ -5690,8 +5837,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5690
5837
  * once withdrawals backfill the draft automatically.
5691
5838
  */
5692
5839
  /** The withdrawal divider: collapsed marker row plus the expandable replay. */
5693
- function WithdrawnDividerView({ node, t, restoreMessage, ...standard }) {
5840
+ function WithdrawnDividerView({ node, t, restoreMessage, renderMessageImages, ...standard }) {
5694
5841
  const data = node.data;
5842
+ const renderImages = renderMessageImages;
5695
5843
  const [expanded, setExpanded] = (0, react.useState)(false);
5696
5844
  const [entries, setEntries] = (0, react.useState)(null);
5697
5845
  const [busy, setBusy] = (0, react.useState)(false);
@@ -5736,7 +5884,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5736
5884
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5737
5885
  className: WithdrawnDividerView_module_css_default.leading,
5738
5886
  "aria-hidden": true,
5739
- children: expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {})
5887
+ children: expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutlineMedium, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronRightOutlineMedium, {})
5740
5888
  }),
5741
5889
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5742
5890
  className: WithdrawnDividerView_module_css_default.title,
@@ -5744,7 +5892,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5744
5892
  }),
5745
5893
  restored && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
5746
5894
  className: WithdrawnDividerView_module_css_default.badge,
5747
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUndoOutline16, {}), t("withdrawn.restored")]
5895
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUndoOutlineMedium, {}), t("withdrawn.restored")]
5748
5896
  })
5749
5897
  ]
5750
5898
  }), expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -5754,13 +5902,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5754
5902
  children: t("withdrawn.empty")
5755
5903
  }) : entries.map((entry, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5756
5904
  className: entry.kind === "user" ? WithdrawnDividerView_module_css_default.entryUser : WithdrawnDividerView_module_css_default.entryAssistant,
5757
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5758
- className: WithdrawnDividerView_module_css_default.entryKind,
5759
- children: entry.kind === "user" ? t("withdrawn.entryUser") : t("withdrawn.entryAssistant")
5760
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5761
- className: WithdrawnDividerView_module_css_default.textRun,
5762
- children: entry.text
5763
- })]
5905
+ children: [
5906
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5907
+ className: WithdrawnDividerView_module_css_default.entryKind,
5908
+ children: entry.kind === "user" ? t("withdrawn.entryUser") : t("withdrawn.entryAssistant")
5909
+ }),
5910
+ entry.text !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5911
+ className: WithdrawnDividerView_module_css_default.textRun,
5912
+ children: entry.text
5913
+ }),
5914
+ renderImages !== void 0 && entry.images.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5915
+ className: WithdrawnDividerView_module_css_default.entryImages,
5916
+ children: renderImages({
5917
+ images: entry.images,
5918
+ align: "end"
5919
+ })
5920
+ })
5921
+ ]
5764
5922
  }, index)), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5765
5923
  className: WithdrawnDividerView_module_css_default.restoreRow,
5766
5924
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
@@ -5792,6 +5950,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5792
5950
  groups: [],
5793
5951
  failures: [],
5794
5952
  status: "idle",
5953
+ pending: null,
5795
5954
  error: null
5796
5955
  });
5797
5956
  /**
@@ -5940,7 +6099,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5940
6099
  loadModels: () => {
5941
6100
  directory?.load().catch(() => void 0);
5942
6101
  },
5943
- selectModel: (selection) => directory === void 0 ? Promise.resolve(false) : directory.select(selection).then(() => true, () => false),
6102
+ selectModel: (selection) => directory === void 0 ? Promise.resolve(false) : directory.select(selection).then((result) => result && typeof result === "object" && "ok" in result ? result.ok : true, () => false),
5944
6103
  hooks: { modelDirectory: directory === void 0 ? EMPTY_MODEL_DIRECTORY : directory.store }
5945
6104
  };
5946
6105
  };