page-agent-sdk 2.14.0 → 2.15.1

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.
@@ -9,7 +9,7 @@ var c = Object.create, l = Object.defineProperty, u = Object.getOwnPropertyDescr
9
9
  enumerable: !(r = u(t, s)) || r.enumerable
10
10
  });
11
11
  return e;
12
- }, g = (e, t, n) => (n = e == null ? {} : c(f(e)), h(t || !e || !e.__esModule ? l(n, "default", {
12
+ }, g = (e, t, n) => (n = e == null ? {} : c(f(e)), h(t || !e || !e.__esModule || !p.call(e, "default") ? l(n, "default", {
13
13
  value: e,
14
14
  enumerable: !0
15
15
  }) : n, e));
@@ -106,7 +106,8 @@ function Se(e) {
106
106
  if (i) for (let e in i) t[e] = i[e];
107
107
  }
108
108
  return t;
109
- } else if (P(e) || I(e)) return e;
109
+ }
110
+ if (P(e) || I(e)) return e;
110
111
  }
111
112
  var Ce = /;(?![^(]*\))/g, we = /:([^]+)/, Te = /\/\*[^]*?\*\//g;
112
113
  function Ee(e) {
@@ -162,7 +163,7 @@ function Be(e, ...t) {
162
163
  }
163
164
  var Ve, He = class {
164
165
  constructor(e = !1) {
165
- this.detached = e, this._active = !0, this._on = 0, this.effects = [], this.cleanups = [], this._isPaused = !1, this._warnOnRun = !0, this.__v_skip = !0, !e && Ve && (Ve.active ? (this.parent = Ve, this.index = (Ve.scopes ||= []).push(this) - 1) : (this._active = !1, this._warnOnRun = !1));
166
+ this.detached = e, this._active = !0, this._on = 0, this.effects = [], this.cleanups = [], this._isPaused = !1, this._warnOnRun = !0, this.__v_skip = !0, !e && Ve && (Ve.active ? (this.parent = Ve, this.index = (Ve.scopes || (Ve.scopes = [])).push(this) - 1) : (this._active = !1, this._warnOnRun = !1));
166
167
  }
167
168
  get active() {
168
169
  return this._active;
@@ -171,7 +172,10 @@ var Ve, He = class {
171
172
  if (this._active) {
172
173
  this._isPaused = !0;
173
174
  let e, t;
174
- if (this.scopes) for (e = 0, t = this.scopes.length; e < t; e++) this.scopes[e].pause();
175
+ if (this.scopes) {
176
+ let n = this.scopes.slice();
177
+ for (e = 0, t = n.length; e < t; e++) n[e].pause();
178
+ }
175
179
  for (e = 0, t = this.effects.length; e < t; e++) this.effects[e].pause();
176
180
  }
177
181
  }
@@ -179,8 +183,12 @@ var Ve, He = class {
179
183
  if (this._active && this._isPaused) {
180
184
  this._isPaused = !1;
181
185
  let e, t;
182
- if (this.scopes) for (e = 0, t = this.scopes.length; e < t; e++) this.scopes[e].resume();
183
- for (e = 0, t = this.effects.length; e < t; e++) this.effects[e].resume();
186
+ if (this.scopes) {
187
+ let n = this.scopes.slice();
188
+ for (e = 0, t = n.length; e < t; e++) n[e].resume();
189
+ }
190
+ let n = this.effects.slice();
191
+ for (e = 0, t = n.length; e < t; e++) n[e].resume();
184
192
  }
185
193
  }
186
194
  run(e) {
@@ -191,7 +199,8 @@ var Ve, He = class {
191
199
  } finally {
192
200
  Ve = t;
193
201
  }
194
- } else process.env.NODE_ENV !== "production" && this._warnOnRun && Be("cannot run an inactive effect scope.");
202
+ }
203
+ process.env.NODE_ENV !== "production" && this._warnOnRun && Be("cannot run an inactive effect scope.");
195
204
  }
196
205
  on() {
197
206
  ++this._on === 1 && (this.prevScope = Ve, Ve = this);
@@ -219,7 +228,8 @@ var Ve, He = class {
219
228
  for (t = 0, n = this.effects.length; t < n; t++) this.effects[t].stop();
220
229
  for (this.effects.length = 0, t = 0, n = this.cleanups.length; t < n; t++) this.cleanups[t]();
221
230
  if (this.cleanups.length = 0, this.scopes) {
222
- for (t = 0, n = this.scopes.length; t < n; t++) this.scopes[t].stop(!0);
231
+ let e = this.scopes.slice();
232
+ for (t = 0, n = e.length; t < n; t++) e[t].stop(!0);
223
233
  this.scopes.length = 0;
224
234
  }
225
235
  if (!this.detached && this.parent && !e) {
@@ -455,9 +465,7 @@ function vt(e, t, n, r, i, a) {
455
465
  case "delete":
456
466
  i || (s(o.get(mt)), j(e) && s(o.get(ht)));
457
467
  break;
458
- case "set":
459
- j(e) && s(o.get(mt));
460
- break;
468
+ case "set": j(e) && s(o.get(mt));
461
469
  }
462
470
  }
463
471
  Ze();
@@ -1119,7 +1127,8 @@ function Vn(e, t, n, r) {
1119
1127
  let i = [];
1120
1128
  for (let a = 0; a < e.length; a++) i.push(Vn(e[a], t, n, r));
1121
1129
  return i;
1122
- } else process.env.NODE_ENV !== "production" && G(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`);
1130
+ }
1131
+ process.env.NODE_ENV !== "production" && G(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`);
1123
1132
  }
1124
1133
  function Hn(e, t, n, r = !0) {
1125
1134
  let i = t ? t.vnode : null, { errorHandler: a, throwUnhandledErrorInProduction: o } = t && t.appContext.config || b;
@@ -1248,7 +1257,7 @@ function pr(e) {
1248
1257
  dr.get(e.type.__hmrId).instances.delete(e);
1249
1258
  }
1250
1259
  function mr(e, t) {
1251
- return dr.has(e) ? !1 : (dr.set(e, {
1260
+ return !dr.has(e) && (dr.set(e, {
1252
1261
  initialDef: hr(t),
1253
1262
  instances: /* @__PURE__ */ new Set()
1254
1263
  }), !0);
@@ -1342,13 +1351,14 @@ function zr(e, t = Ir, n) {
1342
1351
  if (!t || e._n) return e;
1343
1352
  let r = (...n) => {
1344
1353
  r._d && Ko(-1);
1345
- let i = Rr(t), a;
1354
+ let i = Rr(t), a = Ho.length, o;
1346
1355
  try {
1347
- a = e(...n);
1356
+ o = e(...n);
1348
1357
  } finally {
1358
+ for (let e = Ho.length; e > a; e--) Wo();
1349
1359
  Rr(i), r._d && Ko(1);
1350
1360
  }
1351
- return process.env.NODE_ENV !== "production" && Or(t), a;
1361
+ return process.env.NODE_ENV !== "production" && Or(t), o;
1352
1362
  };
1353
1363
  return r._n = !0, r._c = !0, r._d = !0, r;
1354
1364
  }
@@ -1460,7 +1470,7 @@ var Zr = /* @__PURE__ */ new WeakMap(), Qr = /* @__PURE__ */ Symbol("_vte"), $r
1460
1470
  let r = t(n);
1461
1471
  return process.env.NODE_ENV !== "production" && !r && !ei(e) && G(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`), r;
1462
1472
  } else return process.env.NODE_ENV !== "production" && G("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"), null;
1463
- else return process.env.NODE_ENV !== "production" && !n && !ei(e) && G(`Invalid Teleport target: ${n}`), n;
1473
+ return process.env.NODE_ENV !== "production" && !n && !ei(e) && G(`Invalid Teleport target: ${n}`), n;
1464
1474
  }, ai = {
1465
1475
  name: "Teleport",
1466
1476
  __isTeleport: !0,
@@ -1756,14 +1766,8 @@ function ji(e, t, n, r, i = !1) {
1756
1766
  m(l, e.k) && (l.value = null), e.k && (u[e.k] = null);
1757
1767
  }
1758
1768
  }
1759
- if (N(c)) {
1760
- ot();
1761
- try {
1762
- Bn(c, s, 12, [o, u]);
1763
- } finally {
1764
- st();
1765
- }
1766
- } else {
1769
+ if (N(c)) Bn(c, s, 12, [o, u]);
1770
+ else {
1767
1771
  let t = P(c), r = /* @__PURE__ */ mn(c);
1768
1772
  if (t || r) {
1769
1773
  let s = () => {
@@ -1827,7 +1831,8 @@ function zi(e, t, n = hs, r = !1) {
1827
1831
  return i(), st(), a;
1828
1832
  };
1829
1833
  return r ? i.unshift(a) : i.push(a), a;
1830
- } else process.env.NODE_ENV !== "production" && G(`${me(zn[e].replace(/ hook$/, ""))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
1834
+ }
1835
+ process.env.NODE_ENV !== "production" && G(`${me(zn[e].replace(/ hook$/, ""))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
1831
1836
  }
1832
1837
  var Bi = (e) => (t, n = hs) => {
1833
1838
  (!ws || e === "sp") && zi(e, (...e) => t(...e), n);
@@ -2387,7 +2392,7 @@ function Ja(e, t, n, r = !1) {
2387
2392
  let i = {}, a = Ka();
2388
2393
  e.propsDefaults = /* @__PURE__ */ Object.create(null), Za(e, t, i, a);
2389
2394
  for (let t in e.propsOptions[0]) t in i || (i[t] = void 0);
2390
- process.env.NODE_ENV !== "production" && ro(t || {}, i, e), n ? e.props = r ? i : /* @__PURE__ */ nn(i) : e.type.props ? e.props = i : e.props = a, e.attrs = a;
2395
+ process.env.NODE_ENV !== "production" && ro(t || {}, i, e), e.props = n ? r ? i : /* @__PURE__ */ nn(i) : e.type.props ? i : a, e.attrs = a;
2391
2396
  }
2392
2397
  function Ya(e) {
2393
2398
  for (; e;) {
@@ -2486,7 +2491,8 @@ function eo(e, t, n = !1) {
2486
2491
  if (n === "Boolean") {
2487
2492
  c = !0;
2488
2493
  break;
2489
- } else n === "String" && (l = !1);
2494
+ }
2495
+ n === "String" && (l = !1);
2490
2496
  }
2491
2497
  else c = N(i) && i.name === "Boolean";
2492
2498
  r[0] = c, r[1] = l, (c || k(r, "default")) && s.push(t);
@@ -2497,7 +2503,7 @@ function eo(e, t, n = !1) {
2497
2503
  return I(e) && r.set(e, l), l;
2498
2504
  }
2499
2505
  function to(e) {
2500
- return e[0] !== "$" && !se(e) ? !0 : (process.env.NODE_ENV !== "production" && G(`Invalid prop name: "${e}" is a reserved property.`), !1);
2506
+ return e[0] !== "$" && !se(e) || (process.env.NODE_ENV !== "production" && G(`Invalid prop name: "${e}" is a reserved property.`), !1);
2501
2507
  }
2502
2508
  function no(e) {
2503
2509
  return e === null ? "null" : typeof e == "function" ? e.name || "" : typeof e == "object" && e.constructor && e.constructor.name || "";
@@ -2828,7 +2834,8 @@ function Oo(e, t) {
2828
2834
  if (p & 128) {
2829
2835
  re(l, f, n, r, i, a, o, s, c);
2830
2836
  return;
2831
- } else if (p & 256) {
2837
+ }
2838
+ if (p & 256) {
2832
2839
  ne(l, f, n, r, i, a, o, s, c);
2833
2840
  return;
2834
2841
  }
@@ -3293,7 +3300,7 @@ function ms(e, t, n) {
3293
3300
  ec: null,
3294
3301
  sp: null
3295
3302
  };
3296
- return process.env.NODE_ENV === "production" ? a.ctx = { _: a } : a.ctx = ia(a), a.root = t ? t.root : a, a.emit = ka.bind(null, a), e.ce && e.ce(a), a;
3303
+ return a.ctx = process.env.NODE_ENV === "production" ? { _: a } : ia(a), a.root = t ? t.root : a, a.emit = ka.bind(null, a), e.ce && e.ce(a), a;
3297
3304
  }
3298
3305
  var hs = null, gs = () => hs || Ir, _s, vs;
3299
3306
  {
@@ -3426,7 +3433,8 @@ function Ps(e) {
3426
3433
  },
3427
3434
  expose: t
3428
3435
  });
3429
- } else return {
3436
+ }
3437
+ return {
3430
3438
  attrs: new Proxy(e.attrs, Ms),
3431
3439
  slots: e.slots,
3432
3440
  emit: e.emit,
@@ -3508,7 +3516,8 @@ function Us() {
3508
3516
  s(n),
3509
3517
  ">"
3510
3518
  ];
3511
- } else if (/* @__PURE__ */ sn(t)) return [
3519
+ }
3520
+ return /* @__PURE__ */ sn(t) ? [
3512
3521
  "div",
3513
3522
  {},
3514
3523
  [
@@ -3519,8 +3528,7 @@ function Us() {
3519
3528
  "<",
3520
3529
  s(t),
3521
3530
  `>${/* @__PURE__ */ cn(t) ? " (readonly)" : ""}`
3522
- ];
3523
- else if (/* @__PURE__ */ cn(t)) return [
3531
+ ] : /* @__PURE__ */ cn(t) ? [
3524
3532
  "div",
3525
3533
  {},
3526
3534
  [
@@ -3531,8 +3539,7 @@ function Us() {
3531
3539
  "<",
3532
3540
  s(t),
3533
3541
  ">"
3534
- ];
3535
- return null;
3542
+ ] : null;
3536
3543
  },
3537
3544
  hasBody(e) {
3538
3545
  return e && e.__isVue;
@@ -3622,7 +3629,7 @@ function Us() {
3622
3629
  }
3623
3630
  window.devtoolsFormatters ? window.devtoolsFormatters.push(i) : window.devtoolsFormatters = [i];
3624
3631
  }
3625
- var Ws = "3.5.39", Gs = process.env.NODE_ENV === "production" ? S : G;
3632
+ var Ws = "3.5.40", Gs = process.env.NODE_ENV === "production" ? S : G;
3626
3633
  process.env.NODE_ENV, process.env.NODE_ENV;
3627
3634
  //#endregion
3628
3635
  //#region node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
@@ -4212,13 +4219,11 @@ function Cl(e = {}) {
4212
4219
  }
4213
4220
  break;
4214
4221
  }
4215
- case "approval_request":
4216
- l.value = {
4217
- toolName: e.toolName,
4218
- args: e.args,
4219
- resolve: e.resolve
4220
- };
4221
- break;
4222
+ case "approval_request": l.value = {
4223
+ toolName: e.toolName,
4224
+ args: e.args,
4225
+ resolve: e.resolve
4226
+ };
4222
4227
  }
4223
4228
  f();
4224
4229
  }, e);
@@ -4409,7 +4414,7 @@ var Al = ((e = "") => {
4409
4414
  headingBeginRegex: kl((e) => RegExp(`^ {0,${e}}#`)),
4410
4415
  htmlBeginRegex: kl((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
4411
4416
  blockquoteBeginRegex: kl((e) => RegExp(`^ {0,${e}}>`))
4412
- }, Ml = /^(?:[ \t]*(?:\n|$))+/, Nl = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Pl = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Fl = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Il = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Ll = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Rl = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, zl = Z(Rl).replace(/bull/g, Ll).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Bl = Z(Rl).replace(/bull/g, Ll).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Vl = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Hl = /^[^\n]+/, Ul = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Wl = Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ul).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Gl = Z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Ll).getRegex(), Kl = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ql = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Jl = Z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n+|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ql).replace("tag", Kl).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Yl = (e) => Z(Vl).replace("hr", Fl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Kl).getRegex(), Xl = Yl(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Zl = Yl(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/), Ql = {
4417
+ }, Ml = /^(?:[ \t]*(?:\n|$))+/, Nl = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Pl = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Fl = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Il = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Ll = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Rl = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, zl = Z(Rl).replace(/bull/g, Ll).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Bl = Z(Rl).replace(/bull/g, Ll).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Vl = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Hl = /^[^\n]+/, Ul = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Wl = Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ul).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Gl = Z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Ll).getRegex(), Kl = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ql = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Jl = Z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ql).replace("tag", Kl).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Yl = (e) => Z(Vl).replace("hr", Fl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Kl).getRegex(), Xl = Yl(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Zl = Yl(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Ql = {
4413
4418
  blockquote: Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Zl).getRegex(),
4414
4419
  code: Nl,
4415
4420
  def: Wl,
@@ -4423,11 +4428,11 @@ var Al = ((e = "") => {
4423
4428
  paragraph: Xl,
4424
4429
  table: Ol,
4425
4430
  text: Hl
4426
- }, $l = Z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Fl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Kl).getRegex(), eu = {
4431
+ }, $l = Z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Fl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Kl).getRegex(), eu = {
4427
4432
  ...Ql,
4428
4433
  lheading: Bl,
4429
4434
  table: $l,
4430
- paragraph: Z(Vl).replace("hr", Fl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", $l).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Kl).getRegex()
4435
+ paragraph: Z(Vl).replace("hr", Fl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", $l).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Kl).getRegex()
4431
4436
  }, tu = {
4432
4437
  ...Ql,
4433
4438
  html: Z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", ql).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
@@ -4471,7 +4476,7 @@ var Al = ((e = "") => {
4471
4476
  url: Z(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Mu).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
4472
4477
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
4473
4478
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
4474
- text: Z(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Mu).getRegex()
4479
+ text: Z(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Mu).getRegex()
4475
4480
  }, Iu = {
4476
4481
  ...Fu,
4477
4482
  br: Z(iu).replace("{2,}", "*").getRegex(),
@@ -4658,7 +4663,8 @@ ${c}` : c;
4658
4663
  let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
4659
4664
  i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
4660
4665
  break;
4661
- } else if (u?.type === "list") {
4666
+ }
4667
+ if (u?.type === "list") {
4662
4668
  let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
4663
4669
  i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
4664
4670
  continue;
@@ -4909,7 +4915,8 @@ ${c}` : c;
4909
4915
  if (a = [...i].length, r[3] || r[4]) {
4910
4916
  o += a;
4911
4917
  continue;
4912
- } else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
4918
+ }
4919
+ if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
4913
4920
  s += a;
4914
4921
  continue;
4915
4922
  }
@@ -5046,7 +5053,7 @@ ${c}` : c;
5046
5053
  block: Lu.normal,
5047
5054
  inline: Ru.normal
5048
5055
  };
5049
- this.options.pedantic ? (t.block = Lu.pedantic, t.inline = Ru.pedantic) : this.options.gfm && (t.block = Lu.gfm, this.options.breaks ? t.inline = Ru.breaks : t.inline = Ru.gfm), this.tokenizer.rules = t;
5056
+ this.options.pedantic ? (t.block = Lu.pedantic, t.inline = Ru.pedantic) : this.options.gfm && (t.block = Lu.gfm, t.inline = this.options.breaks ? Ru.breaks : Ru.gfm), this.tokenizer.rules = t;
5050
5057
  }
5051
5058
  static get rules() {
5052
5059
  return {
@@ -5165,78 +5172,78 @@ ${c}` : c;
5165
5172
  }
5166
5173
  inlineTokens(e, t = []) {
5167
5174
  this.tokenizer.lexer = this;
5168
- let n = e, r = null;
5175
+ let n = e;
5169
5176
  if (this.tokens.links) {
5170
5177
  let e = Object.keys(this.tokens.links);
5171
- if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
5178
+ e.length > 0 && (n = n.replace(this.tokenizer.rules.inline.reflinkSearch, (t) => e.includes(t.slice(t.lastIndexOf("[") + 1, -1)) ? "[" + "a".repeat(t.length - 2) + "]" : t));
5172
5179
  }
5173
- for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
5174
- let i;
5175
- for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null;) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
5176
- n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
5177
- let a = !1, o = "", s = Infinity;
5180
+ n = n.replace(this.tokenizer.rules.inline.anyPunctuation, "++"), n = n.replace(this.tokenizer.rules.inline.blockSkip, (e, t, n) => {
5181
+ let r = n ? n.length : 0;
5182
+ return e.slice(0, r) + "[" + "a".repeat(e.length - r - 2) + "]";
5183
+ }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
5184
+ let r = !1, i = "", a = Infinity;
5178
5185
  for (; e;) {
5179
- if (e.length < s) s = e.length;
5186
+ if (e.length < a) a = e.length;
5180
5187
  else {
5181
5188
  this.infiniteLoopError(e.charCodeAt(0));
5182
5189
  break;
5183
5190
  }
5184
- a || (o = ""), a = !1;
5185
- let r;
5186
- if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
5187
- if (r = this.tokenizer.escape(e)) {
5188
- e = e.substring(r.raw.length), t.push(r);
5191
+ r || (i = ""), r = !1;
5192
+ let o;
5193
+ if (this.options.extensions?.inline?.some((n) => (o = n.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1)) continue;
5194
+ if (o = this.tokenizer.escape(e)) {
5195
+ e = e.substring(o.raw.length), t.push(o);
5189
5196
  continue;
5190
5197
  }
5191
- if (r = this.tokenizer.tag(e)) {
5192
- e = e.substring(r.raw.length), t.push(r);
5198
+ if (o = this.tokenizer.tag(e)) {
5199
+ e = e.substring(o.raw.length), t.push(o);
5193
5200
  continue;
5194
5201
  }
5195
- if (r = this.tokenizer.link(e)) {
5196
- e = e.substring(r.raw.length), t.push(r);
5202
+ if (o = this.tokenizer.link(e)) {
5203
+ e = e.substring(o.raw.length), t.push(o);
5197
5204
  continue;
5198
5205
  }
5199
- if (r = this.tokenizer.reflink(e, this.tokens.links)) {
5200
- e = e.substring(r.raw.length);
5206
+ if (o = this.tokenizer.reflink(e, this.tokens.links)) {
5207
+ e = e.substring(o.raw.length);
5201
5208
  let n = t.at(-1);
5202
- r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
5209
+ o.type === "text" && n?.type === "text" ? (n.raw += o.raw, n.text += o.text) : t.push(o);
5203
5210
  continue;
5204
5211
  }
5205
- if (r = this.tokenizer.emStrong(e, n, o)) {
5206
- e = e.substring(r.raw.length), t.push(r);
5212
+ if (o = this.tokenizer.emStrong(e, n, i)) {
5213
+ e = e.substring(o.raw.length), t.push(o);
5207
5214
  continue;
5208
5215
  }
5209
- if (r = this.tokenizer.codespan(e)) {
5210
- e = e.substring(r.raw.length), t.push(r);
5216
+ if (o = this.tokenizer.codespan(e)) {
5217
+ e = e.substring(o.raw.length), t.push(o);
5211
5218
  continue;
5212
5219
  }
5213
- if (r = this.tokenizer.br(e)) {
5214
- e = e.substring(r.raw.length), t.push(r);
5220
+ if (o = this.tokenizer.br(e)) {
5221
+ e = e.substring(o.raw.length), t.push(o);
5215
5222
  continue;
5216
5223
  }
5217
- if (r = this.tokenizer.del(e, n, o)) {
5218
- e = e.substring(r.raw.length), t.push(r);
5224
+ if (o = this.tokenizer.del(e, n, i)) {
5225
+ e = e.substring(o.raw.length), t.push(o);
5219
5226
  continue;
5220
5227
  }
5221
- if (r = this.tokenizer.autolink(e)) {
5222
- e = e.substring(r.raw.length), t.push(r);
5228
+ if (o = this.tokenizer.autolink(e)) {
5229
+ e = e.substring(o.raw.length), t.push(o);
5223
5230
  continue;
5224
5231
  }
5225
- if (!this.state.inLink && (r = this.tokenizer.url(e))) {
5226
- e = e.substring(r.raw.length), t.push(r);
5232
+ if (!this.state.inLink && (o = this.tokenizer.url(e))) {
5233
+ e = e.substring(o.raw.length), t.push(o);
5227
5234
  continue;
5228
5235
  }
5229
- let i = e;
5236
+ let s = e;
5230
5237
  if (this.options.extensions?.startInline) {
5231
5238
  let t = Infinity, n = e.slice(1), r;
5232
5239
  this.options.extensions.startInline.forEach((e) => {
5233
5240
  r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
5234
- }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
5241
+ }), t < Infinity && t >= 0 && (s = e.substring(0, t + 1));
5235
5242
  }
5236
- if (r = this.tokenizer.inlineText(i)) {
5237
- e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
5243
+ if (o = this.tokenizer.inlineText(s)) {
5244
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (i = o.raw.slice(-1)), r = !0;
5238
5245
  let n = t.at(-1);
5239
- n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
5246
+ n?.type === "text" ? (n.raw += o.raw, n.text += o.text) : t.push(o);
5240
5247
  continue;
5241
5248
  }
5242
5249
  if (e) {
@@ -5671,14 +5678,14 @@ ${e}</tr>
5671
5678
  if (!(n in t)) throw Error(`hook '${n}' does not exist`);
5672
5679
  if (["options", "block"].includes(n)) continue;
5673
5680
  let r = n, i = e.hooks[r], a = t[r];
5674
- td.passThroughHooks.has(n) ? t[r] = (e) => {
5681
+ t[r] = td.passThroughHooks.has(n) ? (e) => {
5675
5682
  if (this.defaults.async && td.passThroughHooksRespectAsync.has(n)) return (async () => {
5676
5683
  let n = await i.call(t, e);
5677
5684
  return a.call(t, n);
5678
5685
  })();
5679
5686
  let r = i.call(t, e);
5680
5687
  return a.call(t, r);
5681
- } : t[r] = (...e) => {
5688
+ } : (...e) => {
5682
5689
  if (this.defaults.async) return (async () => {
5683
5690
  let n = await i.apply(t, e);
5684
5691
  return n === !1 && (n = await a.apply(t, e)), n;
@@ -6381,7 +6388,8 @@ var rd = /* @__PURE__ */ m(((e, t) => {
6381
6388
  if (r.type === "illegal" && !i) {
6382
6389
  let e = /* @__PURE__ */ Error("Illegal lexeme \"" + a + "\" for mode \"" + (A.scope || "<unnamed>") + "\"");
6383
6390
  throw e.mode = A, e;
6384
- } else if (r.type === "end") {
6391
+ }
6392
+ if (r.type === "end") {
6385
6393
  let e = C(r);
6386
6394
  if (e !== z) return e;
6387
6395
  }
@@ -6527,7 +6535,7 @@ var rd = /* @__PURE__ */ m(((e, t) => {
6527
6535
  else throw e;
6528
6536
  i = c;
6529
6537
  }
6530
- i.name ||= n, t[n] = i, i.rawDefinition = r.bind(null, e), i.aliases && N(i.aliases, { languageName: n });
6538
+ i.name || (i.name = n), t[n] = i, i.rawDefinition = r.bind(null, e), i.aliases && N(i.aliases, { languageName: n });
6531
6539
  }
6532
6540
  function j(e) {
6533
6541
  delete t[e];
@@ -15705,7 +15713,7 @@ function _v() {
15705
15713
  }
15706
15714
  //#endregion
15707
15715
  //#region src/core/backends/storage.ts
15708
- var vv = "chat-sdk", yv = 50 * 1024 * 1024, bv = 4 * 1024 * 1024, xv = 10 * 1024 * 1024, Sv = .9, Cv = 500, wv = 300, Tv = "__meta__", Ev = "v:1", Dv = [
15716
+ var vv = "chat-sdk", yv = 52428800, bv = 4194304, xv = 10485760, Sv = .9, Cv = 500, wv = 300, Tv = "__meta__", Ev = "v:1", Dv = [
15709
15717
  "messages",
15710
15718
  "vfs",
15711
15719
  "todos",
@@ -16610,7 +16618,7 @@ function my(e, t) {
16610
16618
  });
16611
16619
  } else if (e.type === "descendKey") {
16612
16620
  let r = e.key, i = (e) => {
16613
- if (!(e.value == null || typeof e.value != "object")) for (let n of Object.keys(e.value)) {
16621
+ if (e.value != null && typeof e.value == "object") for (let n of Object.keys(e.value)) {
16614
16622
  let a = {
16615
16623
  path: py(e.path, n),
16616
16624
  value: e.value[n]
@@ -16621,7 +16629,7 @@ function my(e, t) {
16621
16629
  for (let e of n) i(e);
16622
16630
  } else if (e.type === "descendAll") {
16623
16631
  let e = (n) => {
16624
- if (!(n.value == null || typeof n.value != "object")) for (let r of Object.keys(n.value)) {
16632
+ if (n.value != null && typeof n.value == "object") for (let r of Object.keys(n.value)) {
16625
16633
  let i = {
16626
16634
  path: py(n.path, r),
16627
16635
  value: n.value[r]
@@ -16812,7 +16820,7 @@ function Ty(e, t) {
16812
16820
  r = r[n[e]];
16813
16821
  }
16814
16822
  let i = n[n.length - 1];
16815
- return r == null || !(i in r) ? !1 : (delete r[i], !0);
16823
+ return r == null || !(i in r) ? !1 : (Array.isArray(r) && /^\d+$/.test(i) ? r.splice(Number(i), 1) : delete r[i], !0);
16816
16824
  }
16817
16825
  function Ey(e) {
16818
16826
  return e === void 0 ? void 0 : JSON.parse(JSON.stringify(e));
@@ -17078,23 +17086,15 @@ function Gy(e, n = {}) {
17078
17086
  if (o.parseError) return Yv("", e, o.parseError);
17079
17087
  r = o.parsed;
17080
17088
  let c = i.safeParse(r);
17081
- if (!c.success) return Jv("", c.error.issues);
17082
- if (typeof a != "object" || !a) return $({
17089
+ return c.success ? typeof a != "object" || !a ? $({
17083
17090
  code: "LEAF_BIND",
17084
17091
  message: `主数据 bind 为原始类型(${a === null ? "null" : typeof a}),set_data 无法就地替换外部持有的值引用`,
17085
17092
  hint: "主数据 bind 必须为对象/数组(低代码主 JSON 本就是);叶子值请用对象包裹(如 {value:\"x\"})或集成方通过 sdk.setData 替换 bind"
17086
- });
17087
- if (m("set"), c.data !== null && typeof c.data == "object") if (s) {
17088
- if (Sy(a, c.data), r && typeof r == "object" && !Array.isArray(r)) {
17089
- let e = new Set(s);
17090
- for (let [t, n] of Object.entries(r)) e.has(t) || (a[t] = n);
17091
- }
17092
- } else Fy(a, c.data);
17093
- return p({
17093
+ }) : (m("set"), c.data !== null && typeof c.data == "object" && (s ? Sy(a, c.data) : Fy(a, c.data)), p({
17094
17094
  op: "set",
17095
17095
  value: c.data,
17096
17096
  timestamp: Date.now()
17097
- }), u = jy(a), `已设置主数据 = ${Ay(c.data, 600)} (新 hash=${jy(a)})${s ? "(白名单模式:仅更新 schema 声明字段,未声明字段保留)" : ""}`;
17097
+ }), u = jy(a), `已设置主数据 = ${Ay(c.data, 600)} (新 hash=${jy(a)})${s ? "(白名单模式:仅更新 schema 声明字段,未声明字段保留)" : ""}`) : Jv("", c.error.issues);
17098
17098
  }, {
17099
17099
  name: "set_data",
17100
17100
  description: "设置主数据的值(整体替换)。value 为 JSON 对象(或 JSON 字符串),需通过 schema 校验。校验失败会返回错误而非写入。expectedHash(可选):改前 read/get 返回的 hash,传入则启用乐观锁;不传时系统自动用你最后一次读到的 hash 比对(autoLock,默认开)。大对象/数组强烈建议改用 edit_data 增量 patch。",
@@ -17465,7 +17465,12 @@ function Gy(e, n = {}) {
17465
17465
  code: "WRITE_INTERCEPT",
17466
17466
  message: `write 拦截器拒绝: ${o.error}`
17467
17467
  });
17468
- c === "delete" || (c === "edit" && r && r.length ? f = o && Array.isArray(o) ? o : r : l = o);
17468
+ if (c !== "delete") if (c === "edit" && r && r.length) f = o && Array.isArray(o) ? o : r;
17469
+ else if (c === "edit") if (o && typeof o == "object" && "op" in o && "jsonPath" in o) {
17470
+ let e = o;
17471
+ e.op && (t.op = e.op), e.jsonPath !== void 0 && (t.jsonPath = e.jsonPath), l = e.value;
17472
+ } else l = o;
17473
+ else l = o;
17469
17474
  } catch (e) {
17470
17475
  return $({
17471
17476
  code: "WRITE_INTERCEPT",
@@ -17564,23 +17569,15 @@ function Gy(e, n = {}) {
17564
17569
  let y = await h("set", g);
17565
17570
  if (y !== null) return y;
17566
17571
  let b = i.safeParse(_);
17567
- if (!b.success) return Jv("", b.error.issues);
17568
- if (typeof a != "object" || !a) return $({
17572
+ return b.success ? typeof a != "object" || !a ? $({
17569
17573
  code: "LEAF_BIND",
17570
17574
  message: `主数据 bind 为原始类型(${a === null ? "null" : typeof a}),write(set) 无法就地替换外部持有的值引用`,
17571
17575
  hint: "主数据 bind 必须为对象/数组;叶子值请用对象包裹(如 {value:\"x\"})或集成方通过 sdk.setData 替换 bind"
17572
- });
17573
- if (m("set"), b.data !== null && typeof b.data == "object") if (s) {
17574
- if (Sy(a, b.data), _ && typeof _ == "object" && !Array.isArray(_)) {
17575
- let e = new Set(s);
17576
- for (let [t, n] of Object.entries(_)) e.has(t) || (a[t] = n);
17577
- }
17578
- } else Fy(a, b.data);
17579
- return p({
17576
+ }) : (m("set"), b.data !== null && typeof b.data == "object" && (s ? Sy(a, b.data) : Fy(a, b.data)), p({
17580
17577
  op: "set",
17581
17578
  value: b.data,
17582
17579
  timestamp: Date.now()
17583
- }), u = jy(a), `已 write(set) 主数据 = ${Ay(b.data, 600)} (新 hash=${jy(a)})${s ? "(白名单模式:仅更新 schema 声明字段,未声明字段保留)" : ""}`;
17580
+ }), u = jy(a), `已 write(set) 主数据 = ${Ay(b.data, 600)} (新 hash=${jy(a)})${s ? "(白名单模式:仅更新 schema 声明字段,未声明字段保留)" : ""}`) : Jv("", b.error.issues);
17584
17581
  }, {
17585
17582
  name: "write",
17586
17583
  description: "写入主数据(高层入口,合并 set/edit/delete + 自动乐观锁 + 自动快照)。四种意图:① 整体替换 write({ value }) value 为 JSON 对象(推荐)或字符串;② 单个增量 patch write({ value, patch:{op,jsonPath} }) op=set/remove/merge/append,jsonPath 相对主数据根(如 components.0.text),value 作为该 patch 的值;③ 批量增量 write({ patches:[{op,jsonPath,value},...] }) 一次原子应用多个 patch(任一失败整体不写入,适合一次改多处);④ 删除 write({ patch:{jsonPath}, del:true })。写入自动经 schema 校验(失败不写)+ 自动存快照(可 restore_data 回退)+ 自动乐观锁(autoLock,用你最后 read 到的 hash 比对,冲突则 VERSION_CONFLICT)。集成方可能经 write 拦截器校验/转换/拒绝(批量模式拦截器收到 {patches},返回新 patches 数组或 {error})。",
@@ -17720,7 +17717,7 @@ function rb(e = {}) {
17720
17717
  },
17721
17718
  async remove(e) {
17722
17719
  let n = tb(t, r, e);
17723
- return await i.get(n) == null ? !1 : (await i.del(n), !0);
17720
+ return await i.get(n) != null && (await i.del(n), !0);
17724
17721
  },
17725
17722
  async clear() {
17726
17723
  await i.clearPrefix(nb(t, r));