@shuffleio/shuffle-mcps 0.0.50 → 0.0.54

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/dist/index.mjs CHANGED
@@ -198,7 +198,7 @@ var buildComponentOverrides = (scopeClassName) => ({
198
198
  }
199
199
  });
200
200
  var ShuffleMcpThemeProvider = ({
201
- children,
201
+ children: children2,
202
202
  mode = "auto"
203
203
  }) => {
204
204
  const parent = useMuiTheme();
@@ -230,12 +230,12 @@ var ShuffleMcpThemeProvider = ({
230
230
  if (sameAsParent) {
231
231
  return /* @__PURE__ */ jsxs(ShuffleMcpThemeContext.Provider, { value: ctxValue, children: [
232
232
  /* @__PURE__ */ jsx("span", { ref: anchorRef, style: { display: "none" }, "aria-hidden": true }),
233
- children
233
+ children2
234
234
  ] });
235
235
  }
236
236
  return /* @__PURE__ */ jsx(ShuffleMcpThemeContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx(ThemeProvider, { theme: merged, children: /* @__PURE__ */ jsxs("div", { className: scopeClassName, "data-shuffle-mode": resolvedModeAttr, "data-shuffle-mcp-root": true, children: [
237
237
  /* @__PURE__ */ jsx("span", { ref: anchorRef, style: { display: "none" }, "aria-hidden": true }),
238
- children
238
+ children2
239
239
  ] }) }) });
240
240
  };
241
241
 
@@ -253,7 +253,755 @@ import { Box as Box2 } from "@mui/material";
253
253
  import ReactMarkdown from "react-markdown";
254
254
  import remarkGfm from "remark-gfm";
255
255
  import remarkBreaks from "remark-breaks";
256
- import rehypeSanitize from "rehype-sanitize";
256
+
257
+ // node_modules/@ungap/structured-clone/esm/types.js
258
+ var VOID = -1;
259
+ var PRIMITIVE = 0;
260
+ var ARRAY = 1;
261
+ var OBJECT = 2;
262
+ var DATE = 3;
263
+ var REGEXP = 4;
264
+ var MAP = 5;
265
+ var SET = 6;
266
+ var ERROR = 7;
267
+ var BIGINT = 8;
268
+
269
+ // node_modules/@ungap/structured-clone/esm/deserialize.js
270
+ var { defineProperty } = Object;
271
+ var env = typeof self === "object" ? self : globalThis;
272
+ var guard = (name, init) => {
273
+ switch (name) {
274
+ case "Function":
275
+ case "SharedWorker":
276
+ case "Worker":
277
+ case "eval":
278
+ case "setInterval":
279
+ case "setTimeout":
280
+ throw new TypeError("unable to deserialize " + name);
281
+ }
282
+ return new env[name](init);
283
+ };
284
+ var deserializer = ($, _) => {
285
+ const as = (out, index) => {
286
+ $.set(index, out);
287
+ return out;
288
+ };
289
+ const unpair = (index) => {
290
+ if ($.has(index))
291
+ return $.get(index);
292
+ const [type, value] = _[index];
293
+ switch (type) {
294
+ case PRIMITIVE:
295
+ case VOID:
296
+ return as(value, index);
297
+ case ARRAY: {
298
+ const arr = as([], index);
299
+ for (const index2 of value)
300
+ arr.push(unpair(index2));
301
+ return arr;
302
+ }
303
+ case OBJECT: {
304
+ const object = as({}, index);
305
+ for (const [key, index2] of value) {
306
+ const k = unpair(key), value2 = unpair(index2);
307
+ if (k === "__proto__") defineProperty(object, k, {
308
+ value: value2,
309
+ configurable: true,
310
+ enumerable: true,
311
+ writable: true
312
+ });
313
+ else object[k] = value2;
314
+ }
315
+ return object;
316
+ }
317
+ case DATE:
318
+ return as(new Date(value), index);
319
+ case REGEXP: {
320
+ const { source, flags } = value;
321
+ return as(new RegExp(source, flags), index);
322
+ }
323
+ case MAP: {
324
+ const map = as(/* @__PURE__ */ new Map(), index);
325
+ for (const [key, index2] of value)
326
+ map.set(unpair(key), unpair(index2));
327
+ return map;
328
+ }
329
+ case SET: {
330
+ const set = as(/* @__PURE__ */ new Set(), index);
331
+ for (const index2 of value)
332
+ set.add(unpair(index2));
333
+ return set;
334
+ }
335
+ case ERROR: {
336
+ const { name, message } = value;
337
+ return as(
338
+ typeof env[name] === "function" ? guard(name, message) : new Error(message),
339
+ index
340
+ );
341
+ }
342
+ case BIGINT:
343
+ return as(BigInt(value), index);
344
+ case "BigInt":
345
+ return as(Object(BigInt(value)), index);
346
+ case "ArrayBuffer":
347
+ return as(new Uint8Array(value).buffer, value);
348
+ case "DataView": {
349
+ const { buffer } = new Uint8Array(value);
350
+ return as(new DataView(buffer), value);
351
+ }
352
+ case "-0":
353
+ return -0;
354
+ }
355
+ return as(guard(type, value), index);
356
+ };
357
+ return unpair;
358
+ };
359
+ var deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
360
+
361
+ // node_modules/@ungap/structured-clone/esm/serialize.js
362
+ var EMPTY = "";
363
+ var { toString } = {};
364
+ var { keys, is } = Object;
365
+ var typeOf = (value) => {
366
+ const type = typeof value;
367
+ if (type !== "object" || !value)
368
+ return [PRIMITIVE, type];
369
+ const asString = toString.call(value).slice(8, -1);
370
+ switch (asString) {
371
+ case "Array":
372
+ return [ARRAY, EMPTY];
373
+ case "Object":
374
+ return [OBJECT, EMPTY];
375
+ case "Date":
376
+ return [DATE, EMPTY];
377
+ case "RegExp":
378
+ return [REGEXP, EMPTY];
379
+ case "Map":
380
+ return [MAP, EMPTY];
381
+ case "Set":
382
+ return [SET, EMPTY];
383
+ case "DataView":
384
+ return [ARRAY, asString];
385
+ }
386
+ if (asString.includes("Array"))
387
+ return [ARRAY, asString];
388
+ if (value instanceof Error)
389
+ return [ERROR, value.name || "Error"];
390
+ return [OBJECT, asString];
391
+ };
392
+ var shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
393
+ var serializer = (strict, json, $, _) => {
394
+ const as = (out, value) => {
395
+ const index = _.push(out) - 1;
396
+ $.set(value, index);
397
+ return index;
398
+ };
399
+ const pair = (value) => {
400
+ if ($.has(value))
401
+ return $.get(value);
402
+ let [TYPE, type] = typeOf(value);
403
+ switch (TYPE) {
404
+ case PRIMITIVE: {
405
+ let entry = value;
406
+ switch (type) {
407
+ case "bigint":
408
+ TYPE = BIGINT;
409
+ entry = value.toString();
410
+ break;
411
+ case "number":
412
+ if (!value && is(value, -0))
413
+ return _.push(["-0"]) - 1;
414
+ break;
415
+ case "function":
416
+ case "symbol":
417
+ if (strict)
418
+ throw new TypeError("unable to serialize " + type);
419
+ entry = null;
420
+ break;
421
+ case "undefined":
422
+ return as([VOID], value);
423
+ }
424
+ return as([TYPE, entry], value);
425
+ }
426
+ case ARRAY: {
427
+ if (type) {
428
+ let spread = value;
429
+ if (type === "DataView") {
430
+ spread = new Uint8Array(value.buffer);
431
+ } else if (type === "ArrayBuffer") {
432
+ spread = new Uint8Array(value);
433
+ }
434
+ return as([type, [...spread]], value);
435
+ }
436
+ const arr = [];
437
+ const index = as([TYPE, arr], value);
438
+ for (const entry of value)
439
+ arr.push(pair(entry));
440
+ return index;
441
+ }
442
+ case OBJECT: {
443
+ if (type) {
444
+ switch (type) {
445
+ case "BigInt":
446
+ return as([type, value.toString()], value);
447
+ case "Boolean":
448
+ case "Number":
449
+ case "String":
450
+ return as([type, value.valueOf()], value);
451
+ }
452
+ }
453
+ if (json && "toJSON" in value)
454
+ return pair(value.toJSON());
455
+ const entries = [];
456
+ const index = as([TYPE, entries], value);
457
+ for (const key of keys(value)) {
458
+ if (strict || !shouldSkip(typeOf(value[key])))
459
+ entries.push([pair(key), pair(value[key])]);
460
+ }
461
+ return index;
462
+ }
463
+ case DATE:
464
+ return as([TYPE, isNaN(value.getTime()) ? EMPTY : value.toISOString()], value);
465
+ case REGEXP: {
466
+ const { source, flags } = value;
467
+ return as([TYPE, { source, flags }], value);
468
+ }
469
+ case MAP: {
470
+ const entries = [];
471
+ const index = as([TYPE, entries], value);
472
+ for (const [key, entry] of value) {
473
+ if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))
474
+ entries.push([pair(key), pair(entry)]);
475
+ }
476
+ return index;
477
+ }
478
+ case SET: {
479
+ const entries = [];
480
+ const index = as([TYPE, entries], value);
481
+ for (const entry of value) {
482
+ if (strict || !shouldSkip(typeOf(entry)))
483
+ entries.push(pair(entry));
484
+ }
485
+ return index;
486
+ }
487
+ }
488
+ const { message } = value;
489
+ return as([TYPE, { name: type, message }], value);
490
+ };
491
+ return pair;
492
+ };
493
+ var serialize = (value, { json, lossy } = {}) => {
494
+ const _ = [];
495
+ return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
496
+ };
497
+
498
+ // node_modules/@ungap/structured-clone/esm/index.js
499
+ var esm_default = typeof structuredClone === "function" ? (
500
+ /* c8 ignore start */
501
+ (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any)
502
+ ) : (any, options) => deserialize(serialize(any, options));
503
+
504
+ // node_modules/unist-util-position/lib/index.js
505
+ var pointEnd = point("end");
506
+ var pointStart = point("start");
507
+ function point(type) {
508
+ return point2;
509
+ function point2(node) {
510
+ const point3 = node && node.position && node.position[type] || {};
511
+ if (typeof point3.line === "number" && point3.line > 0 && typeof point3.column === "number" && point3.column > 0) {
512
+ return {
513
+ line: point3.line,
514
+ column: point3.column,
515
+ offset: typeof point3.offset === "number" && point3.offset > -1 ? point3.offset : void 0
516
+ };
517
+ }
518
+ }
519
+ }
520
+ function position(node) {
521
+ const start = pointStart(node);
522
+ const end = pointEnd(node);
523
+ if (start && end) {
524
+ return { start, end };
525
+ }
526
+ }
527
+
528
+ // node_modules/hast-util-sanitize/lib/schema.js
529
+ var aria = ["ariaDescribedBy", "ariaLabel", "ariaLabelledBy"];
530
+ var defaultSchema = {
531
+ ancestors: {
532
+ tbody: ["table"],
533
+ td: ["table"],
534
+ th: ["table"],
535
+ thead: ["table"],
536
+ tfoot: ["table"],
537
+ tr: ["table"]
538
+ },
539
+ attributes: {
540
+ a: [
541
+ ...aria,
542
+ // Note: these 3 are used by GFM footnotes, they do work on all links.
543
+ "dataFootnoteBackref",
544
+ "dataFootnoteRef",
545
+ ["className", "data-footnote-backref"],
546
+ "href"
547
+ ],
548
+ blockquote: ["cite"],
549
+ // Note: this class is not normally allowed by GH, when manually writing
550
+ // `code` as HTML in markdown, they adds it some other way.
551
+ // We can’t do that, so we have to allow it.
552
+ code: [["className", /^language-./]],
553
+ del: ["cite"],
554
+ div: ["itemScope", "itemType"],
555
+ dl: [...aria],
556
+ // Note: this is used by GFM footnotes.
557
+ h2: [["className", "sr-only"]],
558
+ img: [...aria, "longDesc", "src"],
559
+ // Note: `input` is not normally allowed by GH, when manually writing
560
+ // it in markdown, they add it from tasklists some other way.
561
+ // We can’t do that, so we have to allow it.
562
+ input: [
563
+ ["disabled", true],
564
+ ["type", "checkbox"]
565
+ ],
566
+ ins: ["cite"],
567
+ // Note: this class is not normally allowed by GH, when manually writing
568
+ // `li` as HTML in markdown, they adds it some other way.
569
+ // We can’t do that, so we have to allow it.
570
+ li: [["className", "task-list-item"]],
571
+ // Note: this class is not normally allowed by GH, when manually writing
572
+ // `ol` as HTML in markdown, they adds it some other way.
573
+ // We can’t do that, so we have to allow it.
574
+ ol: [...aria, ["className", "contains-task-list"]],
575
+ q: ["cite"],
576
+ section: ["dataFootnotes", ["className", "footnotes"]],
577
+ source: ["srcSet"],
578
+ summary: [...aria],
579
+ table: [...aria],
580
+ // Note: this class is not normally allowed by GH, when manually writing
581
+ // `ol` as HTML in markdown, they adds it some other way.
582
+ // We can’t do that, so we have to allow it.
583
+ ul: [...aria, ["className", "contains-task-list"]],
584
+ "*": [
585
+ "abbr",
586
+ "accept",
587
+ "acceptCharset",
588
+ "accessKey",
589
+ "action",
590
+ "align",
591
+ "alt",
592
+ "axis",
593
+ "border",
594
+ "cellPadding",
595
+ "cellSpacing",
596
+ "char",
597
+ "charOff",
598
+ "charSet",
599
+ "checked",
600
+ "clear",
601
+ "colSpan",
602
+ "color",
603
+ "cols",
604
+ "compact",
605
+ "coords",
606
+ "dateTime",
607
+ "dir",
608
+ // Note: `disabled` is technically allowed on all elements by GH.
609
+ // But it is useless on everything except `input`.
610
+ // Because `input`s are normally not allowed, but we allow them for
611
+ // checkboxes due to tasklists, we allow `disabled` only there.
612
+ "encType",
613
+ "frame",
614
+ "hSpace",
615
+ "headers",
616
+ "height",
617
+ "hrefLang",
618
+ "htmlFor",
619
+ "id",
620
+ "isMap",
621
+ "itemProp",
622
+ "label",
623
+ "lang",
624
+ "maxLength",
625
+ "media",
626
+ "method",
627
+ "multiple",
628
+ "name",
629
+ "noHref",
630
+ "noShade",
631
+ "noWrap",
632
+ "open",
633
+ "prompt",
634
+ "readOnly",
635
+ "rev",
636
+ "rowSpan",
637
+ "rows",
638
+ "rules",
639
+ "scope",
640
+ "selected",
641
+ "shape",
642
+ "size",
643
+ "span",
644
+ "start",
645
+ "summary",
646
+ "tabIndex",
647
+ "title",
648
+ "useMap",
649
+ "vAlign",
650
+ "value",
651
+ "width"
652
+ ]
653
+ },
654
+ clobber: ["ariaDescribedBy", "ariaLabelledBy", "id", "name"],
655
+ clobberPrefix: "user-content-",
656
+ protocols: {
657
+ cite: ["http", "https"],
658
+ href: ["http", "https", "irc", "ircs", "mailto", "xmpp"],
659
+ longDesc: ["http", "https"],
660
+ src: ["http", "https"]
661
+ },
662
+ required: {
663
+ input: { disabled: true, type: "checkbox" }
664
+ },
665
+ strip: ["script"],
666
+ tagNames: [
667
+ "a",
668
+ "b",
669
+ "blockquote",
670
+ "br",
671
+ "code",
672
+ "dd",
673
+ "del",
674
+ "details",
675
+ "div",
676
+ "dl",
677
+ "dt",
678
+ "em",
679
+ "h1",
680
+ "h2",
681
+ "h3",
682
+ "h4",
683
+ "h5",
684
+ "h6",
685
+ "hr",
686
+ "i",
687
+ "img",
688
+ // Note: `input` is not normally allowed by GH, when manually writing
689
+ // it in markdown, they add it from tasklists some other way.
690
+ // We can’t do that, so we have to allow it.
691
+ "input",
692
+ "ins",
693
+ "kbd",
694
+ "li",
695
+ "ol",
696
+ "p",
697
+ "picture",
698
+ "pre",
699
+ "q",
700
+ "rp",
701
+ "rt",
702
+ "ruby",
703
+ "s",
704
+ "samp",
705
+ "section",
706
+ "source",
707
+ "span",
708
+ "strike",
709
+ "strong",
710
+ "sub",
711
+ "summary",
712
+ "sup",
713
+ "table",
714
+ "tbody",
715
+ "td",
716
+ "tfoot",
717
+ "th",
718
+ "thead",
719
+ "tr",
720
+ "tt",
721
+ "ul",
722
+ "var"
723
+ ]
724
+ };
725
+
726
+ // node_modules/hast-util-sanitize/lib/index.js
727
+ var own = {}.hasOwnProperty;
728
+ function sanitize(node, options) {
729
+ let result = { type: "root", children: [] };
730
+ const state2 = {
731
+ schema: options ? { ...defaultSchema, ...options } : defaultSchema,
732
+ stack: []
733
+ };
734
+ const replace = transform(state2, node);
735
+ if (replace) {
736
+ if (Array.isArray(replace)) {
737
+ if (replace.length === 1) {
738
+ result = replace[0];
739
+ } else {
740
+ result.children = replace;
741
+ }
742
+ } else {
743
+ result = replace;
744
+ }
745
+ }
746
+ return result;
747
+ }
748
+ function transform(state2, node) {
749
+ if (node && typeof node === "object") {
750
+ const unsafe = (
751
+ /** @type {Record<string, Readonly<unknown>>} */
752
+ node
753
+ );
754
+ const type = typeof unsafe.type === "string" ? unsafe.type : "";
755
+ switch (type) {
756
+ case "comment": {
757
+ return comment(state2, unsafe);
758
+ }
759
+ case "doctype": {
760
+ return doctype(state2, unsafe);
761
+ }
762
+ case "element": {
763
+ return element(state2, unsafe);
764
+ }
765
+ case "root": {
766
+ return root(state2, unsafe);
767
+ }
768
+ case "text": {
769
+ return text(state2, unsafe);
770
+ }
771
+ default:
772
+ }
773
+ }
774
+ }
775
+ function comment(state2, unsafe) {
776
+ if (state2.schema.allowComments) {
777
+ const result = typeof unsafe.value === "string" ? unsafe.value : "";
778
+ const index = result.indexOf("-->");
779
+ const value = index < 0 ? result : result.slice(0, index);
780
+ const node = { type: "comment", value };
781
+ patch(node, unsafe);
782
+ return node;
783
+ }
784
+ }
785
+ function doctype(state2, unsafe) {
786
+ if (state2.schema.allowDoctypes) {
787
+ const node = { type: "doctype" };
788
+ patch(node, unsafe);
789
+ return node;
790
+ }
791
+ }
792
+ function element(state2, unsafe) {
793
+ const name = typeof unsafe.tagName === "string" ? unsafe.tagName : "";
794
+ state2.stack.push(name);
795
+ const content = (
796
+ /** @type {Array<ElementContent>} */
797
+ children(state2, unsafe.children)
798
+ );
799
+ const properties_ = properties(state2, unsafe.properties);
800
+ state2.stack.pop();
801
+ let safeElement = false;
802
+ if (name && name !== "*" && (!state2.schema.tagNames || state2.schema.tagNames.includes(name))) {
803
+ safeElement = true;
804
+ if (state2.schema.ancestors && own.call(state2.schema.ancestors, name)) {
805
+ const ancestors = state2.schema.ancestors[name];
806
+ let index = -1;
807
+ safeElement = false;
808
+ while (++index < ancestors.length) {
809
+ if (state2.stack.includes(ancestors[index])) {
810
+ safeElement = true;
811
+ }
812
+ }
813
+ }
814
+ }
815
+ if (!safeElement) {
816
+ return state2.schema.strip && !state2.schema.strip.includes(name) ? content : void 0;
817
+ }
818
+ const node = {
819
+ type: "element",
820
+ tagName: name,
821
+ properties: properties_,
822
+ children: content
823
+ };
824
+ patch(node, unsafe);
825
+ return node;
826
+ }
827
+ function root(state2, unsafe) {
828
+ const content = (
829
+ /** @type {Array<RootContent>} */
830
+ children(state2, unsafe.children)
831
+ );
832
+ const node = { type: "root", children: content };
833
+ patch(node, unsafe);
834
+ return node;
835
+ }
836
+ function text(_, unsafe) {
837
+ const value = typeof unsafe.value === "string" ? unsafe.value : "";
838
+ const node = { type: "text", value };
839
+ patch(node, unsafe);
840
+ return node;
841
+ }
842
+ function children(state2, children2) {
843
+ const results = [];
844
+ if (Array.isArray(children2)) {
845
+ const childrenUnknown = (
846
+ /** @type {Array<Readonly<unknown>>} */
847
+ children2
848
+ );
849
+ let index = -1;
850
+ while (++index < childrenUnknown.length) {
851
+ const value = transform(state2, childrenUnknown[index]);
852
+ if (value) {
853
+ if (Array.isArray(value)) {
854
+ results.push(...value);
855
+ } else {
856
+ results.push(value);
857
+ }
858
+ }
859
+ }
860
+ }
861
+ return results;
862
+ }
863
+ function properties(state2, properties2) {
864
+ const tagName = state2.stack[state2.stack.length - 1];
865
+ const attributes = state2.schema.attributes;
866
+ const required = state2.schema.required;
867
+ const specific = attributes && own.call(attributes, tagName) ? attributes[tagName] : void 0;
868
+ const defaults = attributes && own.call(attributes, "*") ? attributes["*"] : void 0;
869
+ const properties_ = (
870
+ /** @type {Readonly<Record<string, Readonly<unknown>>>} */
871
+ properties2 && typeof properties2 === "object" ? properties2 : {}
872
+ );
873
+ const result = {};
874
+ let key;
875
+ for (key in properties_) {
876
+ if (own.call(properties_, key)) {
877
+ const unsafe = properties_[key];
878
+ let safe = propertyValue(
879
+ state2,
880
+ findDefinition(specific, key),
881
+ key,
882
+ unsafe
883
+ );
884
+ if (safe === null || safe === void 0) {
885
+ safe = propertyValue(state2, findDefinition(defaults, key), key, unsafe);
886
+ }
887
+ if (safe !== null && safe !== void 0) {
888
+ result[key] = safe;
889
+ }
890
+ }
891
+ }
892
+ if (required && own.call(required, tagName)) {
893
+ const properties3 = required[tagName];
894
+ for (key in properties3) {
895
+ if (own.call(properties3, key) && !own.call(result, key)) {
896
+ result[key] = properties3[key];
897
+ }
898
+ }
899
+ }
900
+ return result;
901
+ }
902
+ function propertyValue(state2, definition, key, value) {
903
+ return definition ? Array.isArray(value) ? propertyValueMany(state2, definition, key, value) : propertyValuePrimitive(state2, definition, key, value) : void 0;
904
+ }
905
+ function propertyValueMany(state2, definition, key, values) {
906
+ let index = -1;
907
+ const result = [];
908
+ while (++index < values.length) {
909
+ const value = propertyValuePrimitive(state2, definition, key, values[index]);
910
+ if (typeof value === "number" || typeof value === "string") {
911
+ result.push(value);
912
+ }
913
+ }
914
+ return result;
915
+ }
916
+ function propertyValuePrimitive(state2, definition, key, value) {
917
+ if (typeof value !== "boolean" && typeof value !== "number" && typeof value !== "string") {
918
+ return;
919
+ }
920
+ if (!safeProtocol(state2, key, value)) {
921
+ return;
922
+ }
923
+ if (typeof definition === "object" && definition.length > 1) {
924
+ let ok = false;
925
+ let index = 0;
926
+ while (++index < definition.length) {
927
+ const allowed = definition[index];
928
+ if (allowed && typeof allowed === "object" && "flags" in allowed) {
929
+ if (allowed.test(String(value))) {
930
+ ok = true;
931
+ break;
932
+ }
933
+ } else if (allowed === value) {
934
+ ok = true;
935
+ break;
936
+ }
937
+ }
938
+ if (!ok) return;
939
+ }
940
+ return state2.schema.clobber && state2.schema.clobberPrefix && state2.schema.clobber.includes(key) ? state2.schema.clobberPrefix + value : value;
941
+ }
942
+ function safeProtocol(state2, key, value) {
943
+ const protocols = state2.schema.protocols && own.call(state2.schema.protocols, key) ? state2.schema.protocols[key] : void 0;
944
+ if (!protocols || protocols.length === 0) {
945
+ return true;
946
+ }
947
+ const url = String(value);
948
+ const colon = url.indexOf(":");
949
+ const questionMark = url.indexOf("?");
950
+ const numberSign = url.indexOf("#");
951
+ const slash = url.indexOf("/");
952
+ if (colon < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
953
+ slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign) {
954
+ return true;
955
+ }
956
+ let index = -1;
957
+ while (++index < protocols.length) {
958
+ const protocol = protocols[index];
959
+ if (colon === protocol.length && url.slice(0, protocol.length) === protocol) {
960
+ return true;
961
+ }
962
+ }
963
+ return false;
964
+ }
965
+ function patch(node, unsafe) {
966
+ const cleanPosition = position(
967
+ // @ts-expect-error: looks like a node.
968
+ unsafe
969
+ );
970
+ if (unsafe.data) {
971
+ node.data = esm_default(unsafe.data);
972
+ }
973
+ if (cleanPosition) node.position = cleanPosition;
974
+ }
975
+ function findDefinition(definitions, key) {
976
+ let dataDefault;
977
+ let index = -1;
978
+ if (definitions) {
979
+ while (++index < definitions.length) {
980
+ const entry = definitions[index];
981
+ const name = typeof entry === "string" ? entry : entry[0];
982
+ if (name === key) {
983
+ return entry;
984
+ }
985
+ if (name === "data*") dataDefault = entry;
986
+ }
987
+ }
988
+ if (key.length > 4 && key.slice(0, 4).toLowerCase() === "data") {
989
+ return dataDefault;
990
+ }
991
+ }
992
+
993
+ // node_modules/rehype-sanitize/lib/index.js
994
+ function rehypeSanitize(options) {
995
+ return function(tree) {
996
+ const result = (
997
+ /** @type {Root} */
998
+ sanitize(tree, options)
999
+ );
1000
+ return result;
1001
+ };
1002
+ }
1003
+
1004
+ // components/Markdown.tsx
257
1005
  import JsonView from "react18-json-view";
258
1006
  import "react18-json-view/src/style.css";
259
1007
  import "react18-json-view/src/dark.css";
@@ -431,11 +1179,11 @@ var baseSx = {
431
1179
  "& img": { maxWidth: "100%", borderRadius: "2px" }
432
1180
  };
433
1181
  var defaultComponents = {
434
- a: ({ href, children, ...props }) => {
1182
+ a: ({ href, children: children2, ...props }) => {
435
1183
  const isInternal = typeof href === "string" && href.startsWith("/");
436
1184
  const video = isInternal ? null : resolveVideoUrl(href);
437
1185
  if (video) {
438
- const label = typeof children === "string" ? children : void 0;
1186
+ const label = typeof children2 === "string" ? children2 : void 0;
439
1187
  return /* @__PURE__ */ jsx3(VideoEmbed, { video, title: label });
440
1188
  }
441
1189
  const resolved = typeof href === "string" ? resolveProductLink(href) : null;
@@ -448,7 +1196,7 @@ var defaultComponents = {
448
1196
  ...openExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
449
1197
  onClick: (e) => e.stopPropagation(),
450
1198
  ...props,
451
- children
1199
+ children: children2
452
1200
  }
453
1201
  );
454
1202
  },
@@ -466,17 +1214,17 @@ var defaultComponents = {
466
1214
  }
467
1215
  );
468
1216
  },
469
- pre: ({ children, ...props }) => {
470
- const child = Array.isArray(children) ? children[0] : children;
1217
+ pre: ({ children: children2, ...props }) => {
1218
+ const child = Array.isArray(children2) ? children2[0] : children2;
471
1219
  const raw = child?.props?.children;
472
- const text = Array.isArray(raw) ? raw.join("") : typeof raw === "string" ? raw : "";
473
- const parsed = tryParseJson(text);
1220
+ const text2 = Array.isArray(raw) ? raw.join("") : typeof raw === "string" ? raw : "";
1221
+ const parsed = tryParseJson(text2);
474
1222
  if (parsed) return /* @__PURE__ */ jsx3(MarkdownJsonBlock, { src: parsed });
475
- return /* @__PURE__ */ jsx3("pre", { ...props, children });
1223
+ return /* @__PURE__ */ jsx3("pre", { ...props, children: children2 });
476
1224
  }
477
1225
  };
478
1226
  var ShuffleMarkdown = ({
479
- children,
1227
+ children: children2,
480
1228
  components,
481
1229
  remarkPlugins,
482
1230
  disableBreaks = false,
@@ -507,7 +1255,7 @@ var ShuffleMarkdown = ({
507
1255
  }
508
1256
  return next;
509
1257
  }, [components]);
510
- return /* @__PURE__ */ jsx3(Box2, { className, sx: { ...baseSx, ...sx }, children: /* @__PURE__ */ jsx3(ReactMarkdown, { remarkPlugins: plugins, rehypePlugins: [rehypeSanitize], components: merged, children: children ?? "" }) });
1258
+ return /* @__PURE__ */ jsx3(Box2, { className, sx: { ...baseSx, ...sx }, children: /* @__PURE__ */ jsx3(ReactMarkdown, { remarkPlugins: plugins, rehypePlugins: [rehypeSanitize], components: merged, children: children2 ?? "" }) });
511
1259
  };
512
1260
  var Markdown_default = ShuffleMarkdown;
513
1261
 
@@ -1638,13 +2386,13 @@ var deleteDatastoreItem = async (key, category, overrideOrgId, options) => {
1638
2386
  }
1639
2387
  return { success: true };
1640
2388
  };
1641
- var deleteDatastoreItems = async (keys, category) => {
2389
+ var deleteDatastoreItems = async (keys2, category) => {
1642
2390
  const orgId = await waitForOrgId();
1643
2391
  if (!orgId) {
1644
- return { success: false, deleted: 0, failed: keys, error: "No organization ID found" };
2392
+ return { success: false, deleted: 0, failed: keys2, error: "No organization ID found" };
1645
2393
  }
1646
2394
  const results = await Promise.allSettled(
1647
- keys.map((key) => deleteDatastoreItem(key, category))
2395
+ keys2.map((key) => deleteDatastoreItem(key, category))
1648
2396
  );
1649
2397
  const failed = [];
1650
2398
  let deleted = 0;
@@ -1652,7 +2400,7 @@ var deleteDatastoreItems = async (keys, category) => {
1652
2400
  if (result.status === "fulfilled" && result.value.success) {
1653
2401
  deleted++;
1654
2402
  } else {
1655
- failed.push(keys[index]);
2403
+ failed.push(keys2[index]);
1656
2404
  }
1657
2405
  });
1658
2406
  return {
@@ -4402,7 +5150,7 @@ var fallbackContext = {
4402
5150
  isOpen: false
4403
5151
  };
4404
5152
  var AppDetailContext = createContext(fallbackContext);
4405
- var AppDetailProvider = ({ children }) => {
5153
+ var AppDetailProvider = ({ children: children2 }) => {
4406
5154
  const [currentAppName, setCurrentAppName] = useState3(null);
4407
5155
  const openApp = useCallback2((appName) => {
4408
5156
  setCurrentAppName(appName);
@@ -4410,7 +5158,7 @@ var AppDetailProvider = ({ children }) => {
4410
5158
  const closeApp = useCallback2(() => {
4411
5159
  setCurrentAppName(null);
4412
5160
  }, []);
4413
- return /* @__PURE__ */ jsx7(AppDetailContext.Provider, { value: { openApp, closeApp, currentAppName, isOpen: currentAppName !== null }, children });
5161
+ return /* @__PURE__ */ jsx7(AppDetailContext.Provider, { value: { openApp, closeApp, currentAppName, isOpen: currentAppName !== null }, children: children2 });
4414
5162
  };
4415
5163
  var useAppDetail = () => {
4416
5164
  return useContext(AppDetailContext);
@@ -5386,14 +6134,14 @@ var DEFAULT_SUGGESTIONS = [
5386
6134
  ];
5387
6135
  function inferCategoryKeysFromName(appName) {
5388
6136
  const name = appName.toLowerCase();
5389
- const keys = [];
5390
- if (THREAT_INTEL_PATTERNS.some((p) => name.includes(p))) keys.push("threat", "intel");
5391
- if (EMAIL_APP_PATTERNS.some((p) => name.includes(p))) keys.push("email");
5392
- if (EDR_PATTERNS.some((p) => name.includes(p))) keys.push("edr", "endpoint");
5393
- if (SIEM_PATTERNS.some((p) => name.includes(p))) keys.push("siem");
5394
- if (CASES_PATTERNS.some((p) => name.includes(p))) keys.push("ticket", "case");
5395
- if (COMMUNICATION_PATTERNS_NAMES.some((p) => name.includes(p))) keys.push("communication");
5396
- return keys;
6137
+ const keys2 = [];
6138
+ if (THREAT_INTEL_PATTERNS.some((p) => name.includes(p))) keys2.push("threat", "intel");
6139
+ if (EMAIL_APP_PATTERNS.some((p) => name.includes(p))) keys2.push("email");
6140
+ if (EDR_PATTERNS.some((p) => name.includes(p))) keys2.push("edr", "endpoint");
6141
+ if (SIEM_PATTERNS.some((p) => name.includes(p))) keys2.push("siem");
6142
+ if (CASES_PATTERNS.some((p) => name.includes(p))) keys2.push("ticket", "case");
6143
+ if (COMMUNICATION_PATTERNS_NAMES.some((p) => name.includes(p))) keys2.push("communication");
6144
+ return keys2;
5397
6145
  }
5398
6146
  function getSuggestions(appName, categories) {
5399
6147
  const matched = [];
@@ -6155,7 +6903,7 @@ function highlightSnippet(code, lang) {
6155
6903
  "try",
6156
6904
  "except"
6157
6905
  ]);
6158
- const wrap = (color, text) => `<span style="color:${color}">${escapeHtml(text)}</span>`;
6906
+ const wrap = (color, text2) => `<span style="color:${color}">${escapeHtml(text2)}</span>`;
6159
6907
  const out = [];
6160
6908
  let i = 0;
6161
6909
  const n = code.length;
@@ -7752,6 +8500,8 @@ function AppDetailDrawer({
7752
8500
  appId,
7753
8501
  anchor = "right",
7754
8502
  width = 520,
8503
+ minWidth = 380,
8504
+ maxWidth = 720,
7755
8505
  onRefresh,
7756
8506
  onAddToCanvas,
7757
8507
  isAuthenticated = true,
@@ -7768,6 +8518,8 @@ function AppDetailDrawer({
7768
8518
  const themeScope = useShuffleMcpTheme();
7769
8519
  const scopeClassName = themeScope?.scopeClassName ?? (theme === "dark" ? "shuffle-mcp-scope dark" : theme === "light" ? "shuffle-mcp-scope" : void 0);
7770
8520
  const drawerWidth = `min(${width}px, 100vw)`;
8521
+ const drawerMinWidth = `min(${minWidth}px, 100vw)`;
8522
+ const drawerMaxWidth = `min(${maxWidth}px, 100vw)`;
7771
8523
  const handleClose = () => {
7772
8524
  onRefresh?.();
7773
8525
  onClose();
@@ -7776,8 +8528,8 @@ function AppDetailDrawer({
7776
8528
  className: scopeClassName,
7777
8529
  sx: {
7778
8530
  width: drawerWidth,
7779
- minWidth: drawerWidth,
7780
- maxWidth: drawerWidth,
8531
+ minWidth: drawerMinWidth,
8532
+ maxWidth: drawerMaxWidth,
7781
8533
  flex: `0 0 ${drawerWidth}`,
7782
8534
  height: "100vh",
7783
8535
  display: "flex",
@@ -7803,8 +8555,8 @@ function AppDetailDrawer({
7803
8555
  "& .MuiDrawer-paper": {
7804
8556
  boxSizing: "border-box",
7805
8557
  width: `${drawerWidth} !important`,
7806
- minWidth: `${drawerWidth} !important`,
7807
- maxWidth: `${drawerWidth} !important`,
8558
+ minWidth: `${drawerMinWidth} !important`,
8559
+ maxWidth: `${drawerMaxWidth} !important`,
7808
8560
  flex: `0 0 ${drawerWidth} !important`
7809
8561
  }
7810
8562
  },
@@ -9982,6 +10734,8 @@ function AppSearchDrawer({
9982
10734
  subtitle = "Search and configure a tool",
9983
10735
  anchor = "right",
9984
10736
  width = 560,
10737
+ minWidth = 400,
10738
+ maxWidth = 720,
9985
10739
  showPipelinesBanner = false,
9986
10740
  onQuickSelect,
9987
10741
  onSelectOverride,
@@ -10028,6 +10782,8 @@ function AppSearchDrawer({
10028
10782
  return () => clearTimeout(t);
10029
10783
  }, [open, highlightAppName, highlightDelayMs]);
10030
10784
  const drawerWidth = `min(${width}px, 100vw)`;
10785
+ const drawerMinWidth = `min(${minWidth}px, 100vw)`;
10786
+ const drawerMaxWidth = `min(${maxWidth}px, 100vw)`;
10031
10787
  const handleClose = () => {
10032
10788
  setDetailAppName(null);
10033
10789
  setDetailAppId(null);
@@ -10109,8 +10865,8 @@ function AppSearchDrawer({
10109
10865
  // looks identical on every host (Shuffle Security, /agents,
10110
10866
  // test page, embedded library, etc.). No breakpoint variance.
10111
10867
  width: drawerWidth,
10112
- minWidth: drawerWidth,
10113
- maxWidth: drawerWidth,
10868
+ minWidth: drawerMinWidth,
10869
+ maxWidth: drawerMaxWidth,
10114
10870
  flex: `0 0 ${drawerWidth}`,
10115
10871
  height: "100vh",
10116
10872
  display: "flex",
@@ -10137,8 +10893,8 @@ function AppSearchDrawer({
10137
10893
  "& .MuiDrawer-paper": {
10138
10894
  boxSizing: "border-box",
10139
10895
  width: `${drawerWidth} !important`,
10140
- minWidth: `${drawerWidth} !important`,
10141
- maxWidth: `${drawerWidth} !important`,
10896
+ minWidth: `${drawerMinWidth} !important`,
10897
+ maxWidth: `${drawerMaxWidth} !important`,
10142
10898
  flex: `0 0 ${drawerWidth} !important`
10143
10899
  }
10144
10900
  },
@@ -11009,6 +11765,37 @@ var resolveShuffleCoreTargetUrl = (destinationUrlOrPath) => {
11009
11765
  const cleanPath = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
11010
11766
  return `${coreBase}${cleanPath}`;
11011
11767
  };
11768
+ function hasActiveSession() {
11769
+ if (typeof window === "undefined") return false;
11770
+ const token = getSessionToken();
11771
+ if (token && token.trim().length > 0) return true;
11772
+ try {
11773
+ const cookies = document.cookie || "";
11774
+ if (cookies.includes("session=") || cookies.includes("user_id=") || cookies.includes("token=")) {
11775
+ return true;
11776
+ }
11777
+ const userInfo = localStorage.getItem("shuffle_user_info") || localStorage.getItem("user_id");
11778
+ if (userInfo && userInfo.trim().length > 0 && userInfo !== "null") {
11779
+ return true;
11780
+ }
11781
+ } catch {
11782
+ }
11783
+ return false;
11784
+ }
11785
+ function directNavigate(targetUrl, popupWindow) {
11786
+ if (popupWindow) {
11787
+ try {
11788
+ popupWindow.location.href = targetUrl;
11789
+ } catch {
11790
+ if (typeof window !== "undefined") {
11791
+ window.location.href = targetUrl;
11792
+ }
11793
+ }
11794
+ } else if (typeof window !== "undefined") {
11795
+ window.location.href = targetUrl;
11796
+ }
11797
+ return true;
11798
+ }
11012
11799
  async function navigateToShuffleCore(destinationUrlOrPath, options) {
11013
11800
  const isNewTab = Boolean(options?.newTab);
11014
11801
  const targetUrl = resolveShuffleCoreTargetUrl(destinationUrlOrPath);
@@ -11035,42 +11822,11 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
11035
11822
  const isSameDomain = Boolean(
11036
11823
  currentRoot && targetRoot && currentRoot === targetRoot
11037
11824
  );
11038
- function hasActiveSession2() {
11039
- if (typeof window === "undefined") return false;
11040
- const token = getSessionToken();
11041
- if (token && token.trim().length > 0) return true;
11042
- try {
11043
- const cookies = document.cookie || "";
11044
- if (cookies.includes("session=") || cookies.includes("user_id=") || cookies.includes("token=")) {
11045
- return true;
11046
- }
11047
- const userInfo = localStorage.getItem("shuffle_user_info") || localStorage.getItem("user_id");
11048
- if (userInfo && userInfo.trim().length > 0 && userInfo !== "null") {
11049
- return true;
11050
- }
11051
- } catch {
11052
- }
11053
- return false;
11054
- }
11055
- function directNavigate2(targetUrl2, popupWindow2) {
11056
- if (popupWindow2) {
11057
- try {
11058
- popupWindow2.location.href = targetUrl2;
11059
- } catch {
11060
- if (typeof window !== "undefined") {
11061
- window.location.href = targetUrl2;
11062
- }
11063
- }
11064
- } else if (typeof window !== "undefined") {
11065
- window.location.href = targetUrl2;
11066
- }
11067
- return true;
11068
- }
11069
11825
  if (!isCloudDomain3() && !isShuffleBackend || targetHost && currentHost && targetHost === currentHost || isSameDomain) {
11070
- return directNavigate2(targetUrl, popupWindow);
11826
+ return directNavigate(targetUrl, popupWindow);
11071
11827
  }
11072
- if (!hasActiveSession2()) {
11073
- return directNavigate2(targetUrl, popupWindow);
11828
+ if (!hasActiveSession()) {
11829
+ return directNavigate(targetUrl, popupWindow);
11074
11830
  }
11075
11831
  try {
11076
11832
  const isCloud2 = isCloudDomain3() || currentHost.endsWith(".shuffle.security") || currentHost === "shuffle.security";
@@ -11092,14 +11848,14 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
11092
11848
  console.warn(
11093
11849
  `[authHandoff] Handoff ticket request returned ${response.status}, falling back to direct navigation`
11094
11850
  );
11095
- return directNavigate2(targetUrl, popupWindow);
11851
+ return directNavigate(targetUrl, popupWindow);
11096
11852
  }
11097
11853
  const data = await response.json();
11098
11854
  if (!data?.success || !data?.ticket) {
11099
11855
  console.warn(
11100
11856
  `[authHandoff] No ticket returned (${data?.reason || "unknown"}), falling back to direct navigation`
11101
11857
  );
11102
- return directNavigate2(targetUrl, popupWindow);
11858
+ return directNavigate(targetUrl, popupWindow);
11103
11859
  }
11104
11860
  let targetCoreBase = UK_SHUFFLE_CORE_BASE;
11105
11861
  if (!isShuffleBackend && !isCloud2) {
@@ -11149,7 +11905,7 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
11149
11905
  "[authHandoff] Error during handoff to Shuffle Core, falling back to direct navigation:",
11150
11906
  err
11151
11907
  );
11152
- return directNavigate2(targetUrl, popupWindow);
11908
+ return directNavigate(targetUrl, popupWindow);
11153
11909
  }
11154
11910
  }
11155
11911
 
@@ -11172,9 +11928,9 @@ var fetchExecution = async (executionId, authorization) => {
11172
11928
  body: JSON.stringify({ execution_id: executionId, authorization: authorization || executionId })
11173
11929
  });
11174
11930
  if (!resp.ok) return null;
11175
- const text = await resp.text();
11176
- if (!text || text === "{}" || text === "null") return null;
11177
- return JSON.parse(text);
11931
+ const text2 = await resp.text();
11932
+ if (!text2 || text2 === "{}" || text2 === "null") return null;
11933
+ return JSON.parse(text2);
11178
11934
  } catch {
11179
11935
  return null;
11180
11936
  }
@@ -11355,12 +12111,12 @@ var matchAgentPromptSuggestions = (input, limit = 8) => {
11355
12111
  const q = (input || "").trim().toLowerCase();
11356
12112
  if (!q) return [];
11357
12113
  const scored = [];
11358
- for (const text of AGENT_PROMPT_SUGGESTIONS) {
11359
- const lower = text.toLowerCase();
12114
+ for (const text2 of AGENT_PROMPT_SUGGESTIONS) {
12115
+ const lower = text2.toLowerCase();
11360
12116
  const idx = lower.indexOf(q);
11361
12117
  if (idx < 0) continue;
11362
- const score = idx === 0 ? -1e3 + text.length : idx * 10 + text.length;
11363
- scored.push({ text, score });
12118
+ const score = idx === 0 ? -1e3 + text2.length : idx * 10 + text2.length;
12119
+ scored.push({ text: text2, score });
11364
12120
  }
11365
12121
  scored.sort((a, b) => a.score - b.score);
11366
12122
  return scored.slice(0, limit).map((s) => s.text);
@@ -11443,11 +12199,11 @@ var RULES = [
11443
12199
  { match: /datastore|cache|prune entries|allowlist/i, reqs: [SHUFFLE_DATASTORE] }
11444
12200
  ];
11445
12201
  var getSuggestionAppRequirements = (suggestion, limit = 3) => {
11446
- const text = suggestion || "";
12202
+ const text2 = suggestion || "";
11447
12203
  const out = [];
11448
12204
  const seen = /* @__PURE__ */ new Set();
11449
12205
  for (const rule of RULES) {
11450
- if (!rule.match.test(text)) continue;
12206
+ if (!rule.match.test(text2)) continue;
11451
12207
  for (const req of rule.reqs) {
11452
12208
  const key = `${req.kind}:${req.value}`;
11453
12209
  if (seen.has(key)) continue;
@@ -11589,8 +12345,8 @@ var AGENT_PRESETS = [
11589
12345
  ];
11590
12346
  var isSupportUser = () => {
11591
12347
  try {
11592
- const keys = ["shuffle_user_info", "userinfo", "user_info"];
11593
- for (const key of keys) {
12348
+ const keys2 = ["shuffle_user_info", "userinfo", "user_info"];
12349
+ for (const key of keys2) {
11594
12350
  const raw = localStorage.getItem(key);
11595
12351
  if (!raw) continue;
11596
12352
  const parsed = JSON.parse(raw) || {};
@@ -12376,8 +13132,8 @@ import "react18-json-view/src/style.css";
12376
13132
  import "react18-json-view/src/dark.css";
12377
13133
 
12378
13134
  // ../components/docs/tocUtils.ts
12379
- var isTocHeading = (text) => {
12380
- const norm4 = text.toLowerCase().replace(/[^a-z0-9]/g, "");
13135
+ var isTocHeading = (text2) => {
13136
+ const norm4 = text2.toLowerCase().replace(/[^a-z0-9]/g, "");
12381
13137
  return norm4 === "tableofcontents" || norm4 === "tableofcontent" || norm4 === "toc";
12382
13138
  };
12383
13139
  var stripMarkdownInline = (value) => value.replace(/!\[[^\]]*\]\([^)]*\)/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/<[^>]+>/g, "").replace(/[`*_~#>]/g, "").replace(/\{#[^}]+\}/g, "").replace(/\s+/g, " ").trim();
@@ -12688,13 +13444,13 @@ var detectImage = (raw) => {
12688
13444
  try {
12689
13445
  const parsed = JSON.parse(s);
12690
13446
  const candidates = Array.isArray(parsed) ? parsed : [parsed];
12691
- const keys = ["image_base64", "imageBase64", "image", "screenshot", "screenshot_base64", "data", "png", "jpeg", "jpg", "b64", "base64"];
13447
+ const keys2 = ["image_base64", "imageBase64", "image", "screenshot", "screenshot_base64", "data", "png", "jpeg", "jpg", "b64", "base64"];
12692
13448
  for (const item of candidates) {
12693
13449
  if (!item || typeof item !== "object") continue;
12694
13450
  const rec = item;
12695
13451
  const cursor2 = toCursor(rec.cursor);
12696
13452
  const screenSize2 = toSize(rec.screen_size ?? rec.screenSize);
12697
- for (const key of keys) {
13453
+ for (const key of keys2) {
12698
13454
  const v = rec[key];
12699
13455
  if (typeof v !== "string") continue;
12700
13456
  const inner = v.trim().replace(/\s+/g, "");
@@ -13255,9 +14011,9 @@ var fmtTime = (h, m) => {
13255
14011
  const mm = m.toString().padStart(2, "0");
13256
14012
  return `${h12}:${mm} ${ampm}`;
13257
14013
  };
13258
- var findTime = (text) => {
14014
+ var findTime = (text2) => {
13259
14015
  const re = /\b(\d{1,2})(?::(\d{2}))?\s*(am|pm|a\.m\.|p\.m\.)\b|\b(\d{1,2}):(\d{2})\b(?!\s*(?:am|pm))/i;
13260
- const m = text.match(re);
14016
+ const m = text2.match(re);
13261
14017
  if (!m) return null;
13262
14018
  if (m[1]) {
13263
14019
  let h = parseInt(m[1], 10);
@@ -13276,10 +14032,10 @@ var findTime = (text) => {
13276
14032
  }
13277
14033
  return null;
13278
14034
  };
13279
- var findDay = (text) => {
14035
+ var findDay = (text2) => {
13280
14036
  for (const [name, d] of Object.entries(DAY_NAMES)) {
13281
14037
  const re = new RegExp(`\\b${name}(s)?\\b`, "i");
13282
- const m = text.match(re);
14038
+ const m = text2.match(re);
13283
14039
  if (m) return { day: d, matched: m[0], plural: Boolean(m[1]) };
13284
14040
  }
13285
14041
  return null;
@@ -13301,10 +14057,10 @@ var onceHint = (target, confidence, matchedText) => ({
13301
14057
  once: true,
13302
14058
  runAt: target.toISOString()
13303
14059
  });
13304
- var findPartOfDay = (text) => {
14060
+ var findPartOfDay = (text2) => {
13305
14061
  for (const [name, h] of Object.entries(PART_OF_DAY)) {
13306
14062
  const re = new RegExp(`\\b${name}\\b`, "i");
13307
- const m = text.match(re);
14063
+ const m = text2.match(re);
13308
14064
  if (m) return { h, matched: m[0] };
13309
14065
  }
13310
14066
  return null;
@@ -13385,18 +14141,18 @@ var quantityValue = (raw) => {
13385
14141
  const key = q.replace(/^an?\s+/, "").split(" ")[0];
13386
14142
  return WORD_NUMBERS[key] ?? null;
13387
14143
  };
13388
- var findRelativeOffset = (text) => {
14144
+ var findRelativeOffset = (text2) => {
13389
14145
  const patterns = [
13390
14146
  new RegExp(`\\b(?:in|after|within|wait)\\s+(${QUANTITY})\\s*(${UNIT})\\b(?!\\s*(?:ago))`, "i"),
13391
14147
  new RegExp(`\\b(${QUANTITY})\\s*(${UNIT})\\s+(?:from\\s+now|from\\s+today|later|out)\\b`, "i")
13392
14148
  ];
13393
14149
  for (const re of patterns) {
13394
- const m = text.match(re);
14150
+ const m = text2.match(re);
13395
14151
  if (!m) continue;
13396
14152
  const qty = quantityValue(m[1]);
13397
14153
  const unit = UNIT_ALIASES[m[2].toLowerCase()];
13398
14154
  if (qty === null || !unit) continue;
13399
- if (/\b(?:every|each)\s*$/i.test(text.slice(0, m.index ?? 0))) continue;
14155
+ if (/\b(?:every|each)\s*$/i.test(text2.slice(0, m.index ?? 0))) continue;
13400
14156
  return {
13401
14157
  ms: qty * UNIT_MS[unit],
13402
14158
  matched: m[0],
@@ -13407,9 +14163,9 @@ var findRelativeOffset = (text) => {
13407
14163
  };
13408
14164
  var parseScheduleHint = (input) => {
13409
14165
  if (!input) return null;
13410
- const text = input.toLowerCase();
14166
+ const text2 = input.toLowerCase();
13411
14167
  const hits = [];
13412
- const everyMin = text.match(/every\s+(\d+)\s*(?:m|min|mins|minute|minutes)\b/);
14168
+ const everyMin = text2.match(/every\s+(\d+)\s*(?:m|min|mins|minute|minutes)\b/);
13413
14169
  if (everyMin) {
13414
14170
  const n = Math.max(1, Math.min(59, parseInt(everyMin[1], 10)));
13415
14171
  return {
@@ -13419,7 +14175,7 @@ var parseScheduleHint = (input) => {
13419
14175
  matchedText: everyMin[0]
13420
14176
  };
13421
14177
  }
13422
- const everyHr = text.match(/every\s+(\d+)\s*(?:h|hr|hrs|hour|hours)\b/);
14178
+ const everyHr = text2.match(/every\s+(\d+)\s*(?:h|hr|hrs|hour|hours)\b/);
13423
14179
  if (everyHr) {
13424
14180
  const n = Math.max(1, Math.min(23, parseInt(everyHr[1], 10)));
13425
14181
  return {
@@ -13429,41 +14185,41 @@ var parseScheduleHint = (input) => {
13429
14185
  matchedText: everyHr[0]
13430
14186
  };
13431
14187
  }
13432
- if (/\bhourly\b|\bevery hour\b/.test(text)) {
14188
+ if (/\bhourly\b|\bevery hour\b/.test(text2)) {
13433
14189
  return { cron: "0 * * * *", label: "Hourly", confidence: "high", matchedText: "hourly" };
13434
14190
  }
13435
- const t = findTime(text);
13436
- const part = !t ? findPartOfDay(text) : null;
14191
+ const t = findTime(text2);
14192
+ const part = !t ? findPartOfDay(text2) : null;
13437
14193
  const hour = t ? t.h : part ? part.h : null;
13438
14194
  const minute = t ? t.m : 0;
13439
14195
  if (t) hits.push(t.matched);
13440
14196
  if (part) hits.push(part.matched);
13441
- const day = findDay(text);
14197
+ const day = findDay(text2);
13442
14198
  if (day) hits.push(day.matched);
13443
- const isDaily = /\b(daily|every\s+day|each\s+day)\b/.test(text);
13444
- const isWeekly = /\b(weekly|every\s+week)\b/.test(text);
13445
- const isWeekdays = /\b(weekday|weekdays|every\s+weekday|workdays?|business\s+days?)\b/.test(text);
13446
- const isMonthly = /\b(monthly|every\s+month)\b/.test(text);
13447
- const hasScheduleWord = /\b(schedule|recurring|recur|repeat|automate|cron)\b/.test(text);
14199
+ const isDaily = /\b(daily|every\s+day|each\s+day)\b/.test(text2);
14200
+ const isWeekly = /\b(weekly|every\s+week)\b/.test(text2);
14201
+ const isWeekdays = /\b(weekday|weekdays|every\s+weekday|workdays?|business\s+days?)\b/.test(text2);
14202
+ const isMonthly = /\b(monthly|every\s+month)\b/.test(text2);
14203
+ const hasScheduleWord = /\b(schedule|recurring|recur|repeat|automate|cron)\b/.test(text2);
13448
14204
  if (isDaily) hits.push("daily");
13449
14205
  if (isWeekly) hits.push("weekly");
13450
14206
  if (isWeekdays) hits.push("weekdays");
13451
14207
  if (isMonthly) hits.push("monthly");
13452
- const recurringDayPhrase = day ? day.plural || new RegExp(`\\b(?:every|each)\\s+(?:other\\s+)?${day.matched}\\b`).test(text) : false;
14208
+ const recurringDayPhrase = day ? day.plural || new RegExp(`\\b(?:every|each)\\s+(?:other\\s+)?${day.matched}\\b`).test(text2) : false;
13453
14209
  const oneOffDayPhrase = Boolean(day) && !recurringDayPhrase;
13454
- if (/\bnext\b/.test(text)) hits.push("next");
13455
- const rel = findRelativeOffset(text);
14210
+ if (/\bnext\b/.test(text2)) hits.push("next");
14211
+ const rel = findRelativeOffset(text2);
13456
14212
  if (rel) {
13457
14213
  const target = new Date(Date.now() + rel.ms);
13458
14214
  if (rel.unitDays && (t || part)) target.setHours(hour ?? 9, minute, 0, 0);
13459
14215
  if (rel.unitDays) target.setSeconds(0, 0);
13460
14216
  return onceHint(target, "high", rel.matched);
13461
14217
  }
13462
- const laterMatch = text.match(/\b(later\s+today|later\s+tonight|later\s+this\s+(?:morning|afternoon|evening)|later|soon|shortly|in\s+a\s+bit|in\s+a\s+while|in\s+a\s+moment)\b/);
14218
+ const laterMatch = text2.match(/\b(later\s+today|later\s+tonight|later\s+this\s+(?:morning|afternoon|evening)|later|soon|shortly|in\s+a\s+bit|in\s+a\s+while|in\s+a\s+moment)\b/);
13463
14219
  if (laterMatch && hour === null) {
13464
14220
  return onceHint(new Date(Date.now() + 2 * 36e5), "medium", laterMatch[0]);
13465
14221
  }
13466
- const endOf = text.match(/\bend\s+of\s+(?:the\s+)?(day|today|week|month)\b/);
14222
+ const endOf = text2.match(/\bend\s+of\s+(?:the\s+)?(day|today|week|month)\b/);
13467
14223
  if (endOf && !isDaily && !isWeekly && !isMonthly) {
13468
14224
  const target = /* @__PURE__ */ new Date();
13469
14225
  const which = endOf[1];
@@ -13480,40 +14236,40 @@ var parseScheduleHint = (input) => {
13480
14236
  }
13481
14237
  return onceHint(target, "medium", endOf[0]);
13482
14238
  }
13483
- const dayAfter = text.match(/\b(?:the\s+)?day\s+after\s+tomorrow\b/);
14239
+ const dayAfter = text2.match(/\b(?:the\s+)?day\s+after\s+tomorrow\b/);
13484
14240
  if (dayAfter) {
13485
14241
  const target = /* @__PURE__ */ new Date();
13486
14242
  target.setDate(target.getDate() + 2);
13487
14243
  target.setHours(hour ?? 9, minute, 0, 0);
13488
14244
  return onceHint(target, "high", dayAfter[0]);
13489
14245
  }
13490
- if (/\btonight\b/.test(text) && !isDaily && !isWeekly) {
14246
+ if (/\btonight\b/.test(text2) && !isDaily && !isWeekly) {
13491
14247
  const h = hour ?? 21;
13492
14248
  const target = /* @__PURE__ */ new Date();
13493
14249
  target.setHours(h, minute, 0, 0);
13494
14250
  if (target.getTime() <= Date.now()) target.setDate(target.getDate() + 1);
13495
14251
  return onceHint(target, "medium", "tonight");
13496
14252
  }
13497
- if (/\btomorrow\b/.test(text) && !isDaily && !isWeekly) {
14253
+ if (/\btomorrow\b/.test(text2) && !isDaily && !isWeekly) {
13498
14254
  const target = /* @__PURE__ */ new Date();
13499
14255
  target.setDate(target.getDate() + 1);
13500
14256
  target.setHours(hour ?? 9, minute, 0, 0);
13501
14257
  return onceHint(target, "medium", hits.join(" ") || "tomorrow");
13502
14258
  }
13503
- if (/\btoday\b/.test(text) && hour !== null && !isDaily && !isWeekly) {
14259
+ if (/\btoday\b/.test(text2) && hour !== null && !isDaily && !isWeekly) {
13504
14260
  const target = /* @__PURE__ */ new Date();
13505
14261
  target.setHours(hour, minute, 0, 0);
13506
14262
  if (target.getTime() <= Date.now()) target.setDate(target.getDate() + 1);
13507
14263
  return onceHint(target, "medium", hits.join(" ") || "today");
13508
14264
  }
13509
- const thisPart = text.match(/\bthis\s+(morning|afternoon|evening)\b/);
14265
+ const thisPart = text2.match(/\bthis\s+(morning|afternoon|evening)\b/);
13510
14266
  if (thisPart && !isDaily && !isWeekly) {
13511
14267
  const target = /* @__PURE__ */ new Date();
13512
14268
  target.setHours(hour ?? PART_OF_DAY[thisPart[1]], minute, 0, 0);
13513
14269
  if (target.getTime() <= Date.now()) target.setDate(target.getDate() + 1);
13514
14270
  return onceHint(target, "medium", thisPart[0]);
13515
14271
  }
13516
- const nextSpan = !day ? text.match(/\bnext\s+(week|month)\b/) : null;
14272
+ const nextSpan = !day ? text2.match(/\bnext\s+(week|month)\b/) : null;
13517
14273
  if (nextSpan && !isWeekly && !isMonthly && !isDaily) {
13518
14274
  const target = /* @__PURE__ */ new Date();
13519
14275
  if (nextSpan[1] === "week") target.setDate(target.getDate() + 7);
@@ -13523,7 +14279,7 @@ var parseScheduleHint = (input) => {
13523
14279
  }
13524
14280
  if (day && oneOffDayPhrase && !isWeekly && !isMonthly && !isWeekdays && !isDaily) {
13525
14281
  const target = nextDateForWeekday(day.day, hour ?? 9, minute);
13526
- if (/\bnext\b/.test(text)) {
14282
+ if (/\bnext\b/.test(text2)) {
13527
14283
  const upcomingDelta = Math.round((target.getTime() - Date.now()) / 864e5);
13528
14284
  if (upcomingDelta < 2) target.setDate(target.getDate() + 7);
13529
14285
  }
@@ -13567,7 +14323,7 @@ var parseScheduleHint = (input) => {
13567
14323
  matchedText: hits.join(" ")
13568
14324
  };
13569
14325
  }
13570
- if (isDaily || hour !== null && (isDaily || part || hasScheduleWord || /\bevery\b/.test(text))) {
14326
+ if (isDaily || hour !== null && (isDaily || part || hasScheduleWord || /\bevery\b/.test(text2))) {
13571
14327
  const h = hour ?? 9;
13572
14328
  return {
13573
14329
  cron: `${minute} ${h} * * *`,
@@ -13597,7 +14353,7 @@ var parseScheduleHint = (input) => {
13597
14353
  cron: "0 9 * * *",
13598
14354
  label: "Schedule this prompt",
13599
14355
  confidence: "low",
13600
- matchedText: text.match(/\b(schedule|recurring|recur|repeat|automate|cron)\b/)?.[0] || "schedule"
14356
+ matchedText: text2.match(/\b(schedule|recurring|recur|repeat|automate|cron)\b/)?.[0] || "schedule"
13601
14357
  };
13602
14358
  }
13603
14359
  return null;
@@ -13736,9 +14492,9 @@ var extractDecisionIndex = (path) => {
13736
14492
  const n = Number(m[1]);
13737
14493
  return Number.isFinite(n) ? n : null;
13738
14494
  };
13739
- var isAiAuthText = (text) => {
13740
- if (!text || typeof text !== "string") return false;
13741
- const lower = text.toLowerCase();
14495
+ var isAiAuthText = (text2) => {
14496
+ if (!text2 || typeof text2 !== "string") return false;
14497
+ const lower = text2.toLowerCase();
13742
14498
  const hasAuthSignal = /\b(401|unauthori[sz]ed|invalid[_\s-]*(api[_\s-]*key|credentials?|token|auth|key)|incorrect\s+api\s+key|missing[_\s-]*(api[_\s-]*key|authorization|credentials?)|authentication[_\s-]*(failed|required|error)|ai\s+credentials)\b/.test(
13743
14499
  lower
13744
14500
  ) || /check\s+your\s+ai\s+credentials/.test(lower);
@@ -13754,7 +14510,7 @@ var hasOutputWarning = (run) => {
13754
14510
  return diagnoseOutputWarning(run) !== null;
13755
14511
  };
13756
14512
  var diagnosisHasCtas = (diagnosis) => diagnosis?.kind === "token_limit" || diagnosis?.kind === "ai_auth" || Boolean(diagnosis?.isAiAuth);
13757
- var collectEntries = (root) => {
14513
+ var collectEntries = (root2) => {
13758
14514
  const out = [];
13759
14515
  const walk = (v, path, depth) => {
13760
14516
  if (depth > 8 || v == null) return;
@@ -13773,7 +14529,7 @@ var collectEntries = (root) => {
13773
14529
  }
13774
14530
  }
13775
14531
  };
13776
- walk(root, "", 0);
14532
+ walk(root2, "", 0);
13777
14533
  return out;
13778
14534
  };
13779
14535
  var trimEvidenceValue = (v, max = 180) => {
@@ -14734,7 +15490,7 @@ var collectFromRequest = (req, out) => {
14734
15490
  }
14735
15491
  }
14736
15492
  };
14737
- var collectLlmImageAttachments = (root, maxDepth = 10) => {
15493
+ var collectLlmImageAttachments = (root2, maxDepth = 10) => {
14738
15494
  const found = [];
14739
15495
  const seen = /* @__PURE__ */ new Set();
14740
15496
  const walk = (node, depth) => {
@@ -14771,7 +15527,7 @@ var collectLlmImageAttachments = (root, maxDepth = 10) => {
14771
15527
  }
14772
15528
  for (const value of Object.values(rec)) walk(value, depth + 1);
14773
15529
  };
14774
- walk(root, 0);
15530
+ walk(root2, 0);
14775
15531
  const deduped = [];
14776
15532
  const urls = /* @__PURE__ */ new Set();
14777
15533
  for (const item of found) {
@@ -14994,9 +15750,9 @@ var getActivePageEntityName = () => {
14994
15750
  }
14995
15751
  const titleContainer = document.querySelector('[data-incident-field="title"], [data-case-field="title"]');
14996
15752
  if (titleContainer?.textContent) {
14997
- const text = titleContainer.textContent.trim();
14998
- if (text && text.length > 0 && text.length < 120 && text !== "Enter title..." && text !== "Incident") {
14999
- return text;
15753
+ const text2 = titleContainer.textContent.trim();
15754
+ if (text2 && text2.length > 0 && text2.length < 120 && text2 !== "Enter title..." && text2 !== "Incident") {
15755
+ return text2;
15000
15756
  }
15001
15757
  }
15002
15758
  if (document.title) {
@@ -16037,11 +16793,11 @@ var looksLikeBase64Image = (v) => {
16037
16793
  if (!/^[A-Za-z0-9+/=]+$/.test(s)) return false;
16038
16794
  return B64_IMAGE_PREFIXES.some((p) => s.startsWith(p));
16039
16795
  };
16040
- var scanTextForImage = (text) => {
16041
- if (!text || text.length < 200) return null;
16042
- const dataUri = text.match(/data:image\/[a-z+.-]+;base64,[A-Za-z0-9+/=]{200,}/i);
16796
+ var scanTextForImage = (text2) => {
16797
+ if (!text2 || text2.length < 200) return null;
16798
+ const dataUri = text2.match(/data:image\/[a-z+.-]+;base64,[A-Za-z0-9+/=]{200,}/i);
16043
16799
  if (dataUri) return dataUri[0];
16044
- const bare = text.match(/(?:iVBORw0KGgo|\/9j\/|R0lGOD|UklGR)[A-Za-z0-9+/=]{200,}/);
16800
+ const bare = text2.match(/(?:iVBORw0KGgo|\/9j\/|R0lGOD|UklGR)[A-Za-z0-9+/=]{200,}/);
16045
16801
  return bare ? bare[0] : null;
16046
16802
  };
16047
16803
  var extractScreenshotPayloads = (raw, depth = 0, out = []) => {
@@ -16130,8 +16886,8 @@ var truncateReason = (reason, maxLength = 280) => {
16130
16886
  if (reason.length <= maxLength) return reason;
16131
16887
  return reason.slice(0, maxLength).replace(/\s+\S*$/, "") + "\u2026";
16132
16888
  };
16133
- var FinishAnswerMarkdown = ({ text }) => {
16134
- const wholeJson = useMemo10(() => tryParseJsonObject(stripSingleCodeFence(text)), [text]);
16889
+ var FinishAnswerMarkdown = ({ text: text2 }) => {
16890
+ const wholeJson = useMemo10(() => tryParseJsonObject(stripSingleCodeFence(text2)), [text2]);
16135
16891
  if (wholeJson !== null) {
16136
16892
  return /* @__PURE__ */ jsx31(Box22, { sx: { "& .json-view": { backgroundColor: "transparent !important", fontSize: "0.82rem" } }, children: /* @__PURE__ */ jsx31(JsonView4, { src: wholeJson, collapsed: defaultCollapsed, enableClipboard: true, displaySize: true, theme: "default" }) });
16137
16893
  }
@@ -16139,8 +16895,8 @@ var FinishAnswerMarkdown = ({ text }) => {
16139
16895
  Markdown_default,
16140
16896
  {
16141
16897
  components: {
16142
- code({ inline, className, children, ...props }) {
16143
- const content = String(children ?? "").replace(/\n$/, "");
16898
+ code({ inline, className, children: children2, ...props }) {
16899
+ const content = String(children2 ?? "").replace(/\n$/, "");
16144
16900
  const isBlock = !inline && (content.includes("\n") || /language-/.test(className || ""));
16145
16901
  if (isBlock) {
16146
16902
  const parsed = tryParseJsonObject(content);
@@ -16148,10 +16904,10 @@ var FinishAnswerMarkdown = ({ text }) => {
16148
16904
  return /* @__PURE__ */ jsx31(Box22, { sx: { my: 1, p: 1.5, borderRadius: 1, bgcolor: "hsl(var(--muted))", "& .json-view": { backgroundColor: "transparent !important", fontSize: "0.82rem" } }, children: /* @__PURE__ */ jsx31(JsonView4, { src: parsed, collapsed: defaultCollapsed, enableClipboard: true, displaySize: true, theme: "default" }) });
16149
16905
  }
16150
16906
  }
16151
- return /* @__PURE__ */ jsx31("code", { className, ...props, children });
16907
+ return /* @__PURE__ */ jsx31("code", { className, ...props, children: children2 });
16152
16908
  }
16153
16909
  },
16154
- children: text
16910
+ children: text2
16155
16911
  }
16156
16912
  );
16157
16913
  };
@@ -16165,7 +16921,7 @@ var RunFinishedSummary = ({
16165
16921
  decisionCount,
16166
16922
  durationSec,
16167
16923
  showMeta = false,
16168
- children,
16924
+ children: children2,
16169
16925
  bottomContent
16170
16926
  }) => {
16171
16927
  return /* @__PURE__ */ jsxs24(Fragment12, { children: [
@@ -16197,7 +16953,7 @@ var RunFinishedSummary = ({
16197
16953
  }
16198
16954
  )
16199
16955
  ] }),
16200
- children,
16956
+ children2,
16201
16957
  finishAnswer && /* @__PURE__ */ jsx31(Box22, { sx: {
16202
16958
  p: 2,
16203
16959
  borderRadius: 1.5,
@@ -18193,8 +18949,8 @@ var AgentUI = ({
18193
18949
  reason = typeof body?.reason === "string" ? body.reason : "";
18194
18950
  } catch {
18195
18951
  try {
18196
- const text = (await resp.clone().text())?.trim();
18197
- if (text && text.length < 300 && !text.startsWith("<")) reason = text;
18952
+ const text2 = (await resp.clone().text())?.trim();
18953
+ if (text2 && text2.length < 300 && !text2.startsWith("<")) reason = text2;
18198
18954
  } catch {
18199
18955
  }
18200
18956
  }
@@ -18370,8 +19126,8 @@ var AgentUI = ({
18370
19126
  }, intervalMs);
18371
19127
  return () => clearInterval(id);
18372
19128
  }, [execution?.execution_id, execution?.authorization, execution?.status, agentData?.decisions, runComplete, getExecution]);
18373
- const submitInput = useCallback10(async (text, presetOverride, appsOverride) => {
18374
- if (!text.trim()) return;
19129
+ const submitInput = useCallback10(async (text2, presetOverride, appsOverride) => {
19130
+ if (!text2.trim()) return;
18375
19131
  if (isLoggedIn === false) {
18376
19132
  setError("Authentication required. Please log in to run AI agents.");
18377
19133
  return;
@@ -18379,7 +19135,7 @@ var AgentUI = ({
18379
19135
  if (contextStorageKey) {
18380
19136
  setPageContextChoice(contextStorageKey, { draftPrompt: "" });
18381
19137
  }
18382
- const composed = composeSubmitInput(text);
19138
+ const composed = composeSubmitInput(text2);
18383
19139
  const effectivePreset = presetOverride !== void 0 ? presetOverride : selectedPreset;
18384
19140
  setError(null);
18385
19141
  setAgentRequestLoading(true);
@@ -18485,7 +19241,7 @@ var AgentUI = ({
18485
19241
  setAgentRequestLoading(false);
18486
19242
  if (!result.success) {
18487
19243
  if (contextStorageKey) {
18488
- setPageContextChoice(contextStorageKey, { draftPrompt: text });
19244
+ setPageContextChoice(contextStorageKey, { draftPrompt: text2 });
18489
19245
  }
18490
19246
  setError(result.error || "Agent run failed.");
18491
19247
  activeExecutionIdRef.current = prevActiveExecutionId;
@@ -18501,7 +19257,7 @@ var AgentUI = ({
18501
19257
  if (prevActiveExecutionId) {
18502
19258
  getExecution(prevActiveExecutionId, prevExecution?.authorization);
18503
19259
  }
18504
- onRun?.({ input: text, success: false, error: result.error });
19260
+ onRun?.({ input: text2, success: false, error: result.error });
18505
19261
  return;
18506
19262
  }
18507
19263
  const browserStart = Math.floor(Date.now() / 1e3);
@@ -18531,7 +19287,7 @@ var AgentUI = ({
18531
19287
  }, { replace: true });
18532
19288
  }
18533
19289
  getExecution(eid, auth);
18534
- onRun?.({ input: text, success: true, executionId: eid });
19290
+ onRun?.({ input: text2, success: true, executionId: eid });
18535
19291
  } else {
18536
19292
  if (contextStorageKey && eid) {
18537
19293
  setPageContextChoice(contextStorageKey, {
@@ -18550,11 +19306,11 @@ var AgentUI = ({
18550
19306
  });
18551
19307
  const v = validateJson(raw);
18552
19308
  if (v.valid) {
18553
- setAgentData({ ...v.result, status: "FINISHED", original_input: text });
19309
+ setAgentData({ ...v.result, status: "FINISHED", original_input: text2 });
18554
19310
  } else {
18555
- setAgentData({ original_input: text, status: "FINISHED", message: result.content });
19311
+ setAgentData({ original_input: text2, status: "FINISHED", message: result.content });
18556
19312
  }
18557
- onRun?.({ input: text, success: true, executionId: eid });
19313
+ onRun?.({ input: text2, success: true, executionId: eid });
18558
19314
  }
18559
19315
  }, [chosenApps, executionApps, getExecution, onRun, attachedImages, readUrlParams, setSearchParams, viewMode, selectedPreset, isLoggedIn]);
18560
19316
  const autoSubmittedRef = useRef11(false);
@@ -18994,9 +19750,9 @@ var AgentUI = ({
18994
19750
  }
18995
19751
  let outputText = "";
18996
19752
  for (const c of candidates) {
18997
- const text = stringify(c);
18998
- if (text) {
18999
- outputText = text;
19753
+ const text2 = stringify(c);
19754
+ if (text2) {
19755
+ outputText = text2;
19000
19756
  break;
19001
19757
  }
19002
19758
  }
@@ -19441,9 +20197,9 @@ var AgentUI = ({
19441
20197
  return parsed && parsed.once ? null : parsed;
19442
20198
  }, [finishedRunInput]);
19443
20199
  const postRunAppReqs = useMemo10(() => {
19444
- const text = (finishedRunInput || "").trim();
19445
- if (text.length < 4) return [];
19446
- const reqs = getSuggestionAppRequirements(text, 4);
20200
+ const text2 = (finishedRunInput || "").trim();
20201
+ if (text2.length < 4) return [];
20202
+ const reqs = getSuggestionAppRequirements(text2, 4);
19447
20203
  const meaningful = reqs.filter((r) => !(r.kind === "app" && r.value === "shuffle_tools"));
19448
20204
  const chosen = chosenApps.map((a) => normalizeAgentAppName(a.name || "").replace(/_/g, " "));
19449
20205
  return meaningful.filter((r) => {
@@ -23013,6 +23769,8 @@ var AgentRunDrawer = ({
23013
23769
  permissionsDisabledTooltip = "Coming soon",
23014
23770
  agentUIProps,
23015
23771
  width = 595,
23772
+ minWidth = 420,
23773
+ maxWidth = 900,
23016
23774
  title = "Agent",
23017
23775
  subtitle = "Run actions and manage permissions",
23018
23776
  className,
@@ -23107,19 +23865,33 @@ var AgentRunDrawer = ({
23107
23865
  clearTimeout(t3);
23108
23866
  };
23109
23867
  }, [open, safeActiveTab]);
23868
+ const drawerWidth = `min(${width}px, 100vw)`;
23869
+ const drawerMinWidth = `min(${minWidth}px, 100vw)`;
23870
+ const drawerMaxWidth = `min(${maxWidth}px, 100vw)`;
23110
23871
  return /* @__PURE__ */ jsxs27(
23111
23872
  Drawer4,
23112
23873
  {
23113
23874
  anchor: "right",
23114
23875
  open,
23115
23876
  onClose,
23877
+ sx: {
23878
+ "& .MuiDrawer-paper": {
23879
+ boxSizing: "border-box",
23880
+ width: { xs: "100vw", sm: drawerWidth },
23881
+ minWidth: { xs: "100vw", sm: drawerMinWidth },
23882
+ maxWidth: { xs: "100vw", sm: drawerMaxWidth }
23883
+ }
23884
+ },
23116
23885
  slotProps: {
23117
23886
  paper: {
23118
23887
  ref: paperRef,
23119
23888
  className: [themeScope?.scopeClassName, className].filter(Boolean).join(" ") || void 0,
23120
23889
  sx: [
23121
23890
  {
23122
- width: { xs: "100%", sm: width },
23891
+ width: { xs: "100vw", sm: drawerWidth },
23892
+ minWidth: { xs: "100vw", sm: drawerMinWidth },
23893
+ maxWidth: { xs: "100vw", sm: drawerMaxWidth },
23894
+ boxSizing: "border-box",
23123
23895
  background: "linear-gradient(180deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%)",
23124
23896
  borderLeft: "1px solid hsl(var(--border))",
23125
23897
  boxShadow: "-8px 0 32px hsla(0, 0%, 0%, 0.4)",
@@ -24472,17 +25244,17 @@ var AgentActivityList = ({
24472
25244
  }
24473
25245
  const hasPrompt = !!r.execution_argument || !!originalInput || !!agentResult?.result;
24474
25246
  if (!decisions || !hasPrompt) return null;
24475
- const patch = {
25247
+ const patch2 = {
24476
25248
  results,
24477
25249
  execution_argument: r.execution_argument,
24478
25250
  result: agentResult?.result ?? r.result,
24479
25251
  decisions,
24480
25252
  allowed_actions: allowedActions
24481
25253
  };
24482
- if (originalInput && !patch.execution_argument) {
24483
- patch.execution_argument = JSON.stringify({ original_input: originalInput });
25254
+ if (originalInput && !patch2.execution_argument) {
25255
+ patch2.execution_argument = JSON.stringify({ original_input: originalInput });
24484
25256
  }
24485
- return patch;
25257
+ return patch2;
24486
25258
  };
24487
25259
  let pending = {};
24488
25260
  let flushTimer = null;
@@ -24494,8 +25266,8 @@ var AgentActivityList = ({
24494
25266
  if (Object.keys(batch).length === 0) return;
24495
25267
  setEnrichedRuns((prev) => ({ ...prev, ...batch }));
24496
25268
  };
24497
- const queuePatch = (id, patch) => {
24498
- pending[id] = patch;
25269
+ const queuePatch = (id, patch2) => {
25270
+ pending[id] = patch2;
24499
25271
  if (!flushTimer) flushTimer = setTimeout(flush, 250);
24500
25272
  };
24501
25273
  const needsFetch = [];
@@ -24547,17 +25319,17 @@ var AgentActivityList = ({
24547
25319
  } catch {
24548
25320
  }
24549
25321
  }
24550
- const patch = {
25322
+ const patch2 = {
24551
25323
  results: json.results,
24552
25324
  execution_argument: json.execution_argument,
24553
25325
  result: agentResult?.result,
24554
25326
  decisions,
24555
25327
  allowed_actions: allowedActions
24556
25328
  };
24557
- if (originalInput && !patch.execution_argument) {
24558
- patch.execution_argument = JSON.stringify({ original_input: originalInput });
25329
+ if (originalInput && !patch2.execution_argument) {
25330
+ patch2.execution_argument = JSON.stringify({ original_input: originalInput });
24559
25331
  }
24560
- queuePatch(executionId, patch);
25332
+ queuePatch(executionId, patch2);
24561
25333
  } catch {
24562
25334
  }
24563
25335
  };
@@ -24586,8 +25358,8 @@ var AgentActivityList = ({
24586
25358
  };
24587
25359
  }, [runs, apiKey, orgId]);
24588
25360
  const mergedRuns = runs.map((r) => {
24589
- const patch = r.execution_id ? enrichedRuns[r.execution_id] : void 0;
24590
- const merged = patch ? { ...r, ...patch } : r;
25361
+ const patch2 = r.execution_id ? enrichedRuns[r.execution_id] : void 0;
25362
+ const merged = patch2 ? { ...r, ...patch2 } : r;
24591
25363
  return r.execution_id && abortedIds.has(r.execution_id) ? { ...merged, status: "ABORTED" } : merged;
24592
25364
  });
24593
25365
  const loadMore = useCallback11(() => {
@@ -24948,6 +25720,8 @@ var AgentExecutionDrawer = ({
24948
25720
  onClose,
24949
25721
  run,
24950
25722
  width = 720,
25723
+ minWidth = 480,
25724
+ maxWidth = 960,
24951
25725
  apiKey,
24952
25726
  apiBaseUrl,
24953
25727
  orgId,
@@ -24958,6 +25732,11 @@ var AgentExecutionDrawer = ({
24958
25732
  topBanner,
24959
25733
  onSchedule,
24960
25734
  isSupport,
25735
+ globalUrl,
25736
+ userdata,
25737
+ isLoaded,
25738
+ isLoggedIn,
25739
+ serverside,
24961
25740
  theme,
24962
25741
  colorMode
24963
25742
  }) => {
@@ -24974,6 +25753,9 @@ var AgentExecutionDrawer = ({
24974
25753
  const statusKey = (run?.status || "").toUpperCase();
24975
25754
  const cfg = STATUS_CONFIG[statusKey] || STATUS_CONFIG.WAITING;
24976
25755
  const duration = run ? formatDuration(run) : "";
25756
+ const drawerWidth = `min(${width}px, 100vw)`;
25757
+ const drawerMinWidth = `min(${minWidth}px, 100vw)`;
25758
+ const drawerMaxWidth = `min(${maxWidth}px, 100vw)`;
24977
25759
  return /* @__PURE__ */ jsxs29(
24978
25760
  Drawer5,
24979
25761
  {
@@ -24982,14 +25764,24 @@ var AgentExecutionDrawer = ({
24982
25764
  onClose,
24983
25765
  keepMounted: true,
24984
25766
  transitionDuration: { enter: 120, exit: 100 },
24985
- sx: { zIndex: 10011 },
25767
+ sx: {
25768
+ zIndex: 10011,
25769
+ "& .MuiDrawer-paper": {
25770
+ boxSizing: "border-box",
25771
+ width: { xs: "100vw", sm: drawerWidth },
25772
+ minWidth: { xs: "100vw", sm: drawerMinWidth },
25773
+ maxWidth: { xs: "100vw", sm: drawerMaxWidth }
25774
+ }
25775
+ },
24986
25776
  slotProps: {
24987
25777
  paper: {
24988
25778
  className: [themeScope?.scopeClassName, className].filter(Boolean).join(" ") || void 0,
24989
25779
  sx: [
24990
25780
  {
24991
- width: { xs: "100%", sm: width },
24992
- maxWidth: "100vw",
25781
+ width: { xs: "100vw", sm: drawerWidth },
25782
+ minWidth: { xs: "100vw", sm: drawerMinWidth },
25783
+ maxWidth: { xs: "100vw", sm: drawerMaxWidth },
25784
+ boxSizing: "border-box",
24993
25785
  bgcolor: "hsl(var(--background))",
24994
25786
  color: "hsl(var(--foreground))",
24995
25787
  backgroundImage: "none",
@@ -26482,7 +27274,8 @@ var AskAiSidePanel = ({
26482
27274
  right: 0,
26483
27275
  bottom: 0,
26484
27276
  width: { xs: "100%", sm: effectiveWidth },
26485
- maxWidth: "100vw",
27277
+ minWidth: { xs: "100%", sm: MIN_ASK_AI_PANEL_WIDTH },
27278
+ maxWidth: { xs: "100vw", sm: MAX_ASK_AI_PANEL_WIDTH },
26486
27279
  height: "100dvh",
26487
27280
  bgcolor: "hsl(var(--card))",
26488
27281
  borderLeft: "1px solid hsl(var(--border))",