mcp-browser-dev-tools 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,13 @@
1
1
  import { encodeMessage, MessageBuffer } from "./json-rpc-stdio.mjs";
2
+ import { createLogger } from "./logger.mjs";
3
+ import {
4
+ launchBrowser as launchLocalBrowser,
5
+ supportedLaunchFamilies,
6
+ } from "./browser-launch-service.mjs";
2
7
  import { PACKAGE_NAME, PACKAGE_VERSION } from "./package-info.mjs";
3
8
 
4
9
  const SERVER_NAME = PACKAGE_NAME;
5
10
  const SERVER_VERSION = PACKAGE_VERSION;
6
- const DEBUG_STDIO_ENABLED = process.env.MCP_BROWSER_DEBUG_STDIO === "1";
7
11
 
8
12
  function formatChunkPreview(chunk, limit = 160) {
9
13
  const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
@@ -173,19 +177,320 @@ function waitUntilProperty() {
173
177
  };
174
178
  }
175
179
 
180
+ function waitForInputSchema() {
181
+ return {
182
+ type: "object",
183
+ properties: {
184
+ sessionId: {
185
+ type: "string",
186
+ },
187
+ selector: {
188
+ type: "string",
189
+ },
190
+ state: {
191
+ type: "string",
192
+ enum: ["present", "visible", "hidden"],
193
+ },
194
+ url: {
195
+ type: "string",
196
+ },
197
+ urlIncludes: {
198
+ type: "string",
199
+ },
200
+ readyState: {
201
+ type: "string",
202
+ enum: ["interactive", "complete"],
203
+ },
204
+ timeoutMs: {
205
+ type: "integer",
206
+ minimum: 1,
207
+ },
208
+ pollIntervalMs: {
209
+ type: "integer",
210
+ minimum: 1,
211
+ },
212
+ },
213
+ required: ["sessionId"],
214
+ additionalProperties: false,
215
+ };
216
+ }
217
+
218
+ function compareSessionsSchema(properties, required) {
219
+ return {
220
+ type: "object",
221
+ properties: {
222
+ sessionIdA: {
223
+ type: "string",
224
+ },
225
+ sessionIdB: {
226
+ type: "string",
227
+ },
228
+ ...properties,
229
+ },
230
+ required: ["sessionIdA", "sessionIdB", ...required],
231
+ additionalProperties: false,
232
+ };
233
+ }
234
+
235
+ function storageInputSchema() {
236
+ return {
237
+ type: "object",
238
+ properties: {
239
+ sessionId: {
240
+ type: "string",
241
+ },
242
+ area: {
243
+ type: "string",
244
+ enum: ["all", "localStorage", "sessionStorage"],
245
+ },
246
+ },
247
+ required: ["sessionId"],
248
+ additionalProperties: false,
249
+ };
250
+ }
251
+
252
+ function captureDebugReportInputSchema(browserFamily) {
253
+ return {
254
+ type: "object",
255
+ properties: {
256
+ sessionId: {
257
+ type: "string",
258
+ },
259
+ consoleLimit: {
260
+ type: "integer",
261
+ minimum: 1,
262
+ },
263
+ networkLimit: {
264
+ type: "integer",
265
+ minimum: 1,
266
+ },
267
+ includeScreenshot: {
268
+ type: "boolean",
269
+ },
270
+ screenshotFormat: {
271
+ type: "string",
272
+ enum: screenshotFormatsFor(browserFamily),
273
+ },
274
+ },
275
+ required: ["sessionId"],
276
+ additionalProperties: false,
277
+ };
278
+ }
279
+
280
+ function restoreSessionSnapshotInputSchema() {
281
+ return {
282
+ type: "object",
283
+ properties: {
284
+ sessionId: {
285
+ type: "string",
286
+ },
287
+ snapshot: {
288
+ type: "string",
289
+ },
290
+ clearStorage: {
291
+ type: "boolean",
292
+ },
293
+ },
294
+ required: ["sessionId", "snapshot"],
295
+ additionalProperties: false,
296
+ };
297
+ }
298
+
299
+ function newTabInputSchema(browserFamily) {
300
+ const properties = {
301
+ url: {
302
+ type: "string",
303
+ },
304
+ };
305
+ const required = [];
306
+
307
+ if (browserFamily === "auto") {
308
+ properties.browserFamily = {
309
+ type: "string",
310
+ enum: ["chromium", "firefox"],
311
+ };
312
+ required.push("browserFamily");
313
+ }
314
+
315
+ return {
316
+ type: "object",
317
+ properties,
318
+ required,
319
+ additionalProperties: false,
320
+ };
321
+ }
322
+
323
+ function launchBrowserInputSchema(browserFamily) {
324
+ const properties = {
325
+ url: {
326
+ type: "string",
327
+ },
328
+ browserFamily: {
329
+ type: "string",
330
+ enum: supportedLaunchFamilies(browserFamily),
331
+ },
332
+ port: {
333
+ type: "integer",
334
+ minimum: 1,
335
+ },
336
+ address: {
337
+ type: "string",
338
+ },
339
+ userDataDir: {
340
+ type: "string",
341
+ },
342
+ waitMs: {
343
+ type: "integer",
344
+ minimum: 0,
345
+ },
346
+ skipDoctor: {
347
+ type: "boolean",
348
+ },
349
+ };
350
+ const required = browserFamily === "auto" ? ["browserFamily"] : [];
351
+
352
+ return {
353
+ type: "object",
354
+ properties,
355
+ required,
356
+ additionalProperties: false,
357
+ };
358
+ }
359
+
360
+ function ensureBrowserInputSchema(browserFamily) {
361
+ return {
362
+ type: "object",
363
+ properties: {
364
+ browserFamily: {
365
+ type: "string",
366
+ enum: supportedLaunchFamilies(browserFamily),
367
+ },
368
+ url: {
369
+ type: "string",
370
+ },
371
+ createTab: {
372
+ type: "boolean",
373
+ },
374
+ launchIfMissing: {
375
+ type: "boolean",
376
+ },
377
+ port: {
378
+ type: "integer",
379
+ minimum: 1,
380
+ },
381
+ address: {
382
+ type: "string",
383
+ },
384
+ userDataDir: {
385
+ type: "string",
386
+ },
387
+ waitMs: {
388
+ type: "integer",
389
+ minimum: 0,
390
+ },
391
+ skipDoctor: {
392
+ type: "boolean",
393
+ },
394
+ },
395
+ required: browserFamily === "auto" ? ["browserFamily"] : [],
396
+ additionalProperties: false,
397
+ };
398
+ }
399
+
400
+ function requestedBrowserFamily(configuredFamily, requestedFamily) {
401
+ if (requestedFamily) {
402
+ return requestedFamily;
403
+ }
404
+
405
+ return configuredFamily === "auto" ? null : configuredFamily;
406
+ }
407
+
408
+ function isRequestedBrowserAvailable(
409
+ status,
410
+ configuredFamily,
411
+ requestedFamily,
412
+ ) {
413
+ if (configuredFamily !== "auto" || !requestedFamily) {
414
+ return Boolean(status?.available);
415
+ }
416
+
417
+ return Boolean(status?.browsers?.[requestedFamily]?.available);
418
+ }
419
+
420
+ function shouldCreateBrowserTab(args) {
421
+ if (args.createTab !== undefined) {
422
+ return args.createTab;
423
+ }
424
+
425
+ return typeof args.url === "string" && args.url.trim() !== "";
426
+ }
427
+
428
+ function sameValue(left, right) {
429
+ return JSON.stringify(left) === JSON.stringify(right);
430
+ }
431
+
432
+ function compareField(left, right) {
433
+ return {
434
+ equal: sameValue(left, right),
435
+ a: left,
436
+ b: right,
437
+ };
438
+ }
439
+
440
+ function summarizeComparablePageState(page = {}) {
441
+ return {
442
+ browserFamily: page.browserFamily ?? null,
443
+ url: page.url ?? null,
444
+ title: page.title ?? null,
445
+ readyState: page.readyState ?? null,
446
+ visibilityState: page.visibilityState ?? null,
447
+ viewport: page.viewport ?? null,
448
+ scroll: page.scroll ?? null,
449
+ };
450
+ }
451
+
452
+ function summarizeComparableElement(result = {}) {
453
+ if (!result.found || !result.node) {
454
+ return {
455
+ found: false,
456
+ selector: result.selector ?? null,
457
+ error: result.error ?? null,
458
+ };
459
+ }
460
+
461
+ return {
462
+ found: true,
463
+ selector: result.selector ?? null,
464
+ tagName: result.node.tagName ?? null,
465
+ accessibleName: result.node.accessibleName ?? null,
466
+ role: result.node.role ?? null,
467
+ visible: result.node.visible ?? null,
468
+ disabled: result.node.disabled ?? null,
469
+ textContent: result.node.textContent ?? null,
470
+ };
471
+ }
472
+
176
473
  export class McpBrowserDevToolsServer {
177
474
  constructor({
178
475
  config,
179
476
  browserAdapter,
477
+ launchBrowser = launchLocalBrowser,
180
478
  input = process.stdin,
181
479
  output = process.stdout,
182
480
  errorOutput = process.stderr,
481
+ logger = createLogger({
482
+ level: config.logLevel,
483
+ output: errorOutput,
484
+ name: SERVER_NAME,
485
+ }),
183
486
  }) {
184
487
  this.config = config;
185
488
  this.browserAdapter = browserAdapter;
489
+ this.launchBrowser = launchBrowser;
186
490
  this.input = input;
187
491
  this.output = output;
188
492
  this.errorOutput = errorOutput;
493
+ this.logger = logger;
189
494
  this.messageBuffer = new MessageBuffer();
190
495
  this.tools = this.createTools();
191
496
  }
@@ -222,6 +527,97 @@ export class McpBrowserDevToolsServer {
222
527
  }),
223
528
  },
224
529
  ],
530
+ [
531
+ "launch_browser",
532
+ {
533
+ definition: {
534
+ name: "launch_browser",
535
+ description:
536
+ "Launch a local debug-enabled browser process that matches the current broker configuration and return launch details plus an optional doctor report.",
537
+ inputSchema: launchBrowserInputSchema(this.config.browserFamily),
538
+ },
539
+ handler: async (args) =>
540
+ this.launchBrowser({
541
+ config: this.config,
542
+ browserFamily: args.browserFamily,
543
+ url: args.url,
544
+ port: args.port,
545
+ address: args.address,
546
+ userDataDir: args.userDataDir,
547
+ waitMs: args.waitMs,
548
+ skipDoctor: args.skipDoctor,
549
+ }),
550
+ },
551
+ ],
552
+ [
553
+ "ensure_browser",
554
+ {
555
+ definition: {
556
+ name: "ensure_browser",
557
+ description:
558
+ "Ensure a compatible browser is reachable through the current broker. If needed, launch one locally and optionally open a tab for the requested URL.",
559
+ inputSchema: ensureBrowserInputSchema(this.config.browserFamily),
560
+ },
561
+ handler: async (args) => {
562
+ const browserFamily = requestedBrowserFamily(
563
+ this.config.browserFamily,
564
+ args.browserFamily,
565
+ );
566
+ const currentStatus = await this.browserAdapter.getBrowserStatus();
567
+ const available = isRequestedBrowserAvailable(
568
+ currentStatus,
569
+ this.config.browserFamily,
570
+ browserFamily,
571
+ );
572
+ let launch = null;
573
+ let status = currentStatus;
574
+
575
+ if (!available) {
576
+ if (args.launchIfMissing === false) {
577
+ return {
578
+ browserFamily,
579
+ available: false,
580
+ launched: false,
581
+ status,
582
+ tab: null,
583
+ };
584
+ }
585
+
586
+ launch = await this.launchBrowser({
587
+ config: this.config,
588
+ browserFamily,
589
+ url: args.url,
590
+ port: args.port,
591
+ address: args.address,
592
+ userDataDir: args.userDataDir,
593
+ waitMs: args.waitMs,
594
+ skipDoctor: args.skipDoctor,
595
+ });
596
+ status = await this.browserAdapter.getBrowserStatus();
597
+ }
598
+
599
+ let tab = null;
600
+ if (shouldCreateBrowserTab(args)) {
601
+ tab = await this.browserAdapter.createTab(args.url, {
602
+ browserFamily,
603
+ });
604
+ }
605
+
606
+ return {
607
+ browserFamily,
608
+ available: isRequestedBrowserAvailable(
609
+ status,
610
+ this.config.browserFamily,
611
+ browserFamily,
612
+ ),
613
+ launched: Boolean(launch),
614
+ launch,
615
+ status,
616
+ tab,
617
+ };
618
+ },
619
+ },
620
+ ],
225
621
  [
226
622
  "list_sessions",
227
623
  {
@@ -236,6 +632,43 @@ export class McpBrowserDevToolsServer {
236
632
  }),
237
633
  },
238
634
  ],
635
+ [
636
+ "new_tab",
637
+ {
638
+ definition: {
639
+ name: "new_tab",
640
+ description:
641
+ "Create a new browser tab and return the resulting target metadata.",
642
+ inputSchema: newTabInputSchema(this.config.browserFamily),
643
+ },
644
+ handler: async (args) =>
645
+ this.browserAdapter.createTab(args.url, {
646
+ browserFamily: args.browserFamily,
647
+ }),
648
+ },
649
+ ],
650
+ [
651
+ "close_tab",
652
+ {
653
+ definition: {
654
+ name: "close_tab",
655
+ description:
656
+ "Close a browser tab by target id. Any attached session for that tab will disconnect.",
657
+ inputSchema: {
658
+ type: "object",
659
+ properties: {
660
+ targetId: {
661
+ type: "string",
662
+ },
663
+ },
664
+ required: ["targetId"],
665
+ additionalProperties: false,
666
+ },
667
+ },
668
+ handler: async (args) =>
669
+ this.browserAdapter.closeTarget(args.targetId),
670
+ },
671
+ ],
239
672
  [
240
673
  "attach_tab",
241
674
  {
@@ -294,6 +727,268 @@ export class McpBrowserDevToolsServer {
294
727
  this.browserAdapter.getPageState(args.sessionId),
295
728
  },
296
729
  ],
730
+ [
731
+ "compare_page_state",
732
+ {
733
+ definition: {
734
+ name: "compare_page_state",
735
+ description:
736
+ "Compare bounded page state across two attached sessions, useful for cross-browser checks in auto mode.",
737
+ inputSchema: compareSessionsSchema({}, []),
738
+ },
739
+ handler: async (args) => {
740
+ const [pageA, pageB] = await Promise.all([
741
+ this.browserAdapter.getPageState(args.sessionIdA),
742
+ this.browserAdapter.getPageState(args.sessionIdB),
743
+ ]);
744
+ const left = summarizeComparablePageState(pageA);
745
+ const right = summarizeComparablePageState(pageB);
746
+ const fields = {
747
+ browserFamily: compareField(
748
+ left.browserFamily,
749
+ right.browserFamily,
750
+ ),
751
+ url: compareField(left.url, right.url),
752
+ title: compareField(left.title, right.title),
753
+ readyState: compareField(left.readyState, right.readyState),
754
+ visibilityState: compareField(
755
+ left.visibilityState,
756
+ right.visibilityState,
757
+ ),
758
+ viewport: compareField(left.viewport, right.viewport),
759
+ scroll: compareField(left.scroll, right.scroll),
760
+ };
761
+
762
+ return {
763
+ matches: Object.values(fields).every((field) => field.equal),
764
+ a: left,
765
+ b: right,
766
+ fields,
767
+ };
768
+ },
769
+ },
770
+ ],
771
+ [
772
+ "compare_selector",
773
+ {
774
+ definition: {
775
+ name: "compare_selector",
776
+ description:
777
+ "Compare a selector across two attached sessions using a bounded element summary.",
778
+ inputSchema: compareSessionsSchema(
779
+ {
780
+ selector: {
781
+ type: "string",
782
+ },
783
+ },
784
+ ["selector"],
785
+ ),
786
+ },
787
+ handler: async (args) => {
788
+ const [elementA, elementB] = await Promise.all([
789
+ this.browserAdapter.inspectElement(
790
+ args.sessionIdA,
791
+ args.selector,
792
+ ),
793
+ this.browserAdapter.inspectElement(
794
+ args.sessionIdB,
795
+ args.selector,
796
+ ),
797
+ ]);
798
+ const left = summarizeComparableElement(elementA);
799
+ const right = summarizeComparableElement(elementB);
800
+ const fields = {
801
+ found: compareField(left.found, right.found),
802
+ tagName: compareField(
803
+ left.tagName ?? null,
804
+ right.tagName ?? null,
805
+ ),
806
+ accessibleName: compareField(
807
+ left.accessibleName ?? null,
808
+ right.accessibleName ?? null,
809
+ ),
810
+ role: compareField(left.role ?? null, right.role ?? null),
811
+ visible: compareField(
812
+ left.visible ?? null,
813
+ right.visible ?? null,
814
+ ),
815
+ disabled: compareField(
816
+ left.disabled ?? null,
817
+ right.disabled ?? null,
818
+ ),
819
+ textContent: compareField(
820
+ left.textContent ?? null,
821
+ right.textContent ?? null,
822
+ ),
823
+ };
824
+
825
+ return {
826
+ selector: args.selector,
827
+ matches: Object.values(fields).every((field) => field.equal),
828
+ a: left,
829
+ b: right,
830
+ fields,
831
+ };
832
+ },
833
+ },
834
+ ],
835
+ [
836
+ "wait_for",
837
+ {
838
+ definition: {
839
+ name: "wait_for",
840
+ description:
841
+ "Wait for page state such as selector visibility, URL, or ready state on an attached session.",
842
+ inputSchema: waitForInputSchema(),
843
+ },
844
+ handler: async (args) => {
845
+ if (
846
+ !args.selector &&
847
+ !args.url &&
848
+ !args.urlIncludes &&
849
+ !args.readyState
850
+ ) {
851
+ throw new Error(
852
+ "wait_for requires at least one of selector, url, urlIncludes, or readyState",
853
+ );
854
+ }
855
+
856
+ if (!args.selector && args.state !== undefined) {
857
+ throw new Error("wait_for state requires selector");
858
+ }
859
+
860
+ return this.browserAdapter.waitFor(args.sessionId, {
861
+ selector: args.selector,
862
+ state: args.state,
863
+ url: args.url,
864
+ urlIncludes: args.urlIncludes,
865
+ readyState: args.readyState,
866
+ timeoutMs: args.timeoutMs,
867
+ pollIntervalMs: args.pollIntervalMs,
868
+ });
869
+ },
870
+ },
871
+ ],
872
+ [
873
+ "get_cookies",
874
+ {
875
+ definition: {
876
+ name: "get_cookies",
877
+ description:
878
+ "Read bounded page-visible cookies for the attached session.",
879
+ inputSchema: sessionSchema({}, []),
880
+ },
881
+ handler: async (args) =>
882
+ this.browserAdapter.getCookies(args.sessionId),
883
+ },
884
+ ],
885
+ [
886
+ "get_storage",
887
+ {
888
+ definition: {
889
+ name: "get_storage",
890
+ description:
891
+ "Read bounded localStorage and sessionStorage entries for the attached session.",
892
+ inputSchema: storageInputSchema(),
893
+ },
894
+ handler: async (args) => {
895
+ const result = await this.browserAdapter.getStorage(args.sessionId);
896
+ if (!args.area || args.area === "all") {
897
+ return result;
898
+ }
899
+
900
+ return {
901
+ browserFamily: result.browserFamily,
902
+ storage: {
903
+ [args.area]: result.storage?.[args.area] ?? null,
904
+ },
905
+ };
906
+ },
907
+ },
908
+ ],
909
+ [
910
+ "capture_debug_report",
911
+ {
912
+ definition: {
913
+ name: "capture_debug_report",
914
+ description:
915
+ "Capture a bounded debug bundle with page state, cookies/storage summary, recent console, recent network, and an optional screenshot.",
916
+ inputSchema: captureDebugReportInputSchema(
917
+ this.config.browserFamily,
918
+ ),
919
+ },
920
+ handler: async (args) =>
921
+ this.browserAdapter.captureDebugReport(args.sessionId, {
922
+ consoleLimit: args.consoleLimit,
923
+ networkLimit: args.networkLimit,
924
+ includeScreenshot: args.includeScreenshot,
925
+ screenshotFormat: args.screenshotFormat,
926
+ }),
927
+ },
928
+ ],
929
+ [
930
+ "capture_session_snapshot",
931
+ {
932
+ definition: {
933
+ name: "capture_session_snapshot",
934
+ description:
935
+ "Capture a bounded session snapshot with page state, cookies, and web storage for later bounded restore on the same origin.",
936
+ inputSchema: sessionSchema({}, []),
937
+ },
938
+ handler: async (args) =>
939
+ this.browserAdapter.captureSessionSnapshot(args.sessionId),
940
+ },
941
+ ],
942
+ [
943
+ "restore_session_snapshot",
944
+ {
945
+ definition: {
946
+ name: "restore_session_snapshot",
947
+ description:
948
+ "Restore a bounded session snapshot into the currently attached page context. Restores only page-visible cookies plus localStorage/sessionStorage on the current origin.",
949
+ inputSchema: restoreSessionSnapshotInputSchema(),
950
+ },
951
+ handler: async (args) => {
952
+ let snapshot;
953
+ try {
954
+ snapshot = JSON.parse(args.snapshot);
955
+ } catch {
956
+ throw new Error(
957
+ "restore_session_snapshot snapshot must be valid JSON",
958
+ );
959
+ }
960
+
961
+ if (!snapshot || typeof snapshot !== "object") {
962
+ throw new Error(
963
+ "restore_session_snapshot snapshot must decode to an object",
964
+ );
965
+ }
966
+
967
+ return this.browserAdapter.restoreSessionSnapshot(
968
+ args.sessionId,
969
+ snapshot,
970
+ {
971
+ clearStorage: args.clearStorage,
972
+ },
973
+ );
974
+ },
975
+ },
976
+ ],
977
+ [
978
+ "get_har",
979
+ {
980
+ definition: {
981
+ name: "get_har",
982
+ description:
983
+ "Export a bounded HAR-like summary from buffered network activity for an attached session.",
984
+ inputSchema: sessionWithLimitSchema(),
985
+ },
986
+ handler: async (args) =>
987
+ this.browserAdapter.getHar(args.sessionId, {
988
+ limit: args.limit ?? 50,
989
+ }),
990
+ },
991
+ ],
297
992
  [
298
993
  "navigate",
299
994
  {
@@ -748,9 +1443,11 @@ export class McpBrowserDevToolsServer {
748
1443
 
749
1444
  this.input.on("data", (chunk) => {
750
1445
  sawInput = true;
751
- if (DEBUG_STDIO_ENABLED) {
752
- this.log(
1446
+ if (this.config.debugStdio) {
1447
+ this.logger.log(
1448
+ "debug",
753
1449
  `stdin chunk bytes=${chunk.length} preview="${formatChunkPreview(chunk)}"`,
1450
+ { force: true },
754
1451
  );
755
1452
  }
756
1453
 
@@ -758,7 +1455,7 @@ export class McpBrowserDevToolsServer {
758
1455
  try {
759
1456
  messages = this.messageBuffer.push(chunk);
760
1457
  } catch (error) {
761
- this.log(`failed to parse incoming message: ${error.message}`);
1458
+ this.logger.error(`failed to parse incoming message: ${error.message}`);
762
1459
  return;
763
1460
  }
764
1461
 
@@ -767,13 +1464,17 @@ export class McpBrowserDevToolsServer {
767
1464
  }
768
1465
  });
769
1466
 
770
- if (DEBUG_STDIO_ENABLED) {
1467
+ if (this.config.debugStdio) {
771
1468
  this.input.on("end", () => {
772
- this.log(`stdin ended after_input=${sawInput}`);
1469
+ this.logger.log("debug", `stdin ended after_input=${sawInput}`, {
1470
+ force: true,
1471
+ });
773
1472
  });
774
1473
 
775
1474
  this.input.on("close", () => {
776
- this.log(`stdin closed after_input=${sawInput}`);
1475
+ this.logger.log("debug", `stdin closed after_input=${sawInput}`, {
1476
+ force: true,
1477
+ });
777
1478
  });
778
1479
  }
779
1480
 
@@ -781,15 +1482,11 @@ export class McpBrowserDevToolsServer {
781
1482
  this.input.resume();
782
1483
  }
783
1484
 
784
- this.log(
1485
+ this.logger.info(
785
1486
  `listening on stdio for MCP messages; browser=${this.config.browserFamily}`,
786
1487
  );
787
1488
  }
788
1489
 
789
- log(message) {
790
- this.errorOutput.write(`[${SERVER_NAME}] ${message}\n`);
791
- }
792
-
793
1490
  async dispatch(message) {
794
1491
  const response = await this.handleRequest(message);
795
1492
  if (!response) {