switchroom 0.11.1 → 0.12.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.
Files changed (77) hide show
  1. package/README.md +32 -16
  2. package/dist/agent-scheduler/index.js +216 -97
  3. package/dist/auth-broker/index.js +176 -97
  4. package/dist/cli/drive-write-pretool.mjs +26 -11
  5. package/dist/cli/skill-validate-pretool.mjs +7209 -0
  6. package/dist/cli/switchroom.js +45571 -42642
  7. package/dist/cli/ui/index.html +1281 -0
  8. package/dist/host-control/main.js +3628 -309
  9. package/dist/vault/approvals/kernel-server.js +207 -98
  10. package/dist/vault/broker/server.js +249 -119
  11. package/examples/personal-google-workspace-mcp/README.md +8 -3
  12. package/examples/switchroom.yaml +91 -42
  13. package/package.json +4 -3
  14. package/profiles/_base/start.sh.hbs +76 -36
  15. package/profiles/_shared/agent-self-service.md.hbs +1 -1
  16. package/profiles/default/CLAUDE.md.hbs +4 -2
  17. package/skills/file-bug/SKILL.md +6 -4
  18. package/skills/skill-creator/SKILL.md +52 -0
  19. package/skills/switchroom-cli/SKILL.md +20 -4
  20. package/skills/switchroom-install/SKILL.md +3 -3
  21. package/telegram-plugin/auth-snapshot-format.ts +9 -9
  22. package/telegram-plugin/card-format.ts +3 -3
  23. package/telegram-plugin/dist/bridge/bridge.js +112 -112
  24. package/telegram-plugin/dist/gateway/gateway.js +853 -414
  25. package/telegram-plugin/dist/server.js +162 -161
  26. package/telegram-plugin/format.ts +71 -0
  27. package/telegram-plugin/gateway/access-validator.test.ts +8 -8
  28. package/telegram-plugin/gateway/access-validator.ts +1 -1
  29. package/telegram-plugin/gateway/approval-card.test.ts +18 -18
  30. package/telegram-plugin/gateway/approval-card.ts +1 -1
  31. package/telegram-plugin/gateway/auth-command.ts +2 -2
  32. package/telegram-plugin/gateway/boot-card.ts +40 -3
  33. package/telegram-plugin/gateway/boot-probes.ts +114 -30
  34. package/telegram-plugin/gateway/diff-preview-card.test.ts +15 -15
  35. package/telegram-plugin/gateway/diff-preview-card.ts +1 -1
  36. package/telegram-plugin/gateway/drive-write-approval.test.ts +2 -2
  37. package/telegram-plugin/gateway/gateway.ts +265 -22
  38. package/telegram-plugin/gateway/update-announce.ts +167 -0
  39. package/telegram-plugin/quota-check.ts +0 -195
  40. package/telegram-plugin/recent-outbound-dedup.ts +1 -1
  41. package/telegram-plugin/registry/turns-schema.ts +1 -1
  42. package/telegram-plugin/retry-api-call.ts +24 -0
  43. package/telegram-plugin/server.ts +8 -5
  44. package/telegram-plugin/tests/auth-add-flow.test.ts +32 -3
  45. package/telegram-plugin/tests/auth-command-format2.test.ts +4 -4
  46. package/telegram-plugin/tests/auth-snapshot-format.test.ts +17 -17
  47. package/telegram-plugin/tests/auto-fallback-fleet.test.ts +10 -10
  48. package/telegram-plugin/tests/boot-probes.test.ts +90 -2
  49. package/telegram-plugin/tests/bot-runtime.test.ts +23 -1
  50. package/telegram-plugin/tests/fixtures/service-log-current-claude-code.bin +1 -1
  51. package/telegram-plugin/tests/fleet-state.test.ts +3 -2
  52. package/telegram-plugin/tests/quota-check.test.ts +0 -409
  53. package/telegram-plugin/tests/retry-api-call.test.ts +76 -0
  54. package/telegram-plugin/tests/secret-detect-audit.test.ts +1 -1
  55. package/telegram-plugin/tests/secret-detect-pipeline.test.ts +7 -6
  56. package/telegram-plugin/tests/secret-detect-suppressor-no-silent-allow.test.ts +6 -5
  57. package/telegram-plugin/tests/secret-detect.test.ts +8 -8
  58. package/telegram-plugin/tests/telegram-format.test.ts +84 -1
  59. package/telegram-plugin/tests/update-announce.test.ts +154 -0
  60. package/telegram-plugin/tests/vault-grant-inbound-builders.test.ts +8 -8
  61. package/telegram-plugin/tests/vault-request-access-tool.test.ts +51 -0
  62. package/telegram-plugin/welcome-text.ts +1 -8
  63. package/profiles/default/CLAUDE.md +0 -192
  64. package/skills/docx/scripts/office/validators/__pycache__/__init__.cpython-313.pyc +0 -0
  65. package/skills/docx/scripts/office/validators/__pycache__/base.cpython-313.pyc +0 -0
  66. package/skills/skill-creator/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  67. package/skills/skill-creator/scripts/__pycache__/generate_report.cpython-313.pyc +0 -0
  68. package/skills/skill-creator/scripts/__pycache__/improve_description.cpython-313.pyc +0 -0
  69. package/skills/skill-creator/scripts/__pycache__/run_eval.cpython-313.pyc +0 -0
  70. package/skills/skill-creator/scripts/__pycache__/run_loop.cpython-313.pyc +0 -0
  71. package/skills/skill-creator/scripts/__pycache__/utils.cpython-313.pyc +0 -0
  72. package/telegram-plugin/first-paint.ts +0 -225
  73. package/telegram-plugin/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  74. package/telegram-plugin/server.js +0 -41795
  75. package/telegram-plugin/tests/html-balanced.ts +0 -63
  76. package/telegram-plugin/tests/snapshot-serializer.ts +0 -79
  77. package/telegram-plugin/tool-error-filter.ts +0 -89
@@ -1,5 +1,34 @@
1
1
  import { createRequire } from "node:module";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
2
4
  var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ if (canCache)
29
+ cache.set(mod, to);
30
+ return to;
31
+ };
3
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
4
33
  var __returnValue = (v) => v;
5
34
  function __exportSetter(name, newValue) {
@@ -14,9 +43,10 @@ var __export = (target, all) => {
14
43
  set: __exportSetter.bind(all, name)
15
44
  });
16
45
  };
46
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
47
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
18
48
 
19
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.js
49
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.js
20
50
  var require_identity = __commonJS((exports) => {
21
51
  var ALIAS = Symbol.for("yaml.alias");
22
52
  var DOC = Symbol.for("yaml.document");
@@ -70,7 +100,7 @@ var require_identity = __commonJS((exports) => {
70
100
  exports.isSeq = isSeq;
71
101
  });
72
102
 
73
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/visit.js
103
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/visit.js
74
104
  var require_visit = __commonJS((exports) => {
75
105
  var identity = require_identity();
76
106
  var BREAK = Symbol("break visit");
@@ -225,7 +255,7 @@ var require_visit = __commonJS((exports) => {
225
255
  exports.visitAsync = visitAsync;
226
256
  });
227
257
 
228
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/directives.js
258
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/directives.js
229
259
  var require_directives = __commonJS((exports) => {
230
260
  var identity = require_identity();
231
261
  var visit = require_visit();
@@ -377,7 +407,7 @@ var require_directives = __commonJS((exports) => {
377
407
  exports.Directives = Directives;
378
408
  });
379
409
 
380
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.js
410
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.js
381
411
  var require_anchors = __commonJS((exports) => {
382
412
  var identity = require_identity();
383
413
  var visit = require_visit();
@@ -439,7 +469,7 @@ var require_anchors = __commonJS((exports) => {
439
469
  exports.findNewAnchor = findNewAnchor;
440
470
  });
441
471
 
442
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.js
472
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.js
443
473
  var require_applyReviver = __commonJS((exports) => {
444
474
  function applyReviver(reviver, obj, key, val) {
445
475
  if (val && typeof val === "object") {
@@ -486,7 +516,7 @@ var require_applyReviver = __commonJS((exports) => {
486
516
  exports.applyReviver = applyReviver;
487
517
  });
488
518
 
489
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.js
519
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.js
490
520
  var require_toJS = __commonJS((exports) => {
491
521
  var identity = require_identity();
492
522
  function toJS(value, arg, ctx) {
@@ -513,7 +543,7 @@ var require_toJS = __commonJS((exports) => {
513
543
  exports.toJS = toJS;
514
544
  });
515
545
 
516
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.js
546
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.js
517
547
  var require_Node = __commonJS((exports) => {
518
548
  var applyReviver = require_applyReviver();
519
549
  var identity = require_identity();
@@ -550,7 +580,7 @@ var require_Node = __commonJS((exports) => {
550
580
  exports.NodeBase = NodeBase;
551
581
  });
552
582
 
553
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.js
583
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.js
554
584
  var require_Alias = __commonJS((exports) => {
555
585
  var anchors = require_anchors();
556
586
  var visit = require_visit();
@@ -658,7 +688,7 @@ var require_Alias = __commonJS((exports) => {
658
688
  exports.Alias = Alias;
659
689
  });
660
690
 
661
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.js
691
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.js
662
692
  var require_Scalar = __commonJS((exports) => {
663
693
  var identity = require_identity();
664
694
  var Node = require_Node();
@@ -686,7 +716,7 @@ var require_Scalar = __commonJS((exports) => {
686
716
  exports.isScalarValue = isScalarValue;
687
717
  });
688
718
 
689
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.js
719
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.js
690
720
  var require_createNode = __commonJS((exports) => {
691
721
  var Alias = require_Alias();
692
722
  var identity = require_identity();
@@ -758,7 +788,7 @@ var require_createNode = __commonJS((exports) => {
758
788
  exports.createNode = createNode;
759
789
  });
760
790
 
761
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.js
791
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.js
762
792
  var require_Collection = __commonJS((exports) => {
763
793
  var createNode = require_createNode();
764
794
  var identity = require_identity();
@@ -873,7 +903,7 @@ var require_Collection = __commonJS((exports) => {
873
903
  exports.isEmptyPath = isEmptyPath;
874
904
  });
875
905
 
876
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.js
906
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.js
877
907
  var require_stringifyComment = __commonJS((exports) => {
878
908
  var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
879
909
  function indentComment(comment, indent) {
@@ -890,7 +920,7 @@ var require_stringifyComment = __commonJS((exports) => {
890
920
  exports.stringifyComment = stringifyComment;
891
921
  });
892
922
 
893
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.js
923
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.js
894
924
  var require_foldFlowLines = __commonJS((exports) => {
895
925
  var FOLD_FLOW = "flow";
896
926
  var FOLD_BLOCK = "block";
@@ -1027,7 +1057,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
1027
1057
  exports.foldFlowLines = foldFlowLines;
1028
1058
  });
1029
1059
 
1030
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.js
1060
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.js
1031
1061
  var require_stringifyString = __commonJS((exports) => {
1032
1062
  var Scalar = require_Scalar();
1033
1063
  var foldFlowLines = require_foldFlowLines();
@@ -1325,7 +1355,7 @@ ${indent}`);
1325
1355
  exports.stringifyString = stringifyString;
1326
1356
  });
1327
1357
 
1328
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.js
1358
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.js
1329
1359
  var require_stringify = __commonJS((exports) => {
1330
1360
  var anchors = require_anchors();
1331
1361
  var identity = require_identity();
@@ -1446,7 +1476,7 @@ ${ctx.indent}${str}`;
1446
1476
  exports.stringify = stringify;
1447
1477
  });
1448
1478
 
1449
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.js
1479
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.js
1450
1480
  var require_stringifyPair = __commonJS((exports) => {
1451
1481
  var identity = require_identity();
1452
1482
  var Scalar = require_Scalar();
@@ -1582,7 +1612,7 @@ ${ctx.indent}`;
1582
1612
  exports.stringifyPair = stringifyPair;
1583
1613
  });
1584
1614
 
1585
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/log.js
1615
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/log.js
1586
1616
  var require_log = __commonJS((exports) => {
1587
1617
  var node_process = __require("process");
1588
1618
  function debug(logLevel, ...messages) {
@@ -1601,7 +1631,7 @@ var require_log = __commonJS((exports) => {
1601
1631
  exports.warn = warn;
1602
1632
  });
1603
1633
 
1604
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.js
1634
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.js
1605
1635
  var require_merge = __commonJS((exports) => {
1606
1636
  var identity = require_identity();
1607
1637
  var Scalar = require_Scalar();
@@ -1655,7 +1685,7 @@ var require_merge = __commonJS((exports) => {
1655
1685
  exports.merge = merge;
1656
1686
  });
1657
1687
 
1658
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.js
1688
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.js
1659
1689
  var require_addPairToJSMap = __commonJS((exports) => {
1660
1690
  var log = require_log();
1661
1691
  var merge = require_merge();
@@ -1716,7 +1746,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
1716
1746
  exports.addPairToJSMap = addPairToJSMap;
1717
1747
  });
1718
1748
 
1719
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.js
1749
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.js
1720
1750
  var require_Pair = __commonJS((exports) => {
1721
1751
  var createNode = require_createNode();
1722
1752
  var stringifyPair = require_stringifyPair();
@@ -1754,7 +1784,7 @@ var require_Pair = __commonJS((exports) => {
1754
1784
  exports.createPair = createPair;
1755
1785
  });
1756
1786
 
1757
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.js
1787
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.js
1758
1788
  var require_stringifyCollection = __commonJS((exports) => {
1759
1789
  var identity = require_identity();
1760
1790
  var stringify = require_stringify();
@@ -1906,7 +1936,7 @@ ${indent}${end}`;
1906
1936
  exports.stringifyCollection = stringifyCollection;
1907
1937
  });
1908
1938
 
1909
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.js
1939
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.js
1910
1940
  var require_YAMLMap = __commonJS((exports) => {
1911
1941
  var stringifyCollection = require_stringifyCollection();
1912
1942
  var addPairToJSMap = require_addPairToJSMap();
@@ -2033,7 +2063,7 @@ var require_YAMLMap = __commonJS((exports) => {
2033
2063
  exports.findPair = findPair;
2034
2064
  });
2035
2065
 
2036
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.js
2066
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.js
2037
2067
  var require_map = __commonJS((exports) => {
2038
2068
  var identity = require_identity();
2039
2069
  var YAMLMap = require_YAMLMap();
@@ -2052,7 +2082,7 @@ var require_map = __commonJS((exports) => {
2052
2082
  exports.map = map;
2053
2083
  });
2054
2084
 
2055
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.js
2085
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.js
2056
2086
  var require_YAMLSeq = __commonJS((exports) => {
2057
2087
  var createNode = require_createNode();
2058
2088
  var stringifyCollection = require_stringifyCollection();
@@ -2145,7 +2175,7 @@ var require_YAMLSeq = __commonJS((exports) => {
2145
2175
  exports.YAMLSeq = YAMLSeq;
2146
2176
  });
2147
2177
 
2148
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.js
2178
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.js
2149
2179
  var require_seq = __commonJS((exports) => {
2150
2180
  var identity = require_identity();
2151
2181
  var YAMLSeq = require_YAMLSeq();
@@ -2164,7 +2194,7 @@ var require_seq = __commonJS((exports) => {
2164
2194
  exports.seq = seq;
2165
2195
  });
2166
2196
 
2167
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.js
2197
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.js
2168
2198
  var require_string = __commonJS((exports) => {
2169
2199
  var stringifyString = require_stringifyString();
2170
2200
  var string = {
@@ -2180,7 +2210,7 @@ var require_string = __commonJS((exports) => {
2180
2210
  exports.string = string;
2181
2211
  });
2182
2212
 
2183
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.js
2213
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.js
2184
2214
  var require_null = __commonJS((exports) => {
2185
2215
  var Scalar = require_Scalar();
2186
2216
  var nullTag = {
@@ -2195,7 +2225,7 @@ var require_null = __commonJS((exports) => {
2195
2225
  exports.nullTag = nullTag;
2196
2226
  });
2197
2227
 
2198
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.js
2228
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.js
2199
2229
  var require_bool = __commonJS((exports) => {
2200
2230
  var Scalar = require_Scalar();
2201
2231
  var boolTag = {
@@ -2216,7 +2246,7 @@ var require_bool = __commonJS((exports) => {
2216
2246
  exports.boolTag = boolTag;
2217
2247
  });
2218
2248
 
2219
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.js
2249
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.js
2220
2250
  var require_stringifyNumber = __commonJS((exports) => {
2221
2251
  function stringifyNumber({ format, minFractionDigits, tag, value }) {
2222
2252
  if (typeof value === "bigint")
@@ -2240,7 +2270,7 @@ var require_stringifyNumber = __commonJS((exports) => {
2240
2270
  exports.stringifyNumber = stringifyNumber;
2241
2271
  });
2242
2272
 
2243
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.js
2273
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.js
2244
2274
  var require_float = __commonJS((exports) => {
2245
2275
  var Scalar = require_Scalar();
2246
2276
  var stringifyNumber = require_stringifyNumber();
@@ -2283,7 +2313,7 @@ var require_float = __commonJS((exports) => {
2283
2313
  exports.floatNaN = floatNaN;
2284
2314
  });
2285
2315
 
2286
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.js
2316
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.js
2287
2317
  var require_int = __commonJS((exports) => {
2288
2318
  var stringifyNumber = require_stringifyNumber();
2289
2319
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -2325,7 +2355,7 @@ var require_int = __commonJS((exports) => {
2325
2355
  exports.intOct = intOct;
2326
2356
  });
2327
2357
 
2328
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.js
2358
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.js
2329
2359
  var require_schema = __commonJS((exports) => {
2330
2360
  var map = require_map();
2331
2361
  var _null = require_null();
@@ -2350,7 +2380,7 @@ var require_schema = __commonJS((exports) => {
2350
2380
  exports.schema = schema;
2351
2381
  });
2352
2382
 
2353
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.js
2383
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.js
2354
2384
  var require_schema2 = __commonJS((exports) => {
2355
2385
  var Scalar = require_Scalar();
2356
2386
  var map = require_map();
@@ -2414,7 +2444,7 @@ var require_schema2 = __commonJS((exports) => {
2414
2444
  exports.schema = schema;
2415
2445
  });
2416
2446
 
2417
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.js
2447
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.js
2418
2448
  var require_binary = __commonJS((exports) => {
2419
2449
  var node_buffer = __require("buffer");
2420
2450
  var Scalar = require_Scalar();
@@ -2469,7 +2499,7 @@ var require_binary = __commonJS((exports) => {
2469
2499
  exports.binary = binary;
2470
2500
  });
2471
2501
 
2472
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
2502
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
2473
2503
  var require_pairs = __commonJS((exports) => {
2474
2504
  var identity = require_identity();
2475
2505
  var Pair = require_Pair();
@@ -2544,7 +2574,7 @@ ${cn.comment}` : item.comment;
2544
2574
  exports.resolvePairs = resolvePairs;
2545
2575
  });
2546
2576
 
2547
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.js
2577
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.js
2548
2578
  var require_omap = __commonJS((exports) => {
2549
2579
  var identity = require_identity();
2550
2580
  var toJS = require_toJS();
@@ -2616,7 +2646,7 @@ var require_omap = __commonJS((exports) => {
2616
2646
  exports.omap = omap;
2617
2647
  });
2618
2648
 
2619
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.js
2649
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.js
2620
2650
  var require_bool2 = __commonJS((exports) => {
2621
2651
  var Scalar = require_Scalar();
2622
2652
  function boolStringify({ value, source }, ctx) {
@@ -2645,7 +2675,7 @@ var require_bool2 = __commonJS((exports) => {
2645
2675
  exports.trueTag = trueTag;
2646
2676
  });
2647
2677
 
2648
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.js
2678
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.js
2649
2679
  var require_float2 = __commonJS((exports) => {
2650
2680
  var Scalar = require_Scalar();
2651
2681
  var stringifyNumber = require_stringifyNumber();
@@ -2691,7 +2721,7 @@ var require_float2 = __commonJS((exports) => {
2691
2721
  exports.floatNaN = floatNaN;
2692
2722
  });
2693
2723
 
2694
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.js
2724
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.js
2695
2725
  var require_int2 = __commonJS((exports) => {
2696
2726
  var stringifyNumber = require_stringifyNumber();
2697
2727
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -2767,7 +2797,7 @@ var require_int2 = __commonJS((exports) => {
2767
2797
  exports.intOct = intOct;
2768
2798
  });
2769
2799
 
2770
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.js
2800
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.js
2771
2801
  var require_set = __commonJS((exports) => {
2772
2802
  var identity = require_identity();
2773
2803
  var Pair = require_Pair();
@@ -2850,7 +2880,7 @@ var require_set = __commonJS((exports) => {
2850
2880
  exports.set = set;
2851
2881
  });
2852
2882
 
2853
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
2883
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
2854
2884
  var require_timestamp = __commonJS((exports) => {
2855
2885
  var stringifyNumber = require_stringifyNumber();
2856
2886
  function parseSexagesimal(str, asBigInt) {
@@ -2932,7 +2962,7 @@ var require_timestamp = __commonJS((exports) => {
2932
2962
  exports.timestamp = timestamp;
2933
2963
  });
2934
2964
 
2935
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.js
2965
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.js
2936
2966
  var require_schema3 = __commonJS((exports) => {
2937
2967
  var map = require_map();
2938
2968
  var _null = require_null();
@@ -2973,7 +3003,7 @@ var require_schema3 = __commonJS((exports) => {
2973
3003
  exports.schema = schema;
2974
3004
  });
2975
3005
 
2976
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/tags.js
3006
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/tags.js
2977
3007
  var require_tags = __commonJS((exports) => {
2978
3008
  var map = require_map();
2979
3009
  var _null = require_null();
@@ -3064,7 +3094,7 @@ var require_tags = __commonJS((exports) => {
3064
3094
  exports.getTags = getTags;
3065
3095
  });
3066
3096
 
3067
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.js
3097
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.js
3068
3098
  var require_Schema = __commonJS((exports) => {
3069
3099
  var identity = require_identity();
3070
3100
  var map = require_map();
@@ -3094,7 +3124,7 @@ var require_Schema = __commonJS((exports) => {
3094
3124
  exports.Schema = Schema;
3095
3125
  });
3096
3126
 
3097
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.js
3127
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.js
3098
3128
  var require_stringifyDocument = __commonJS((exports) => {
3099
3129
  var identity = require_identity();
3100
3130
  var stringify = require_stringify();
@@ -3174,7 +3204,7 @@ var require_stringifyDocument = __commonJS((exports) => {
3174
3204
  exports.stringifyDocument = stringifyDocument;
3175
3205
  });
3176
3206
 
3177
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/Document.js
3207
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/Document.js
3178
3208
  var require_Document = __commonJS((exports) => {
3179
3209
  var Alias = require_Alias();
3180
3210
  var Collection = require_Collection();
@@ -3409,7 +3439,7 @@ var require_Document = __commonJS((exports) => {
3409
3439
  exports.Document = Document;
3410
3440
  });
3411
3441
 
3412
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/errors.js
3442
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/errors.js
3413
3443
  var require_errors = __commonJS((exports) => {
3414
3444
  class YAMLError extends Error {
3415
3445
  constructor(name, pos, code, message) {
@@ -3474,7 +3504,7 @@ ${pointer}
3474
3504
  exports.prettifyError = prettifyError;
3475
3505
  });
3476
3506
 
3477
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.js
3507
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.js
3478
3508
  var require_resolve_props = __commonJS((exports) => {
3479
3509
  function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
3480
3510
  let spaceBefore = false;
@@ -3604,7 +3634,7 @@ var require_resolve_props = __commonJS((exports) => {
3604
3634
  exports.resolveProps = resolveProps;
3605
3635
  });
3606
3636
 
3607
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.js
3637
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.js
3608
3638
  var require_util_contains_newline = __commonJS((exports) => {
3609
3639
  function containsNewline(key) {
3610
3640
  if (!key)
@@ -3644,7 +3674,7 @@ var require_util_contains_newline = __commonJS((exports) => {
3644
3674
  exports.containsNewline = containsNewline;
3645
3675
  });
3646
3676
 
3647
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.js
3677
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.js
3648
3678
  var require_util_flow_indent_check = __commonJS((exports) => {
3649
3679
  var utilContainsNewline = require_util_contains_newline();
3650
3680
  function flowIndentCheck(indent, fc, onError) {
@@ -3659,7 +3689,7 @@ var require_util_flow_indent_check = __commonJS((exports) => {
3659
3689
  exports.flowIndentCheck = flowIndentCheck;
3660
3690
  });
3661
3691
 
3662
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.js
3692
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.js
3663
3693
  var require_util_map_includes = __commonJS((exports) => {
3664
3694
  var identity = require_identity();
3665
3695
  function mapIncludes(ctx, items, search) {
@@ -3672,7 +3702,7 @@ var require_util_map_includes = __commonJS((exports) => {
3672
3702
  exports.mapIncludes = mapIncludes;
3673
3703
  });
3674
3704
 
3675
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.js
3705
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.js
3676
3706
  var require_resolve_block_map = __commonJS((exports) => {
3677
3707
  var Pair = require_Pair();
3678
3708
  var YAMLMap = require_YAMLMap();
@@ -3779,7 +3809,7 @@ var require_resolve_block_map = __commonJS((exports) => {
3779
3809
  exports.resolveBlockMap = resolveBlockMap;
3780
3810
  });
3781
3811
 
3782
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.js
3812
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.js
3783
3813
  var require_resolve_block_seq = __commonJS((exports) => {
3784
3814
  var YAMLSeq = require_YAMLSeq();
3785
3815
  var resolveProps = require_resolve_props();
@@ -3827,7 +3857,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
3827
3857
  exports.resolveBlockSeq = resolveBlockSeq;
3828
3858
  });
3829
3859
 
3830
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.js
3860
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.js
3831
3861
  var require_resolve_end = __commonJS((exports) => {
3832
3862
  function resolveEnd(end, offset, reqSpace, onError) {
3833
3863
  let comment = "";
@@ -3867,7 +3897,7 @@ var require_resolve_end = __commonJS((exports) => {
3867
3897
  exports.resolveEnd = resolveEnd;
3868
3898
  });
3869
3899
 
3870
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.js
3900
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.js
3871
3901
  var require_resolve_flow_collection = __commonJS((exports) => {
3872
3902
  var identity = require_identity();
3873
3903
  var Pair = require_Pair();
@@ -4058,7 +4088,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
4058
4088
  exports.resolveFlowCollection = resolveFlowCollection;
4059
4089
  });
4060
4090
 
4061
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.js
4091
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.js
4062
4092
  var require_compose_collection = __commonJS((exports) => {
4063
4093
  var identity = require_identity();
4064
4094
  var Scalar = require_Scalar();
@@ -4120,7 +4150,7 @@ var require_compose_collection = __commonJS((exports) => {
4120
4150
  exports.composeCollection = composeCollection;
4121
4151
  });
4122
4152
 
4123
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.js
4153
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.js
4124
4154
  var require_resolve_block_scalar = __commonJS((exports) => {
4125
4155
  var Scalar = require_Scalar();
4126
4156
  function resolveBlockScalar(ctx, scalar, onError) {
@@ -4313,7 +4343,7 @@ var require_resolve_block_scalar = __commonJS((exports) => {
4313
4343
  exports.resolveBlockScalar = resolveBlockScalar;
4314
4344
  });
4315
4345
 
4316
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.js
4346
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.js
4317
4347
  var require_resolve_flow_scalar = __commonJS((exports) => {
4318
4348
  var Scalar = require_Scalar();
4319
4349
  var resolveEnd = require_resolve_end();
@@ -4529,7 +4559,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
4529
4559
  exports.resolveFlowScalar = resolveFlowScalar;
4530
4560
  });
4531
4561
 
4532
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.js
4562
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.js
4533
4563
  var require_compose_scalar = __commonJS((exports) => {
4534
4564
  var identity = require_identity();
4535
4565
  var Scalar = require_Scalar();
@@ -4607,7 +4637,7 @@ var require_compose_scalar = __commonJS((exports) => {
4607
4637
  exports.composeScalar = composeScalar;
4608
4638
  });
4609
4639
 
4610
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.js
4640
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.js
4611
4641
  var require_util_empty_scalar_position = __commonJS((exports) => {
4612
4642
  function emptyScalarPosition(offset, before, pos) {
4613
4643
  if (before) {
@@ -4634,7 +4664,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
4634
4664
  exports.emptyScalarPosition = emptyScalarPosition;
4635
4665
  });
4636
4666
 
4637
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.js
4667
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.js
4638
4668
  var require_compose_node = __commonJS((exports) => {
4639
4669
  var Alias = require_Alias();
4640
4670
  var identity = require_identity();
@@ -4737,7 +4767,7 @@ var require_compose_node = __commonJS((exports) => {
4737
4767
  exports.composeNode = composeNode;
4738
4768
  });
4739
4769
 
4740
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.js
4770
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.js
4741
4771
  var require_compose_doc = __commonJS((exports) => {
4742
4772
  var Document = require_Document();
4743
4773
  var composeNode = require_compose_node();
@@ -4777,7 +4807,7 @@ var require_compose_doc = __commonJS((exports) => {
4777
4807
  exports.composeDoc = composeDoc;
4778
4808
  });
4779
4809
 
4780
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/composer.js
4810
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/composer.js
4781
4811
  var require_composer = __commonJS((exports) => {
4782
4812
  var node_process = __require("process");
4783
4813
  var directives = require_directives();
@@ -4966,7 +4996,7 @@ ${end.comment}` : end.comment;
4966
4996
  exports.Composer = Composer;
4967
4997
  });
4968
4998
 
4969
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.js
4999
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.js
4970
5000
  var require_cst_scalar = __commonJS((exports) => {
4971
5001
  var resolveBlockScalar = require_resolve_block_scalar();
4972
5002
  var resolveFlowScalar = require_resolve_flow_scalar();
@@ -5156,7 +5186,7 @@ var require_cst_scalar = __commonJS((exports) => {
5156
5186
  exports.setScalarValue = setScalarValue;
5157
5187
  });
5158
5188
 
5159
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.js
5189
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.js
5160
5190
  var require_cst_stringify = __commonJS((exports) => {
5161
5191
  var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
5162
5192
  function stringifyToken(token) {
@@ -5214,7 +5244,7 @@ var require_cst_stringify = __commonJS((exports) => {
5214
5244
  exports.stringify = stringify;
5215
5245
  });
5216
5246
 
5217
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.js
5247
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.js
5218
5248
  var require_cst_visit = __commonJS((exports) => {
5219
5249
  var BREAK = Symbol("break visit");
5220
5250
  var SKIP = Symbol("skip children");
@@ -5273,7 +5303,7 @@ var require_cst_visit = __commonJS((exports) => {
5273
5303
  exports.visit = visit;
5274
5304
  });
5275
5305
 
5276
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst.js
5306
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst.js
5277
5307
  var require_cst = __commonJS((exports) => {
5278
5308
  var cstScalar = require_cst_scalar();
5279
5309
  var cstStringify = require_cst_stringify();
@@ -5374,7 +5404,7 @@ var require_cst = __commonJS((exports) => {
5374
5404
  exports.tokenType = tokenType;
5375
5405
  });
5376
5406
 
5377
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.js
5407
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.js
5378
5408
  var require_lexer = __commonJS((exports) => {
5379
5409
  var cst = require_cst();
5380
5410
  function isEmpty(ch) {
@@ -5960,7 +5990,7 @@ var require_lexer = __commonJS((exports) => {
5960
5990
  exports.Lexer = Lexer;
5961
5991
  });
5962
5992
 
5963
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.js
5993
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.js
5964
5994
  var require_line_counter = __commonJS((exports) => {
5965
5995
  class LineCounter {
5966
5996
  constructor() {
@@ -5988,7 +6018,7 @@ var require_line_counter = __commonJS((exports) => {
5988
6018
  exports.LineCounter = LineCounter;
5989
6019
  });
5990
6020
 
5991
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/parser.js
6021
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/parser.js
5992
6022
  var require_parser = __commonJS((exports) => {
5993
6023
  var node_process = __require("process");
5994
6024
  var cst = require_cst();
@@ -6837,7 +6867,7 @@ var require_parser = __commonJS((exports) => {
6837
6867
  exports.Parser = Parser;
6838
6868
  });
6839
6869
 
6840
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/public-api.js
6870
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/public-api.js
6841
6871
  var require_public_api = __commonJS((exports) => {
6842
6872
  var composer = require_composer();
6843
6873
  var Document = require_Document();
@@ -6931,213 +6961,2916 @@ var require_public_api = __commonJS((exports) => {
6931
6961
  exports.stringify = stringify;
6932
6962
  });
6933
6963
 
6934
- // src/host-control/main.ts
6935
- import { homedir as homedir2 } from "node:os";
6964
+ // telegram-plugin/secret-detect/suppressor.ts
6965
+ function isSuppressed(text, start, end) {
6966
+ const left = Math.max(0, start - WINDOW);
6967
+ const right = Math.min(text.length, end + WINDOW);
6968
+ const context = text.slice(left, start) + text.slice(end, right);
6969
+ return MARKER_RE.test(context);
6970
+ }
6971
+ var MARKERS, WINDOW = 40, MARKER_RE;
6972
+ var init_suppressor = __esm(() => {
6973
+ MARKERS = ["test", "mock", "example", "fixture", "dummy"];
6974
+ MARKER_RE = new RegExp(`\\b(?:${MARKERS.join("|")})\\b`, "i");
6975
+ });
6936
6976
 
6937
- // src/config/loader.ts
6938
- import { readFileSync as readFileSync2, existsSync as existsSync3 } from "node:fs";
6939
- import { homedir } from "node:os";
6940
- import { resolve as resolve3 } from "node:path";
6977
+ // telegram-plugin/secret-detect/slug.ts
6978
+ function sanitizeKeyName(raw) {
6979
+ const up = raw.toUpperCase();
6980
+ const cleaned = up.replace(/[^A-Z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
6981
+ return cleaned.length > 0 ? cleaned : "SECRET";
6982
+ }
6983
+ function datePart(now = new Date) {
6984
+ const y = now.getUTCFullYear();
6985
+ const m = String(now.getUTCMonth() + 1).padStart(2, "0");
6986
+ const d = String(now.getUTCDate()).padStart(2, "0");
6987
+ return `${y}${m}${d}`;
6988
+ }
6989
+ function deriveSlug(inputs, existing) {
6990
+ let base;
6991
+ if (inputs.key_name && inputs.key_name.trim().length > 0) {
6992
+ base = sanitizeKeyName(inputs.key_name);
6993
+ } else {
6994
+ base = `${inputs.rule_id}_${datePart(inputs.now)}`;
6995
+ }
6996
+ if (!existing.has(base))
6997
+ return base;
6998
+ let n = 2;
6999
+ while (existing.has(`${base}_${n}`))
7000
+ n++;
7001
+ return `${base}_${n}`;
7002
+ }
6941
7003
 
6942
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/index.js
6943
- var composer = require_composer();
6944
- var Document = require_Document();
6945
- var Schema = require_Schema();
6946
- var errors = require_errors();
6947
- var Alias = require_Alias();
6948
- var identity = require_identity();
6949
- var Pair = require_Pair();
6950
- var Scalar = require_Scalar();
6951
- var YAMLMap = require_YAMLMap();
6952
- var YAMLSeq = require_YAMLSeq();
6953
- var cst = require_cst();
6954
- var lexer = require_lexer();
6955
- var lineCounter = require_line_counter();
6956
- var parser = require_parser();
6957
- var publicApi = require_public_api();
6958
- var visit = require_visit();
6959
- var $Composer = composer.Composer;
6960
- var $Document = Document.Document;
6961
- var $Schema = Schema.Schema;
6962
- var $YAMLError = errors.YAMLError;
6963
- var $YAMLParseError = errors.YAMLParseError;
6964
- var $YAMLWarning = errors.YAMLWarning;
6965
- var $Alias = Alias.Alias;
6966
- var $isAlias = identity.isAlias;
6967
- var $isCollection = identity.isCollection;
6968
- var $isDocument = identity.isDocument;
6969
- var $isMap = identity.isMap;
6970
- var $isNode = identity.isNode;
6971
- var $isPair = identity.isPair;
6972
- var $isScalar = identity.isScalar;
6973
- var $isSeq = identity.isSeq;
6974
- var $Pair = Pair.Pair;
6975
- var $Scalar = Scalar.Scalar;
6976
- var $YAMLMap = YAMLMap.YAMLMap;
6977
- var $YAMLSeq = YAMLSeq.YAMLSeq;
6978
- var $Lexer = lexer.Lexer;
6979
- var $LineCounter = lineCounter.LineCounter;
6980
- var $Parser = parser.Parser;
6981
- var $parse = publicApi.parse;
6982
- var $parseAllDocuments = publicApi.parseAllDocuments;
6983
- var $parseDocument = publicApi.parseDocument;
6984
- var $stringify = publicApi.stringify;
6985
- var $visit = visit.visit;
6986
- var $visitAsync = visit.visitAsync;
7004
+ // ../switchroom/node_modules/.bun/boundary@2.0.0/node_modules/boundary/lib/index.js
7005
+ var require_lib = __commonJS((exports) => {
7006
+ Object.defineProperty(exports, "__esModule", { value: true });
7007
+ exports.binarySearch = exports.upperBound = exports.lowerBound = exports.compare = undefined;
7008
+ function compare(v1, v2) {
7009
+ return v1 < v2;
7010
+ }
7011
+ exports.compare = compare;
7012
+ function upperBound(array, value, comp = compare) {
7013
+ let len = array.length;
7014
+ let i = 0;
7015
+ while (len) {
7016
+ let diff = len >>> 1;
7017
+ let cursor = i + diff;
7018
+ if (comp(value, array[cursor])) {
7019
+ len = diff;
7020
+ } else {
7021
+ i = cursor + 1;
7022
+ len -= diff + 1;
7023
+ }
7024
+ }
7025
+ return i;
7026
+ }
7027
+ exports.upperBound = upperBound;
7028
+ function lowerBound(array, value, comp = compare) {
7029
+ let len = array.length;
7030
+ let i = 0;
7031
+ while (len) {
7032
+ let diff = len >>> 1;
7033
+ let cursor = i + diff;
7034
+ if (comp(array[cursor], value)) {
7035
+ i = cursor + 1;
7036
+ len -= diff + 1;
7037
+ } else {
7038
+ len = diff;
7039
+ }
7040
+ }
7041
+ return i;
7042
+ }
7043
+ exports.lowerBound = lowerBound;
7044
+ function binarySearch(array, value, comp = compare) {
7045
+ let cursor = lowerBound(array, value, comp);
7046
+ return cursor !== array.length && !comp(value, array[cursor]);
7047
+ }
7048
+ exports.binarySearch = binarySearch;
7049
+ });
6987
7050
 
6988
- // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
6989
- var exports_external = {};
6990
- __export(exports_external, {
6991
- void: () => voidType,
6992
- util: () => util,
6993
- unknown: () => unknownType,
6994
- union: () => unionType,
6995
- undefined: () => undefinedType,
6996
- tuple: () => tupleType,
6997
- transformer: () => effectsType,
6998
- symbol: () => symbolType,
6999
- string: () => stringType,
7000
- strictObject: () => strictObjectType,
7001
- setErrorMap: () => setErrorMap,
7002
- set: () => setType,
7003
- record: () => recordType,
7004
- quotelessJson: () => quotelessJson,
7005
- promise: () => promiseType,
7006
- preprocess: () => preprocessType,
7007
- pipeline: () => pipelineType,
7008
- ostring: () => ostring,
7009
- optional: () => optionalType,
7010
- onumber: () => onumber,
7011
- oboolean: () => oboolean,
7012
- objectUtil: () => objectUtil,
7013
- object: () => objectType,
7014
- number: () => numberType,
7015
- nullable: () => nullableType,
7016
- null: () => nullType,
7017
- never: () => neverType,
7018
- nativeEnum: () => nativeEnumType,
7019
- nan: () => nanType,
7020
- map: () => mapType,
7021
- makeIssue: () => makeIssue,
7022
- literal: () => literalType,
7023
- lazy: () => lazyType,
7024
- late: () => late,
7025
- isValid: () => isValid,
7026
- isDirty: () => isDirty,
7027
- isAsync: () => isAsync,
7028
- isAborted: () => isAborted,
7029
- intersection: () => intersectionType,
7030
- instanceof: () => instanceOfType,
7031
- getParsedType: () => getParsedType,
7032
- getErrorMap: () => getErrorMap,
7033
- function: () => functionType,
7034
- enum: () => enumType,
7035
- effect: () => effectsType,
7036
- discriminatedUnion: () => discriminatedUnionType,
7037
- defaultErrorMap: () => en_default,
7038
- datetimeRegex: () => datetimeRegex,
7039
- date: () => dateType,
7040
- custom: () => custom,
7041
- coerce: () => coerce,
7042
- boolean: () => booleanType,
7043
- bigint: () => bigIntType,
7044
- array: () => arrayType,
7045
- any: () => anyType,
7046
- addIssueToContext: () => addIssueToContext,
7047
- ZodVoid: () => ZodVoid,
7048
- ZodUnknown: () => ZodUnknown,
7049
- ZodUnion: () => ZodUnion,
7050
- ZodUndefined: () => ZodUndefined,
7051
- ZodType: () => ZodType,
7052
- ZodTuple: () => ZodTuple,
7053
- ZodTransformer: () => ZodEffects,
7054
- ZodSymbol: () => ZodSymbol,
7055
- ZodString: () => ZodString,
7056
- ZodSet: () => ZodSet,
7057
- ZodSchema: () => ZodType,
7058
- ZodRecord: () => ZodRecord,
7059
- ZodReadonly: () => ZodReadonly,
7060
- ZodPromise: () => ZodPromise,
7061
- ZodPipeline: () => ZodPipeline,
7062
- ZodParsedType: () => ZodParsedType,
7063
- ZodOptional: () => ZodOptional,
7064
- ZodObject: () => ZodObject,
7065
- ZodNumber: () => ZodNumber,
7066
- ZodNullable: () => ZodNullable,
7067
- ZodNull: () => ZodNull,
7068
- ZodNever: () => ZodNever,
7069
- ZodNativeEnum: () => ZodNativeEnum,
7070
- ZodNaN: () => ZodNaN,
7071
- ZodMap: () => ZodMap,
7072
- ZodLiteral: () => ZodLiteral,
7073
- ZodLazy: () => ZodLazy,
7074
- ZodIssueCode: () => ZodIssueCode,
7075
- ZodIntersection: () => ZodIntersection,
7076
- ZodFunction: () => ZodFunction,
7077
- ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
7078
- ZodError: () => ZodError,
7079
- ZodEnum: () => ZodEnum,
7080
- ZodEffects: () => ZodEffects,
7081
- ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
7082
- ZodDefault: () => ZodDefault,
7083
- ZodDate: () => ZodDate,
7084
- ZodCatch: () => ZodCatch,
7085
- ZodBranded: () => ZodBranded,
7086
- ZodBoolean: () => ZodBoolean,
7087
- ZodBigInt: () => ZodBigInt,
7088
- ZodArray: () => ZodArray,
7089
- ZodAny: () => ZodAny,
7090
- Schema: () => ZodType,
7091
- ParseStatus: () => ParseStatus,
7092
- OK: () => OK,
7093
- NEVER: () => NEVER,
7094
- INVALID: () => INVALID,
7095
- EMPTY_PATH: () => EMPTY_PATH,
7096
- DIRTY: () => DIRTY,
7097
- BRAND: () => BRAND
7051
+ // ../switchroom/node_modules/.bun/structured-source@4.0.0/node_modules/structured-source/lib/structured-source.js
7052
+ var require_structured_source = __commonJS((exports) => {
7053
+ Object.defineProperty(exports, "__esModule", { value: true });
7054
+ exports.StructuredSource = undefined;
7055
+ var boundary_1 = require_lib();
7056
+
7057
+ class StructuredSource {
7058
+ constructor(source) {
7059
+ this.indice = [0];
7060
+ let regexp = /[\r\n\u2028\u2029]/g;
7061
+ const length = source.length;
7062
+ regexp.lastIndex = 0;
7063
+ while (true) {
7064
+ let result = regexp.exec(source);
7065
+ if (!result) {
7066
+ break;
7067
+ }
7068
+ let index = result.index;
7069
+ if (source.charCodeAt(index) === 13 && source.charCodeAt(index + 1) === 10) {
7070
+ index += 1;
7071
+ }
7072
+ let nextIndex = index + 1;
7073
+ if (length < nextIndex) {
7074
+ break;
7075
+ }
7076
+ this.indice.push(nextIndex);
7077
+ regexp.lastIndex = nextIndex;
7078
+ }
7079
+ }
7080
+ get line() {
7081
+ return this.indice.length;
7082
+ }
7083
+ locationToRange(loc) {
7084
+ return [this.positionToIndex(loc.start), this.positionToIndex(loc.end)];
7085
+ }
7086
+ rangeToLocation(range) {
7087
+ return {
7088
+ start: this.indexToPosition(range[0]),
7089
+ end: this.indexToPosition(range[1])
7090
+ };
7091
+ }
7092
+ positionToIndex(pos) {
7093
+ let start = this.indice[pos.line - 1];
7094
+ return start + pos.column;
7095
+ }
7096
+ indexToPosition(index) {
7097
+ const startLine = (0, boundary_1.upperBound)(this.indice, index);
7098
+ return {
7099
+ line: startLine,
7100
+ column: index - this.indice[startLine - 1]
7101
+ };
7102
+ }
7103
+ }
7104
+ exports.StructuredSource = StructuredSource;
7105
+ });
7106
+ // ../switchroom/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/SecretLintSourceCodeImpl.js
7107
+ var import_structured_source;
7108
+ var init_SecretLintSourceCodeImpl = __esm(() => {
7109
+ import_structured_source = __toESM(require_structured_source(), 1);
7098
7110
  });
7099
7111
 
7100
- // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
7101
- var util;
7102
- (function(util2) {
7103
- util2.assertEqual = (_) => {};
7104
- function assertIs(_arg) {}
7105
- util2.assertIs = assertIs;
7106
- function assertNever(_x) {
7107
- throw new Error;
7112
+ // ../switchroom/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/helper/promise-event-emitter.js
7113
+ class EventEmitter {
7114
+ #listeners = new Map;
7115
+ on(type, listener) {
7116
+ const prevSet = this.#listeners.get(type);
7117
+ const listenerSet = prevSet ?? new Set;
7118
+ listenerSet?.add(listener);
7119
+ this.#listeners.set(type, listenerSet);
7120
+ }
7121
+ emit(type, ...args) {
7122
+ const listenerSet = this.#listeners.get(type);
7123
+ if (!listenerSet) {
7124
+ return;
7125
+ }
7126
+ for (const listenerSetElement of listenerSet) {
7127
+ listenerSetElement(...args);
7128
+ }
7108
7129
  }
7109
- util2.assertNever = assertNever;
7110
- util2.arrayToEnum = (items) => {
7111
- const obj = {};
7112
- for (const item of items) {
7113
- obj[item] = item;
7130
+ off(type, listener) {
7131
+ const listenerSet = this.#listeners.get(type);
7132
+ if (!listenerSet) {
7133
+ return;
7114
7134
  }
7115
- return obj;
7116
- };
7117
- util2.getValidEnumValues = (obj) => {
7118
- const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
7119
- const filtered = {};
7120
- for (const k of validKeys) {
7121
- filtered[k] = obj[k];
7135
+ for (const listenerSetElement of listenerSet) {
7136
+ if (listenerSetElement === listener) {
7137
+ listenerSet.delete(listener);
7138
+ }
7122
7139
  }
7123
- return util2.objectValues(filtered);
7124
- };
7125
- util2.objectValues = (obj) => {
7126
- return util2.objectKeys(obj).map(function(e) {
7127
- return obj[e];
7140
+ }
7141
+ removeAllListeners() {
7142
+ this.#listeners.clear();
7143
+ }
7144
+ listenerCount(type) {
7145
+ return this.#listeners.get(type)?.size ?? 0;
7146
+ }
7147
+ listeners(type) {
7148
+ return Array.from(this.#listeners.get(type) ?? []);
7149
+ }
7150
+ }
7151
+ // ../switchroom/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RuleContext.js
7152
+ var init_RuleContext = () => {};
7153
+ // ../switchroom/node_modules/.bun/@secretlint+profiler@12.2.0/node_modules/@secretlint/profiler/module/index.js
7154
+ class SecretLintProfiler {
7155
+ perf;
7156
+ entries = [];
7157
+ measures = [];
7158
+ executionPromises = [];
7159
+ constructor(options) {
7160
+ this.perf = options.perf;
7161
+ const pattern = /(.*?)::end(\|\|.*)?/;
7162
+ const observer = new options.PerformanceObserver((items) => {
7163
+ const entries = items.getEntries();
7164
+ entries.forEach((entry) => {
7165
+ if (entry.entryType === "mark") {
7166
+ const match = entry.name.match(pattern);
7167
+ const endIdentifier = match ? match[1] : undefined;
7168
+ const suffix = match && match[2] ? match[2] : "";
7169
+ if (endIdentifier) {
7170
+ const startIdentifier = `${endIdentifier}::start`;
7171
+ this.entries.find((savedEntry) => {
7172
+ return savedEntry.name === startIdentifier;
7173
+ });
7174
+ if (startIdentifier) {
7175
+ this.executionPromises.push(Promise.resolve().then(() => {
7176
+ this.perf.measure(endIdentifier + suffix, `${endIdentifier}::start${suffix}`, `${endIdentifier}::end${suffix}`);
7177
+ }));
7178
+ }
7179
+ }
7180
+ this.entries.push(entry);
7181
+ } else if (entry.entryType === "measure") {
7182
+ this.measures.push(entry);
7183
+ }
7184
+ });
7128
7185
  });
7129
- };
7130
- util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
7131
- const keys = [];
7132
- for (const key in object) {
7133
- if (Object.prototype.hasOwnProperty.call(object, key)) {
7134
- keys.push(key);
7135
- }
7186
+ observer.observe({ entryTypes: ["mark", "measure"] });
7187
+ }
7188
+ mark(marker) {
7189
+ if ("id" in marker) {
7190
+ this.perf.mark(`${marker.type}||${marker.id}`);
7191
+ } else {
7192
+ this.perf.mark(marker.type);
7136
7193
  }
7137
- return keys;
7194
+ }
7195
+ waifForExecutionPromises = () => {
7196
+ return Promise.all(this.executionPromises).finally(() => {
7197
+ this.executionPromises.length = 0;
7198
+ });
7138
7199
  };
7139
- util2.find = (arr, checker) => {
7140
- for (const item of arr) {
7200
+ async getEntries() {
7201
+ await this.waifForExecutionPromises();
7202
+ return this.entries;
7203
+ }
7204
+ async getMeasures() {
7205
+ await this.waifForExecutionPromises();
7206
+ return this.measures;
7207
+ }
7208
+ }
7209
+
7210
+ // ../switchroom/node_modules/.bun/@secretlint+profiler@12.2.0/node_modules/@secretlint/profiler/module/node.js
7211
+ import perf_hooks from "node:perf_hooks";
7212
+
7213
+ class NullPerformanceObserver {
7214
+ disconnect() {}
7215
+ observe(_options) {}
7216
+ }
7217
+ var secretLintProfiler;
7218
+ var init_node = __esm(() => {
7219
+ secretLintProfiler = new SecretLintProfiler({
7220
+ perf: perf_hooks.performance,
7221
+ PerformanceObserver: perf_hooks.PerformanceObserver ? perf_hooks.PerformanceObserver : NullPerformanceObserver
7222
+ });
7223
+ });
7224
+
7225
+ // ../switchroom/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RunningEvents.js
7226
+ var init_RunningEvents = __esm(() => {
7227
+ init_node();
7228
+ });
7229
+
7230
+ // ../switchroom/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RulePresetContext.js
7231
+ var init_RulePresetContext = __esm(() => {
7232
+ init_RuleContext();
7233
+ });
7234
+ // ../switchroom/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/messages/index.js
7235
+ var init_messages = () => {};
7236
+
7237
+ // ../switchroom/node_modules/.bun/ms@2.1.3/node_modules/ms/index.js
7238
+ var require_ms = __commonJS((exports, module) => {
7239
+ var s = 1000;
7240
+ var m = s * 60;
7241
+ var h = m * 60;
7242
+ var d = h * 24;
7243
+ var w = d * 7;
7244
+ var y = d * 365.25;
7245
+ module.exports = function(val, options) {
7246
+ options = options || {};
7247
+ var type = typeof val;
7248
+ if (type === "string" && val.length > 0) {
7249
+ return parse(val);
7250
+ } else if (type === "number" && isFinite(val)) {
7251
+ return options.long ? fmtLong(val) : fmtShort(val);
7252
+ }
7253
+ throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
7254
+ };
7255
+ function parse(str) {
7256
+ str = String(str);
7257
+ if (str.length > 100) {
7258
+ return;
7259
+ }
7260
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
7261
+ if (!match) {
7262
+ return;
7263
+ }
7264
+ var n = parseFloat(match[1]);
7265
+ var type = (match[2] || "ms").toLowerCase();
7266
+ switch (type) {
7267
+ case "years":
7268
+ case "year":
7269
+ case "yrs":
7270
+ case "yr":
7271
+ case "y":
7272
+ return n * y;
7273
+ case "weeks":
7274
+ case "week":
7275
+ case "w":
7276
+ return n * w;
7277
+ case "days":
7278
+ case "day":
7279
+ case "d":
7280
+ return n * d;
7281
+ case "hours":
7282
+ case "hour":
7283
+ case "hrs":
7284
+ case "hr":
7285
+ case "h":
7286
+ return n * h;
7287
+ case "minutes":
7288
+ case "minute":
7289
+ case "mins":
7290
+ case "min":
7291
+ case "m":
7292
+ return n * m;
7293
+ case "seconds":
7294
+ case "second":
7295
+ case "secs":
7296
+ case "sec":
7297
+ case "s":
7298
+ return n * s;
7299
+ case "milliseconds":
7300
+ case "millisecond":
7301
+ case "msecs":
7302
+ case "msec":
7303
+ case "ms":
7304
+ return n;
7305
+ default:
7306
+ return;
7307
+ }
7308
+ }
7309
+ function fmtShort(ms) {
7310
+ var msAbs = Math.abs(ms);
7311
+ if (msAbs >= d) {
7312
+ return Math.round(ms / d) + "d";
7313
+ }
7314
+ if (msAbs >= h) {
7315
+ return Math.round(ms / h) + "h";
7316
+ }
7317
+ if (msAbs >= m) {
7318
+ return Math.round(ms / m) + "m";
7319
+ }
7320
+ if (msAbs >= s) {
7321
+ return Math.round(ms / s) + "s";
7322
+ }
7323
+ return ms + "ms";
7324
+ }
7325
+ function fmtLong(ms) {
7326
+ var msAbs = Math.abs(ms);
7327
+ if (msAbs >= d) {
7328
+ return plural(ms, msAbs, d, "day");
7329
+ }
7330
+ if (msAbs >= h) {
7331
+ return plural(ms, msAbs, h, "hour");
7332
+ }
7333
+ if (msAbs >= m) {
7334
+ return plural(ms, msAbs, m, "minute");
7335
+ }
7336
+ if (msAbs >= s) {
7337
+ return plural(ms, msAbs, s, "second");
7338
+ }
7339
+ return ms + " ms";
7340
+ }
7341
+ function plural(ms, msAbs, n, name) {
7342
+ var isPlural = msAbs >= n * 1.5;
7343
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
7344
+ }
7345
+ });
7346
+
7347
+ // ../switchroom/node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js
7348
+ var require_common = __commonJS((exports, module) => {
7349
+ function setup(env) {
7350
+ createDebug.debug = createDebug;
7351
+ createDebug.default = createDebug;
7352
+ createDebug.coerce = coerce2;
7353
+ createDebug.disable = disable;
7354
+ createDebug.enable = enable;
7355
+ createDebug.enabled = enabled;
7356
+ createDebug.humanize = require_ms();
7357
+ createDebug.destroy = destroy;
7358
+ Object.keys(env).forEach((key) => {
7359
+ createDebug[key] = env[key];
7360
+ });
7361
+ createDebug.names = [];
7362
+ createDebug.skips = [];
7363
+ createDebug.formatters = {};
7364
+ function selectColor(namespace) {
7365
+ let hash = 0;
7366
+ for (let i = 0;i < namespace.length; i++) {
7367
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
7368
+ hash |= 0;
7369
+ }
7370
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
7371
+ }
7372
+ createDebug.selectColor = selectColor;
7373
+ function createDebug(namespace) {
7374
+ let prevTime;
7375
+ let enableOverride = null;
7376
+ let namespacesCache;
7377
+ let enabledCache;
7378
+ function debug(...args) {
7379
+ if (!debug.enabled) {
7380
+ return;
7381
+ }
7382
+ const self2 = debug;
7383
+ const curr = Number(new Date);
7384
+ const ms = curr - (prevTime || curr);
7385
+ self2.diff = ms;
7386
+ self2.prev = prevTime;
7387
+ self2.curr = curr;
7388
+ prevTime = curr;
7389
+ args[0] = createDebug.coerce(args[0]);
7390
+ if (typeof args[0] !== "string") {
7391
+ args.unshift("%O");
7392
+ }
7393
+ let index = 0;
7394
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
7395
+ if (match === "%%") {
7396
+ return "%";
7397
+ }
7398
+ index++;
7399
+ const formatter = createDebug.formatters[format];
7400
+ if (typeof formatter === "function") {
7401
+ const val = args[index];
7402
+ match = formatter.call(self2, val);
7403
+ args.splice(index, 1);
7404
+ index--;
7405
+ }
7406
+ return match;
7407
+ });
7408
+ createDebug.formatArgs.call(self2, args);
7409
+ const logFn = self2.log || createDebug.log;
7410
+ logFn.apply(self2, args);
7411
+ }
7412
+ debug.namespace = namespace;
7413
+ debug.useColors = createDebug.useColors();
7414
+ debug.color = createDebug.selectColor(namespace);
7415
+ debug.extend = extend;
7416
+ debug.destroy = createDebug.destroy;
7417
+ Object.defineProperty(debug, "enabled", {
7418
+ enumerable: true,
7419
+ configurable: false,
7420
+ get: () => {
7421
+ if (enableOverride !== null) {
7422
+ return enableOverride;
7423
+ }
7424
+ if (namespacesCache !== createDebug.namespaces) {
7425
+ namespacesCache = createDebug.namespaces;
7426
+ enabledCache = createDebug.enabled(namespace);
7427
+ }
7428
+ return enabledCache;
7429
+ },
7430
+ set: (v) => {
7431
+ enableOverride = v;
7432
+ }
7433
+ });
7434
+ if (typeof createDebug.init === "function") {
7435
+ createDebug.init(debug);
7436
+ }
7437
+ return debug;
7438
+ }
7439
+ function extend(namespace, delimiter) {
7440
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
7441
+ newDebug.log = this.log;
7442
+ return newDebug;
7443
+ }
7444
+ function enable(namespaces) {
7445
+ createDebug.save(namespaces);
7446
+ createDebug.namespaces = namespaces;
7447
+ createDebug.names = [];
7448
+ createDebug.skips = [];
7449
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
7450
+ for (const ns of split) {
7451
+ if (ns[0] === "-") {
7452
+ createDebug.skips.push(ns.slice(1));
7453
+ } else {
7454
+ createDebug.names.push(ns);
7455
+ }
7456
+ }
7457
+ }
7458
+ function matchesTemplate(search, template) {
7459
+ let searchIndex = 0;
7460
+ let templateIndex = 0;
7461
+ let starIndex = -1;
7462
+ let matchIndex = 0;
7463
+ while (searchIndex < search.length) {
7464
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
7465
+ if (template[templateIndex] === "*") {
7466
+ starIndex = templateIndex;
7467
+ matchIndex = searchIndex;
7468
+ templateIndex++;
7469
+ } else {
7470
+ searchIndex++;
7471
+ templateIndex++;
7472
+ }
7473
+ } else if (starIndex !== -1) {
7474
+ templateIndex = starIndex + 1;
7475
+ matchIndex++;
7476
+ searchIndex = matchIndex;
7477
+ } else {
7478
+ return false;
7479
+ }
7480
+ }
7481
+ while (templateIndex < template.length && template[templateIndex] === "*") {
7482
+ templateIndex++;
7483
+ }
7484
+ return templateIndex === template.length;
7485
+ }
7486
+ function disable() {
7487
+ const namespaces = [
7488
+ ...createDebug.names,
7489
+ ...createDebug.skips.map((namespace) => "-" + namespace)
7490
+ ].join(",");
7491
+ createDebug.enable("");
7492
+ return namespaces;
7493
+ }
7494
+ function enabled(name) {
7495
+ for (const skip of createDebug.skips) {
7496
+ if (matchesTemplate(name, skip)) {
7497
+ return false;
7498
+ }
7499
+ }
7500
+ for (const ns of createDebug.names) {
7501
+ if (matchesTemplate(name, ns)) {
7502
+ return true;
7503
+ }
7504
+ }
7505
+ return false;
7506
+ }
7507
+ function coerce2(val) {
7508
+ if (val instanceof Error) {
7509
+ return val.stack || val.message;
7510
+ }
7511
+ return val;
7512
+ }
7513
+ function destroy() {
7514
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
7515
+ }
7516
+ createDebug.enable(createDebug.load());
7517
+ return createDebug;
7518
+ }
7519
+ module.exports = setup;
7520
+ });
7521
+
7522
+ // ../switchroom/node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js
7523
+ var require_browser = __commonJS((exports, module) => {
7524
+ exports.formatArgs = formatArgs;
7525
+ exports.save = save;
7526
+ exports.load = load;
7527
+ exports.useColors = useColors;
7528
+ exports.storage = localstorage();
7529
+ exports.destroy = (() => {
7530
+ let warned = false;
7531
+ return () => {
7532
+ if (!warned) {
7533
+ warned = true;
7534
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
7535
+ }
7536
+ };
7537
+ })();
7538
+ exports.colors = [
7539
+ "#0000CC",
7540
+ "#0000FF",
7541
+ "#0033CC",
7542
+ "#0033FF",
7543
+ "#0066CC",
7544
+ "#0066FF",
7545
+ "#0099CC",
7546
+ "#0099FF",
7547
+ "#00CC00",
7548
+ "#00CC33",
7549
+ "#00CC66",
7550
+ "#00CC99",
7551
+ "#00CCCC",
7552
+ "#00CCFF",
7553
+ "#3300CC",
7554
+ "#3300FF",
7555
+ "#3333CC",
7556
+ "#3333FF",
7557
+ "#3366CC",
7558
+ "#3366FF",
7559
+ "#3399CC",
7560
+ "#3399FF",
7561
+ "#33CC00",
7562
+ "#33CC33",
7563
+ "#33CC66",
7564
+ "#33CC99",
7565
+ "#33CCCC",
7566
+ "#33CCFF",
7567
+ "#6600CC",
7568
+ "#6600FF",
7569
+ "#6633CC",
7570
+ "#6633FF",
7571
+ "#66CC00",
7572
+ "#66CC33",
7573
+ "#9900CC",
7574
+ "#9900FF",
7575
+ "#9933CC",
7576
+ "#9933FF",
7577
+ "#99CC00",
7578
+ "#99CC33",
7579
+ "#CC0000",
7580
+ "#CC0033",
7581
+ "#CC0066",
7582
+ "#CC0099",
7583
+ "#CC00CC",
7584
+ "#CC00FF",
7585
+ "#CC3300",
7586
+ "#CC3333",
7587
+ "#CC3366",
7588
+ "#CC3399",
7589
+ "#CC33CC",
7590
+ "#CC33FF",
7591
+ "#CC6600",
7592
+ "#CC6633",
7593
+ "#CC9900",
7594
+ "#CC9933",
7595
+ "#CCCC00",
7596
+ "#CCCC33",
7597
+ "#FF0000",
7598
+ "#FF0033",
7599
+ "#FF0066",
7600
+ "#FF0099",
7601
+ "#FF00CC",
7602
+ "#FF00FF",
7603
+ "#FF3300",
7604
+ "#FF3333",
7605
+ "#FF3366",
7606
+ "#FF3399",
7607
+ "#FF33CC",
7608
+ "#FF33FF",
7609
+ "#FF6600",
7610
+ "#FF6633",
7611
+ "#FF9900",
7612
+ "#FF9933",
7613
+ "#FFCC00",
7614
+ "#FFCC33"
7615
+ ];
7616
+ function useColors() {
7617
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
7618
+ return true;
7619
+ }
7620
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
7621
+ return false;
7622
+ }
7623
+ let m;
7624
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
7625
+ }
7626
+ function formatArgs(args) {
7627
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
7628
+ if (!this.useColors) {
7629
+ return;
7630
+ }
7631
+ const c = "color: " + this.color;
7632
+ args.splice(1, 0, c, "color: inherit");
7633
+ let index = 0;
7634
+ let lastC = 0;
7635
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
7636
+ if (match === "%%") {
7637
+ return;
7638
+ }
7639
+ index++;
7640
+ if (match === "%c") {
7641
+ lastC = index;
7642
+ }
7643
+ });
7644
+ args.splice(lastC, 0, c);
7645
+ }
7646
+ exports.log = console.debug || console.log || (() => {});
7647
+ function save(namespaces) {
7648
+ try {
7649
+ if (namespaces) {
7650
+ exports.storage.setItem("debug", namespaces);
7651
+ } else {
7652
+ exports.storage.removeItem("debug");
7653
+ }
7654
+ } catch (error) {}
7655
+ }
7656
+ function load() {
7657
+ let r;
7658
+ try {
7659
+ r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
7660
+ } catch (error) {}
7661
+ if (!r && typeof process !== "undefined" && "env" in process) {
7662
+ r = process.env.DEBUG;
7663
+ }
7664
+ return r;
7665
+ }
7666
+ function localstorage() {
7667
+ try {
7668
+ return localStorage;
7669
+ } catch (error) {}
7670
+ }
7671
+ module.exports = require_common()(exports);
7672
+ var { formatters } = module.exports;
7673
+ formatters.j = function(v) {
7674
+ try {
7675
+ return JSON.stringify(v);
7676
+ } catch (error) {
7677
+ return "[UnexpectedJSONParseError]: " + error.message;
7678
+ }
7679
+ };
7680
+ });
7681
+
7682
+ // ../switchroom/node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js
7683
+ var require_has_flag = __commonJS((exports, module) => {
7684
+ module.exports = (flag, argv = process.argv) => {
7685
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
7686
+ const position = argv.indexOf(prefix + flag);
7687
+ const terminatorPosition = argv.indexOf("--");
7688
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
7689
+ };
7690
+ });
7691
+
7692
+ // ../switchroom/node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js
7693
+ var require_supports_color = __commonJS((exports, module) => {
7694
+ var os = __require("os");
7695
+ var tty = __require("tty");
7696
+ var hasFlag = require_has_flag();
7697
+ var { env } = process;
7698
+ var forceColor;
7699
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
7700
+ forceColor = 0;
7701
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
7702
+ forceColor = 1;
7703
+ }
7704
+ if ("FORCE_COLOR" in env) {
7705
+ if (env.FORCE_COLOR === "true") {
7706
+ forceColor = 1;
7707
+ } else if (env.FORCE_COLOR === "false") {
7708
+ forceColor = 0;
7709
+ } else {
7710
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
7711
+ }
7712
+ }
7713
+ function translateLevel(level) {
7714
+ if (level === 0) {
7715
+ return false;
7716
+ }
7717
+ return {
7718
+ level,
7719
+ hasBasic: true,
7720
+ has256: level >= 2,
7721
+ has16m: level >= 3
7722
+ };
7723
+ }
7724
+ function supportsColor(haveStream, streamIsTTY) {
7725
+ if (forceColor === 0) {
7726
+ return 0;
7727
+ }
7728
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
7729
+ return 3;
7730
+ }
7731
+ if (hasFlag("color=256")) {
7732
+ return 2;
7733
+ }
7734
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
7735
+ return 0;
7736
+ }
7737
+ const min = forceColor || 0;
7738
+ if (env.TERM === "dumb") {
7739
+ return min;
7740
+ }
7741
+ if (process.platform === "win32") {
7742
+ const osRelease = os.release().split(".");
7743
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7744
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
7745
+ }
7746
+ return 1;
7747
+ }
7748
+ if ("CI" in env) {
7749
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
7750
+ return 1;
7751
+ }
7752
+ return min;
7753
+ }
7754
+ if ("TEAMCITY_VERSION" in env) {
7755
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
7756
+ }
7757
+ if (env.COLORTERM === "truecolor") {
7758
+ return 3;
7759
+ }
7760
+ if ("TERM_PROGRAM" in env) {
7761
+ const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
7762
+ switch (env.TERM_PROGRAM) {
7763
+ case "iTerm.app":
7764
+ return version >= 3 ? 3 : 2;
7765
+ case "Apple_Terminal":
7766
+ return 2;
7767
+ }
7768
+ }
7769
+ if (/-256(color)?$/i.test(env.TERM)) {
7770
+ return 2;
7771
+ }
7772
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
7773
+ return 1;
7774
+ }
7775
+ if ("COLORTERM" in env) {
7776
+ return 1;
7777
+ }
7778
+ return min;
7779
+ }
7780
+ function getSupportLevel(stream) {
7781
+ const level = supportsColor(stream, stream && stream.isTTY);
7782
+ return translateLevel(level);
7783
+ }
7784
+ module.exports = {
7785
+ supportsColor: getSupportLevel,
7786
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
7787
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
7788
+ };
7789
+ });
7790
+
7791
+ // ../switchroom/node_modules/.bun/debug@4.4.3/node_modules/debug/src/node.js
7792
+ var require_node = __commonJS((exports, module) => {
7793
+ var tty = __require("tty");
7794
+ var util3 = __require("util");
7795
+ exports.init = init;
7796
+ exports.log = log;
7797
+ exports.formatArgs = formatArgs;
7798
+ exports.save = save;
7799
+ exports.load = load;
7800
+ exports.useColors = useColors;
7801
+ exports.destroy = util3.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
7802
+ exports.colors = [6, 2, 3, 4, 5, 1];
7803
+ try {
7804
+ const supportsColor = require_supports_color();
7805
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
7806
+ exports.colors = [
7807
+ 20,
7808
+ 21,
7809
+ 26,
7810
+ 27,
7811
+ 32,
7812
+ 33,
7813
+ 38,
7814
+ 39,
7815
+ 40,
7816
+ 41,
7817
+ 42,
7818
+ 43,
7819
+ 44,
7820
+ 45,
7821
+ 56,
7822
+ 57,
7823
+ 62,
7824
+ 63,
7825
+ 68,
7826
+ 69,
7827
+ 74,
7828
+ 75,
7829
+ 76,
7830
+ 77,
7831
+ 78,
7832
+ 79,
7833
+ 80,
7834
+ 81,
7835
+ 92,
7836
+ 93,
7837
+ 98,
7838
+ 99,
7839
+ 112,
7840
+ 113,
7841
+ 128,
7842
+ 129,
7843
+ 134,
7844
+ 135,
7845
+ 148,
7846
+ 149,
7847
+ 160,
7848
+ 161,
7849
+ 162,
7850
+ 163,
7851
+ 164,
7852
+ 165,
7853
+ 166,
7854
+ 167,
7855
+ 168,
7856
+ 169,
7857
+ 170,
7858
+ 171,
7859
+ 172,
7860
+ 173,
7861
+ 178,
7862
+ 179,
7863
+ 184,
7864
+ 185,
7865
+ 196,
7866
+ 197,
7867
+ 198,
7868
+ 199,
7869
+ 200,
7870
+ 201,
7871
+ 202,
7872
+ 203,
7873
+ 204,
7874
+ 205,
7875
+ 206,
7876
+ 207,
7877
+ 208,
7878
+ 209,
7879
+ 214,
7880
+ 215,
7881
+ 220,
7882
+ 221
7883
+ ];
7884
+ }
7885
+ } catch (error) {}
7886
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
7887
+ return /^debug_/i.test(key);
7888
+ }).reduce((obj, key) => {
7889
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
7890
+ return k.toUpperCase();
7891
+ });
7892
+ let val = process.env[key];
7893
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
7894
+ val = true;
7895
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
7896
+ val = false;
7897
+ } else if (val === "null") {
7898
+ val = null;
7899
+ } else {
7900
+ val = Number(val);
7901
+ }
7902
+ obj[prop] = val;
7903
+ return obj;
7904
+ }, {});
7905
+ function useColors() {
7906
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
7907
+ }
7908
+ function formatArgs(args) {
7909
+ const { namespace: name, useColors: useColors2 } = this;
7910
+ if (useColors2) {
7911
+ const c = this.color;
7912
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
7913
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
7914
+ args[0] = prefix + args[0].split(`
7915
+ `).join(`
7916
+ ` + prefix);
7917
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
7918
+ } else {
7919
+ args[0] = getDate() + name + " " + args[0];
7920
+ }
7921
+ }
7922
+ function getDate() {
7923
+ if (exports.inspectOpts.hideDate) {
7924
+ return "";
7925
+ }
7926
+ return new Date().toISOString() + " ";
7927
+ }
7928
+ function log(...args) {
7929
+ return process.stderr.write(util3.formatWithOptions(exports.inspectOpts, ...args) + `
7930
+ `);
7931
+ }
7932
+ function save(namespaces) {
7933
+ if (namespaces) {
7934
+ process.env.DEBUG = namespaces;
7935
+ } else {
7936
+ delete process.env.DEBUG;
7937
+ }
7938
+ }
7939
+ function load() {
7940
+ return process.env.DEBUG;
7941
+ }
7942
+ function init(debug) {
7943
+ debug.inspectOpts = {};
7944
+ const keys = Object.keys(exports.inspectOpts);
7945
+ for (let i = 0;i < keys.length; i++) {
7946
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
7947
+ }
7948
+ }
7949
+ module.exports = require_common()(exports);
7950
+ var { formatters } = module.exports;
7951
+ formatters.o = function(v) {
7952
+ this.inspectOpts.colors = this.useColors;
7953
+ return util3.inspect(v, this.inspectOpts).split(`
7954
+ `).map((str) => str.trim()).join(" ");
7955
+ };
7956
+ formatters.O = function(v) {
7957
+ this.inspectOpts.colors = this.useColors;
7958
+ return util3.inspect(v, this.inspectOpts);
7959
+ };
7960
+ });
7961
+
7962
+ // ../switchroom/node_modules/.bun/debug@4.4.3/node_modules/debug/src/index.js
7963
+ var require_src = __commonJS((exports, module) => {
7964
+ if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
7965
+ module.exports = require_browser();
7966
+ } else {
7967
+ module.exports = require_node();
7968
+ }
7969
+ });
7970
+
7971
+ // ../switchroom/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/index.js
7972
+ var import_debug, debug;
7973
+ var init_module = __esm(() => {
7974
+ init_SecretLintSourceCodeImpl();
7975
+ init_RuleContext();
7976
+ init_RunningEvents();
7977
+ init_node();
7978
+ init_RulePresetContext();
7979
+ init_messages();
7980
+ import_debug = __toESM(require_src(), 1);
7981
+ debug = import_debug.default("@secretlint/core");
7982
+ });
7983
+
7984
+ // ../switchroom/node_modules/.bun/@secretlint+secretlint-rule-preset-recommend@12.2.0/node_modules/@secretlint/secretlint-rule-preset-recommend/module/index.js
7985
+ function requireLodash_uniq() {
7986
+ if (hasRequiredLodash_uniq)
7987
+ return lodash_uniq;
7988
+ hasRequiredLodash_uniq = 1;
7989
+ var LARGE_ARRAY_SIZE = 200;
7990
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
7991
+ var INFINITY = 1 / 0;
7992
+ var funcTag = "[object Function]", genTag = "[object GeneratorFunction]";
7993
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
7994
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
7995
+ var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
7996
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
7997
+ var root = freeGlobal || freeSelf || Function("return this")();
7998
+ function arrayIncludes(array, value) {
7999
+ var length = array ? array.length : 0;
8000
+ return !!length && baseIndexOf(array, value, 0) > -1;
8001
+ }
8002
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
8003
+ var length = array.length, index = fromIndex + -1;
8004
+ while (++index < length) {
8005
+ if (predicate(array[index], index, array)) {
8006
+ return index;
8007
+ }
8008
+ }
8009
+ return -1;
8010
+ }
8011
+ function baseIndexOf(array, value, fromIndex) {
8012
+ if (value !== value) {
8013
+ return baseFindIndex(array, baseIsNaN, fromIndex);
8014
+ }
8015
+ var index = fromIndex - 1, length = array.length;
8016
+ while (++index < length) {
8017
+ if (array[index] === value) {
8018
+ return index;
8019
+ }
8020
+ }
8021
+ return -1;
8022
+ }
8023
+ function baseIsNaN(value) {
8024
+ return value !== value;
8025
+ }
8026
+ function cacheHas(cache, key) {
8027
+ return cache.has(key);
8028
+ }
8029
+ function getValue(object, key) {
8030
+ return object == null ? undefined : object[key];
8031
+ }
8032
+ function isHostObject(value) {
8033
+ var result = false;
8034
+ if (value != null && typeof value.toString != "function") {
8035
+ try {
8036
+ result = !!(value + "");
8037
+ } catch (e) {}
8038
+ }
8039
+ return result;
8040
+ }
8041
+ function setToArray(set) {
8042
+ var index = -1, result = Array(set.size);
8043
+ set.forEach(function(value) {
8044
+ result[++index] = value;
8045
+ });
8046
+ return result;
8047
+ }
8048
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
8049
+ var coreJsData = root["__core-js_shared__"];
8050
+ var maskSrcKey = function() {
8051
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
8052
+ return uid ? "Symbol(src)_1." + uid : "";
8053
+ }();
8054
+ var funcToString = funcProto.toString;
8055
+ var hasOwnProperty = objectProto.hasOwnProperty;
8056
+ var objectToString = objectProto.toString;
8057
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
8058
+ var splice = arrayProto.splice;
8059
+ var Map2 = getNative(root, "Map"), Set2 = getNative(root, "Set"), nativeCreate = getNative(Object, "create");
8060
+ function Hash(entries) {
8061
+ var index = -1, length = entries ? entries.length : 0;
8062
+ this.clear();
8063
+ while (++index < length) {
8064
+ var entry = entries[index];
8065
+ this.set(entry[0], entry[1]);
8066
+ }
8067
+ }
8068
+ function hashClear() {
8069
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
8070
+ }
8071
+ function hashDelete(key) {
8072
+ return this.has(key) && delete this.__data__[key];
8073
+ }
8074
+ function hashGet(key) {
8075
+ var data = this.__data__;
8076
+ if (nativeCreate) {
8077
+ var result = data[key];
8078
+ return result === HASH_UNDEFINED ? undefined : result;
8079
+ }
8080
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
8081
+ }
8082
+ function hashHas(key) {
8083
+ var data = this.__data__;
8084
+ return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
8085
+ }
8086
+ function hashSet(key, value) {
8087
+ var data = this.__data__;
8088
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
8089
+ return this;
8090
+ }
8091
+ Hash.prototype.clear = hashClear;
8092
+ Hash.prototype["delete"] = hashDelete;
8093
+ Hash.prototype.get = hashGet;
8094
+ Hash.prototype.has = hashHas;
8095
+ Hash.prototype.set = hashSet;
8096
+ function ListCache(entries) {
8097
+ var index = -1, length = entries ? entries.length : 0;
8098
+ this.clear();
8099
+ while (++index < length) {
8100
+ var entry = entries[index];
8101
+ this.set(entry[0], entry[1]);
8102
+ }
8103
+ }
8104
+ function listCacheClear() {
8105
+ this.__data__ = [];
8106
+ }
8107
+ function listCacheDelete(key) {
8108
+ var data = this.__data__, index = assocIndexOf(data, key);
8109
+ if (index < 0) {
8110
+ return false;
8111
+ }
8112
+ var lastIndex = data.length - 1;
8113
+ if (index == lastIndex) {
8114
+ data.pop();
8115
+ } else {
8116
+ splice.call(data, index, 1);
8117
+ }
8118
+ return true;
8119
+ }
8120
+ function listCacheGet(key) {
8121
+ var data = this.__data__, index = assocIndexOf(data, key);
8122
+ return index < 0 ? undefined : data[index][1];
8123
+ }
8124
+ function listCacheHas(key) {
8125
+ return assocIndexOf(this.__data__, key) > -1;
8126
+ }
8127
+ function listCacheSet(key, value) {
8128
+ var data = this.__data__, index = assocIndexOf(data, key);
8129
+ if (index < 0) {
8130
+ data.push([key, value]);
8131
+ } else {
8132
+ data[index][1] = value;
8133
+ }
8134
+ return this;
8135
+ }
8136
+ ListCache.prototype.clear = listCacheClear;
8137
+ ListCache.prototype["delete"] = listCacheDelete;
8138
+ ListCache.prototype.get = listCacheGet;
8139
+ ListCache.prototype.has = listCacheHas;
8140
+ ListCache.prototype.set = listCacheSet;
8141
+ function MapCache(entries) {
8142
+ var index = -1, length = entries ? entries.length : 0;
8143
+ this.clear();
8144
+ while (++index < length) {
8145
+ var entry = entries[index];
8146
+ this.set(entry[0], entry[1]);
8147
+ }
8148
+ }
8149
+ function mapCacheClear() {
8150
+ this.__data__ = {
8151
+ hash: new Hash,
8152
+ map: new (Map2 || ListCache),
8153
+ string: new Hash
8154
+ };
8155
+ }
8156
+ function mapCacheDelete(key) {
8157
+ return getMapData(this, key)["delete"](key);
8158
+ }
8159
+ function mapCacheGet(key) {
8160
+ return getMapData(this, key).get(key);
8161
+ }
8162
+ function mapCacheHas(key) {
8163
+ return getMapData(this, key).has(key);
8164
+ }
8165
+ function mapCacheSet(key, value) {
8166
+ getMapData(this, key).set(key, value);
8167
+ return this;
8168
+ }
8169
+ MapCache.prototype.clear = mapCacheClear;
8170
+ MapCache.prototype["delete"] = mapCacheDelete;
8171
+ MapCache.prototype.get = mapCacheGet;
8172
+ MapCache.prototype.has = mapCacheHas;
8173
+ MapCache.prototype.set = mapCacheSet;
8174
+ function SetCache(values) {
8175
+ var index = -1, length = values ? values.length : 0;
8176
+ this.__data__ = new MapCache;
8177
+ while (++index < length) {
8178
+ this.add(values[index]);
8179
+ }
8180
+ }
8181
+ function setCacheAdd(value) {
8182
+ this.__data__.set(value, HASH_UNDEFINED);
8183
+ return this;
8184
+ }
8185
+ function setCacheHas(value) {
8186
+ return this.__data__.has(value);
8187
+ }
8188
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
8189
+ SetCache.prototype.has = setCacheHas;
8190
+ function assocIndexOf(array, key) {
8191
+ var length = array.length;
8192
+ while (length--) {
8193
+ if (eq(array[length][0], key)) {
8194
+ return length;
8195
+ }
8196
+ }
8197
+ return -1;
8198
+ }
8199
+ function baseIsNative(value) {
8200
+ if (!isObject(value) || isMasked(value)) {
8201
+ return false;
8202
+ }
8203
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
8204
+ return pattern.test(toSource(value));
8205
+ }
8206
+ function baseUniq(array, iteratee, comparator) {
8207
+ var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
8208
+ if (length >= LARGE_ARRAY_SIZE) {
8209
+ var set = createSet(array);
8210
+ if (set) {
8211
+ return setToArray(set);
8212
+ }
8213
+ isCommon = false;
8214
+ includes = cacheHas;
8215
+ seen = new SetCache;
8216
+ } else {
8217
+ seen = result;
8218
+ }
8219
+ outer:
8220
+ while (++index < length) {
8221
+ var value = array[index], computed = value;
8222
+ value = value !== 0 ? value : 0;
8223
+ if (isCommon && computed === computed) {
8224
+ var seenIndex = seen.length;
8225
+ while (seenIndex--) {
8226
+ if (seen[seenIndex] === computed) {
8227
+ continue outer;
8228
+ }
8229
+ }
8230
+ result.push(value);
8231
+ } else if (!includes(seen, computed, comparator)) {
8232
+ if (seen !== result) {
8233
+ seen.push(computed);
8234
+ }
8235
+ result.push(value);
8236
+ }
8237
+ }
8238
+ return result;
8239
+ }
8240
+ var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
8241
+ return new Set2(values);
8242
+ };
8243
+ function getMapData(map, key) {
8244
+ var data = map.__data__;
8245
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
8246
+ }
8247
+ function getNative(object, key) {
8248
+ var value = getValue(object, key);
8249
+ return baseIsNative(value) ? value : undefined;
8250
+ }
8251
+ function isKeyable(value) {
8252
+ var type = typeof value;
8253
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
8254
+ }
8255
+ function isMasked(func) {
8256
+ return !!maskSrcKey && maskSrcKey in func;
8257
+ }
8258
+ function toSource(func) {
8259
+ if (func != null) {
8260
+ try {
8261
+ return funcToString.call(func);
8262
+ } catch (e) {}
8263
+ try {
8264
+ return func + "";
8265
+ } catch (e) {}
8266
+ }
8267
+ return "";
8268
+ }
8269
+ function uniq(array) {
8270
+ return array && array.length ? baseUniq(array) : [];
8271
+ }
8272
+ function eq(value, other) {
8273
+ return value === other || value !== value && other !== other;
8274
+ }
8275
+ function isFunction(value) {
8276
+ var tag = isObject(value) ? objectToString.call(value) : "";
8277
+ return tag == funcTag || tag == genTag;
8278
+ }
8279
+ function isObject(value) {
8280
+ var type = typeof value;
8281
+ return !!value && (type == "object" || type == "function");
8282
+ }
8283
+ function noop() {}
8284
+ lodash_uniq = uniq;
8285
+ return lodash_uniq;
8286
+ }
8287
+ function requireLodash_uniqwith() {
8288
+ if (hasRequiredLodash_uniqwith)
8289
+ return lodash_uniqwith;
8290
+ hasRequiredLodash_uniqwith = 1;
8291
+ var LARGE_ARRAY_SIZE = 200;
8292
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
8293
+ var INFINITY = 1 / 0;
8294
+ var funcTag = "[object Function]", genTag = "[object GeneratorFunction]";
8295
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
8296
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
8297
+ var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
8298
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
8299
+ var root = freeGlobal || freeSelf || Function("return this")();
8300
+ function arrayIncludes(array, value) {
8301
+ var length = array ? array.length : 0;
8302
+ return !!length && baseIndexOf(array, value, 0) > -1;
8303
+ }
8304
+ function arrayIncludesWith(array, value, comparator) {
8305
+ var index = -1, length = array ? array.length : 0;
8306
+ while (++index < length) {
8307
+ if (comparator(value, array[index])) {
8308
+ return true;
8309
+ }
8310
+ }
8311
+ return false;
8312
+ }
8313
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
8314
+ var length = array.length, index = fromIndex + -1;
8315
+ while (++index < length) {
8316
+ if (predicate(array[index], index, array)) {
8317
+ return index;
8318
+ }
8319
+ }
8320
+ return -1;
8321
+ }
8322
+ function baseIndexOf(array, value, fromIndex) {
8323
+ if (value !== value) {
8324
+ return baseFindIndex(array, baseIsNaN, fromIndex);
8325
+ }
8326
+ var index = fromIndex - 1, length = array.length;
8327
+ while (++index < length) {
8328
+ if (array[index] === value) {
8329
+ return index;
8330
+ }
8331
+ }
8332
+ return -1;
8333
+ }
8334
+ function baseIsNaN(value) {
8335
+ return value !== value;
8336
+ }
8337
+ function cacheHas(cache, key) {
8338
+ return cache.has(key);
8339
+ }
8340
+ function getValue(object, key) {
8341
+ return object == null ? undefined : object[key];
8342
+ }
8343
+ function isHostObject(value) {
8344
+ var result = false;
8345
+ if (value != null && typeof value.toString != "function") {
8346
+ try {
8347
+ result = !!(value + "");
8348
+ } catch (e) {}
8349
+ }
8350
+ return result;
8351
+ }
8352
+ function setToArray(set) {
8353
+ var index = -1, result = Array(set.size);
8354
+ set.forEach(function(value) {
8355
+ result[++index] = value;
8356
+ });
8357
+ return result;
8358
+ }
8359
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
8360
+ var coreJsData = root["__core-js_shared__"];
8361
+ var maskSrcKey = function() {
8362
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
8363
+ return uid ? "Symbol(src)_1." + uid : "";
8364
+ }();
8365
+ var funcToString = funcProto.toString;
8366
+ var hasOwnProperty = objectProto.hasOwnProperty;
8367
+ var objectToString = objectProto.toString;
8368
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
8369
+ var splice = arrayProto.splice;
8370
+ var Map2 = getNative(root, "Map"), Set2 = getNative(root, "Set"), nativeCreate = getNative(Object, "create");
8371
+ function Hash(entries) {
8372
+ var index = -1, length = entries ? entries.length : 0;
8373
+ this.clear();
8374
+ while (++index < length) {
8375
+ var entry = entries[index];
8376
+ this.set(entry[0], entry[1]);
8377
+ }
8378
+ }
8379
+ function hashClear() {
8380
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
8381
+ }
8382
+ function hashDelete(key) {
8383
+ return this.has(key) && delete this.__data__[key];
8384
+ }
8385
+ function hashGet(key) {
8386
+ var data = this.__data__;
8387
+ if (nativeCreate) {
8388
+ var result = data[key];
8389
+ return result === HASH_UNDEFINED ? undefined : result;
8390
+ }
8391
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
8392
+ }
8393
+ function hashHas(key) {
8394
+ var data = this.__data__;
8395
+ return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
8396
+ }
8397
+ function hashSet(key, value) {
8398
+ var data = this.__data__;
8399
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
8400
+ return this;
8401
+ }
8402
+ Hash.prototype.clear = hashClear;
8403
+ Hash.prototype["delete"] = hashDelete;
8404
+ Hash.prototype.get = hashGet;
8405
+ Hash.prototype.has = hashHas;
8406
+ Hash.prototype.set = hashSet;
8407
+ function ListCache(entries) {
8408
+ var index = -1, length = entries ? entries.length : 0;
8409
+ this.clear();
8410
+ while (++index < length) {
8411
+ var entry = entries[index];
8412
+ this.set(entry[0], entry[1]);
8413
+ }
8414
+ }
8415
+ function listCacheClear() {
8416
+ this.__data__ = [];
8417
+ }
8418
+ function listCacheDelete(key) {
8419
+ var data = this.__data__, index = assocIndexOf(data, key);
8420
+ if (index < 0) {
8421
+ return false;
8422
+ }
8423
+ var lastIndex = data.length - 1;
8424
+ if (index == lastIndex) {
8425
+ data.pop();
8426
+ } else {
8427
+ splice.call(data, index, 1);
8428
+ }
8429
+ return true;
8430
+ }
8431
+ function listCacheGet(key) {
8432
+ var data = this.__data__, index = assocIndexOf(data, key);
8433
+ return index < 0 ? undefined : data[index][1];
8434
+ }
8435
+ function listCacheHas(key) {
8436
+ return assocIndexOf(this.__data__, key) > -1;
8437
+ }
8438
+ function listCacheSet(key, value) {
8439
+ var data = this.__data__, index = assocIndexOf(data, key);
8440
+ if (index < 0) {
8441
+ data.push([key, value]);
8442
+ } else {
8443
+ data[index][1] = value;
8444
+ }
8445
+ return this;
8446
+ }
8447
+ ListCache.prototype.clear = listCacheClear;
8448
+ ListCache.prototype["delete"] = listCacheDelete;
8449
+ ListCache.prototype.get = listCacheGet;
8450
+ ListCache.prototype.has = listCacheHas;
8451
+ ListCache.prototype.set = listCacheSet;
8452
+ function MapCache(entries) {
8453
+ var index = -1, length = entries ? entries.length : 0;
8454
+ this.clear();
8455
+ while (++index < length) {
8456
+ var entry = entries[index];
8457
+ this.set(entry[0], entry[1]);
8458
+ }
8459
+ }
8460
+ function mapCacheClear() {
8461
+ this.__data__ = {
8462
+ hash: new Hash,
8463
+ map: new (Map2 || ListCache),
8464
+ string: new Hash
8465
+ };
8466
+ }
8467
+ function mapCacheDelete(key) {
8468
+ return getMapData(this, key)["delete"](key);
8469
+ }
8470
+ function mapCacheGet(key) {
8471
+ return getMapData(this, key).get(key);
8472
+ }
8473
+ function mapCacheHas(key) {
8474
+ return getMapData(this, key).has(key);
8475
+ }
8476
+ function mapCacheSet(key, value) {
8477
+ getMapData(this, key).set(key, value);
8478
+ return this;
8479
+ }
8480
+ MapCache.prototype.clear = mapCacheClear;
8481
+ MapCache.prototype["delete"] = mapCacheDelete;
8482
+ MapCache.prototype.get = mapCacheGet;
8483
+ MapCache.prototype.has = mapCacheHas;
8484
+ MapCache.prototype.set = mapCacheSet;
8485
+ function SetCache(values) {
8486
+ var index = -1, length = values ? values.length : 0;
8487
+ this.__data__ = new MapCache;
8488
+ while (++index < length) {
8489
+ this.add(values[index]);
8490
+ }
8491
+ }
8492
+ function setCacheAdd(value) {
8493
+ this.__data__.set(value, HASH_UNDEFINED);
8494
+ return this;
8495
+ }
8496
+ function setCacheHas(value) {
8497
+ return this.__data__.has(value);
8498
+ }
8499
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
8500
+ SetCache.prototype.has = setCacheHas;
8501
+ function assocIndexOf(array, key) {
8502
+ var length = array.length;
8503
+ while (length--) {
8504
+ if (eq(array[length][0], key)) {
8505
+ return length;
8506
+ }
8507
+ }
8508
+ return -1;
8509
+ }
8510
+ function baseIsNative(value) {
8511
+ if (!isObject(value) || isMasked(value)) {
8512
+ return false;
8513
+ }
8514
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
8515
+ return pattern.test(toSource(value));
8516
+ }
8517
+ function baseUniq(array, iteratee, comparator) {
8518
+ var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
8519
+ if (comparator) {
8520
+ isCommon = false;
8521
+ includes = arrayIncludesWith;
8522
+ } else if (length >= LARGE_ARRAY_SIZE) {
8523
+ var set = createSet(array);
8524
+ if (set) {
8525
+ return setToArray(set);
8526
+ }
8527
+ isCommon = false;
8528
+ includes = cacheHas;
8529
+ seen = new SetCache;
8530
+ } else {
8531
+ seen = result;
8532
+ }
8533
+ outer:
8534
+ while (++index < length) {
8535
+ var value = array[index], computed = value;
8536
+ value = comparator || value !== 0 ? value : 0;
8537
+ if (isCommon && computed === computed) {
8538
+ var seenIndex = seen.length;
8539
+ while (seenIndex--) {
8540
+ if (seen[seenIndex] === computed) {
8541
+ continue outer;
8542
+ }
8543
+ }
8544
+ result.push(value);
8545
+ } else if (!includes(seen, computed, comparator)) {
8546
+ if (seen !== result) {
8547
+ seen.push(computed);
8548
+ }
8549
+ result.push(value);
8550
+ }
8551
+ }
8552
+ return result;
8553
+ }
8554
+ var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
8555
+ return new Set2(values);
8556
+ };
8557
+ function getMapData(map, key) {
8558
+ var data = map.__data__;
8559
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
8560
+ }
8561
+ function getNative(object, key) {
8562
+ var value = getValue(object, key);
8563
+ return baseIsNative(value) ? value : undefined;
8564
+ }
8565
+ function isKeyable(value) {
8566
+ var type = typeof value;
8567
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
8568
+ }
8569
+ function isMasked(func) {
8570
+ return !!maskSrcKey && maskSrcKey in func;
8571
+ }
8572
+ function toSource(func) {
8573
+ if (func != null) {
8574
+ try {
8575
+ return funcToString.call(func);
8576
+ } catch (e) {}
8577
+ try {
8578
+ return func + "";
8579
+ } catch (e) {}
8580
+ }
8581
+ return "";
8582
+ }
8583
+ function uniqWith(array, comparator) {
8584
+ return array && array.length ? baseUniq(array, undefined, comparator) : [];
8585
+ }
8586
+ function eq(value, other) {
8587
+ return value === other || value !== value && other !== other;
8588
+ }
8589
+ function isFunction(value) {
8590
+ var tag = isObject(value) ? objectToString.call(value) : "";
8591
+ return tag == funcTag || tag == genTag;
8592
+ }
8593
+ function isObject(value) {
8594
+ var type = typeof value;
8595
+ return !!value && (type == "object" || type == "function");
8596
+ }
8597
+ function noop() {}
8598
+ lodash_uniqwith = uniqWith;
8599
+ return lodash_uniqwith;
8600
+ }
8601
+ function requireLodash_sortby() {
8602
+ if (hasRequiredLodash_sortby)
8603
+ return lodash_sortby.exports;
8604
+ hasRequiredLodash_sortby = 1;
8605
+ (function(module, exports$1) {
8606
+ var LARGE_ARRAY_SIZE = 200;
8607
+ var FUNC_ERROR_TEXT = "Expected a function";
8608
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
8609
+ var UNORDERED_COMPARE_FLAG = 1, PARTIAL_COMPARE_FLAG = 2;
8610
+ var MAX_SAFE_INTEGER = 9007199254740991;
8611
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
8612
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
8613
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
8614
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
8615
+ var reEscapeChar = /\\(\\)?/g;
8616
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
8617
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
8618
+ var typedArrayTags = {};
8619
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
8620
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
8621
+ var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
8622
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
8623
+ var root = freeGlobal || freeSelf || Function("return this")();
8624
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
8625
+ var freeModule = freeExports && true && module && !module.nodeType && module;
8626
+ var moduleExports = freeModule && freeModule.exports === freeExports;
8627
+ var freeProcess = moduleExports && freeGlobal.process;
8628
+ var nodeUtil = function() {
8629
+ try {
8630
+ return freeProcess && freeProcess.binding("util");
8631
+ } catch (e) {}
8632
+ }();
8633
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
8634
+ function apply(func, thisArg, args) {
8635
+ switch (args.length) {
8636
+ case 0:
8637
+ return func.call(thisArg);
8638
+ case 1:
8639
+ return func.call(thisArg, args[0]);
8640
+ case 2:
8641
+ return func.call(thisArg, args[0], args[1]);
8642
+ case 3:
8643
+ return func.call(thisArg, args[0], args[1], args[2]);
8644
+ }
8645
+ return func.apply(thisArg, args);
8646
+ }
8647
+ function arrayMap(array, iteratee) {
8648
+ var index = -1, length = array ? array.length : 0, result = Array(length);
8649
+ while (++index < length) {
8650
+ result[index] = iteratee(array[index], index, array);
8651
+ }
8652
+ return result;
8653
+ }
8654
+ function arrayPush(array, values) {
8655
+ var index = -1, length = values.length, offset = array.length;
8656
+ while (++index < length) {
8657
+ array[offset + index] = values[index];
8658
+ }
8659
+ return array;
8660
+ }
8661
+ function arraySome(array, predicate) {
8662
+ var index = -1, length = array ? array.length : 0;
8663
+ while (++index < length) {
8664
+ if (predicate(array[index], index, array)) {
8665
+ return true;
8666
+ }
8667
+ }
8668
+ return false;
8669
+ }
8670
+ function baseProperty(key) {
8671
+ return function(object) {
8672
+ return object == null ? undefined : object[key];
8673
+ };
8674
+ }
8675
+ function baseSortBy(array, comparer) {
8676
+ var length = array.length;
8677
+ array.sort(comparer);
8678
+ while (length--) {
8679
+ array[length] = array[length].value;
8680
+ }
8681
+ return array;
8682
+ }
8683
+ function baseTimes(n, iteratee) {
8684
+ var index = -1, result = Array(n);
8685
+ while (++index < n) {
8686
+ result[index] = iteratee(index);
8687
+ }
8688
+ return result;
8689
+ }
8690
+ function baseUnary(func) {
8691
+ return function(value) {
8692
+ return func(value);
8693
+ };
8694
+ }
8695
+ function getValue(object, key) {
8696
+ return object == null ? undefined : object[key];
8697
+ }
8698
+ function isHostObject(value) {
8699
+ var result = false;
8700
+ if (value != null && typeof value.toString != "function") {
8701
+ try {
8702
+ result = !!(value + "");
8703
+ } catch (e) {}
8704
+ }
8705
+ return result;
8706
+ }
8707
+ function mapToArray(map) {
8708
+ var index = -1, result = Array(map.size);
8709
+ map.forEach(function(value, key) {
8710
+ result[++index] = [key, value];
8711
+ });
8712
+ return result;
8713
+ }
8714
+ function overArg(func, transform) {
8715
+ return function(arg) {
8716
+ return func(transform(arg));
8717
+ };
8718
+ }
8719
+ function setToArray(set) {
8720
+ var index = -1, result = Array(set.size);
8721
+ set.forEach(function(value) {
8722
+ result[++index] = value;
8723
+ });
8724
+ return result;
8725
+ }
8726
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
8727
+ var coreJsData = root["__core-js_shared__"];
8728
+ var maskSrcKey = function() {
8729
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
8730
+ return uid ? "Symbol(src)_1." + uid : "";
8731
+ }();
8732
+ var funcToString = funcProto.toString;
8733
+ var hasOwnProperty = objectProto.hasOwnProperty;
8734
+ var objectToString = objectProto.toString;
8735
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
8736
+ var { Symbol: Symbol2, Uint8Array: Uint8Array2 } = root, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined;
8737
+ var nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max;
8738
+ var DataView2 = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap2 = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
8739
+ var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
8740
+ var symbolProto = Symbol2 ? Symbol2.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined;
8741
+ function Hash(entries) {
8742
+ var index = -1, length = entries ? entries.length : 0;
8743
+ this.clear();
8744
+ while (++index < length) {
8745
+ var entry = entries[index];
8746
+ this.set(entry[0], entry[1]);
8747
+ }
8748
+ }
8749
+ function hashClear() {
8750
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
8751
+ }
8752
+ function hashDelete(key) {
8753
+ return this.has(key) && delete this.__data__[key];
8754
+ }
8755
+ function hashGet(key) {
8756
+ var data = this.__data__;
8757
+ if (nativeCreate) {
8758
+ var result = data[key];
8759
+ return result === HASH_UNDEFINED ? undefined : result;
8760
+ }
8761
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
8762
+ }
8763
+ function hashHas(key) {
8764
+ var data = this.__data__;
8765
+ return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
8766
+ }
8767
+ function hashSet(key, value) {
8768
+ var data = this.__data__;
8769
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
8770
+ return this;
8771
+ }
8772
+ Hash.prototype.clear = hashClear;
8773
+ Hash.prototype["delete"] = hashDelete;
8774
+ Hash.prototype.get = hashGet;
8775
+ Hash.prototype.has = hashHas;
8776
+ Hash.prototype.set = hashSet;
8777
+ function ListCache(entries) {
8778
+ var index = -1, length = entries ? entries.length : 0;
8779
+ this.clear();
8780
+ while (++index < length) {
8781
+ var entry = entries[index];
8782
+ this.set(entry[0], entry[1]);
8783
+ }
8784
+ }
8785
+ function listCacheClear() {
8786
+ this.__data__ = [];
8787
+ }
8788
+ function listCacheDelete(key) {
8789
+ var data = this.__data__, index = assocIndexOf(data, key);
8790
+ if (index < 0) {
8791
+ return false;
8792
+ }
8793
+ var lastIndex = data.length - 1;
8794
+ if (index == lastIndex) {
8795
+ data.pop();
8796
+ } else {
8797
+ splice.call(data, index, 1);
8798
+ }
8799
+ return true;
8800
+ }
8801
+ function listCacheGet(key) {
8802
+ var data = this.__data__, index = assocIndexOf(data, key);
8803
+ return index < 0 ? undefined : data[index][1];
8804
+ }
8805
+ function listCacheHas(key) {
8806
+ return assocIndexOf(this.__data__, key) > -1;
8807
+ }
8808
+ function listCacheSet(key, value) {
8809
+ var data = this.__data__, index = assocIndexOf(data, key);
8810
+ if (index < 0) {
8811
+ data.push([key, value]);
8812
+ } else {
8813
+ data[index][1] = value;
8814
+ }
8815
+ return this;
8816
+ }
8817
+ ListCache.prototype.clear = listCacheClear;
8818
+ ListCache.prototype["delete"] = listCacheDelete;
8819
+ ListCache.prototype.get = listCacheGet;
8820
+ ListCache.prototype.has = listCacheHas;
8821
+ ListCache.prototype.set = listCacheSet;
8822
+ function MapCache(entries) {
8823
+ var index = -1, length = entries ? entries.length : 0;
8824
+ this.clear();
8825
+ while (++index < length) {
8826
+ var entry = entries[index];
8827
+ this.set(entry[0], entry[1]);
8828
+ }
8829
+ }
8830
+ function mapCacheClear() {
8831
+ this.__data__ = {
8832
+ hash: new Hash,
8833
+ map: new (Map2 || ListCache),
8834
+ string: new Hash
8835
+ };
8836
+ }
8837
+ function mapCacheDelete(key) {
8838
+ return getMapData(this, key)["delete"](key);
8839
+ }
8840
+ function mapCacheGet(key) {
8841
+ return getMapData(this, key).get(key);
8842
+ }
8843
+ function mapCacheHas(key) {
8844
+ return getMapData(this, key).has(key);
8845
+ }
8846
+ function mapCacheSet(key, value) {
8847
+ getMapData(this, key).set(key, value);
8848
+ return this;
8849
+ }
8850
+ MapCache.prototype.clear = mapCacheClear;
8851
+ MapCache.prototype["delete"] = mapCacheDelete;
8852
+ MapCache.prototype.get = mapCacheGet;
8853
+ MapCache.prototype.has = mapCacheHas;
8854
+ MapCache.prototype.set = mapCacheSet;
8855
+ function SetCache(values) {
8856
+ var index = -1, length = values ? values.length : 0;
8857
+ this.__data__ = new MapCache;
8858
+ while (++index < length) {
8859
+ this.add(values[index]);
8860
+ }
8861
+ }
8862
+ function setCacheAdd(value) {
8863
+ this.__data__.set(value, HASH_UNDEFINED);
8864
+ return this;
8865
+ }
8866
+ function setCacheHas(value) {
8867
+ return this.__data__.has(value);
8868
+ }
8869
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
8870
+ SetCache.prototype.has = setCacheHas;
8871
+ function Stack(entries) {
8872
+ this.__data__ = new ListCache(entries);
8873
+ }
8874
+ function stackClear() {
8875
+ this.__data__ = new ListCache;
8876
+ }
8877
+ function stackDelete(key) {
8878
+ return this.__data__["delete"](key);
8879
+ }
8880
+ function stackGet(key) {
8881
+ return this.__data__.get(key);
8882
+ }
8883
+ function stackHas(key) {
8884
+ return this.__data__.has(key);
8885
+ }
8886
+ function stackSet(key, value) {
8887
+ var cache = this.__data__;
8888
+ if (cache instanceof ListCache) {
8889
+ var pairs = cache.__data__;
8890
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
8891
+ pairs.push([key, value]);
8892
+ return this;
8893
+ }
8894
+ cache = this.__data__ = new MapCache(pairs);
8895
+ }
8896
+ cache.set(key, value);
8897
+ return this;
8898
+ }
8899
+ Stack.prototype.clear = stackClear;
8900
+ Stack.prototype["delete"] = stackDelete;
8901
+ Stack.prototype.get = stackGet;
8902
+ Stack.prototype.has = stackHas;
8903
+ Stack.prototype.set = stackSet;
8904
+ function arrayLikeKeys(value, inherited) {
8905
+ var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
8906
+ var length = result.length, skipIndexes = !!length;
8907
+ for (var key in value) {
8908
+ if (hasOwnProperty.call(value, key) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
8909
+ result.push(key);
8910
+ }
8911
+ }
8912
+ return result;
8913
+ }
8914
+ function assocIndexOf(array, key) {
8915
+ var length = array.length;
8916
+ while (length--) {
8917
+ if (eq(array[length][0], key)) {
8918
+ return length;
8919
+ }
8920
+ }
8921
+ return -1;
8922
+ }
8923
+ var baseEach = createBaseEach(baseForOwn);
8924
+ function baseFlatten(array, depth, predicate, isStrict, result) {
8925
+ var index = -1, length = array.length;
8926
+ predicate || (predicate = isFlattenable);
8927
+ result || (result = []);
8928
+ while (++index < length) {
8929
+ var value = array[index];
8930
+ if (predicate(value)) {
8931
+ {
8932
+ arrayPush(result, value);
8933
+ }
8934
+ } else {
8935
+ result[result.length] = value;
8936
+ }
8937
+ }
8938
+ return result;
8939
+ }
8940
+ var baseFor = createBaseFor();
8941
+ function baseForOwn(object, iteratee) {
8942
+ return object && baseFor(object, iteratee, keys);
8943
+ }
8944
+ function baseGet(object, path) {
8945
+ path = isKey(path, object) ? [path] : castPath(path);
8946
+ var index = 0, length = path.length;
8947
+ while (object != null && index < length) {
8948
+ object = object[toKey(path[index++])];
8949
+ }
8950
+ return index && index == length ? object : undefined;
8951
+ }
8952
+ function baseGetTag(value) {
8953
+ return objectToString.call(value);
8954
+ }
8955
+ function baseHasIn(object, key) {
8956
+ return object != null && key in Object(object);
8957
+ }
8958
+ function baseIsEqual(value, other, customizer, bitmask, stack) {
8959
+ if (value === other) {
8960
+ return true;
8961
+ }
8962
+ if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
8963
+ return value !== value && other !== other;
8964
+ }
8965
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
8966
+ }
8967
+ function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
8968
+ var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag;
8969
+ if (!objIsArr) {
8970
+ objTag = getTag(object);
8971
+ objTag = objTag == argsTag ? objectTag : objTag;
8972
+ }
8973
+ if (!othIsArr) {
8974
+ othTag = getTag(other);
8975
+ othTag = othTag == argsTag ? objectTag : othTag;
8976
+ }
8977
+ var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag;
8978
+ if (isSameTag && !objIsObj) {
8979
+ stack || (stack = new Stack);
8980
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
8981
+ }
8982
+ if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
8983
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
8984
+ if (objIsWrapped || othIsWrapped) {
8985
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
8986
+ stack || (stack = new Stack);
8987
+ return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
8988
+ }
8989
+ }
8990
+ if (!isSameTag) {
8991
+ return false;
8992
+ }
8993
+ stack || (stack = new Stack);
8994
+ return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
8995
+ }
8996
+ function baseIsMatch(object, source, matchData, customizer) {
8997
+ var index = matchData.length, length = index;
8998
+ if (object == null) {
8999
+ return !length;
9000
+ }
9001
+ object = Object(object);
9002
+ while (index--) {
9003
+ var data = matchData[index];
9004
+ if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
9005
+ return false;
9006
+ }
9007
+ }
9008
+ while (++index < length) {
9009
+ data = matchData[index];
9010
+ var key = data[0], objValue = object[key], srcValue = data[1];
9011
+ if (data[2]) {
9012
+ if (objValue === undefined && !(key in object)) {
9013
+ return false;
9014
+ }
9015
+ } else {
9016
+ var stack = new Stack;
9017
+ var result;
9018
+ if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
9019
+ return false;
9020
+ }
9021
+ }
9022
+ }
9023
+ return true;
9024
+ }
9025
+ function baseIsNative(value) {
9026
+ if (!isObject(value) || isMasked(value)) {
9027
+ return false;
9028
+ }
9029
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
9030
+ return pattern.test(toSource(value));
9031
+ }
9032
+ function baseIsTypedArray(value) {
9033
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
9034
+ }
9035
+ function baseIteratee(value) {
9036
+ if (typeof value == "function") {
9037
+ return value;
9038
+ }
9039
+ if (value == null) {
9040
+ return identity2;
9041
+ }
9042
+ if (typeof value == "object") {
9043
+ return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
9044
+ }
9045
+ return property(value);
9046
+ }
9047
+ function baseKeys(object) {
9048
+ if (!isPrototype(object)) {
9049
+ return nativeKeys(object);
9050
+ }
9051
+ var result = [];
9052
+ for (var key in Object(object)) {
9053
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
9054
+ result.push(key);
9055
+ }
9056
+ }
9057
+ return result;
9058
+ }
9059
+ function baseMap(collection, iteratee) {
9060
+ var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
9061
+ baseEach(collection, function(value, key, collection2) {
9062
+ result[++index] = iteratee(value, key, collection2);
9063
+ });
9064
+ return result;
9065
+ }
9066
+ function baseMatches(source) {
9067
+ var matchData = getMatchData(source);
9068
+ if (matchData.length == 1 && matchData[0][2]) {
9069
+ return matchesStrictComparable(matchData[0][0], matchData[0][1]);
9070
+ }
9071
+ return function(object) {
9072
+ return object === source || baseIsMatch(object, source, matchData);
9073
+ };
9074
+ }
9075
+ function baseMatchesProperty(path, srcValue) {
9076
+ if (isKey(path) && isStrictComparable(srcValue)) {
9077
+ return matchesStrictComparable(toKey(path), srcValue);
9078
+ }
9079
+ return function(object) {
9080
+ var objValue = get(object, path);
9081
+ return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
9082
+ };
9083
+ }
9084
+ function baseOrderBy(collection, iteratees, orders) {
9085
+ var index = -1;
9086
+ iteratees = arrayMap(iteratees.length ? iteratees : [identity2], baseUnary(baseIteratee));
9087
+ var result = baseMap(collection, function(value, key, collection2) {
9088
+ var criteria = arrayMap(iteratees, function(iteratee) {
9089
+ return iteratee(value);
9090
+ });
9091
+ return { criteria, index: ++index, value };
9092
+ });
9093
+ return baseSortBy(result, function(object, other) {
9094
+ return compareMultiple(object, other, orders);
9095
+ });
9096
+ }
9097
+ function basePropertyDeep(path) {
9098
+ return function(object) {
9099
+ return baseGet(object, path);
9100
+ };
9101
+ }
9102
+ function baseRest(func, start) {
9103
+ start = nativeMax(start === undefined ? func.length - 1 : start, 0);
9104
+ return function() {
9105
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
9106
+ while (++index < length) {
9107
+ array[index] = args[start + index];
9108
+ }
9109
+ index = -1;
9110
+ var otherArgs = Array(start + 1);
9111
+ while (++index < start) {
9112
+ otherArgs[index] = args[index];
9113
+ }
9114
+ otherArgs[start] = array;
9115
+ return apply(func, this, otherArgs);
9116
+ };
9117
+ }
9118
+ function baseToString(value) {
9119
+ if (typeof value == "string") {
9120
+ return value;
9121
+ }
9122
+ if (isSymbol(value)) {
9123
+ return symbolToString ? symbolToString.call(value) : "";
9124
+ }
9125
+ var result = value + "";
9126
+ return result == "0" && 1 / value == -Infinity ? "-0" : result;
9127
+ }
9128
+ function castPath(value) {
9129
+ return isArray(value) ? value : stringToPath(value);
9130
+ }
9131
+ function compareAscending(value, other) {
9132
+ if (value !== other) {
9133
+ var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
9134
+ var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
9135
+ if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
9136
+ return 1;
9137
+ }
9138
+ if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
9139
+ return -1;
9140
+ }
9141
+ }
9142
+ return 0;
9143
+ }
9144
+ function compareMultiple(object, other, orders) {
9145
+ var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
9146
+ while (++index < length) {
9147
+ var result = compareAscending(objCriteria[index], othCriteria[index]);
9148
+ if (result) {
9149
+ if (index >= ordersLength) {
9150
+ return result;
9151
+ }
9152
+ var order = orders[index];
9153
+ return result * (order == "desc" ? -1 : 1);
9154
+ }
9155
+ }
9156
+ return object.index - other.index;
9157
+ }
9158
+ function createBaseEach(eachFunc, fromRight) {
9159
+ return function(collection, iteratee) {
9160
+ if (collection == null) {
9161
+ return collection;
9162
+ }
9163
+ if (!isArrayLike(collection)) {
9164
+ return eachFunc(collection, iteratee);
9165
+ }
9166
+ var length = collection.length, index = -1, iterable = Object(collection);
9167
+ while (++index < length) {
9168
+ if (iteratee(iterable[index], index, iterable) === false) {
9169
+ break;
9170
+ }
9171
+ }
9172
+ return collection;
9173
+ };
9174
+ }
9175
+ function createBaseFor(fromRight) {
9176
+ return function(object, iteratee, keysFunc) {
9177
+ var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
9178
+ while (length--) {
9179
+ var key = props[++index];
9180
+ if (iteratee(iterable[key], key, iterable) === false) {
9181
+ break;
9182
+ }
9183
+ }
9184
+ return object;
9185
+ };
9186
+ }
9187
+ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
9188
+ var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length;
9189
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
9190
+ return false;
9191
+ }
9192
+ var stacked = stack.get(array);
9193
+ if (stacked && stack.get(other)) {
9194
+ return stacked == other;
9195
+ }
9196
+ var index = -1, result = true, seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache : undefined;
9197
+ stack.set(array, other);
9198
+ stack.set(other, array);
9199
+ while (++index < arrLength) {
9200
+ var arrValue = array[index], othValue = other[index];
9201
+ if (customizer) {
9202
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
9203
+ }
9204
+ if (compared !== undefined) {
9205
+ if (compared) {
9206
+ continue;
9207
+ }
9208
+ result = false;
9209
+ break;
9210
+ }
9211
+ if (seen) {
9212
+ if (!arraySome(other, function(othValue2, othIndex) {
9213
+ if (!seen.has(othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, customizer, bitmask, stack))) {
9214
+ return seen.add(othIndex);
9215
+ }
9216
+ })) {
9217
+ result = false;
9218
+ break;
9219
+ }
9220
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
9221
+ result = false;
9222
+ break;
9223
+ }
9224
+ }
9225
+ stack["delete"](array);
9226
+ stack["delete"](other);
9227
+ return result;
9228
+ }
9229
+ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
9230
+ switch (tag) {
9231
+ case dataViewTag:
9232
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
9233
+ return false;
9234
+ }
9235
+ object = object.buffer;
9236
+ other = other.buffer;
9237
+ case arrayBufferTag:
9238
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
9239
+ return false;
9240
+ }
9241
+ return true;
9242
+ case boolTag:
9243
+ case dateTag:
9244
+ case numberTag:
9245
+ return eq(+object, +other);
9246
+ case errorTag:
9247
+ return object.name == other.name && object.message == other.message;
9248
+ case regexpTag:
9249
+ case stringTag:
9250
+ return object == other + "";
9251
+ case mapTag:
9252
+ var convert = mapToArray;
9253
+ case setTag:
9254
+ var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
9255
+ convert || (convert = setToArray);
9256
+ if (object.size != other.size && !isPartial) {
9257
+ return false;
9258
+ }
9259
+ var stacked = stack.get(object);
9260
+ if (stacked) {
9261
+ return stacked == other;
9262
+ }
9263
+ bitmask |= UNORDERED_COMPARE_FLAG;
9264
+ stack.set(object, other);
9265
+ var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
9266
+ stack["delete"](object);
9267
+ return result;
9268
+ case symbolTag:
9269
+ if (symbolValueOf) {
9270
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
9271
+ }
9272
+ }
9273
+ return false;
9274
+ }
9275
+ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
9276
+ var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
9277
+ if (objLength != othLength && !isPartial) {
9278
+ return false;
9279
+ }
9280
+ var index = objLength;
9281
+ while (index--) {
9282
+ var key = objProps[index];
9283
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
9284
+ return false;
9285
+ }
9286
+ }
9287
+ var stacked = stack.get(object);
9288
+ if (stacked && stack.get(other)) {
9289
+ return stacked == other;
9290
+ }
9291
+ var result = true;
9292
+ stack.set(object, other);
9293
+ stack.set(other, object);
9294
+ var skipCtor = isPartial;
9295
+ while (++index < objLength) {
9296
+ key = objProps[index];
9297
+ var objValue = object[key], othValue = other[key];
9298
+ if (customizer) {
9299
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
9300
+ }
9301
+ if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
9302
+ result = false;
9303
+ break;
9304
+ }
9305
+ skipCtor || (skipCtor = key == "constructor");
9306
+ }
9307
+ if (result && !skipCtor) {
9308
+ var objCtor = object.constructor, othCtor = other.constructor;
9309
+ if (objCtor != othCtor && (("constructor" in object) && ("constructor" in other)) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
9310
+ result = false;
9311
+ }
9312
+ }
9313
+ stack["delete"](object);
9314
+ stack["delete"](other);
9315
+ return result;
9316
+ }
9317
+ function getMapData(map, key) {
9318
+ var data = map.__data__;
9319
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
9320
+ }
9321
+ function getMatchData(object) {
9322
+ var result = keys(object), length = result.length;
9323
+ while (length--) {
9324
+ var key = result[length], value = object[key];
9325
+ result[length] = [key, value, isStrictComparable(value)];
9326
+ }
9327
+ return result;
9328
+ }
9329
+ function getNative(object, key) {
9330
+ var value = getValue(object, key);
9331
+ return baseIsNative(value) ? value : undefined;
9332
+ }
9333
+ var getTag = baseGetTag;
9334
+ if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2) != setTag || WeakMap2 && getTag(new WeakMap2) != weakMapTag) {
9335
+ getTag = function(value) {
9336
+ var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : undefined;
9337
+ if (ctorString) {
9338
+ switch (ctorString) {
9339
+ case dataViewCtorString:
9340
+ return dataViewTag;
9341
+ case mapCtorString:
9342
+ return mapTag;
9343
+ case promiseCtorString:
9344
+ return promiseTag;
9345
+ case setCtorString:
9346
+ return setTag;
9347
+ case weakMapCtorString:
9348
+ return weakMapTag;
9349
+ }
9350
+ }
9351
+ return result;
9352
+ };
9353
+ }
9354
+ function hasPath(object, path, hasFunc) {
9355
+ path = isKey(path, object) ? [path] : castPath(path);
9356
+ var result, index = -1, length = path.length;
9357
+ while (++index < length) {
9358
+ var key = toKey(path[index]);
9359
+ if (!(result = object != null && hasFunc(object, key))) {
9360
+ break;
9361
+ }
9362
+ object = object[key];
9363
+ }
9364
+ if (result) {
9365
+ return result;
9366
+ }
9367
+ var length = object ? object.length : 0;
9368
+ return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
9369
+ }
9370
+ function isFlattenable(value) {
9371
+ return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
9372
+ }
9373
+ function isIndex(value, length) {
9374
+ length = length == null ? MAX_SAFE_INTEGER : length;
9375
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
9376
+ }
9377
+ function isIterateeCall(value, index, object) {
9378
+ if (!isObject(object)) {
9379
+ return false;
9380
+ }
9381
+ var type = typeof index;
9382
+ if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && (index in object)) {
9383
+ return eq(object[index], value);
9384
+ }
9385
+ return false;
9386
+ }
9387
+ function isKey(value, object) {
9388
+ if (isArray(value)) {
9389
+ return false;
9390
+ }
9391
+ var type = typeof value;
9392
+ if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
9393
+ return true;
9394
+ }
9395
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
9396
+ }
9397
+ function isKeyable(value) {
9398
+ var type = typeof value;
9399
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
9400
+ }
9401
+ function isMasked(func) {
9402
+ return !!maskSrcKey && maskSrcKey in func;
9403
+ }
9404
+ function isPrototype(value) {
9405
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
9406
+ return value === proto;
9407
+ }
9408
+ function isStrictComparable(value) {
9409
+ return value === value && !isObject(value);
9410
+ }
9411
+ function matchesStrictComparable(key, srcValue) {
9412
+ return function(object) {
9413
+ if (object == null) {
9414
+ return false;
9415
+ }
9416
+ return object[key] === srcValue && (srcValue !== undefined || (key in Object(object)));
9417
+ };
9418
+ }
9419
+ var stringToPath = memoize(function(string) {
9420
+ string = toString(string);
9421
+ var result = [];
9422
+ if (reLeadingDot.test(string)) {
9423
+ result.push("");
9424
+ }
9425
+ string.replace(rePropName, function(match, number, quote, string2) {
9426
+ result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match);
9427
+ });
9428
+ return result;
9429
+ });
9430
+ function toKey(value) {
9431
+ if (typeof value == "string" || isSymbol(value)) {
9432
+ return value;
9433
+ }
9434
+ var result = value + "";
9435
+ return result == "0" && 1 / value == -Infinity ? "-0" : result;
9436
+ }
9437
+ function toSource(func) {
9438
+ if (func != null) {
9439
+ try {
9440
+ return funcToString.call(func);
9441
+ } catch (e) {}
9442
+ try {
9443
+ return func + "";
9444
+ } catch (e) {}
9445
+ }
9446
+ return "";
9447
+ }
9448
+ var sortBy = baseRest(function(collection, iteratees) {
9449
+ if (collection == null) {
9450
+ return [];
9451
+ }
9452
+ var length = iteratees.length;
9453
+ if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
9454
+ iteratees = [];
9455
+ } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
9456
+ iteratees = [iteratees[0]];
9457
+ }
9458
+ return baseOrderBy(collection, baseFlatten(iteratees), []);
9459
+ });
9460
+ function memoize(func, resolver) {
9461
+ if (typeof func != "function" || resolver && typeof resolver != "function") {
9462
+ throw new TypeError(FUNC_ERROR_TEXT);
9463
+ }
9464
+ var memoized = function() {
9465
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
9466
+ if (cache.has(key)) {
9467
+ return cache.get(key);
9468
+ }
9469
+ var result = func.apply(this, args);
9470
+ memoized.cache = cache.set(key, result);
9471
+ return result;
9472
+ };
9473
+ memoized.cache = new (memoize.Cache || MapCache);
9474
+ return memoized;
9475
+ }
9476
+ memoize.Cache = MapCache;
9477
+ function eq(value, other) {
9478
+ return value === other || value !== value && other !== other;
9479
+ }
9480
+ function isArguments(value) {
9481
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
9482
+ }
9483
+ var isArray = Array.isArray;
9484
+ function isArrayLike(value) {
9485
+ return value != null && isLength(value.length) && !isFunction(value);
9486
+ }
9487
+ function isArrayLikeObject(value) {
9488
+ return isObjectLike(value) && isArrayLike(value);
9489
+ }
9490
+ function isFunction(value) {
9491
+ var tag = isObject(value) ? objectToString.call(value) : "";
9492
+ return tag == funcTag || tag == genTag;
9493
+ }
9494
+ function isLength(value) {
9495
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
9496
+ }
9497
+ function isObject(value) {
9498
+ var type = typeof value;
9499
+ return !!value && (type == "object" || type == "function");
9500
+ }
9501
+ function isObjectLike(value) {
9502
+ return !!value && typeof value == "object";
9503
+ }
9504
+ function isSymbol(value) {
9505
+ return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
9506
+ }
9507
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
9508
+ function toString(value) {
9509
+ return value == null ? "" : baseToString(value);
9510
+ }
9511
+ function get(object, path, defaultValue) {
9512
+ var result = object == null ? undefined : baseGet(object, path);
9513
+ return result === undefined ? defaultValue : result;
9514
+ }
9515
+ function hasIn(object, path) {
9516
+ return object != null && hasPath(object, path, baseHasIn);
9517
+ }
9518
+ function keys(object) {
9519
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
9520
+ }
9521
+ function identity2(value) {
9522
+ return value;
9523
+ }
9524
+ function property(path) {
9525
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
9526
+ }
9527
+ module.exports = sortBy;
9528
+ })(lodash_sortby, lodash_sortby.exports);
9529
+ return lodash_sortby.exports;
9530
+ }
9531
+ function requireEscapeStringRegexp() {
9532
+ if (hasRequiredEscapeStringRegexp)
9533
+ return escapeStringRegexp;
9534
+ hasRequiredEscapeStringRegexp = 1;
9535
+ escapeStringRegexp = (string) => {
9536
+ if (typeof string !== "string") {
9537
+ throw new TypeError("Expected a string");
9538
+ }
9539
+ return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
9540
+ };
9541
+ return escapeStringRegexp;
9542
+ }
9543
+ function requireRegexpParse() {
9544
+ if (hasRequiredRegexpParse)
9545
+ return regexpParse;
9546
+ hasRequiredRegexpParse = 1;
9547
+ Object.defineProperty(regexpParse, "__esModule", { value: true });
9548
+ regexpParse.isRegExpString = regexpParse.parseRegExpString = undefined;
9549
+ var REGEXP_LITERAL_PATTERN = /^\/(.+)\/([guimysd]*)$/;
9550
+ var parseRegExpString = function(str) {
9551
+ var result = str.match(REGEXP_LITERAL_PATTERN);
9552
+ if (!result) {
9553
+ return null;
9554
+ }
9555
+ return {
9556
+ source: result[1],
9557
+ flagString: result[2]
9558
+ };
9559
+ };
9560
+ regexpParse.parseRegExpString = parseRegExpString;
9561
+ var isRegExpString = function(str) {
9562
+ return REGEXP_LITERAL_PATTERN.test(str);
9563
+ };
9564
+ regexpParse.isRegExpString = isRegExpString;
9565
+ return regexpParse;
9566
+ }
9567
+ function requireRegexpStringMatcher() {
9568
+ if (hasRequiredRegexpStringMatcher)
9569
+ return regexpStringMatcher;
9570
+ hasRequiredRegexpStringMatcher = 1;
9571
+ (function(exports$1) {
9572
+ var __importDefault = regexpStringMatcher && regexpStringMatcher.__importDefault || function(mod) {
9573
+ return mod && mod.__esModule ? mod : { default: mod };
9574
+ };
9575
+ Object.defineProperty(exports$1, "__esModule", { value: true });
9576
+ exports$1.matchPatterns = exports$1.createRegExp = undefined;
9577
+ var lodash_uniq_1 = __importDefault(requireLodash_uniq());
9578
+ var lodash_uniqwith_1 = __importDefault(requireLodash_uniqwith());
9579
+ var lodash_sortby_1 = __importDefault(requireLodash_sortby());
9580
+ var escape_string_regexp_1 = __importDefault(requireEscapeStringRegexp());
9581
+ var regexp_parse_1 = requireRegexpParse();
9582
+ var DEFAULT_FLAGS = "ug";
9583
+ var defaultFlags = function(flagsString) {
9584
+ if (flagsString.length === 0) {
9585
+ return DEFAULT_FLAGS;
9586
+ }
9587
+ return (0, lodash_uniq_1.default)((flagsString + DEFAULT_FLAGS).split("")).join("");
9588
+ };
9589
+ var createRegExp = function(patternString, defaultFlag) {
9590
+ if (defaultFlag === undefined) {
9591
+ defaultFlag = DEFAULT_FLAGS;
9592
+ }
9593
+ if (patternString.length === 0) {
9594
+ throw new Error("Empty string can not handled");
9595
+ }
9596
+ if ((0, regexp_parse_1.isRegExpString)(patternString)) {
9597
+ var regExpStructure = (0, regexp_parse_1.parseRegExpString)(patternString);
9598
+ if (regExpStructure) {
9599
+ return new RegExp(regExpStructure.source, defaultFlags(regExpStructure.flagString));
9600
+ }
9601
+ throw new Error('"'.concat(patternString, '" can not parse as RegExp.'));
9602
+ } else {
9603
+ return new RegExp((0, escape_string_regexp_1.default)(patternString), defaultFlag);
9604
+ }
9605
+ };
9606
+ exports$1.createRegExp = createRegExp;
9607
+ var isEqualMatchPatternResult = function(a, b) {
9608
+ return a.startIndex === b.startIndex && a.endIndex === b.endIndex && a.match === b.match;
9609
+ };
9610
+ var matchPatterns = function(text, regExpLikeStrings) {
9611
+ var matchPatternResults = [];
9612
+ regExpLikeStrings.map(function(patternString) {
9613
+ return (0, exports$1.createRegExp)(patternString);
9614
+ }).forEach(function(regExp) {
9615
+ var results = text.matchAll(regExp);
9616
+ Array.from(results).forEach(function(result) {
9617
+ if (result.index === undefined) {
9618
+ return;
9619
+ }
9620
+ var match = result[0];
9621
+ var index = result.index;
9622
+ matchPatternResults.push({
9623
+ match,
9624
+ captures: result.slice(1),
9625
+ startIndex: index,
9626
+ endIndex: index + match.length
9627
+ });
9628
+ });
9629
+ });
9630
+ var uniqResults = (0, lodash_uniqwith_1.default)(matchPatternResults, isEqualMatchPatternResult);
9631
+ return (0, lodash_sortby_1.default)(uniqResults, ["startIndex", "endIndex"]);
9632
+ };
9633
+ exports$1.matchPatterns = matchPatterns;
9634
+ })(regexpStringMatcher);
9635
+ return regexpStringMatcher;
9636
+ }
9637
+ var commonjsGlobal, regexpStringMatcher, lodash_uniq, hasRequiredLodash_uniq, lodash_uniqwith, hasRequiredLodash_uniqwith, lodash_sortby, hasRequiredLodash_sortby, escapeStringRegexp, hasRequiredEscapeStringRegexp, regexpParse, hasRequiredRegexpParse, hasRequiredRegexpStringMatcher, regexpStringMatcherExports, OID_DATA, OID_SHA1, OID_SHA256, OID_SHA384, OID_SHA512, typeMap;
9638
+ var init_module2 = __esm(() => {
9639
+ commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
9640
+ regexpStringMatcher = {};
9641
+ lodash_sortby = { exports: {} };
9642
+ lodash_sortby.exports;
9643
+ regexpParse = {};
9644
+ regexpStringMatcherExports = requireRegexpStringMatcher();
9645
+ OID_DATA = new Uint8Array([42, 134, 72, 134, 247, 13, 1, 7, 1]);
9646
+ OID_SHA1 = new Uint8Array([43, 14, 3, 2, 26]);
9647
+ OID_SHA256 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 1]);
9648
+ OID_SHA384 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 2]);
9649
+ OID_SHA512 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 3]);
9650
+ typeMap = new Map([
9651
+ ["ghp", "GitHub personal access tokens"],
9652
+ ["gho", "OAuth access tokens"],
9653
+ ["ghu", "GitHub user-to-server tokens"],
9654
+ ["ghs", "GitHub server-to-server tokens"],
9655
+ ["ghr", "refresh tokens"],
9656
+ ["github_pat", "fine-grained personal access tokens"]
9657
+ ]);
9658
+ });
9659
+
9660
+ // telegram-plugin/secret-detect/secretlint-source.ts
9661
+ var init_secretlint_source = __esm(() => {
9662
+ init_module();
9663
+ init_module2();
9664
+ init_suppressor();
9665
+ });
9666
+
9667
+ // src/host-control/main.ts
9668
+ import { homedir as homedir3 } from "node:os";
9669
+
9670
+ // src/config/loader.ts
9671
+ import { readFileSync as readFileSync2, existsSync as existsSync3 } from "node:fs";
9672
+ import { homedir } from "node:os";
9673
+ import { resolve as resolve3 } from "node:path";
9674
+
9675
+ // ../switchroom/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/index.js
9676
+ var composer = require_composer();
9677
+ var Document = require_Document();
9678
+ var Schema = require_Schema();
9679
+ var errors = require_errors();
9680
+ var Alias = require_Alias();
9681
+ var identity = require_identity();
9682
+ var Pair = require_Pair();
9683
+ var Scalar = require_Scalar();
9684
+ var YAMLMap = require_YAMLMap();
9685
+ var YAMLSeq = require_YAMLSeq();
9686
+ var cst = require_cst();
9687
+ var lexer = require_lexer();
9688
+ var lineCounter = require_line_counter();
9689
+ var parser = require_parser();
9690
+ var publicApi = require_public_api();
9691
+ var visit = require_visit();
9692
+ var $Composer = composer.Composer;
9693
+ var $Document = Document.Document;
9694
+ var $Schema = Schema.Schema;
9695
+ var $YAMLError = errors.YAMLError;
9696
+ var $YAMLParseError = errors.YAMLParseError;
9697
+ var $YAMLWarning = errors.YAMLWarning;
9698
+ var $Alias = Alias.Alias;
9699
+ var $isAlias = identity.isAlias;
9700
+ var $isCollection = identity.isCollection;
9701
+ var $isDocument = identity.isDocument;
9702
+ var $isMap = identity.isMap;
9703
+ var $isNode = identity.isNode;
9704
+ var $isPair = identity.isPair;
9705
+ var $isScalar = identity.isScalar;
9706
+ var $isSeq = identity.isSeq;
9707
+ var $Pair = Pair.Pair;
9708
+ var $Scalar = Scalar.Scalar;
9709
+ var $YAMLMap = YAMLMap.YAMLMap;
9710
+ var $YAMLSeq = YAMLSeq.YAMLSeq;
9711
+ var $Lexer = lexer.Lexer;
9712
+ var $LineCounter = lineCounter.LineCounter;
9713
+ var $Parser = parser.Parser;
9714
+ var $parse = publicApi.parse;
9715
+ var $parseAllDocuments = publicApi.parseAllDocuments;
9716
+ var $parseDocument = publicApi.parseDocument;
9717
+ var $stringify = publicApi.stringify;
9718
+ var $visit = visit.visit;
9719
+ var $visitAsync = visit.visitAsync;
9720
+
9721
+ // ../switchroom/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
9722
+ var exports_external = {};
9723
+ __export(exports_external, {
9724
+ void: () => voidType,
9725
+ util: () => util,
9726
+ unknown: () => unknownType,
9727
+ union: () => unionType,
9728
+ undefined: () => undefinedType,
9729
+ tuple: () => tupleType,
9730
+ transformer: () => effectsType,
9731
+ symbol: () => symbolType,
9732
+ string: () => stringType,
9733
+ strictObject: () => strictObjectType,
9734
+ setErrorMap: () => setErrorMap,
9735
+ set: () => setType,
9736
+ record: () => recordType,
9737
+ quotelessJson: () => quotelessJson,
9738
+ promise: () => promiseType,
9739
+ preprocess: () => preprocessType,
9740
+ pipeline: () => pipelineType,
9741
+ ostring: () => ostring,
9742
+ optional: () => optionalType,
9743
+ onumber: () => onumber,
9744
+ oboolean: () => oboolean,
9745
+ objectUtil: () => objectUtil,
9746
+ object: () => objectType,
9747
+ number: () => numberType,
9748
+ nullable: () => nullableType,
9749
+ null: () => nullType,
9750
+ never: () => neverType,
9751
+ nativeEnum: () => nativeEnumType,
9752
+ nan: () => nanType,
9753
+ map: () => mapType,
9754
+ makeIssue: () => makeIssue,
9755
+ literal: () => literalType,
9756
+ lazy: () => lazyType,
9757
+ late: () => late,
9758
+ isValid: () => isValid,
9759
+ isDirty: () => isDirty,
9760
+ isAsync: () => isAsync,
9761
+ isAborted: () => isAborted,
9762
+ intersection: () => intersectionType,
9763
+ instanceof: () => instanceOfType,
9764
+ getParsedType: () => getParsedType,
9765
+ getErrorMap: () => getErrorMap,
9766
+ function: () => functionType,
9767
+ enum: () => enumType,
9768
+ effect: () => effectsType,
9769
+ discriminatedUnion: () => discriminatedUnionType,
9770
+ defaultErrorMap: () => en_default,
9771
+ datetimeRegex: () => datetimeRegex,
9772
+ date: () => dateType,
9773
+ custom: () => custom,
9774
+ coerce: () => coerce,
9775
+ boolean: () => booleanType,
9776
+ bigint: () => bigIntType,
9777
+ array: () => arrayType,
9778
+ any: () => anyType,
9779
+ addIssueToContext: () => addIssueToContext,
9780
+ ZodVoid: () => ZodVoid,
9781
+ ZodUnknown: () => ZodUnknown,
9782
+ ZodUnion: () => ZodUnion,
9783
+ ZodUndefined: () => ZodUndefined,
9784
+ ZodType: () => ZodType,
9785
+ ZodTuple: () => ZodTuple,
9786
+ ZodTransformer: () => ZodEffects,
9787
+ ZodSymbol: () => ZodSymbol,
9788
+ ZodString: () => ZodString,
9789
+ ZodSet: () => ZodSet,
9790
+ ZodSchema: () => ZodType,
9791
+ ZodRecord: () => ZodRecord,
9792
+ ZodReadonly: () => ZodReadonly,
9793
+ ZodPromise: () => ZodPromise,
9794
+ ZodPipeline: () => ZodPipeline,
9795
+ ZodParsedType: () => ZodParsedType,
9796
+ ZodOptional: () => ZodOptional,
9797
+ ZodObject: () => ZodObject,
9798
+ ZodNumber: () => ZodNumber,
9799
+ ZodNullable: () => ZodNullable,
9800
+ ZodNull: () => ZodNull,
9801
+ ZodNever: () => ZodNever,
9802
+ ZodNativeEnum: () => ZodNativeEnum,
9803
+ ZodNaN: () => ZodNaN,
9804
+ ZodMap: () => ZodMap,
9805
+ ZodLiteral: () => ZodLiteral,
9806
+ ZodLazy: () => ZodLazy,
9807
+ ZodIssueCode: () => ZodIssueCode,
9808
+ ZodIntersection: () => ZodIntersection,
9809
+ ZodFunction: () => ZodFunction,
9810
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
9811
+ ZodError: () => ZodError,
9812
+ ZodEnum: () => ZodEnum,
9813
+ ZodEffects: () => ZodEffects,
9814
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
9815
+ ZodDefault: () => ZodDefault,
9816
+ ZodDate: () => ZodDate,
9817
+ ZodCatch: () => ZodCatch,
9818
+ ZodBranded: () => ZodBranded,
9819
+ ZodBoolean: () => ZodBoolean,
9820
+ ZodBigInt: () => ZodBigInt,
9821
+ ZodArray: () => ZodArray,
9822
+ ZodAny: () => ZodAny,
9823
+ Schema: () => ZodType,
9824
+ ParseStatus: () => ParseStatus,
9825
+ OK: () => OK,
9826
+ NEVER: () => NEVER,
9827
+ INVALID: () => INVALID,
9828
+ EMPTY_PATH: () => EMPTY_PATH,
9829
+ DIRTY: () => DIRTY,
9830
+ BRAND: () => BRAND
9831
+ });
9832
+
9833
+ // ../switchroom/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
9834
+ var util;
9835
+ (function(util2) {
9836
+ util2.assertEqual = (_) => {};
9837
+ function assertIs(_arg) {}
9838
+ util2.assertIs = assertIs;
9839
+ function assertNever(_x) {
9840
+ throw new Error;
9841
+ }
9842
+ util2.assertNever = assertNever;
9843
+ util2.arrayToEnum = (items) => {
9844
+ const obj = {};
9845
+ for (const item of items) {
9846
+ obj[item] = item;
9847
+ }
9848
+ return obj;
9849
+ };
9850
+ util2.getValidEnumValues = (obj) => {
9851
+ const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
9852
+ const filtered = {};
9853
+ for (const k of validKeys) {
9854
+ filtered[k] = obj[k];
9855
+ }
9856
+ return util2.objectValues(filtered);
9857
+ };
9858
+ util2.objectValues = (obj) => {
9859
+ return util2.objectKeys(obj).map(function(e) {
9860
+ return obj[e];
9861
+ });
9862
+ };
9863
+ util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
9864
+ const keys = [];
9865
+ for (const key in object) {
9866
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
9867
+ keys.push(key);
9868
+ }
9869
+ }
9870
+ return keys;
9871
+ };
9872
+ util2.find = (arr, checker) => {
9873
+ for (const item of arr) {
7141
9874
  if (checker(item))
7142
9875
  return item;
7143
9876
  }
@@ -7228,7 +9961,7 @@ var getParsedType = (data) => {
7228
9961
  }
7229
9962
  };
7230
9963
 
7231
- // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
9964
+ // ../switchroom/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
7232
9965
  var ZodIssueCode = util.arrayToEnum([
7233
9966
  "invalid_type",
7234
9967
  "invalid_literal",
@@ -7347,7 +10080,7 @@ ZodError.create = (issues) => {
7347
10080
  return error;
7348
10081
  };
7349
10082
 
7350
- // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
10083
+ // ../switchroom/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
7351
10084
  var errorMap = (issue, _ctx) => {
7352
10085
  let message;
7353
10086
  switch (issue.code) {
@@ -7450,7 +10183,7 @@ var errorMap = (issue, _ctx) => {
7450
10183
  };
7451
10184
  var en_default = errorMap;
7452
10185
 
7453
- // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
10186
+ // ../switchroom/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
7454
10187
  var overrideErrorMap = en_default;
7455
10188
  function setErrorMap(map) {
7456
10189
  overrideErrorMap = map;
@@ -7458,7 +10191,7 @@ function setErrorMap(map) {
7458
10191
  function getErrorMap() {
7459
10192
  return overrideErrorMap;
7460
10193
  }
7461
- // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
10194
+ // ../switchroom/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
7462
10195
  var makeIssue = (params) => {
7463
10196
  const { data, path, errorMaps, issueData } = params;
7464
10197
  const fullPath = [...path, ...issueData.path || []];
@@ -7564,14 +10297,14 @@ var isAborted = (x) => x.status === "aborted";
7564
10297
  var isDirty = (x) => x.status === "dirty";
7565
10298
  var isValid = (x) => x.status === "valid";
7566
10299
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
7567
- // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
10300
+ // ../switchroom/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
7568
10301
  var errorUtil;
7569
10302
  (function(errorUtil2) {
7570
10303
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
7571
10304
  errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
7572
10305
  })(errorUtil || (errorUtil = {}));
7573
10306
 
7574
- // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
10307
+ // ../switchroom/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
7575
10308
  class ParseInputLazyPath {
7576
10309
  constructor(parent, value, path, key) {
7577
10310
  this._cachedPath = [];
@@ -10972,7 +13705,7 @@ var AgentBindMountSchema = exports_external.object({
10972
13705
  var ScheduleEntrySchema = exports_external.object({
10973
13706
  cron: exports_external.string().describe("Cron expression (e.g., '0 8 * * *')"),
10974
13707
  prompt: exports_external.string().describe("Prompt to send at the scheduled time"),
10975
- model: exports_external.string().optional().describe("Model for this task. Defaults to claude-sonnet-4-6 (cheap, fast). " + "Use claude-opus-4-7 for tasks needing complex reasoning."),
13708
+ model: exports_external.string().optional().describe("DEPRECATED / IGNORED. Pre-v0.8 the singleton scheduler ran each " + "task as an isolated `claude -p` and could set --model per task. " + "Post cron-fold-in (v0.8) the fire is injected into the agent's " + "running session, so it always uses the agent's configured model " + "— this field has no effect. Accepted (optional) only so existing " + "configs keep validating; set the model at the agent level instead. " + "See docs/scheduling.md."),
10976
13709
  secrets: exports_external.array(exports_external.string().regex(/^[a-zA-Z0-9_\-/]+$/, "Secret key names must contain only alphanumeric characters, underscores, hyphens, and forward slashes")).default([]).describe("Vault key names this cron task may read via the vault-broker daemon. " + "Empty by default — broker requests for unlisted keys are denied. " + "Note: this is misconfiguration protection (a typo in cron-A doesn't " + "accidentally read cron-B's keys) rather than a security boundary — " + "anyone who can edit cron scripts can also edit switchroom.yaml, and " + "anyone with the vault passphrase can read the vault file directly. " + "See docs/configuration.md for the full framing.")
10977
13710
  });
10978
13711
  var AgentSoulSchema = exports_external.object({
@@ -11039,6 +13772,7 @@ var SessionContinuitySchema = exports_external.object({
11039
13772
  resume_max_bytes: exports_external.number().int().positive().optional().describe("Byte threshold above which 'auto' mode falls back to handoff " + "instead of --continue. Default 2_000_000 (~2MB). Large transcripts " + "can blow out the context window even with prefix caching, and " + "--continue replay is known-fragile at scale.")
11040
13773
  }).optional();
11041
13774
  var TelegramChannelSchema = exports_external.object({
13775
+ enabled: exports_external.boolean().default(true).describe("Master switch for the per-agent Telegram gateway sidecar. " + "When false, start.sh skips the gateway supervise loop and the " + "agent boots without bot-token requirements (smoke-test + " + "offline-dev use case)."),
11042
13776
  plugin: exports_external.enum(["switchroom", "official"]).optional().describe("Which Telegram MCP plugin to load. Default is 'switchroom' — the " + "enhanced fork with streaming edits, reactions, history, and " + "access control. Set to 'official' for the upstream marketplace " + "plugin (basic send/receive only)."),
11043
13777
  format: exports_external.enum(["html", "markdownv2", "text"]).optional().describe("Default reply format passed to the plugin"),
11044
13778
  rate_limit_ms: exports_external.number().optional().describe("Minimum delay between outgoing messages in ms"),
@@ -11103,6 +13837,9 @@ var GoogleWorkspaceConfigSchema = exports_external.object({
11103
13837
  tier: GoogleWorkspaceTierSchema.optional().describe("RFC G Phase 1: which upstream MCP tier to expose. " + "core (default) = ~16 tools (Drive+Docs+Sheets+Calendar). " + "extended = ~40 tools (+Slides, Forms, Tasks, Chat). " + "complete = ~60+ tools (+Gmail; not recommended yet — see RFC G §5).")
11104
13838
  }).optional();
11105
13839
  var AgentGoogleWorkspaceConfigSchema = exports_external.object({
13840
+ account: exports_external.string().regex(/^[^@\s:]+@[^@\s:]+\.[^@\s:]+$/, {
13841
+ message: "google_workspace.account must be a Google account email like " + "'alice@example.com' (colons not allowed)"
13842
+ }).transform((v) => v.trim().toLowerCase()).optional().describe("RFC G: the Google account this agent uses for the Workspace MCP. " + "Must be a key in top-level `google_accounts:` with this agent " + "listed in its `enabled_for[]`. Read by the auth-broker " + "(get-credentials, provider=google) and by the scaffold to decide " + "whether to emit the `gdrive` MCP entry. Normalized to lowercase " + "so it matches the google_accounts key (which is also normalized)."),
11106
13843
  approvers: exports_external.array(ApproverIdSchema).min(1).optional().describe("Per-agent approver override. When set, replaces (does not extend) " + "the top-level drive.approvers list for this agent's onboarding card."),
11107
13844
  tier: GoogleWorkspaceTierSchema.optional().describe("Per-agent tier override (RFC G Phase 1). When set, replaces the " + "top-level google_workspace.tier for this agent. Common case: most " + "agents on `core`, one specialist on `extended` for Slides access.")
11108
13845
  }).optional();
@@ -11113,9 +13850,17 @@ var ReactionsSchema = exports_external.object({
11113
13850
  per_hour_cap: exports_external.number().int().nonnegative().optional().describe("Max reaction-triggered synthetic turns per chat per rolling hour. " + "Refusals are stderr-logged but not surfaced to the agent. " + "Default 10. Set to 0 to disable triggering via the cap path."),
11114
13851
  group_admin_only: exports_external.boolean().optional().describe("In groups/supergroups (negative chat_id), only trigger a synthetic " + "turn when the reacter is a chat admin (creator or administrator). " + "Failing the lookup is treated as non-admin (fail-closed). " + "DMs are never affected by this flag — the reacter IS the user. " + "Default true.")
11115
13852
  }).optional();
13853
+ var ReleaseBlock = exports_external.object({
13854
+ channel: exports_external.enum(["dev", "rc", "latest"]).optional(),
13855
+ pin: exports_external.string().regex(/^(sha-[0-9a-f]{7,40}|v\d+\.\d+\.\d+)$/).optional()
13856
+ }).strict().refine((r) => !(r.channel && r.pin), {
13857
+ message: "release.channel and release.pin are mutually exclusive"
13858
+ });
13859
+ var NetworkIsolationSchema = exports_external.enum(["host", "strict"]).optional().describe("Container network mode (sec WS6-F1 #1390 / feature #1413). " + "'host' (DEFAULT when unset): `network_mode: host` — the agent " + "shares the host network stack; hindsight 127.0.0.1:18888 and " + "operator-LAN devices are reachable, but there is NO network " + "isolation from sibling agents or host services (the documented, " + "deliberate shared-host tradeoff). 'strict': the agent joins its " + "OWN dedicated docker bridge network instead — it cannot reach " + "sibling agents; host services are reached via " + "`host.docker.internal`. OPT-IN: validate hindsight / operator-" + "LAN / cron / boot-self-test paths for your deployment before " + "adopting fleet-wide (default-flip is deferred to that validation " + "cycle, #1413). Cascades override (agent → profile → defaults).");
11116
13860
  var profileFields = {
11117
13861
  extends: exports_external.string().optional(),
11118
13862
  bot_token: exports_external.string().optional(),
13863
+ release: ReleaseBlock.optional().describe("Release-channel pin / pointer. Either `channel` (dev|rc|latest) or " + "`pin` (sha-<hex>|v<semver>) — mutually exclusive. Per-agent value " + "REPLACES the root entirely (no field merge)."),
11119
13864
  timezone: exports_external.string().regex(TIMEZONE_REGEX, "timezone must be an IANA zone name like 'Australia/Melbourne' or 'UTC' " + "(three-letter aliases like EST/PST and bare offsets like UTC+10 are not accepted)").optional().describe("IANA timezone name (e.g. 'Australia/Melbourne', 'America/New_York', " + "'UTC'). Used to generate the per-turn local-time hint the agent's " + "UserPromptSubmit timezone hook emits, and baked into the systemd " + "unit as TZ= so subprocess `date`/`Date.now()` are correct. If unset " + "at every cascade layer, switchroom auto-detects from /etc/timezone " + "and warns on `reconcile` when the detected zone is UTC."),
11120
13865
  soul: exports_external.object({
11121
13866
  name: exports_external.string().optional(),
@@ -11152,8 +13897,8 @@ var profileFields = {
11152
13897
  session: SessionSchema,
11153
13898
  session_continuity: SessionContinuitySchema,
11154
13899
  channels: ChannelsSchema,
13900
+ network_isolation: NetworkIsolationSchema,
11155
13901
  dangerous_mode: exports_external.boolean().optional(),
11156
- skip_permission_prompt: exports_external.boolean().optional(),
11157
13902
  settings_raw: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
11158
13903
  claude_md_raw: exports_external.string().optional(),
11159
13904
  cli_args: exports_external.array(exports_external.string()).optional(),
@@ -11175,6 +13920,7 @@ var AgentDefaultsSchema = exports_external.object(defaultsFields).optional();
11175
13920
  var AgentSchema = exports_external.object({
11176
13921
  extends: exports_external.string().optional().describe("Name of a profile to inherit from (e.g., 'coding', 'health-coach'). " + "Profiles may be defined inline under switchroom.yaml `profiles:` or as a " + "filesystem directory `profiles/<name>/`. Defaults to DEFAULT_PROFILE " + "('default') when unset."),
11177
13922
  bot_token: exports_external.string().optional().describe("Per-agent Telegram bot token or vault reference (overrides global telegram.bot_token)"),
13923
+ release: ReleaseBlock.optional().describe("Per-agent release-channel pin / pointer. REPLACES the root " + "`release` block entirely (no field merge) — a pinned agent does " + "not inherit the fleet channel, and vice versa."),
11178
13924
  bot_username: exports_external.string().optional().describe("Per-agent Telegram bot username (without leading @) when it doesn't " + "contain the agent slug. Replaces the default 'username includes slug' " + "preflight check with an exact (case-insensitive) match. Use when an " + "agent and its bot have intentionally divergent names (e.g. agent " + "'lawgpt' paired with bot '@meken_law_bot')."),
11179
13925
  timezone: exports_external.string().regex(TIMEZONE_REGEX, "timezone must be an IANA zone name like 'Australia/Melbourne' or 'UTC' " + "(three-letter aliases like EST/PST and bare offsets like UTC+10 are not accepted)").optional().describe("Per-agent IANA timezone override. Wins over any profile/defaults " + "value and over the top-level switchroom.timezone global. Controls " + "the UserPromptSubmit timezone hook's emitted local time and the " + "systemd unit's TZ= env."),
11180
13926
  auth: exports_external.object({
@@ -11219,7 +13965,7 @@ var AgentSchema = exports_external.object({
11219
13965
  session_continuity: SessionContinuitySchema.describe("Handoff-briefing settings. When enabled (default), a Stop hook " + "summarizes each session at shutdown and start.sh injects that " + "briefing into the next session via --append-system-prompt."),
11220
13966
  channels: ChannelsSchema.describe("Per-channel configuration. Today only `telegram` is defined; the " + "shape is designed to expand to other channels (Slack, Discord, " + "Matrix, Email) as they're added."),
11221
13967
  dangerous_mode: exports_external.boolean().optional().describe("If true, include --dangerously-skip-permissions in start.sh"),
11222
- skip_permission_prompt: exports_external.boolean().optional().describe("DEPRECATED no-op (accepted for backwards compatibility). Claude Code " + "ignores skipDangerousModePermissionPrompt at project scope; autoaccept " + "(src/agents/autoaccept.ts) handles the bypass-mode prompt instead. " + "Safe to remove from switchroom.yaml."),
13968
+ network_isolation: NetworkIsolationSchema,
11223
13969
  admin: exports_external.boolean().optional().describe("If true, the agent's Telegram gateway intercepts admin slash commands " + "(/agents, /logs, /restart, /delete, /update, /auth, /reconcile, etc.) " + "locally before forwarding to Claude. Commands are handled silently — " + "Claude never sees them. Requires the agent to use the switchroom-telegram " + "plugin. When false or absent, all messages pass through to Claude unchanged."),
11224
13970
  settings_raw: exports_external.record(exports_external.string(), exports_external.unknown()).optional().describe("Escape hatch: raw object deep-merged into the generated " + "settings.json as the final step. Use for Claude Code settings " + "keys switchroom doesn't wrap directly (e.g. effort, apiKeyHelper). " + "Power-user-only — prefer the typed fields when they exist."),
11225
13971
  claude_md_raw: exports_external.string().optional().describe("Escape hatch: markdown text appended verbatim to CLAUDE.md on " + "initial scaffold. Not re-applied on reconcile (CLAUDE.md is " + "user-protected). Use for one-off persona tuning that isn't " + "worth a template."),
@@ -11296,6 +14042,7 @@ var SwitchroomConfigSchema = exports_external.object({
11296
14042
  timezone: exports_external.string().regex(TIMEZONE_REGEX, "timezone must be an IANA zone name like 'Australia/Melbourne' or 'UTC'").optional().describe("Global default IANA timezone applied to every agent unless the " + "agent (or its profile) declares its own. See the per-agent " + "timezone field for the full cascade and auto-detection fallback.")
11297
14043
  }),
11298
14044
  telegram: TelegramConfigSchema,
14045
+ release: ReleaseBlock.optional().describe("Fleet-wide default release-channel pin / pointer for the update " + "flow. Either `channel` (dev|rc|latest) or `pin` (sha-<hex>|v<semver>) " + "— mutually exclusive. Per-agent `release` REPLACES this entirely."),
11299
14046
  memory: MemoryBackendConfigSchema.optional(),
11300
14047
  vault: VaultConfigSchema.optional(),
11301
14048
  auth: exports_external.object({
@@ -11335,6 +14082,14 @@ var LEGACY_STATE_DIR = ".clerk";
11335
14082
  function home() {
11336
14083
  return process.env.HOME ?? "/root";
11337
14084
  }
14085
+ var _legacyStateWarned = false;
14086
+ function warnLegacyStateOnce(legacy) {
14087
+ if (_legacyStateWarned)
14088
+ return;
14089
+ _legacyStateWarned = true;
14090
+ process.stderr.write(`[switchroom] DEPRECATED: reading legacy state from ${legacy}. ` + "Run `mv ~/.clerk ~/.switchroom` (and rename any top-level `clerk:` " + "key in switchroom.yaml to `switchroom:`). This back-compat shim is " + `REMOVED in v0.13.0 — no automatic migration exists.
14091
+ `);
14092
+ }
11338
14093
  function resolveDualPath(pathStr) {
11339
14094
  const h = home();
11340
14095
  if (pathStr.startsWith("~/")) {
@@ -11344,8 +14099,10 @@ function resolveDualPath(pathStr) {
11344
14099
  const frag = rest.slice(DEFAULT_STATE_DIR.length + 1);
11345
14100
  if (!existsSync(absolute)) {
11346
14101
  const legacy = resolve(h, LEGACY_STATE_DIR, frag);
11347
- if (existsSync(legacy))
14102
+ if (existsSync(legacy)) {
14103
+ warnLegacyStateOnce(legacy);
11348
14104
  return legacy;
14105
+ }
11349
14106
  }
11350
14107
  }
11351
14108
  return absolute;
@@ -11690,8 +14447,8 @@ function mergeAgentConfig(defaultsIn, agentIn) {
11690
14447
  if (defaults.dangerous_mode !== undefined && merged.dangerous_mode === undefined) {
11691
14448
  merged.dangerous_mode = defaults.dangerous_mode;
11692
14449
  }
11693
- if (defaults.skip_permission_prompt !== undefined && merged.skip_permission_prompt === undefined) {
11694
- merged.skip_permission_prompt = defaults.skip_permission_prompt;
14450
+ if (defaults.network_isolation !== undefined && merged.network_isolation === undefined) {
14451
+ merged.network_isolation = defaults.network_isolation;
11695
14452
  }
11696
14453
  if (defaults.thinking_effort !== undefined && merged.thinking_effort === undefined) {
11697
14454
  merged.thinking_effort = defaults.thinking_effort;
@@ -11811,6 +14568,9 @@ function mergeAgentConfig(defaultsIn, agentIn) {
11811
14568
  }
11812
14569
  merged.session_continuity = combined;
11813
14570
  }
14571
+ if (merged.release === undefined && defaults.release !== undefined) {
14572
+ merged.release = defaults.release;
14573
+ }
11814
14574
  if (defaults.channels || merged.channels) {
11815
14575
  const dChan = defaults.channels ?? {};
11816
14576
  const aChan = merged.channels ?? {};
@@ -11923,10 +14683,17 @@ var BIND_MOUNT_EXACT_SOURCE_DENY = new Set(["/var/run/docker.sock"]);
11923
14683
 
11924
14684
  // src/host-control/server.ts
11925
14685
  import { createServer } from "node:net";
11926
- import { spawn } from "node:child_process";
14686
+ import { spawn, spawnSync } from "node:child_process";
11927
14687
  import { mkdir, chmod, chown, unlink, appendFile } from "node:fs/promises";
11928
- import { readdirSync as readdirSync2, existsSync as existsSync4, statSync as statSync2 } from "node:fs";
11929
- import { join, dirname } from "node:path";
14688
+ import {
14689
+ readdirSync as readdirSync2,
14690
+ existsSync as existsSync5,
14691
+ readFileSync as readFileSync3,
14692
+ writeFileSync,
14693
+ renameSync,
14694
+ mkdirSync
14695
+ } from "node:fs";
14696
+ import { join as join2, dirname as dirname2 } from "node:path";
11930
14697
 
11931
14698
  // src/host-control/protocol.ts
11932
14699
  var MAX_FRAME_BYTES = 64 * 1024;
@@ -11968,7 +14735,9 @@ var UpdateApplyRequestSchema = exports_external.object({
11968
14735
  op: exports_external.literal("update_apply"),
11969
14736
  args: exports_external.object({
11970
14737
  skip_images: exports_external.boolean().optional(),
11971
- rebuild: exports_external.boolean().optional()
14738
+ rebuild: exports_external.boolean().optional(),
14739
+ channel: exports_external.enum(["dev", "rc", "latest"]).nullable().optional(),
14740
+ pin: exports_external.string().regex(/^(sha-[0-9a-f]{7,40}|v\d+\.\d+\.\d+)$/).nullable().optional()
11972
14741
  }).optional()
11973
14742
  });
11974
14743
  var ApplyRequestSchema = exports_external.object({
@@ -12067,6 +14836,71 @@ function errorResponse(request_id, error, duration_ms = 0) {
12067
14836
  };
12068
14837
  }
12069
14838
 
14839
+ // src/util/audit-hashchain.ts
14840
+ import { createHash as createHash2 } from "node:crypto";
14841
+ import { openSync, readSync, fstatSync, closeSync } from "node:fs";
14842
+ var CHAIN_GENESIS = "GENESIS";
14843
+ var SEP = "\x00";
14844
+ function rowHash(prev, seq, rowJsonNoChain) {
14845
+ return createHash2("sha256").update(prev + SEP + String(seq) + SEP + rowJsonNoChain).digest("hex");
14846
+ }
14847
+ function chainRow(state, entry) {
14848
+ const seq = state.seq + 1;
14849
+ const prev = state.lastHash;
14850
+ const entryJson = JSON.stringify(entry);
14851
+ const hash = rowHash(prev, seq, entryJson);
14852
+ const chained = { ...entry, _seq: seq, _prev: prev, _hash: hash };
14853
+ return {
14854
+ line: JSON.stringify(chained) + `
14855
+ `,
14856
+ next: { seq, lastHash: hash }
14857
+ };
14858
+ }
14859
+ function readTail(path, tailBytes = 64 * 1024) {
14860
+ let fd;
14861
+ try {
14862
+ fd = openSync(path, "r");
14863
+ } catch {
14864
+ return null;
14865
+ }
14866
+ try {
14867
+ const size = fstatSync(fd).size;
14868
+ if (size === 0)
14869
+ return "";
14870
+ const len = Math.min(size, tailBytes);
14871
+ const buf = Buffer.allocUnsafe(len);
14872
+ readSync(fd, buf, 0, len, size - len);
14873
+ return buf.toString("utf8");
14874
+ } catch {
14875
+ return null;
14876
+ } finally {
14877
+ try {
14878
+ closeSync(fd);
14879
+ } catch {}
14880
+ }
14881
+ }
14882
+ function seedChain(path) {
14883
+ const tail = readTail(path);
14884
+ if (tail === null || tail === "") {
14885
+ return { seq: 0, lastHash: CHAIN_GENESIS };
14886
+ }
14887
+ const lines = tail.split(`
14888
+ `).filter((l) => l.length > 0);
14889
+ const last = lines[lines.length - 1];
14890
+ if (last !== undefined) {
14891
+ try {
14892
+ const obj = JSON.parse(last);
14893
+ if (typeof obj._seq === "number" && typeof obj._hash === "string" && obj._hash.length > 0) {
14894
+ return { seq: obj._seq, lastHash: obj._hash };
14895
+ }
14896
+ } catch {}
14897
+ }
14898
+ return {
14899
+ seq: 0,
14900
+ lastHash: "CORRUPT-TAIL-" + createHash2("sha256").update(tail).digest("hex").slice(0, 16)
14901
+ };
14902
+ }
14903
+
12070
14904
  // src/host-control/peercred.ts
12071
14905
  var SOCKET_PATH_CONTAINER_SUBDIR_RE = /^\/run\/switchroom\/hostd\/([a-zA-Z0-9][a-zA-Z0-9_-]*)\/sock$/;
12072
14906
  var SOCKET_PATH_HOST_SUBDIR_RE = /\/\.switchroom\/hostd\/([a-zA-Z0-9][a-zA-Z0-9_-]*)\/sock$/;
@@ -12085,7 +14919,400 @@ function socketPathToIdentity(socketPath) {
12085
14919
  return { kind: "agent", name };
12086
14920
  }
12087
14921
 
14922
+ // telegram-plugin/secret-detect/patterns.ts
14923
+ var ANCHORED_PATTERNS = [
14924
+ { rule_id: "anthropic_api_key", regex: /\b(sk-ant-[A-Za-z0-9_-]{8,})\b/g, captureIndex: 1, slugHint: "anthropic_api_key" },
14925
+ { rule_id: "anthropic_oauth_code", regex: /(?:^|\s)([A-Za-z0-9_-]{20,}#[A-Za-z0-9_-]{20,})(?=\s|$)/gm, captureIndex: 1, slugHint: "anthropic_oauth_code" },
14926
+ { rule_id: "openai_api_key", regex: /\b(sk-[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "openai_api_key" },
14927
+ { rule_id: "github_pat_classic", regex: /\b(ghp_[A-Za-z0-9]{20,})\b/g, captureIndex: 1, slugHint: "github_pat" },
14928
+ { rule_id: "github_pat_fine_grained", regex: /\b(github_pat_[A-Za-z0-9_]{20,})\b/g, captureIndex: 1, slugHint: "github_pat" },
14929
+ { rule_id: "slack_token", regex: /\b(xox[baprs]-[A-Za-z0-9-]{10,})\b/g, captureIndex: 1, slugHint: "slack_token" },
14930
+ { rule_id: "slack_app_token", regex: /\b(xapp-[A-Za-z0-9-]{10,})\b/g, captureIndex: 1, slugHint: "slack_app_token" },
14931
+ { rule_id: "groq_api_key", regex: /\b(gsk_[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "groq_api_key" },
14932
+ { rule_id: "google_api_key", regex: /\b(AIza[0-9A-Za-z\-_]{20,})\b/g, captureIndex: 1, slugHint: "google_api_key" },
14933
+ { rule_id: "perplexity_api_key", regex: /\b(pplx-[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "perplexity_api_key" },
14934
+ { rule_id: "npm_token", regex: /\b(npm_[A-Za-z0-9]{10,})\b/g, captureIndex: 1, slugHint: "npm_token" },
14935
+ { rule_id: "telegram_bot_token_prefixed", regex: /\bbot(\d{6,}:[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "telegram_bot_token" },
14936
+ { rule_id: "telegram_bot_token", regex: /\b(\d{6,}:[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "telegram_bot_token" },
14937
+ { rule_id: "aws_access_key", regex: /\b(AKIA[0-9A-Z]{16})\b/g, captureIndex: 1, slugHint: "aws_access_key" },
14938
+ { rule_id: "jwt", regex: /\b(eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "jwt" }
14939
+ ];
14940
+ var STRUCTURED_PATTERNS = [
14941
+ {
14942
+ rule_id: "env_key_value",
14943
+ regex: /\b([A-Z0-9_]*(?:KEY|TOKEN|SECRET|PASSWORD|PASSWD))\b\s*[=:]\s*(["']?)([^\s"'\\]+)\2/g,
14944
+ captureIndex: 3,
14945
+ slugHint: "env"
14946
+ },
14947
+ {
14948
+ rule_id: "json_secret_field",
14949
+ regex: /"(?:apiKey|token|secret|password|passwd|accessToken|refreshToken)"\s*:\s*"([^"]+)"/g,
14950
+ captureIndex: 1,
14951
+ slugHint: "json_secret"
14952
+ },
14953
+ {
14954
+ rule_id: "cli_flag",
14955
+ regex: /--(?:api[-_]?key|hook[-_]?token|token|secret|password|passwd)\s+(["']?)([^\s"']+)\1/g,
14956
+ captureIndex: 2,
14957
+ slugHint: "cli_flag"
14958
+ },
14959
+ {
14960
+ rule_id: "bearer_auth_header",
14961
+ regex: /Authorization\s*[:=]\s*Bearer\s+([A-Za-z0-9._\-+=]+)/g,
14962
+ captureIndex: 1,
14963
+ slugHint: "bearer_token"
14964
+ },
14965
+ {
14966
+ rule_id: "bearer_loose",
14967
+ regex: /\bBearer\s+([A-Za-z0-9._\-+=]{18,})\b/g,
14968
+ captureIndex: 1,
14969
+ slugHint: "bearer_token"
14970
+ },
14971
+ {
14972
+ rule_id: "pem_private_key",
14973
+ regex: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]+?-----END [A-Z ]*PRIVATE KEY-----/g,
14974
+ captureIndex: 0,
14975
+ slugHint: "pem_private_key"
14976
+ }
14977
+ ];
14978
+ var ALL_PATTERNS = [...ANCHORED_PATTERNS, ...STRUCTURED_PATTERNS];
14979
+
14980
+ // telegram-plugin/secret-detect/entropy.ts
14981
+ function shannonEntropy(s) {
14982
+ if (s.length === 0)
14983
+ return 0;
14984
+ const counts = new Map;
14985
+ for (const ch of s) {
14986
+ counts.set(ch, (counts.get(ch) ?? 0) + 1);
14987
+ }
14988
+ let h = 0;
14989
+ const len = s.length;
14990
+ for (const c of counts.values()) {
14991
+ const p = c / len;
14992
+ h -= p * Math.log2(p);
14993
+ }
14994
+ return h;
14995
+ }
14996
+
14997
+ // telegram-plugin/secret-detect/kv-scanner.ts
14998
+ var KV_RE = /\b([A-Za-z_][A-Za-z0-9_-]*(?:password|passwd|token|secret|key|api[_-]?key))\s*[:=]\s*["']?([^\s"'\\]{8,})["']?/gi;
14999
+ var KV_ENTROPY_THRESHOLD = 4;
15000
+ function scanKeyValue(text) {
15001
+ const hits = [];
15002
+ KV_RE.lastIndex = 0;
15003
+ let m;
15004
+ while ((m = KV_RE.exec(text)) !== null) {
15005
+ const [, keyName, value] = m;
15006
+ if (!value)
15007
+ continue;
15008
+ const h = shannonEntropy(value);
15009
+ if (h < KV_ENTROPY_THRESHOLD)
15010
+ continue;
15011
+ const valueOffsetInMatch = m[0].indexOf(value, keyName.length);
15012
+ if (valueOffsetInMatch < 0)
15013
+ continue;
15014
+ const start = m.index + valueOffsetInMatch;
15015
+ const end = start + value.length;
15016
+ hits.push({
15017
+ rule_id: "kv_entropy",
15018
+ start,
15019
+ end,
15020
+ matched_text: value,
15021
+ key_name: keyName,
15022
+ confidence: "ambiguous"
15023
+ });
15024
+ }
15025
+ return hits;
15026
+ }
15027
+
15028
+ // telegram-plugin/secret-detect/chunker.ts
15029
+ var CHUNK_THRESHOLD = 32 * 1024;
15030
+ var WINDOW_SIZE = 16 * 1024;
15031
+ var OVERLAP = 1024;
15032
+ function chunk(text) {
15033
+ if (text.length <= CHUNK_THRESHOLD) {
15034
+ return [{ offset: 0, text }];
15035
+ }
15036
+ const out = [];
15037
+ let offset = 0;
15038
+ while (offset < text.length) {
15039
+ const end = Math.min(offset + WINDOW_SIZE, text.length);
15040
+ out.push({ offset, text: text.slice(offset, end) });
15041
+ if (end >= text.length)
15042
+ break;
15043
+ offset = end - OVERLAP;
15044
+ }
15045
+ return out;
15046
+ }
15047
+
15048
+ // telegram-plugin/secret-detect/index.ts
15049
+ init_suppressor();
15050
+
15051
+ // telegram-plugin/secret-detect/url-redact.ts
15052
+ var SENSITIVE_PARAMS = new Set([
15053
+ "token",
15054
+ "key",
15055
+ "api_key",
15056
+ "apikey",
15057
+ "secret",
15058
+ "access_token",
15059
+ "password",
15060
+ "pass",
15061
+ "auth",
15062
+ "client_secret",
15063
+ "refresh_token",
15064
+ "signature"
15065
+ ]);
15066
+ var URL_RE = /\b(?:https?|wss?|ftp):\/\/[^\s<>"']+/gi;
15067
+ function redactUrls(text) {
15068
+ return text.replace(URL_RE, (m) => {
15069
+ const redacted = redactOne(m);
15070
+ return redacted ?? m;
15071
+ });
15072
+ }
15073
+ function redactOne(raw) {
15074
+ let u;
15075
+ try {
15076
+ u = new URL(raw);
15077
+ } catch {
15078
+ return null;
15079
+ }
15080
+ let changed = false;
15081
+ if (u.username || u.password) {
15082
+ u.username = "***";
15083
+ u.password = "";
15084
+ changed = true;
15085
+ }
15086
+ for (const [key] of u.searchParams) {
15087
+ if (SENSITIVE_PARAMS.has(key.toLowerCase())) {
15088
+ u.searchParams.set(key, "***");
15089
+ changed = true;
15090
+ }
15091
+ }
15092
+ return changed ? u.toString() : null;
15093
+ }
15094
+
15095
+ // telegram-plugin/secret-detect/index.ts
15096
+ init_secretlint_source();
15097
+ function detectSecrets(text) {
15098
+ if (!text || text.length === 0)
15099
+ return [];
15100
+ const windows = chunk(text);
15101
+ const raw = [];
15102
+ for (const win of windows) {
15103
+ for (const p of ALL_PATTERNS) {
15104
+ const re = new RegExp(p.regex.source, p.regex.flags.includes("g") ? p.regex.flags : p.regex.flags + "g");
15105
+ let m;
15106
+ while ((m = re.exec(win.text)) !== null) {
15107
+ if (m[0].length === 0) {
15108
+ re.lastIndex++;
15109
+ continue;
15110
+ }
15111
+ const cap = p.captureIndex === 0 ? m[0] : m[p.captureIndex];
15112
+ if (!cap)
15113
+ continue;
15114
+ const matchStart = p.captureIndex === 0 ? m.index : m.index + m[0].indexOf(cap);
15115
+ if (matchStart < 0)
15116
+ continue;
15117
+ const globalStart = win.offset + matchStart;
15118
+ const globalEnd = globalStart + cap.length;
15119
+ const keyName = p.rule_id === "env_key_value" ? m[1] : undefined;
15120
+ if (p.rule_id === "env_key_value") {
15121
+ const ENV_KV_MIN_LEN = 12;
15122
+ const ENV_KV_MIN_ENTROPY = 3.5;
15123
+ if (cap.length < ENV_KV_MIN_LEN)
15124
+ continue;
15125
+ if (shannonEntropy(cap) < ENV_KV_MIN_ENTROPY)
15126
+ continue;
15127
+ }
15128
+ raw.push({
15129
+ rule_id: p.rule_id,
15130
+ start: globalStart,
15131
+ end: globalEnd,
15132
+ matched_text: cap,
15133
+ key_name: keyName,
15134
+ confidence: "high"
15135
+ });
15136
+ }
15137
+ }
15138
+ const kvHits = scanKeyValue(win.text);
15139
+ for (const h of kvHits) {
15140
+ raw.push({ ...h, start: h.start + win.offset, end: h.end + win.offset });
15141
+ }
15142
+ }
15143
+ const deduped = dedupeRaw(raw);
15144
+ const final = dropOverlaps(deduped);
15145
+ const existing = new Set;
15146
+ const out = [];
15147
+ for (const h of final) {
15148
+ const suggested_slug = deriveSlug({ key_name: h.key_name, rule_id: h.rule_id }, existing);
15149
+ existing.add(suggested_slug);
15150
+ out.push({
15151
+ rule_id: h.rule_id,
15152
+ matched_text: h.matched_text,
15153
+ start: h.start,
15154
+ end: h.end,
15155
+ confidence: h.confidence,
15156
+ suppressed: isSuppressed(text, h.start, h.end),
15157
+ suggested_slug,
15158
+ key_name: h.key_name
15159
+ });
15160
+ }
15161
+ out.sort((a, b) => a.start - b.start);
15162
+ return out;
15163
+ }
15164
+ function dedupeRaw(raw) {
15165
+ const seen = new Map;
15166
+ for (const h of raw) {
15167
+ const key = `${h.start}:${h.end}`;
15168
+ const existing = seen.get(key);
15169
+ if (!existing) {
15170
+ seen.set(key, h);
15171
+ continue;
15172
+ }
15173
+ if (existing.confidence === "ambiguous" && h.confidence === "high") {
15174
+ seen.set(key, h);
15175
+ }
15176
+ }
15177
+ return Array.from(seen.values());
15178
+ }
15179
+ function dropOverlaps(hits) {
15180
+ const sorted = [...hits].sort((a, b) => a.end - a.start - (b.end - b.start));
15181
+ const out = [];
15182
+ for (const h of sorted) {
15183
+ const contained = out.some((existing) => existing !== h && existing.start <= h.start && existing.end >= h.end && !(existing.start === h.start && existing.end === h.end));
15184
+ if (!contained)
15185
+ out.push(h);
15186
+ }
15187
+ out.sort((a, b) => a.start - b.start || a.end - b.end);
15188
+ return out;
15189
+ }
15190
+
15191
+ // src/secret-detect/redact.ts
15192
+ var REDACTED_MARKER = "[REDACTED]";
15193
+ function redact(text) {
15194
+ if (!text || text.length === 0)
15195
+ return text;
15196
+ const urlScrubbed = redactUrls(text);
15197
+ const hits = detectSecrets(urlScrubbed);
15198
+ if (hits.length === 0)
15199
+ return urlScrubbed;
15200
+ const sorted = [...hits].sort((a, b) => b.start - a.start);
15201
+ let out = urlScrubbed;
15202
+ for (const h of sorted) {
15203
+ out = out.slice(0, h.start) + redactedMarker(h.rule_id) + out.slice(h.end);
15204
+ }
15205
+ return out;
15206
+ }
15207
+ function redactedMarker(ruleId) {
15208
+ const trimmed = ruleId.replace(/^(kv|env)_/, "");
15209
+ if (!trimmed || trimmed === "key_value" || trimmed === "kv_entropy") {
15210
+ return REDACTED_MARKER;
15211
+ }
15212
+ return `[REDACTED:${trimmed}]`;
15213
+ }
15214
+
15215
+ // src/cli/install-detect.ts
15216
+ import * as fs from "node:fs";
15217
+ import * as path from "node:path";
15218
+ import * as os from "node:os";
15219
+ var BIN_PATH = "/usr/local/bin/switchroom";
15220
+ function sourceArtifactPath() {
15221
+ return path.join(os.homedir(), "code", "switchroom", "dist", "cli", "switchroom.js");
15222
+ }
15223
+ function sourceDistPrefix() {
15224
+ return path.join(os.homedir(), "code", "switchroom", "dist") + path.sep;
15225
+ }
15226
+ function detectInstallType() {
15227
+ try {
15228
+ const repoArtifact = sourceArtifactPath();
15229
+ const distPrefix = sourceDistPrefix();
15230
+ const binExists = fs.existsSync(BIN_PATH);
15231
+ const repoExists = fs.existsSync(repoArtifact);
15232
+ if (binExists) {
15233
+ const lst = fs.lstatSync(BIN_PATH);
15234
+ if (lst.isSymbolicLink()) {
15235
+ const target = fs.readlinkSync(BIN_PATH);
15236
+ const resolved = path.isAbsolute(target) ? target : path.resolve(path.dirname(BIN_PATH), target);
15237
+ if (resolved.startsWith(distPrefix)) {
15238
+ return {
15239
+ install_type: "source",
15240
+ source_paths: { bin: BIN_PATH, repo: repoExists ? repoArtifact : undefined }
15241
+ };
15242
+ }
15243
+ return {
15244
+ install_type: "binary",
15245
+ source_paths: { bin: BIN_PATH }
15246
+ };
15247
+ }
15248
+ return {
15249
+ install_type: "binary",
15250
+ source_paths: { bin: BIN_PATH }
15251
+ };
15252
+ }
15253
+ if (repoExists) {
15254
+ return {
15255
+ install_type: "source-unlinked",
15256
+ source_paths: { repo: repoArtifact }
15257
+ };
15258
+ }
15259
+ return { install_type: "docker", source_paths: {} };
15260
+ } catch {
15261
+ return { install_type: "unknown", source_paths: {} };
15262
+ }
15263
+ }
15264
+
12088
15265
  // src/host-control/server.ts
15266
+ function resolveDigests(imageRefs) {
15267
+ const out = new Map;
15268
+ for (const ref of imageRefs) {
15269
+ try {
15270
+ const r = spawnSync("docker", ["inspect", "--format={{index .RepoDigests 0}}", ref], { encoding: "utf-8", timeout: 5000 });
15271
+ if (r.status !== 0)
15272
+ continue;
15273
+ const trimmed = (r.stdout ?? "").trim();
15274
+ const at = trimmed.lastIndexOf("@");
15275
+ if (at < 0)
15276
+ continue;
15277
+ const digest = trimmed.slice(at + 1);
15278
+ if (!/^sha256:[0-9a-f]{32,}$/.test(digest))
15279
+ continue;
15280
+ out.set(ref, digest);
15281
+ } catch {
15282
+ continue;
15283
+ }
15284
+ }
15285
+ return out;
15286
+ }
15287
+ function readCachedInstallType(bindRoot) {
15288
+ const cacheDir = join2(bindRoot, ".switchroom");
15289
+ const cachePath = join2(cacheDir, "install-type.json");
15290
+ if (existsSync5(cachePath)) {
15291
+ try {
15292
+ const raw = readFileSync3(cachePath, "utf-8");
15293
+ const parsed = JSON.parse(raw);
15294
+ if (parsed && typeof parsed.install_type === "string" && typeof parsed.detected_at === "string") {
15295
+ return parsed;
15296
+ }
15297
+ return { install_type: "unknown", detected_at: new Date().toISOString() };
15298
+ } catch {
15299
+ return { install_type: "unknown", detected_at: new Date().toISOString() };
15300
+ }
15301
+ }
15302
+ const ctx = detectInstallType();
15303
+ const payload = {
15304
+ install_type: ctx.install_type,
15305
+ detected_at: new Date().toISOString(),
15306
+ source_paths: ctx.source_paths
15307
+ };
15308
+ try {
15309
+ mkdirSync(cacheDir, { recursive: true });
15310
+ const tmp = `${cachePath}.tmp`;
15311
+ writeFileSync(tmp, JSON.stringify(payload, null, 2), { mode: 420 });
15312
+ renameSync(tmp, cachePath);
15313
+ } catch {}
15314
+ return payload;
15315
+ }
12089
15316
  var STATUS_RETENTION_MS = 10 * 60 * 1000;
12090
15317
  var STATUS_MAX_ENTRIES = 256;
12091
15318
  var TAIL_BYTES = 4096;
@@ -12094,13 +15321,15 @@ class HostdServer {
12094
15321
  opts;
12095
15322
  servers = new Map;
12096
15323
  statusByRequestId = new Map;
15324
+ auditAppendChain = Promise.resolve();
15325
+ auditChainState;
12097
15326
  idempotencyKeys = new Map;
12098
15327
  fleetMutationInFlight = null;
12099
15328
  constructor(opts) {
12100
15329
  this.opts = opts;
12101
15330
  }
12102
15331
  async start() {
12103
- const hostdDir = join(this.opts.homeDir, ".switchroom", "hostd");
15332
+ const hostdDir = join2(this.opts.homeDir, ".switchroom", "hostd");
12104
15333
  await mkdir(hostdDir, { recursive: true });
12105
15334
  await chmod(hostdDir, 493).catch(() => {
12106
15335
  return;
@@ -12111,13 +15340,13 @@ class HostdServer {
12111
15340
  }
12112
15341
  try {
12113
15342
  for (const name of agentNames) {
12114
- const dir = join(hostdDir, name);
12115
- const sockPath = join(dir, "sock");
15343
+ const dir = join2(hostdDir, name);
15344
+ const sockPath = join2(dir, "sock");
12116
15345
  await mkdir(dir, { recursive: true });
12117
15346
  await chmod(dir, 493).catch(() => {
12118
15347
  return;
12119
15348
  });
12120
- if (existsSync4(sockPath))
15349
+ if (existsSync5(sockPath))
12121
15350
  await unlink(sockPath).catch(() => {
12122
15351
  return;
12123
15352
  });
@@ -12126,8 +15355,8 @@ class HostdServer {
12126
15355
  process.stderr.write(`hostd: server error on ${sockPath}: ${err.message}
12127
15356
  `);
12128
15357
  });
12129
- await new Promise((resolve4, reject) => {
12130
- server.listen(sockPath, () => resolve4());
15358
+ await new Promise((resolve5, reject) => {
15359
+ server.listen(sockPath, () => resolve5());
12131
15360
  server.once("error", reject);
12132
15361
  });
12133
15362
  await chmod(sockPath, 432).catch(() => {
@@ -12149,7 +15378,7 @@ class HostdServer {
12149
15378
  async stop() {
12150
15379
  const paths = [...this.servers.keys()];
12151
15380
  for (const [, server] of this.servers) {
12152
- await new Promise((resolve4) => server.close(() => resolve4()));
15381
+ await new Promise((resolve5) => server.close(() => resolve5()));
12153
15382
  }
12154
15383
  this.servers.clear();
12155
15384
  for (const s of paths) {
@@ -12172,8 +15401,8 @@ class HostdServer {
12172
15401
  return;
12173
15402
  }
12174
15403
  let buf = "";
12175
- socket.on("data", (chunk) => {
12176
- buf += chunk.toString("utf8");
15404
+ socket.on("data", (chunk2) => {
15405
+ buf += chunk2.toString("utf8");
12177
15406
  if (Buffer.byteLength(buf, "utf8") > MAX_FRAME_BYTES * 2) {
12178
15407
  process.stderr.write(`hostd: closing connection — request exceeded ${MAX_FRAME_BYTES * 2} bytes without a newline
12179
15408
  `);
@@ -12379,11 +15608,24 @@ class HostdServer {
12379
15608
  const denied = this.checkFleetMutationLock(req.op, req.request_id, started);
12380
15609
  if (denied)
12381
15610
  return denied;
15611
+ if (req.args?.channel && req.args?.pin) {
15612
+ return deniedResponse(req.request_id, "update_apply: `channel` and `pin` are mutually exclusive — pass at most one.", Date.now() - started);
15613
+ }
12382
15614
  const args = ["update"];
12383
15615
  if (req.args?.skip_images)
12384
15616
  args.push("--skip-images");
12385
15617
  if (req.args?.rebuild)
12386
15618
  args.push("--rebuild");
15619
+ if (req.args?.channel)
15620
+ args.push("--channel", req.args.channel);
15621
+ if (req.args?.pin)
15622
+ args.push("--pin", req.args.pin);
15623
+ const installCtx = readCachedInstallType(this.opts.bindRoot ?? this.opts.homeDir);
15624
+ const digestRefs = this.imageRefsForDigestCapture();
15625
+ const digests = resolveDigests(digestRefs);
15626
+ const resolved_sha = {};
15627
+ for (const [k, v] of digests)
15628
+ resolved_sha[k] = v;
12387
15629
  const entry = {
12388
15630
  request_id: req.request_id,
12389
15631
  caller,
@@ -12393,7 +15635,14 @@ class HostdServer {
12393
15635
  started_at: started,
12394
15636
  finished_at: null,
12395
15637
  stdout_tail: "",
12396
- stderr_tail: ""
15638
+ stderr_tail: "",
15639
+ ...req.args?.channel ? { channel: req.args.channel } : {},
15640
+ ...req.args?.pin ? { pin: req.args.pin } : {},
15641
+ ...Object.keys(resolved_sha).length > 0 ? { resolved_sha } : {},
15642
+ install_context: {
15643
+ install_type: installCtx.install_type,
15644
+ detected_at: installCtx.detected_at
15645
+ }
12397
15646
  };
12398
15647
  this.recordStatus(entry);
12399
15648
  this.fleetMutationInFlight = {
@@ -12490,8 +15739,11 @@ class HostdServer {
12490
15739
  if (!isAllowlistedReadOnlyArgv(argv0)) {
12491
15740
  return deniedResponse(req.request_id, `agent_exec: "${argv0}" is not on the read-only allowlist. ` + `Allowed: ${READONLY_EXEC_ALLOWLIST.join(", ")}. ` + `Writes inside peer containers require the host_os.exec ` + `approval-kernel scope, which is not yet wired — see ` + `docs/rfcs/approval-kernel.md §6 (deferred follow-up).`, Date.now() - started);
12492
15741
  }
15742
+ if (!req.args.argv.every(isSafeExecArgvElement)) {
15743
+ return deniedResponse(req.request_id, `agent_exec: an argv element contains a control character ` + `(C0 / DEL) or exceeds ${MAX_EXEC_ARGV_ELEMENT_BYTES} bytes, ` + `which is not permitted (#1401 / #1400).`, Date.now() - started);
15744
+ }
12493
15745
  const container = `switchroom-${req.args.name}`;
12494
- const res = await this.runDocker(["exec", container, ...req.args.argv]);
15746
+ const res = await this.runDocker(["exec", container, "--", ...req.args.argv]);
12495
15747
  return {
12496
15748
  v: 1,
12497
15749
  request_id: req.request_id,
@@ -12503,7 +15755,7 @@ class HostdServer {
12503
15755
  };
12504
15756
  }
12505
15757
  runDocker(args) {
12506
- return new Promise((resolve4, reject) => {
15758
+ return new Promise((resolve5, reject) => {
12507
15759
  const bin = this.opts.dockerBin ?? "docker";
12508
15760
  const child = spawn(bin, args, {
12509
15761
  stdio: ["ignore", "pipe", "pipe"],
@@ -12518,9 +15770,33 @@ class HostdServer {
12518
15770
  stderr += d.toString("utf8");
12519
15771
  });
12520
15772
  child.on("error", (err) => reject(err));
12521
- child.on("close", (code) => resolve4({ exit_code: code ?? -1, stdout, stderr }));
15773
+ child.on("close", (code) => resolve5({ exit_code: code ?? -1, stdout, stderr }));
12522
15774
  });
12523
15775
  }
15776
+ imageRefsForDigestCapture() {
15777
+ if (this.opts.imageRefsForDigests)
15778
+ return this.opts.imageRefsForDigests();
15779
+ try {
15780
+ const composePath = join2(this.opts.bindRoot ?? this.opts.homeDir, ".switchroom", "compose", "docker-compose.yml");
15781
+ if (!existsSync5(composePath))
15782
+ return [];
15783
+ const r = spawnSync("docker", [
15784
+ "compose",
15785
+ "-p",
15786
+ "switchroom",
15787
+ "-f",
15788
+ composePath,
15789
+ "config",
15790
+ "--images"
15791
+ ], { encoding: "utf-8", timeout: 5000 });
15792
+ if (r.status !== 0)
15793
+ return [];
15794
+ return (r.stdout ?? "").split(`
15795
+ `).map((l) => l.trim()).filter((l) => l.length > 0);
15796
+ } catch {
15797
+ return [];
15798
+ }
15799
+ }
12524
15800
  checkFleetMutationLock(op, request_id, started) {
12525
15801
  const inFlight = this.fleetMutationInFlight;
12526
15802
  if (!inFlight)
@@ -12541,6 +15817,7 @@ class HostdServer {
12541
15817
  entry.finished_at = Date.now();
12542
15818
  entry.error = err.message;
12543
15819
  }).finally(() => {
15820
+ this.writeTerminalAudit(entry);
12544
15821
  if (this.fleetMutationInFlight && this.fleetMutationInFlight.request_id === entry.request_id) {
12545
15822
  this.fleetMutationInFlight = null;
12546
15823
  }
@@ -12584,12 +15861,31 @@ class HostdServer {
12584
15861
  this.idempotencyKeys.delete(k);
12585
15862
  }
12586
15863
  }
12587
- async writeAudit(args) {
12588
- const path = this.opts.auditLogPath ?? join(this.opts.homeDir, ".switchroom", "host-control-audit.log");
12589
- await mkdir(dirname(path), { recursive: true }).catch(() => {
12590
- return;
15864
+ auditLogPath() {
15865
+ return this.opts.auditLogPath ?? join2(this.opts.homeDir, ".switchroom", "host-control-audit.log");
15866
+ }
15867
+ appendAuditRow(row) {
15868
+ const path2 = this.auditLogPath();
15869
+ this.auditAppendChain = this.auditAppendChain.then(async () => {
15870
+ await mkdir(dirname2(path2), { recursive: true }).catch(() => {
15871
+ return;
15872
+ });
15873
+ if (this.auditChainState === undefined) {
15874
+ this.auditChainState = seedChain(path2);
15875
+ }
15876
+ const { line, next } = chainRow(this.auditChainState, row);
15877
+ try {
15878
+ await appendFile(path2, line);
15879
+ this.auditChainState = next;
15880
+ } catch (err) {
15881
+ process.stderr.write(`hostd: audit append failed: ${err.message}
15882
+ `);
15883
+ }
12591
15884
  });
12592
- const row = {
15885
+ return this.auditAppendChain;
15886
+ }
15887
+ async writeAudit(args) {
15888
+ await this.appendAuditRow({
12593
15889
  ts: new Date().toISOString(),
12594
15890
  op: args.req.op,
12595
15891
  caller: args.caller.kind === "agent" ? { kind: "agent", name: args.caller.name } : { kind: "operator" },
@@ -12598,15 +15894,32 @@ class HostdServer {
12598
15894
  exit_code: args.resp.exit_code,
12599
15895
  duration_ms: args.resp.duration_ms,
12600
15896
  error: args.resp.error
12601
- };
12602
- await appendFile(path, JSON.stringify(row) + `
12603
- `).catch((err) => {
12604
- process.stderr.write(`hostd: audit append failed: ${err.message}
12605
- `);
15897
+ });
15898
+ }
15899
+ async writeTerminalAudit(entry) {
15900
+ const stdoutTail = entry.stdout_tail ? redact(entry.stdout_tail) : "";
15901
+ const stderrTail = entry.stderr_tail ? redact(entry.stderr_tail) : "";
15902
+ const errMsg = entry.error ? redact(entry.error) : "";
15903
+ await this.appendAuditRow({
15904
+ ts: new Date().toISOString(),
15905
+ op: entry.op,
15906
+ phase: "terminal",
15907
+ caller: entry.caller.kind === "agent" ? { kind: "agent", name: entry.caller.name } : { kind: "operator" },
15908
+ request_id: entry.request_id,
15909
+ result: entry.result,
15910
+ exit_code: entry.exit_code,
15911
+ duration_ms: (entry.finished_at ?? Date.now()) - entry.started_at,
15912
+ ...stdoutTail ? { stdout_tail: stdoutTail } : {},
15913
+ ...stderrTail ? { stderr_tail: stderrTail } : {},
15914
+ ...errMsg ? { error: errMsg } : {},
15915
+ ...entry.channel ? { channel: entry.channel } : {},
15916
+ ...entry.pin ? { pin: entry.pin } : {},
15917
+ ...entry.resolved_sha ? { resolved_sha: entry.resolved_sha } : {},
15918
+ ...entry.install_context ? { install_context: entry.install_context } : {}
12606
15919
  });
12607
15920
  }
12608
15921
  runSwitchroom(args) {
12609
- return new Promise((resolve4, reject) => {
15922
+ return new Promise((resolve5, reject) => {
12610
15923
  const bin = this.opts.switchroomBin ?? "switchroom";
12611
15924
  const child = spawn(bin, args, {
12612
15925
  stdio: ["ignore", "pipe", "pipe"],
@@ -12621,7 +15934,7 @@ class HostdServer {
12621
15934
  stderr += d.toString("utf8");
12622
15935
  });
12623
15936
  child.on("error", (err) => reject(err));
12624
- child.on("close", (code) => resolve4({ exit_code: code ?? -1, stdout, stderr }));
15937
+ child.on("close", (code) => resolve5({ exit_code: code ?? -1, stdout, stderr }));
12625
15938
  });
12626
15939
  }
12627
15940
  }
@@ -12652,6 +15965,12 @@ var READONLY_EXEC_ALLOWLIST = [
12652
15965
  function isAllowlistedReadOnlyArgv(argv0) {
12653
15966
  return READONLY_EXEC_ALLOWLIST.includes(argv0);
12654
15967
  }
15968
+ var MAX_EXEC_ARGV_ELEMENT_BYTES = 4096;
15969
+ function isSafeExecArgvElement(s) {
15970
+ if (Buffer.byteLength(s, "utf8") > MAX_EXEC_ARGV_ELEMENT_BYTES)
15971
+ return false;
15972
+ return !/[\u0000-\u001f\u007f]/.test(s);
15973
+ }
12655
15974
 
12656
15975
  // src/host-control/main.ts
12657
15976
  async function main() {
@@ -12672,7 +15991,7 @@ async function main() {
12672
15991
  process.exit(2);
12673
15992
  }
12674
15993
  const server = new HostdServer({
12675
- homeDir: homedir2(),
15994
+ homeDir: homedir3(),
12676
15995
  agentUids,
12677
15996
  config: {
12678
15997
  agents: Object.fromEntries(Object.entries(config.agents).map(([n, a]) => [n, { admin: a.admin === true }]))