@finogeeks2026/chatkit-web 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/dist/index.js +239 -216
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -334,6 +334,22 @@ function sl(e, t, n) {
334
334
  result: { capabilities: { remoteDom: true } }
335
335
  }, '*');
336
336
  window.dispatchEvent(new CustomEvent('mcp-ui-ready', { detail: data.params }));
337
+ return;
338
+ }
339
+ if (data && data.jsonrpc === '2.0' && data.method === 'mcp-ui-request-size') {
340
+ try {
341
+ console.log('[mcpui-bridge] request-size received', { force: data?.params?.force, messageId: messageId });
342
+ } catch {
343
+ // ignore console failure
344
+ }
345
+ report(true);
346
+ if (data.id) {
347
+ window.parent.postMessage({
348
+ jsonrpc: '2.0',
349
+ id: data.id,
350
+ result: { ok: true }
351
+ }, '*');
352
+ }
337
353
  }
338
354
  });
339
355
  // 与 ai-web 保持一致:使用 ResizeObserver 监听 body 变化
@@ -2396,14 +2412,14 @@ function uc() {
2396
2412
  return H(o), te;
2397
2413
  }
2398
2414
  }
2399
- function C() {
2415
+ function A() {
2400
2416
  var N = [];
2401
2417
  k(N);
2402
2418
  for (var w; w = O(); )
2403
2419
  w !== !1 && (N.push(w), k(N));
2404
2420
  return N;
2405
2421
  }
2406
- return G(), C();
2422
+ return G(), A();
2407
2423
  }
2408
2424
  function h(_) {
2409
2425
  return _ ? _.replace(s, d) : d;
@@ -3479,10 +3495,10 @@ function ou(e, t, n) {
3479
3495
  return x.enter("codeFencedFence"), ae(w) ? le(x, O, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(w) : O(w);
3480
3496
  }
3481
3497
  function O(w) {
3482
- return w === s ? (x.enter("codeFencedFenceSequence"), C(w)) : H(w);
3498
+ return w === s ? (x.enter("codeFencedFenceSequence"), A(w)) : H(w);
3483
3499
  }
3484
- function C(w) {
3485
- return w === s ? (G++, x.consume(w), C) : G >= o ? (x.exit("codeFencedFenceSequence"), ae(w) ? le(x, N, "whitespace")(w) : N(w)) : H(w);
3500
+ function A(w) {
3501
+ return w === s ? (G++, x.consume(w), A) : G >= o ? (x.exit("codeFencedFenceSequence"), ae(w) ? le(x, N, "whitespace")(w) : N(w)) : H(w);
3486
3502
  }
3487
3503
  function N(w) {
3488
3504
  return w === null || V(w) ? (x.exit("codeFencedFence"), z(w)) : H(w);
@@ -4193,16 +4209,16 @@ function Lu(e, t, n) {
4193
4209
  return E === null || V(E) ? O(E) : ae(E) ? (e.consume(E), P) : n(E);
4194
4210
  }
4195
4211
  function O(E) {
4196
- return E === 45 && i === 2 ? (e.consume(E), D) : E === 60 && i === 1 ? (e.consume(E), te) : E === 62 && i === 4 ? (e.consume(E), pe) : E === 63 && i === 3 ? (e.consume(E), b) : E === 93 && i === 5 ? (e.consume(E), J) : V(E) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(Ou, ge, C)(E)) : E === null || V(E) ? (e.exit("htmlFlowData"), C(E)) : (e.consume(E), O);
4212
+ return E === 45 && i === 2 ? (e.consume(E), D) : E === 60 && i === 1 ? (e.consume(E), te) : E === 62 && i === 4 ? (e.consume(E), pe) : E === 63 && i === 3 ? (e.consume(E), b) : E === 93 && i === 5 ? (e.consume(E), J) : V(E) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(Ou, ge, A)(E)) : E === null || V(E) ? (e.exit("htmlFlowData"), A(E)) : (e.consume(E), O);
4197
4213
  }
4198
- function C(E) {
4214
+ function A(E) {
4199
4215
  return e.check(Mu, N, ge)(E);
4200
4216
  }
4201
4217
  function N(E) {
4202
4218
  return e.enter("lineEnding"), e.consume(E), e.exit("lineEnding"), w;
4203
4219
  }
4204
4220
  function w(E) {
4205
- return E === null || V(E) ? C(E) : (e.enter("htmlFlowData"), O(E));
4221
+ return E === null || V(E) ? A(E) : (e.enter("htmlFlowData"), O(E));
4206
4222
  }
4207
4223
  function D(E) {
4208
4224
  return E === 45 ? (e.consume(E), b) : O(E);
@@ -4319,10 +4335,10 @@ function zu(e, t, n) {
4319
4335
  return b === 61 ? (e.consume(b), O) : V(b) ? (o = P, te(b)) : ae(b) ? (e.consume(b), P) : G(b);
4320
4336
  }
4321
4337
  function O(b) {
4322
- return b === null || b === 60 || b === 61 || b === 62 || b === 96 ? n(b) : b === 34 || b === 39 ? (e.consume(b), i = b, C) : V(b) ? (o = O, te(b)) : ae(b) ? (e.consume(b), O) : (e.consume(b), N);
4338
+ return b === null || b === 60 || b === 61 || b === 62 || b === 96 ? n(b) : b === 34 || b === 39 ? (e.consume(b), i = b, A) : V(b) ? (o = O, te(b)) : ae(b) ? (e.consume(b), O) : (e.consume(b), N);
4323
4339
  }
4324
- function C(b) {
4325
- return b === i ? (e.consume(b), i = void 0, w) : b === null ? n(b) : V(b) ? (o = C, te(b)) : (e.consume(b), C);
4340
+ function A(b) {
4341
+ return b === i ? (e.consume(b), i = void 0, w) : b === null ? n(b) : V(b) ? (o = A, te(b)) : (e.consume(b), A);
4326
4342
  }
4327
4343
  function N(b) {
4328
4344
  return b === null || b === 34 || b === 39 || b === 60 || b === 61 || b === 96 ? n(b) : b === 47 || b === 62 || he(b) ? G(b) : (e.consume(b), N);
@@ -4909,14 +4925,14 @@ function Td(e, t, n) {
4909
4925
  const {
4910
4926
  _bufferIndex: P,
4911
4927
  _index: O,
4912
- line: C,
4928
+ line: A,
4913
4929
  column: N,
4914
4930
  offset: w
4915
4931
  } = r;
4916
4932
  return {
4917
4933
  _bufferIndex: P,
4918
4934
  _index: O,
4919
- line: C,
4935
+ line: A,
4920
4936
  column: N,
4921
4937
  offset: w
4922
4938
  };
@@ -4945,8 +4961,8 @@ function Td(e, t, n) {
4945
4961
  o[r._index].length && (r._bufferIndex = -1, r._index++)), c.previous = P;
4946
4962
  }
4947
4963
  function S(P, O) {
4948
- const C = O || {};
4949
- return C.type = P, C.start = g(), c.events.push(["enter", C, c]), s.push(C), C;
4964
+ const A = O || {};
4965
+ return A.type = P, A.start = g(), c.events.push(["enter", A, c]), s.push(A), A;
4950
4966
  }
4951
4967
  function I(P) {
4952
4968
  const O = s.pop();
@@ -4959,8 +4975,8 @@ function Td(e, t, n) {
4959
4975
  O.restore();
4960
4976
  }
4961
4977
  function z(P, O) {
4962
- return C;
4963
- function C(N, w, D) {
4978
+ return A;
4979
+ function A(N, w, D) {
4964
4980
  let te, Y, J, b;
4965
4981
  return Array.isArray(N) ? (
4966
4982
  /* c8 ignore next 1 */
@@ -5013,13 +5029,13 @@ function Td(e, t, n) {
5013
5029
  P.resolveAll && !a.includes(P) && a.push(P), P.resolve && Ke(c.events, O, c.events.length - O, P.resolve(c.events.slice(O), c)), P.resolveTo && (c.events = P.resolveTo(c.events, c));
5014
5030
  }
5015
5031
  function G() {
5016
- const P = g(), O = c.previous, C = c.currentConstruct, N = c.events.length, w = Array.from(s);
5032
+ const P = g(), O = c.previous, A = c.currentConstruct, N = c.events.length, w = Array.from(s);
5017
5033
  return {
5018
5034
  from: N,
5019
5035
  restore: D
5020
5036
  };
5021
5037
  function D() {
5022
- r = P, c.previous = O, c.currentConstruct = C, c.events.length = N, s = w, k();
5038
+ r = P, c.previous = O, c.currentConstruct = A, c.events.length = N, s = w, k();
5023
5039
  }
5024
5040
  }
5025
5041
  function k() {
@@ -5235,7 +5251,7 @@ function Pd(e) {
5235
5251
  emphasis: l(),
5236
5252
  hardBreakEscape: l(O),
5237
5253
  hardBreakTrailing: l(O),
5238
- htmlFlow: l(C),
5254
+ htmlFlow: l(A),
5239
5255
  htmlFlowData: k,
5240
5256
  htmlText: l(N),
5241
5257
  htmlTextData: k,
@@ -5262,7 +5278,7 @@ function Pd(e) {
5262
5278
  Ia(t, (e || {}).mdastExtensions || []);
5263
5279
  const n = {};
5264
5280
  return r;
5265
- function r(A) {
5281
+ function r(C) {
5266
5282
  let F = {
5267
5283
  type: "root",
5268
5284
  children: []
@@ -5278,31 +5294,31 @@ function Pd(e) {
5278
5294
  data: n
5279
5295
  }, oe = [];
5280
5296
  let ue = -1;
5281
- for (; ++ue < A.length; )
5282
- if (A[ue][1].type === "listOrdered" || A[ue][1].type === "listUnordered")
5283
- if (A[ue][0] === "enter")
5297
+ for (; ++ue < C.length; )
5298
+ if (C[ue][1].type === "listOrdered" || C[ue][1].type === "listUnordered")
5299
+ if (C[ue][0] === "enter")
5284
5300
  oe.push(ue);
5285
5301
  else {
5286
5302
  const $e = oe.pop();
5287
- ue = i(A, $e, ue);
5303
+ ue = i(C, $e, ue);
5288
5304
  }
5289
- for (ue = -1; ++ue < A.length; ) {
5290
- const $e = t[A[ue][0]];
5291
- Aa.call($e, A[ue][1].type) && $e[A[ue][1].type].call(Object.assign({
5292
- sliceSerialize: A[ue][2].sliceSerialize
5293
- }, X), A[ue][1]);
5305
+ for (ue = -1; ++ue < C.length; ) {
5306
+ const $e = t[C[ue][0]];
5307
+ Aa.call($e, C[ue][1].type) && $e[C[ue][1].type].call(Object.assign({
5308
+ sliceSerialize: C[ue][2].sliceSerialize
5309
+ }, X), C[ue][1]);
5294
5310
  }
5295
5311
  if (X.tokenStack.length > 0) {
5296
5312
  const $e = X.tokenStack[X.tokenStack.length - 1];
5297
5313
  ($e[1] || co).call(X, void 0, $e[0]);
5298
5314
  }
5299
5315
  for (F.position = {
5300
- start: yt(A.length > 0 ? A[0][1].start : {
5316
+ start: yt(C.length > 0 ? C[0][1].start : {
5301
5317
  line: 1,
5302
5318
  column: 1,
5303
5319
  offset: 0
5304
5320
  }),
5305
- end: yt(A.length > 0 ? A[A.length - 2][1].end : {
5321
+ end: yt(C.length > 0 ? C[C.length - 2][1].end : {
5306
5322
  line: 1,
5307
5323
  column: 1,
5308
5324
  offset: 0
@@ -5311,10 +5327,10 @@ function Pd(e) {
5311
5327
  F = t.transforms[ue](F) || F;
5312
5328
  return F;
5313
5329
  }
5314
- function i(A, F, X) {
5330
+ function i(C, F, X) {
5315
5331
  let oe = F - 1, ue = -1, $e = !1, ct, Ye, gt, St;
5316
5332
  for (; ++oe <= X; ) {
5317
- const De = A[oe];
5333
+ const De = C[oe];
5318
5334
  switch (De[1].type) {
5319
5335
  case "listUnordered":
5320
5336
  case "listOrdered":
@@ -5339,13 +5355,13 @@ function Pd(e) {
5339
5355
  if (ct) {
5340
5356
  let ht = oe;
5341
5357
  for (Ye = void 0; ht--; ) {
5342
- const He = A[ht];
5358
+ const He = C[ht];
5343
5359
  if (He[1].type === "lineEnding" || He[1].type === "lineEndingBlank") {
5344
5360
  if (He[0] === "exit") continue;
5345
- Ye && (A[Ye][1].type = "lineEndingBlank", $e = !0), He[1].type = "lineEnding", Ye = ht;
5361
+ Ye && (C[Ye][1].type = "lineEndingBlank", $e = !0), He[1].type = "lineEnding", Ye = ht;
5346
5362
  } else if (!(He[1].type === "linePrefix" || He[1].type === "blockQuotePrefix" || He[1].type === "blockQuotePrefixWhitespace" || He[1].type === "blockQuoteMarker" || He[1].type === "listItemIndent")) break;
5347
5363
  }
5348
- gt && (!Ye || gt < Ye) && (ct._spread = !0), ct.end = Object.assign({}, Ye ? A[Ye][1].start : De[1].end), A.splice(Ye || oe, 0, ["exit", ct, De[2]]), oe++, X++;
5364
+ gt && (!Ye || gt < Ye) && (ct._spread = !0), ct.end = Object.assign({}, Ye ? C[Ye][1].start : De[1].end), C.splice(Ye || oe, 0, ["exit", ct, De[2]]), oe++, X++;
5349
5365
  }
5350
5366
  if (De[1].type === "listItemPrefix") {
5351
5367
  const ht = {
@@ -5355,16 +5371,16 @@ function Pd(e) {
5355
5371
  // @ts-expect-error: we’ll add `end` in a second.
5356
5372
  end: void 0
5357
5373
  };
5358
- ct = ht, A.splice(oe, 0, ["enter", ht, De[2]]), oe++, X++, gt = void 0, St = !0;
5374
+ ct = ht, C.splice(oe, 0, ["enter", ht, De[2]]), oe++, X++, gt = void 0, St = !0;
5359
5375
  }
5360
5376
  }
5361
5377
  }
5362
- return A[F][1]._spread = $e, X;
5378
+ return C[F][1]._spread = $e, X;
5363
5379
  }
5364
- function a(A, F) {
5380
+ function a(C, F) {
5365
5381
  return X;
5366
5382
  function X(oe) {
5367
- s.call(this, A(oe), oe), F && F.call(this, oe);
5383
+ s.call(this, C(oe), oe), F && F.call(this, oe);
5368
5384
  }
5369
5385
  }
5370
5386
  function o() {
@@ -5373,28 +5389,28 @@ function Pd(e) {
5373
5389
  children: []
5374
5390
  });
5375
5391
  }
5376
- function s(A, F, X) {
5377
- this.stack[this.stack.length - 1].children.push(A), this.stack.push(A), this.tokenStack.push([F, X || void 0]), A.position = {
5392
+ function s(C, F, X) {
5393
+ this.stack[this.stack.length - 1].children.push(C), this.stack.push(C), this.tokenStack.push([F, X || void 0]), C.position = {
5378
5394
  start: yt(F.start),
5379
5395
  // @ts-expect-error: `end` will be patched later.
5380
5396
  end: void 0
5381
5397
  };
5382
5398
  }
5383
- function l(A) {
5399
+ function l(C) {
5384
5400
  return F;
5385
5401
  function F(X) {
5386
- A && A.call(this, X), c.call(this, X);
5402
+ C && C.call(this, X), c.call(this, X);
5387
5403
  }
5388
5404
  }
5389
- function c(A, F) {
5405
+ function c(C, F) {
5390
5406
  const X = this.stack.pop(), oe = this.tokenStack.pop();
5391
5407
  if (oe)
5392
- oe[0].type !== A.type && (F ? F.call(this, A, oe[0]) : (oe[1] || co).call(this, A, oe[0]));
5393
- else throw new Error("Cannot close `" + A.type + "` (" + an({
5394
- start: A.start,
5395
- end: A.end
5408
+ oe[0].type !== C.type && (F ? F.call(this, C, oe[0]) : (oe[1] || co).call(this, C, oe[0]));
5409
+ else throw new Error("Cannot close `" + C.type + "` (" + an({
5410
+ start: C.start,
5411
+ end: C.end
5396
5412
  }) + "): it’s not open");
5397
- X.position.end = yt(A.end);
5413
+ X.position.end = yt(C.end);
5398
5414
  }
5399
5415
  function u() {
5400
5416
  return ri(this.stack.pop());
@@ -5402,134 +5418,134 @@ function Pd(e) {
5402
5418
  function d() {
5403
5419
  this.data.expectingFirstListItemValue = !0;
5404
5420
  }
5405
- function f(A) {
5421
+ function f(C) {
5406
5422
  if (this.data.expectingFirstListItemValue) {
5407
5423
  const F = this.stack[this.stack.length - 2];
5408
- F.start = Number.parseInt(this.sliceSerialize(A), 10), this.data.expectingFirstListItemValue = void 0;
5424
+ F.start = Number.parseInt(this.sliceSerialize(C), 10), this.data.expectingFirstListItemValue = void 0;
5409
5425
  }
5410
5426
  }
5411
5427
  function p() {
5412
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5413
- F.lang = A;
5428
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5429
+ F.lang = C;
5414
5430
  }
5415
5431
  function g() {
5416
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5417
- F.meta = A;
5432
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5433
+ F.meta = C;
5418
5434
  }
5419
5435
  function h() {
5420
5436
  this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
5421
5437
  }
5422
5438
  function _() {
5423
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5424
- F.value = A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
5439
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5440
+ F.value = C.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
5425
5441
  }
5426
5442
  function m() {
5427
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5428
- F.value = A.replace(/(\r?\n|\r)$/g, "");
5443
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5444
+ F.value = C.replace(/(\r?\n|\r)$/g, "");
5429
5445
  }
5430
- function v(A) {
5446
+ function v(C) {
5431
5447
  const F = this.resume(), X = this.stack[this.stack.length - 1];
5432
- X.label = F, X.identifier = Ze(this.sliceSerialize(A)).toLowerCase();
5448
+ X.label = F, X.identifier = Ze(this.sliceSerialize(C)).toLowerCase();
5433
5449
  }
5434
5450
  function S() {
5435
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5436
- F.title = A;
5451
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5452
+ F.title = C;
5437
5453
  }
5438
5454
  function I() {
5439
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5440
- F.url = A;
5455
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5456
+ F.url = C;
5441
5457
  }
5442
- function M(A) {
5458
+ function M(C) {
5443
5459
  const F = this.stack[this.stack.length - 1];
5444
5460
  if (!F.depth) {
5445
- const X = this.sliceSerialize(A).length;
5461
+ const X = this.sliceSerialize(C).length;
5446
5462
  F.depth = X;
5447
5463
  }
5448
5464
  }
5449
5465
  function x() {
5450
5466
  this.data.setextHeadingSlurpLineEnding = !0;
5451
5467
  }
5452
- function z(A) {
5468
+ function z(C) {
5453
5469
  const F = this.stack[this.stack.length - 1];
5454
- F.depth = this.sliceSerialize(A).codePointAt(0) === 61 ? 1 : 2;
5470
+ F.depth = this.sliceSerialize(C).codePointAt(0) === 61 ? 1 : 2;
5455
5471
  }
5456
5472
  function H() {
5457
5473
  this.data.setextHeadingSlurpLineEnding = void 0;
5458
5474
  }
5459
- function G(A) {
5475
+ function G(C) {
5460
5476
  const X = this.stack[this.stack.length - 1].children;
5461
5477
  let oe = X[X.length - 1];
5462
5478
  (!oe || oe.type !== "text") && (oe = lt(), oe.position = {
5463
- start: yt(A.start),
5479
+ start: yt(C.start),
5464
5480
  // @ts-expect-error: we’ll add `end` later.
5465
5481
  end: void 0
5466
5482
  }, X.push(oe)), this.stack.push(oe);
5467
5483
  }
5468
- function k(A) {
5484
+ function k(C) {
5469
5485
  const F = this.stack.pop();
5470
- F.value += this.sliceSerialize(A), F.position.end = yt(A.end);
5486
+ F.value += this.sliceSerialize(C), F.position.end = yt(C.end);
5471
5487
  }
5472
- function P(A) {
5488
+ function P(C) {
5473
5489
  const F = this.stack[this.stack.length - 1];
5474
5490
  if (this.data.atHardBreak) {
5475
5491
  const X = F.children[F.children.length - 1];
5476
- X.position.end = yt(A.end), this.data.atHardBreak = void 0;
5492
+ X.position.end = yt(C.end), this.data.atHardBreak = void 0;
5477
5493
  return;
5478
5494
  }
5479
- !this.data.setextHeadingSlurpLineEnding && t.canContainEols.includes(F.type) && (G.call(this, A), k.call(this, A));
5495
+ !this.data.setextHeadingSlurpLineEnding && t.canContainEols.includes(F.type) && (G.call(this, C), k.call(this, C));
5480
5496
  }
5481
5497
  function O() {
5482
5498
  this.data.atHardBreak = !0;
5483
5499
  }
5484
- function C() {
5485
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5486
- F.value = A;
5500
+ function A() {
5501
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5502
+ F.value = C;
5487
5503
  }
5488
5504
  function N() {
5489
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5490
- F.value = A;
5505
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5506
+ F.value = C;
5491
5507
  }
5492
5508
  function w() {
5493
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5494
- F.value = A;
5509
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5510
+ F.value = C;
5495
5511
  }
5496
5512
  function D() {
5497
- const A = this.stack[this.stack.length - 1];
5513
+ const C = this.stack[this.stack.length - 1];
5498
5514
  if (this.data.inReference) {
5499
5515
  const F = this.data.referenceType || "shortcut";
5500
- A.type += "Reference", A.referenceType = F, delete A.url, delete A.title;
5516
+ C.type += "Reference", C.referenceType = F, delete C.url, delete C.title;
5501
5517
  } else
5502
- delete A.identifier, delete A.label;
5518
+ delete C.identifier, delete C.label;
5503
5519
  this.data.referenceType = void 0;
5504
5520
  }
5505
5521
  function te() {
5506
- const A = this.stack[this.stack.length - 1];
5522
+ const C = this.stack[this.stack.length - 1];
5507
5523
  if (this.data.inReference) {
5508
5524
  const F = this.data.referenceType || "shortcut";
5509
- A.type += "Reference", A.referenceType = F, delete A.url, delete A.title;
5525
+ C.type += "Reference", C.referenceType = F, delete C.url, delete C.title;
5510
5526
  } else
5511
- delete A.identifier, delete A.label;
5527
+ delete C.identifier, delete C.label;
5512
5528
  this.data.referenceType = void 0;
5513
5529
  }
5514
- function Y(A) {
5515
- const F = this.sliceSerialize(A), X = this.stack[this.stack.length - 2];
5530
+ function Y(C) {
5531
+ const F = this.sliceSerialize(C), X = this.stack[this.stack.length - 2];
5516
5532
  X.label = Md(F), X.identifier = Ze(F).toLowerCase();
5517
5533
  }
5518
5534
  function J() {
5519
- const A = this.stack[this.stack.length - 1], F = this.resume(), X = this.stack[this.stack.length - 1];
5535
+ const C = this.stack[this.stack.length - 1], F = this.resume(), X = this.stack[this.stack.length - 1];
5520
5536
  if (this.data.inReference = !0, X.type === "link") {
5521
- const oe = A.children;
5537
+ const oe = C.children;
5522
5538
  X.children = oe;
5523
5539
  } else
5524
5540
  X.alt = F;
5525
5541
  }
5526
5542
  function b() {
5527
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5528
- F.url = A;
5543
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5544
+ F.url = C;
5529
5545
  }
5530
5546
  function pe() {
5531
- const A = this.resume(), F = this.stack[this.stack.length - 1];
5532
- F.title = A;
5547
+ const C = this.resume(), F = this.stack[this.stack.length - 1];
5548
+ F.title = C;
5533
5549
  }
5534
5550
  function ge() {
5535
5551
  this.data.inReference = void 0;
@@ -5537,33 +5553,33 @@ function Pd(e) {
5537
5553
  function E() {
5538
5554
  this.data.referenceType = "collapsed";
5539
5555
  }
5540
- function Me(A) {
5556
+ function Me(C) {
5541
5557
  const F = this.resume(), X = this.stack[this.stack.length - 1];
5542
- X.label = F, X.identifier = Ze(this.sliceSerialize(A)).toLowerCase(), this.data.referenceType = "full";
5558
+ X.label = F, X.identifier = Ze(this.sliceSerialize(C)).toLowerCase(), this.data.referenceType = "full";
5543
5559
  }
5544
- function qe(A) {
5545
- this.data.characterReferenceType = A.type;
5560
+ function qe(C) {
5561
+ this.data.characterReferenceType = C.type;
5546
5562
  }
5547
- function Ee(A) {
5548
- const F = this.sliceSerialize(A), X = this.data.characterReferenceType;
5563
+ function Ee(C) {
5564
+ const F = this.sliceSerialize(C), X = this.data.characterReferenceType;
5549
5565
  let oe;
5550
5566
  X ? (oe = Ea(F, X === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : oe = ii(F);
5551
5567
  const ue = this.stack[this.stack.length - 1];
5552
5568
  ue.value += oe;
5553
5569
  }
5554
- function it(A) {
5570
+ function it(C) {
5555
5571
  const F = this.stack.pop();
5556
- F.position.end = yt(A.end);
5572
+ F.position.end = yt(C.end);
5557
5573
  }
5558
- function ze(A) {
5559
- k.call(this, A);
5574
+ function ze(C) {
5575
+ k.call(this, C);
5560
5576
  const F = this.stack[this.stack.length - 1];
5561
- F.url = this.sliceSerialize(A);
5577
+ F.url = this.sliceSerialize(C);
5562
5578
  }
5563
- function ot(A) {
5564
- k.call(this, A);
5579
+ function ot(C) {
5580
+ k.call(this, C);
5565
5581
  const F = this.stack[this.stack.length - 1];
5566
- F.url = "mailto:" + this.sliceSerialize(A);
5582
+ F.url = "mailto:" + this.sliceSerialize(C);
5567
5583
  }
5568
5584
  function Ue() {
5569
5585
  return {
@@ -5635,19 +5651,19 @@ function Pd(e) {
5635
5651
  children: []
5636
5652
  };
5637
5653
  }
5638
- function Zt(A) {
5654
+ function Zt(C) {
5639
5655
  return {
5640
5656
  type: "list",
5641
- ordered: A.type === "listOrdered",
5657
+ ordered: C.type === "listOrdered",
5642
5658
  start: null,
5643
- spread: A._spread,
5659
+ spread: C._spread,
5644
5660
  children: []
5645
5661
  };
5646
5662
  }
5647
- function Yn(A) {
5663
+ function Yn(C) {
5648
5664
  return {
5649
5665
  type: "listItem",
5650
- spread: A._spread,
5666
+ spread: C._spread,
5651
5667
  checked: null,
5652
5668
  children: []
5653
5669
  };
@@ -9639,8 +9655,8 @@ function ch(e, t, n) {
9639
9655
  N === "linePrefix") P--;
9640
9656
  else break;
9641
9657
  }
9642
- const O = P > -1 ? r.events[P][1].type : null, C = O === "tableHead" || O === "tableRow" ? x : l;
9643
- return C === x && r.parser.lazy[r.now().line] ? n(k) : C(k);
9658
+ const O = P > -1 ? r.events[P][1].type : null, A = O === "tableHead" || O === "tableRow" ? x : l;
9659
+ return A === x && r.parser.lazy[r.now().line] ? n(k) : A(k);
9644
9660
  }
9645
9661
  function l(k) {
9646
9662
  return e.enter("tableHead"), e.enter("tableRow"), c(k);
@@ -14533,7 +14549,7 @@ function tm(e) {
14533
14549
  function O(Y) {
14534
14550
  return t.concat("(?!", Y.join("|"), ")");
14535
14551
  }
14536
- const C = {
14552
+ const A = {
14537
14553
  match: t.concat(
14538
14554
  /\b/,
14539
14555
  O([
@@ -14736,7 +14752,7 @@ function tm(e) {
14736
14752
  className: { 1: "title.function" },
14737
14753
  contains: [x]
14738
14754
  },
14739
- C,
14755
+ A,
14740
14756
  P,
14741
14757
  z,
14742
14758
  w,
@@ -17427,7 +17443,7 @@ function ym(e) {
17427
17443
  g,
17428
17444
  h,
17429
17445
  x
17430
- ], C = {
17446
+ ], A = {
17431
17447
  begin: t.concat(
17432
17448
  /#\[\s*\\?/,
17433
17449
  t.either(
@@ -17475,7 +17491,7 @@ function ym(e) {
17475
17491
  case_insensitive: !1,
17476
17492
  keywords: I,
17477
17493
  contains: [
17478
- C,
17494
+ A,
17479
17495
  e.HASH_COMMENT_MODE,
17480
17496
  e.COMMENT("//", "$"),
17481
17497
  e.COMMENT(
@@ -17547,7 +17563,7 @@ function ym(e) {
17547
17563
  keywords: I,
17548
17564
  contains: [
17549
17565
  "self",
17550
- C,
17566
+ A,
17551
17567
  o,
17552
17568
  H,
17553
17569
  e.C_BLOCK_COMMENT_MODE,
@@ -20989,7 +21005,7 @@ function Gm(e) {
20989
21005
  }
20990
21006
  ]
20991
21007
  };
20992
- }, C = {
21008
+ }, A = {
20993
21009
  scope: "regexp",
20994
21010
  variants: [
20995
21011
  O("###"),
@@ -21089,7 +21105,7 @@ function Gm(e) {
21089
21105
  "self",
21090
21106
  Me,
21091
21107
  ...r,
21092
- C,
21108
+ A,
21093
21109
  ...u,
21094
21110
  ...p,
21095
21111
  ..._,
@@ -21292,7 +21308,7 @@ function Gm(e) {
21292
21308
  contains: [...r],
21293
21309
  relevance: 0
21294
21310
  },
21295
- C,
21311
+ A,
21296
21312
  ...u,
21297
21313
  ...p,
21298
21314
  ..._,
@@ -21746,7 +21762,7 @@ function Km(e) {
21746
21762
  function O(Y) {
21747
21763
  return t.concat("(?!", Y.join("|"), ")");
21748
21764
  }
21749
- const C = {
21765
+ const A = {
21750
21766
  match: t.concat(
21751
21767
  /\b/,
21752
21768
  O([
@@ -21949,7 +21965,7 @@ function Km(e) {
21949
21965
  className: { 1: "title.function" },
21950
21966
  contains: [x]
21951
21967
  },
21952
- C,
21968
+ A,
21953
21969
  P,
21954
21970
  z,
21955
21971
  w,
@@ -22959,7 +22975,7 @@ function Qm() {
22959
22975
  return K;
22960
22976
  }).map((Q) => `(${Q})`).join(R);
22961
22977
  }
22962
- const x = /\b\B/, z = "[a-zA-Z]\\w*", H = "[a-zA-Z_]\\w*", G = "\\b\\d+(\\.\\d+)?", k = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", P = "\\b(0b[01]+)", O = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", C = (y = {}) => {
22978
+ const x = /\b\B/, z = "[a-zA-Z]\\w*", H = "[a-zA-Z_]\\w*", G = "\\b\\d+(\\.\\d+)?", k = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", P = "\\b(0b[01]+)", O = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", A = (y = {}) => {
22963
22979
  const R = /^#![ ]*\//;
22964
22980
  return y.binary && (y.begin = h(
22965
22981
  R,
@@ -23133,7 +23149,7 @@ function Qm() {
23133
23149
  QUOTE_STRING_MODE: D,
23134
23150
  REGEXP_MODE: qe,
23135
23151
  RE_STARTERS_RE: O,
23136
- SHEBANG: C,
23152
+ SHEBANG: A,
23137
23153
  TITLE_MODE: Ee,
23138
23154
  UNDERSCORE_IDENT_RE: H,
23139
23155
  UNDERSCORE_TITLE_MODE: it
@@ -23212,7 +23228,7 @@ function Qm() {
23212
23228
  console.error(y);
23213
23229
  }, yn = (y, ...R) => {
23214
23230
  console.log(`WARN: ${y}`, ...R);
23215
- }, A = (y, R) => {
23231
+ }, C = (y, R) => {
23216
23232
  bn[`${y}/${R}`] || (console.log(`Deprecated as of ${y}. ${R}`), bn[`${y}/${R}`] = !0);
23217
23233
  }, F = new Error();
23218
23234
  function X(y, R, { key: U }) {
@@ -23399,7 +23415,7 @@ function Qm() {
23399
23415
  }
23400
23416
  function ke(B, j, se) {
23401
23417
  let me = "", ve = "";
23402
- typeof j == "object" ? (me = B, se = j.ignoreIllegals, ve = j.language) : (A("10.7.0", "highlight(lang, code, ...args) has been deprecated."), A("10.7.0", `Please use highlight(code, options) instead.
23418
+ typeof j == "object" ? (me = B, se = j.ignoreIllegals, ve = j.language) : (C("10.7.0", "highlight(lang, code, ...args) has been deprecated."), C("10.7.0", `Please use highlight(code, options) instead.
23403
23419
  https://github.com/highlightjs/highlight.js/issues/2277`), ve = B, me = j), se === void 0 && (se = !0);
23404
23420
  const Xe = {
23405
23421
  code: me,
@@ -23668,10 +23684,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ve = B, me = j), se =
23668
23684
  W = mi(W, B);
23669
23685
  }
23670
23686
  const Ls = () => {
23671
- En(), A("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
23687
+ En(), C("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
23672
23688
  };
23673
23689
  function Ps() {
23674
- En(), A("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
23690
+ En(), C("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
23675
23691
  }
23676
23692
  let Ei = !1;
23677
23693
  function En() {
@@ -23742,7 +23758,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ve = B, me = j), se =
23742
23758
  });
23743
23759
  }
23744
23760
  function Ws(B) {
23745
- return A("10.7.0", "highlightBlock will be removed entirely in v12.0"), A("10.7.0", "Please use highlightElement now."), Jn(B);
23761
+ return C("10.7.0", "highlightBlock will be removed entirely in v12.0"), C("10.7.0", "Please use highlightElement now."), Jn(B);
23746
23762
  }
23747
23763
  Object.assign(y, {
23748
23764
  highlight: ke,
@@ -24060,7 +24076,6 @@ const Nt = {
24060
24076
  },
24061
24077
  remoteRoot: {
24062
24078
  width: "100%",
24063
- minHeight: 200,
24064
24079
  border: "1px solid #e0e0e0",
24065
24080
  borderRadius: 8,
24066
24081
  background: "white",
@@ -24087,7 +24102,6 @@ const Nt = {
24087
24102
  maxWidth: "100%",
24088
24103
  minWidth: 0,
24089
24104
  // 允许 flex 子元素缩小
24090
- minHeight: 200,
24091
24105
  border: "none",
24092
24106
  background: "#ffffff",
24093
24107
  display: e ? "none" : "block",
@@ -24099,7 +24113,7 @@ const Nt = {
24099
24113
  display: "flex",
24100
24114
  alignItems: "center",
24101
24115
  justifyContent: "center",
24102
- height: 200,
24116
+ padding: "20px 12px",
24103
24117
  background: "#f8f9fa",
24104
24118
  borderRadius: 8,
24105
24119
  color: "#5f6368",
@@ -24133,38 +24147,43 @@ function As({ resource: e, messageId: t, isStreaming: n = !1, followLatest: r =
24133
24147
  const O = _["fallback-text"];
24134
24148
  return typeof O == "string" ? O : "";
24135
24149
  }, [_]), S = e.mimeType || "", I = !!e.script || /\bremote-dom\b/i.test(S) && !!e.text, M = I, x = S === "text/uri-list", z = x && typeof e.text == "string" && e.text.split(`
24136
- `).map((O) => O.trim()).find(Boolean) || null, H = It(() => !M && !x && e.text ? n && !e.text.trim() ? "" : sl(e.text, m, t) : "", [e.text, m, t, M, x, n]), G = Ve(async () => {
24137
- var O;
24138
- if (!(!c.current || M)) {
24139
- (O = f.current) == null || O.destroy();
24140
- try {
24141
- const C = new ll(c.current.contentWindow);
24142
- f.current = C, C.on("legacy-message", () => {
24143
- }), C.on("mcp-ui-call-tool", (N) => {
24144
- const w = N;
24145
- i && w.toolName ? i({ toolName: w.toolName, args: w.args, messageId: w.messageId }) : console.log("[MCPUIRenderer] mcp-ui-call-tool (no handler):", w);
24146
- }), C.on("mcp-ui-trigger-intent", (N) => {
24147
- const w = N;
24148
- a && w.intent ? a({ intent: w.intent, data: w.data, messageId: w.messageId }) : console.log("[MCPUIRenderer] mcp-ui-trigger-intent (no handler):", w);
24149
- }), C.on("mcp-ui-submit-prompt", (N) => {
24150
- const w = (N == null ? void 0 : N.prompt) ?? "";
24151
- o ? o(w) : console.log("[MCPUIRenderer] mcp-ui-submit-prompt (no handler):", w);
24152
- }), C.on("mcp-ui-notify", (N) => {
24153
- const w = (N == null ? void 0 : N.message) ?? "";
24154
- s ? s(w) : console.log("[MCPUIRenderer] mcp-ui-notify (no handler):", w);
24155
- }), await C.request("initialize", m);
24156
- } catch {
24157
- } finally {
24158
- h(!1);
24159
- }
24150
+ `).map((O) => O.trim()).find(Boolean) || null, H = It(() => !M && !x && e.text ? n && !e.text.trim() ? "" : sl(e.text, m, t) : "", [e.text, m, t, M, x, n]), G = Ve(() => {
24151
+ var A;
24152
+ if (!c.current || M)
24153
+ return;
24154
+ (A = f.current) == null || A.destroy();
24155
+ let O = null;
24156
+ try {
24157
+ O = new ll(c.current.contentWindow), f.current = O, O.on("legacy-message", () => {
24158
+ }), O.on("mcp-ui-call-tool", (N) => {
24159
+ const w = N;
24160
+ i && w.toolName ? i({ toolName: w.toolName, args: w.args, messageId: w.messageId }) : console.log("[MCPUIRenderer] mcp-ui-call-tool (no handler):", w);
24161
+ }), O.on("mcp-ui-trigger-intent", (N) => {
24162
+ const w = N;
24163
+ a && w.intent ? a({ intent: w.intent, data: w.data, messageId: w.messageId }) : console.log("[MCPUIRenderer] mcp-ui-trigger-intent (no handler):", w);
24164
+ }), O.on("mcp-ui-submit-prompt", (N) => {
24165
+ const w = (N == null ? void 0 : N.prompt) ?? "";
24166
+ o ? o(w) : console.log("[MCPUIRenderer] mcp-ui-submit-prompt (no handler):", w);
24167
+ }), O.on("mcp-ui-notify", (N) => {
24168
+ const w = (N == null ? void 0 : N.message) ?? "";
24169
+ s ? s(w) : console.log("[MCPUIRenderer] mcp-ui-notify (no handler):", w);
24170
+ });
24171
+ } catch {
24172
+ h(!1);
24173
+ return;
24160
24174
  }
24175
+ h(!1), O.request("initialize", m).then(() => {
24176
+ console.log("[MCPUIRenderer] initialize ok", { messageId: t, mime: S });
24177
+ }).catch((N) => {
24178
+ console.warn("[MCPUIRenderer] initialize failed (ignored)", { messageId: t, mime: S, error: N });
24179
+ }), O.notify("mcp-ui-request-size", { force: !0 }), console.log("[MCPUIRenderer] request-size sent", { messageId: t, mime: S, isUrl: x, iframeSrc: z });
24161
24180
  }, [m, M, i, a, o, s]);
24162
24181
  return Ae(() => {
24163
24182
  if (M)
24164
24183
  return;
24165
- const O = (C) => {
24166
- const N = C.data;
24167
- if (!N || t && N.messageId !== t || c.current && C.source !== c.current.contentWindow)
24184
+ const O = (A) => {
24185
+ const N = A.data;
24186
+ if (!N || t && N.messageId !== t || c.current && A.source !== c.current.contentWindow)
24168
24187
  return;
24169
24188
  const { method: w, params: D } = N;
24170
24189
  switch (w) {
@@ -24181,7 +24200,11 @@ function As({ resource: e, messageId: t, isStreaming: n = !1, followLatest: r =
24181
24200
  a == null || a(D);
24182
24201
  break;
24183
24202
  case "mcp-ui-report-size":
24184
- if (c.current && D.height) {
24203
+ if (console.log("[MCPUIRenderer] report-size received", {
24204
+ messageId: t,
24205
+ width: D == null ? void 0 : D.width,
24206
+ height: D == null ? void 0 : D.height
24207
+ }), c.current && D.height) {
24185
24208
  const te = Math.max(0, Math.ceil(Number(D.height)));
24186
24209
  if (!te || te === p.current)
24187
24210
  break;
@@ -24199,8 +24222,8 @@ function As({ resource: e, messageId: t, isStreaming: n = !1, followLatest: r =
24199
24222
  if (!O)
24200
24223
  return;
24201
24224
  ub();
24202
- const C = (e.script || e.text || "").trim();
24203
- if (!C) {
24225
+ const A = (e.script || e.text || "").trim();
24226
+ if (!A) {
24204
24227
  O.innerHTML = "<div>Remote DOM: Empty script</div>", h(!1);
24205
24228
  return;
24206
24229
  }
@@ -24249,7 +24272,7 @@ function As({ resource: e, messageId: t, isStreaming: n = !1, followLatest: r =
24249
24272
  }
24250
24273
  };
24251
24274
  try {
24252
- new Function("document", "root", "window", C)(document, O, N), h(!1);
24275
+ new Function("document", "root", "window", A)(document, O, N), h(!1);
24253
24276
  } catch (w) {
24254
24277
  O.innerHTML = `<div>Render Error: ${w instanceof Error ? w.message : String(w)}</div>`, h(!1);
24255
24278
  }
@@ -24449,8 +24472,8 @@ function Eb({ messages: e, isLoading: t = !1, className: n, onCallTool: r, onTri
24449
24472
  Ae(() => () => {
24450
24473
  _.current && (cancelAnimationFrame(_.current), _.current = 0), m.current && (cancelAnimationFrame(m.current), m.current = 0);
24451
24474
  }, []), Ae(() => {
24452
- var C;
24453
- const k = e.length, P = ((C = e[0]) == null ? void 0 : C.id) ?? "";
24475
+ var A;
24476
+ const k = e.length, P = ((A = e[0]) == null ? void 0 : A.id) ?? "";
24454
24477
  g.current;
24455
24478
  const O = f.current && P !== "" && h.current !== "" && P !== h.current;
24456
24479
  (!f.current || O) && (f.current = !0, d(Math.max(0, k - Rr)), c(!0), setTimeout(() => {
@@ -24461,15 +24484,15 @@ function Eb({ messages: e, isLoading: t = !1, className: n, onCallTool: r, onTri
24461
24484
  }, [e, I]), Zs(() => {
24462
24485
  if (!v.current || !s.current)
24463
24486
  return;
24464
- const k = s.current, { prevHeight: P, prevTop: O } = v.current, C = k.scrollHeight - P;
24465
- k.scrollTop = O + C, v.current = null;
24487
+ const k = s.current, { prevHeight: P, prevTop: O } = v.current, A = k.scrollHeight - P;
24488
+ k.scrollTop = O + A, v.current = null;
24466
24489
  }, [u, S.length]), Ae(() => {
24467
24490
  const k = s.current;
24468
24491
  if (!k)
24469
24492
  return;
24470
24493
  const P = () => {
24471
- const C = x() <= yb;
24472
- C !== l && c(C), k.scrollTop <= bb && u > 0 && !v.current && (v.current = { prevHeight: k.scrollHeight, prevTop: k.scrollTop }, d((N) => Math.max(0, N - Rr)));
24494
+ const A = x() <= yb;
24495
+ A !== l && c(A), k.scrollTop <= bb && u > 0 && !v.current && (v.current = { prevHeight: k.scrollHeight, prevTop: k.scrollTop }, d((N) => Math.max(0, N - Rr)));
24473
24496
  };
24474
24497
  return k.addEventListener("scroll", P, { passive: !0 }), () => k.removeEventListener("scroll", P);
24475
24498
  }, [l, x, u]), Ae(() => {
@@ -25263,13 +25286,13 @@ function Xo({ onPin: e, onDelete: t, onPinClick: n, onDeleteClick: r }) {
25263
25286
  }, style: ie.actionBtnDelete, children: [T.jsx(vb, { size: 14, color: "currentColor" }), "删除"] })] });
25264
25287
  }
25265
25288
  function Yb({ open: e, onClose: t, sessions: n, currentSessionId: r, onSelect: i, onDelete: a, onPin: o, title: s = "历史对话" }) {
25266
- const [l, c] = nt(null), [u, d] = nt(null), [f, p] = nt(null), g = Ne(null), h = n.filter((C) => C.pinned), _ = n.filter((C) => !C.pinned), m = pn.useMemo(() => {
25267
- const C = /* @__PURE__ */ new Map(), N = [..._].sort((w, D) => new Date(D.updatedAt).getTime() - new Date(w.updatedAt).getTime());
25289
+ const [l, c] = nt(null), [u, d] = nt(null), [f, p] = nt(null), g = Ne(null), h = n.filter((A) => A.pinned), _ = n.filter((A) => !A.pinned), m = pn.useMemo(() => {
25290
+ const A = /* @__PURE__ */ new Map(), N = [..._].sort((w, D) => new Date(D.updatedAt).getTime() - new Date(w.updatedAt).getTime());
25268
25291
  for (const w of N) {
25269
25292
  const D = Ob(w.updatedAt || w.createdAt);
25270
- C.has(D) || C.set(D, []), C.get(D).push(w);
25293
+ A.has(D) || A.set(D, []), A.get(D).push(w);
25271
25294
  }
25272
- return Array.from(C.entries());
25295
+ return Array.from(A.entries());
25273
25296
  }, [_]), v = () => {
25274
25297
  l && a && (a(l), c(null));
25275
25298
  }, S = () => {
@@ -25278,68 +25301,68 @@ function Yb({ open: e, onClose: t, sessions: n, currentSessionId: r, onSelect: i
25278
25301
  Ae(() => {
25279
25302
  if (!e)
25280
25303
  return;
25281
- const C = document.body.style.overflow, N = document.body.style.overflowX;
25304
+ const A = document.body.style.overflow, N = document.body.style.overflowX;
25282
25305
  return document.body.style.overflow = "hidden", document.body.style.overflowX = "hidden", () => {
25283
- document.body.style.overflow = C, document.body.style.overflowX = N;
25306
+ document.body.style.overflow = A, document.body.style.overflowX = N;
25284
25307
  };
25285
25308
  }, [e]), Ae(() => {
25286
25309
  if (!f)
25287
25310
  return;
25288
- const C = () => {
25311
+ const A = () => {
25289
25312
  d((N) => f && f.currentX - f.startX < -40 ? f.id : N === f.id ? null : N), p(null), g.current = null;
25290
25313
  };
25291
- return document.addEventListener("mouseup", C), () => document.removeEventListener("mouseup", C);
25314
+ return document.addEventListener("mouseup", A), () => document.removeEventListener("mouseup", A);
25292
25315
  }, [f]);
25293
- const M = (C) => {
25294
- if ((f == null ? void 0 : f.id) === C) {
25316
+ const M = (A) => {
25317
+ if ((f == null ? void 0 : f.id) === A) {
25295
25318
  const N = f.currentX - f.startX;
25296
25319
  return Math.min(0, Math.max(-Xr, N));
25297
25320
  }
25298
- return u === C ? -Xr : 0;
25299
- }, x = (C, N) => {
25300
- I && (g.current = { id: C, x: N.touches[0].clientX }, u && u !== C && d(null));
25301
- }, z = (C, N) => {
25302
- if (!g.current || g.current.id !== C)
25321
+ return u === A ? -Xr : 0;
25322
+ }, x = (A, N) => {
25323
+ I && (g.current = { id: A, x: N.touches[0].clientX }, u && u !== A && d(null));
25324
+ }, z = (A, N) => {
25325
+ if (!g.current || g.current.id !== A)
25303
25326
  return;
25304
25327
  const w = N.touches[0].clientX;
25305
- !f || f.id !== C ? p({ id: C, startX: g.current.x, currentX: w }) : p((D) => D ? { ...D, currentX: w } : null);
25306
- }, H = (C) => {
25328
+ !f || f.id !== A ? p({ id: A, startX: g.current.x, currentX: w }) : p((D) => D ? { ...D, currentX: w } : null);
25329
+ }, H = (A) => {
25307
25330
  var N;
25308
- if (((N = g.current) == null ? void 0 : N.id) === C && (g.current = null, (f == null ? void 0 : f.id) === C)) {
25331
+ if (((N = g.current) == null ? void 0 : N.id) === A && (g.current = null, (f == null ? void 0 : f.id) === A)) {
25309
25332
  const w = f.currentX - f.startX;
25310
- d(w < -40 ? C : null), p(null);
25333
+ d(w < -40 ? A : null), p(null);
25311
25334
  }
25312
- }, G = (C, N) => {
25313
- I && N.button === 0 && (g.current = { id: C, x: N.clientX }, u && u !== C && d(null));
25314
- }, k = (C, N) => {
25315
- if (!g.current || g.current.id !== C || N.buttons !== 1)
25335
+ }, G = (A, N) => {
25336
+ I && N.button === 0 && (g.current = { id: A, x: N.clientX }, u && u !== A && d(null));
25337
+ }, k = (A, N) => {
25338
+ if (!g.current || g.current.id !== A || N.buttons !== 1)
25316
25339
  return;
25317
25340
  const w = N.clientX;
25318
- !f || f.id !== C ? p({ id: C, startX: g.current.x, currentX: w }) : p((D) => D ? { ...D, currentX: w } : null);
25319
- }, P = (C) => {
25341
+ !f || f.id !== A ? p({ id: A, startX: g.current.x, currentX: w }) : p((D) => D ? { ...D, currentX: w } : null);
25342
+ }, P = (A) => {
25320
25343
  var N;
25321
- if (((N = g.current) == null ? void 0 : N.id) === C && (g.current = null, (f == null ? void 0 : f.id) === C)) {
25344
+ if (((N = g.current) == null ? void 0 : N.id) === A && (g.current = null, (f == null ? void 0 : f.id) === A)) {
25322
25345
  const w = f.currentX - f.startX;
25323
- d(w < -40 ? C : null), p(null);
25346
+ d(w < -40 ? A : null), p(null);
25324
25347
  }
25325
25348
  }, O = () => {
25326
25349
  if (g.current = null, f) {
25327
- const C = f.currentX - f.startX;
25328
- d(C < -40 ? f.id : null), p(null);
25350
+ const A = f.currentX - f.startX;
25351
+ d(A < -40 ? f.id : null), p(null);
25329
25352
  }
25330
25353
  };
25331
- return e ? T.jsxs(T.Fragment, { children: [T.jsx("div", { role: "presentation", style: ie.overlay, onClick: t, onKeyDown: (C) => C.key === "Escape" && t() }), T.jsxs("div", { role: "dialog", "aria-label": s, style: ie.drawer, onClick: (C) => C.stopPropagation(), children: [T.jsxs("div", { style: ie.header, children: [T.jsx("h2", { style: ie.title, children: s }), T.jsx("button", { type: "button", onClick: t, "aria-label": "关闭", style: ie.closeBtn, children: "×" })] }), T.jsx("div", { style: ie.scrollArea, onClick: S, children: n.length === 0 ? T.jsx("div", { style: ie.empty, children: "暂无历史对话" }) : T.jsxs(T.Fragment, { children: [h.length > 0 && T.jsxs("div", { style: ie.section, children: [T.jsx(Yo, { children: "置顶" }), h.map((C) => {
25332
- const N = M(C.id), w = r === C.id;
25354
+ return e ? T.jsxs(T.Fragment, { children: [T.jsx("div", { role: "presentation", style: ie.overlay, onClick: t, onKeyDown: (A) => A.key === "Escape" && t() }), T.jsxs("div", { role: "dialog", "aria-label": s, style: ie.drawer, onClick: (A) => A.stopPropagation(), children: [T.jsxs("div", { style: ie.header, children: [T.jsx("h2", { style: ie.title, children: s }), T.jsx("button", { type: "button", onClick: t, "aria-label": "关闭", style: ie.closeBtn, children: "×" })] }), T.jsx("div", { style: ie.scrollArea, onClick: S, children: n.length === 0 ? T.jsx("div", { style: ie.empty, children: "暂无历史对话" }) : T.jsxs(T.Fragment, { children: [h.length > 0 && T.jsxs("div", { style: ie.section, children: [T.jsx(Yo, { children: "置顶" }), h.map((A) => {
25355
+ const N = M(A.id), w = r === A.id;
25333
25356
  return T.jsxs("div", { style: ie.rowWrap, children: [T.jsx("div", { style: ie.actionStrip, children: T.jsx(Xo, { onPin: o, onDelete: a, onPinClick: () => {
25334
- o == null || o(C.id), d(null);
25357
+ o == null || o(A.id), d(null);
25335
25358
  }, onDeleteClick: () => {
25336
- d(null), c(C.id);
25359
+ d(null), c(A.id);
25337
25360
  } }) }), T.jsxs("div", { onClick: (D) => {
25338
- D.stopPropagation(), !(Math.abs(N) > 5) && (i(C.id), t());
25339
- }, style: ie.rowContentPinned(N, w), children: [T.jsxs("span", { style: ie.rowTitle, children: [T.jsx("span", { style: ie.rowTitleIcon, children: T.jsx(Is, { size: 14 }) }), C.title || "新对话"] }), I && T.jsx("button", { type: "button", onClick: (D) => {
25340
- D.stopPropagation(), d(u === C.id ? null : C.id);
25341
- }, style: ie.menuTriggerBtn, "aria-label": "更多", children: "⋮" })] })] }, C.id);
25342
- })] }), m.map(([C, N]) => T.jsxs("div", { style: ie.section, children: [T.jsx(Yo, { children: C }), N.map((w) => {
25361
+ D.stopPropagation(), !(Math.abs(N) > 5) && (i(A.id), t());
25362
+ }, style: ie.rowContentPinned(N, w), children: [T.jsxs("span", { style: ie.rowTitle, children: [T.jsx("span", { style: ie.rowTitleIcon, children: T.jsx(Is, { size: 14 }) }), A.title || "新对话"] }), I && T.jsx("button", { type: "button", onClick: (D) => {
25363
+ D.stopPropagation(), d(u === A.id ? null : A.id);
25364
+ }, style: ie.menuTriggerBtn, "aria-label": "更多", children: "⋮" })] })] }, A.id);
25365
+ })] }), m.map(([A, N]) => T.jsxs("div", { style: ie.section, children: [T.jsx(Yo, { children: A }), N.map((w) => {
25343
25366
  var Y;
25344
25367
  const D = M(w.id), te = r === w.id;
25345
25368
  return T.jsxs("div", { style: ie.rowWrap, onTouchStart: (J) => x(w.id, J), onTouchMove: (J) => z(w.id, J), onTouchEnd: () => H(w.id), onMouseDown: (J) => G(w.id, J), onMouseMove: (J) => k(w.id, J), onMouseUp: () => P(w.id), onMouseLeave: O, children: [T.jsx("div", { style: ie.actionStrip, children: T.jsx(Xo, { onPin: o, onDelete: a, onPinClick: () => {
@@ -25358,7 +25381,7 @@ function Yb({ open: e, onClose: t, sessions: n, currentSessionId: r, onSelect: i
25358
25381
  }, children: [T.jsx("div", { style: ie.rowBody, children: T.jsxs("div", { style: ie.rowBodyMain, children: [T.jsx("div", { style: ie.rowItemTitle, children: w.title || "新对话" }), T.jsx("div", { style: ie.rowItemSummary, children: Db(w) }), T.jsxs("div", { style: ie.rowItemMeta, children: [Mb(w.updatedAt || w.createdAt), " ·", " ", ((Y = w.messages) == null ? void 0 : Y.length) ?? 0, "条"] })] }) }), I && T.jsx("button", { type: "button", onClick: (J) => {
25359
25382
  J.stopPropagation(), d(u === w.id ? null : w.id);
25360
25383
  }, title: "更多", style: ie.menuTriggerBtn, "aria-label": "更多", children: "⋮" })] })] }, w.id);
25361
- })] }, C))] }) })] }), l != null && T.jsxs(T.Fragment, { children: [T.jsx("div", { role: "presentation", style: ie.deleteOverlay, onClick: () => c(null) }), T.jsxs("div", { role: "dialog", "aria-labelledby": "delete-dialog-title", style: ie.deleteDialog, onClick: (C) => C.stopPropagation(), children: [T.jsxs("div", { style: ie.deleteHeader, children: [T.jsx("h3", { id: "delete-dialog-title", style: ie.deleteTitle, children: "删除对话" }), T.jsx("button", { type: "button", onClick: () => c(null), "aria-label": "关闭", style: ie.deleteCloseBtn, children: "×" })] }), T.jsx("p", { style: ie.deleteBody, children: "确定要删除此对话吗?" }), T.jsxs("div", { style: ie.deleteActions, children: [T.jsx("button", { type: "button", onClick: () => c(null), style: ie.deleteCancelBtn, children: "取消" }), T.jsx("button", { type: "button", onClick: v, style: ie.deleteConfirmBtn, children: "确认" })] })] })] })] }) : null;
25384
+ })] }, A))] }) })] }), l != null && T.jsxs(T.Fragment, { children: [T.jsx("div", { role: "presentation", style: ie.deleteOverlay, onClick: () => c(null) }), T.jsxs("div", { role: "dialog", "aria-labelledby": "delete-dialog-title", style: ie.deleteDialog, onClick: (A) => A.stopPropagation(), children: [T.jsxs("div", { style: ie.deleteHeader, children: [T.jsx("h3", { id: "delete-dialog-title", style: ie.deleteTitle, children: "删除对话" }), T.jsx("button", { type: "button", onClick: () => c(null), "aria-label": "关闭", style: ie.deleteCloseBtn, children: "×" })] }), T.jsx("p", { style: ie.deleteBody, children: "确定要删除此对话吗?" }), T.jsxs("div", { style: ie.deleteActions, children: [T.jsx("button", { type: "button", onClick: () => c(null), style: ie.deleteCancelBtn, children: "取消" }), T.jsx("button", { type: "button", onClick: v, style: ie.deleteConfirmBtn, children: "确认" })] })] })] })] }) : null;
25362
25385
  }
25363
25386
  const Rs = Js(null);
25364
25387
  function Xb({ children: e, defaultMode: t = "light", customVariables: n = {} }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finogeeks2026/chatkit-web",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "面向 Web / H5 的 AI 对话 UI SDK,支持流式对话、多会话管理、主题定制",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",