chrome-devtools-mcp 0.18.0 → 0.19.0

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 (40) hide show
  1. package/README.md +4 -3
  2. package/build/src/McpContext.js +248 -266
  3. package/build/src/McpPage.js +95 -0
  4. package/build/src/McpResponse.js +99 -28
  5. package/build/src/bin/chrome-devtools.js +184 -0
  6. package/build/src/bin/cliDefinitions.js +651 -0
  7. package/build/src/browser.js +5 -3
  8. package/build/src/cli.js +11 -1
  9. package/build/src/daemon/client.js +151 -0
  10. package/build/src/daemon/daemon.js +49 -15
  11. package/build/src/daemon/types.js +6 -0
  12. package/build/src/daemon/utils.js +56 -15
  13. package/build/src/main.js +5 -171
  14. package/build/src/server.js +209 -0
  15. package/build/src/telemetry/watchdog/ClearcutSender.js +2 -0
  16. package/build/src/third_party/THIRD_PARTY_NOTICES +1480 -111
  17. package/build/src/third_party/bundled-packages.json +4 -3
  18. package/build/src/third_party/devtools-formatter-worker.js +5 -13
  19. package/build/src/third_party/index.js +1980 -396
  20. package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +54183 -0
  21. package/build/src/tools/ToolDefinition.js +52 -0
  22. package/build/src/tools/console.js +3 -3
  23. package/build/src/tools/emulation.js +13 -45
  24. package/build/src/tools/extensions.js +17 -0
  25. package/build/src/tools/input.js +33 -33
  26. package/build/src/tools/lighthouse.js +123 -0
  27. package/build/src/tools/memory.js +6 -7
  28. package/build/src/tools/network.js +7 -7
  29. package/build/src/tools/pages.js +46 -44
  30. package/build/src/tools/performance.js +16 -14
  31. package/build/src/tools/screencast.js +5 -5
  32. package/build/src/tools/screenshot.js +6 -6
  33. package/build/src/tools/script.js +99 -49
  34. package/build/src/tools/slim/tools.js +18 -18
  35. package/build/src/tools/snapshot.js +5 -4
  36. package/build/src/tools/tools.js +2 -1
  37. package/build/src/types.js +6 -0
  38. package/build/src/utils/files.js +19 -0
  39. package/build/src/version.js +1 -1
  40. package/package.json +11 -8
@@ -2,34 +2,36 @@ import process$2 from 'node:process';
2
2
  import readline from 'node:readline';
3
3
  import * as WorkerThreads from 'node:worker_threads';
4
4
  import require$$2, { strictEqual, notStrictEqual } from 'assert';
5
- import require$$1$4, { resolve as resolve$2, dirname, normalize, join, relative, extname, basename } from 'path';
6
- import require$$0$7, { statSync, readdirSync, readFileSync, writeFile } from 'fs';
5
+ import require$$0$4, { resolve as resolve$2, dirname, normalize, join, relative, extname, basename } from 'path';
6
+ import require$$0$3, { statSync, readdirSync, readFileSync, writeFile } from 'fs';
7
7
  import require$$0$2, { format as format$5, inspect } from 'util';
8
8
  import require$$5, { fileURLToPath } from 'url';
9
9
  import { createRequire } from 'node:module';
10
10
  import fs, { readdirSync as readdirSync$1, readFileSync as readFileSync$1, accessSync, existsSync } from 'node:fs';
11
11
  import require$$1 from 'tty';
12
12
  import require$$0$1 from 'os';
13
+ import require$$0$5 from 'child_process';
14
+ import { PassThrough } from 'node:stream';
13
15
  import { mkdtemp, unlink, rename, readFile } from 'node:fs/promises';
14
16
  import os, { tmpdir } from 'node:os';
15
17
  import path$1, { join as join$1, dirname as dirname$1 } from 'node:path';
16
- import childProcess, { execSync, spawnSync, spawn } from 'node:child_process';
18
+ import childProcess, { execSync, spawnSync, spawn as spawn$1 } from 'node:child_process';
17
19
  import { EventEmitter as EventEmitter$1 } from 'node:events';
18
20
  import * as http$1 from 'node:http';
19
21
  import * as https$1 from 'node:https';
20
22
  import { urlToHttpOptions, URL as URL$1 } from 'node:url';
21
- import require$$0$3 from 'http';
23
+ import require$$0$6 from 'http';
22
24
  import require$$1$1 from 'https';
23
- import require$$0$4 from 'net';
25
+ import require$$0$7 from 'net';
24
26
  import require$$1$2 from 'tls';
25
- import require$$0$5 from 'events';
26
- import require$$0$6 from 'buffer';
27
+ import require$$0$8 from 'events';
28
+ import require$$0$9 from 'buffer';
27
29
  import require$$1$3 from 'stream';
28
30
  import require$$3$3 from 'dns';
29
31
  import require$$2$1 from 'crypto';
30
32
  import 'node:assert';
31
- import { PassThrough } from 'node:stream';
32
- import require$$0$8 from 'zlib';
33
+ import require$$0$a from 'zlib';
34
+ import { generateReport as generateReport$1, navigation as navigation$1, snapshot as snapshot$1 } from './lighthouse-devtools-mcp-bundle.js';
33
35
 
34
36
  function _mergeNamespaces(n, m) {
35
37
  m.forEach(function (e) {
@@ -20966,7 +20968,7 @@ const ToolListChangedNotificationSchema = NotificationSchema.extend({
20966
20968
  method: literal('notifications/tools/list_changed'),
20967
20969
  params: NotificationsParamsSchema.optional()
20968
20970
  });
20969
- object({
20971
+ const ListChangedOptionsBaseSchema = object({
20970
20972
  autoRefresh: boolean().default(true),
20971
20973
  debounceMs: number().int().nonnegative().default(300)
20972
20974
  });
@@ -36675,273 +36677,333 @@ class ExperimentalServerTasks {
36675
36677
  requestStream(request, resultSchema, options) {
36676
36678
  return this._server.requestStream(request, resultSchema, options);
36677
36679
  }
36678
- async getTask(taskId, options) {
36679
- return this._server.getTask({ taskId }, options);
36680
- }
36681
- async getTaskResult(taskId, resultSchema, options) {
36682
- return this._server.getTaskResult({ taskId }, resultSchema, options);
36683
- }
36684
- async listTasks(cursor, options) {
36685
- return this._server.listTasks(cursor ? { cursor } : undefined, options);
36686
- }
36687
- async cancelTask(taskId, options) {
36688
- return this._server.cancelTask({ taskId }, options);
36689
- }
36690
- }
36691
-
36692
- function assertToolsCallTaskCapability(requests, method, entityName) {
36693
- if (!requests) {
36694
- throw new Error(`${entityName} does not support task creation (required for ${method})`);
36695
- }
36696
- switch (method) {
36697
- case 'tools/call':
36698
- if (!requests.tools?.call) {
36699
- throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
36700
- }
36701
- break;
36702
- }
36703
- }
36704
- function assertClientRequestTaskCapability(requests, method, entityName) {
36705
- if (!requests) {
36706
- throw new Error(`${entityName} does not support task creation (required for ${method})`);
36707
- }
36708
- switch (method) {
36709
- case 'sampling/createMessage':
36710
- if (!requests.sampling?.createMessage) {
36711
- throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
36712
- }
36713
- break;
36714
- case 'elicitation/create':
36715
- if (!requests.elicitation?.create) {
36716
- throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
36717
- }
36718
- break;
36719
- }
36720
- }
36721
-
36722
- class Server extends Protocol {
36723
- constructor(_serverInfo, options) {
36724
- super(options);
36725
- this._serverInfo = _serverInfo;
36726
- this._loggingLevels = new Map();
36727
- this.LOG_LEVEL_SEVERITY = new Map(LoggingLevelSchema.options.map((level, index) => [level, index]));
36728
- this.isMessageIgnored = (level, sessionId) => {
36729
- const currentLevel = this._loggingLevels.get(sessionId);
36730
- return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
36731
- };
36732
- this._capabilities = options?.capabilities ?? {};
36733
- this._instructions = options?.instructions;
36734
- this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
36735
- this.setRequestHandler(InitializeRequestSchema, request => this._oninitialize(request));
36736
- this.setNotificationHandler(InitializedNotificationSchema, () => this.oninitialized?.());
36737
- if (this._capabilities.logging) {
36738
- this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => {
36739
- const transportSessionId = extra.sessionId || extra.requestInfo?.headers['mcp-session-id'] || undefined;
36740
- const { level } = request.params;
36741
- const parseResult = LoggingLevelSchema.safeParse(level);
36742
- if (parseResult.success) {
36743
- this._loggingLevels.set(transportSessionId, parseResult.data);
36744
- }
36745
- return {};
36746
- });
36747
- }
36748
- }
36749
- get experimental() {
36750
- if (!this._experimental) {
36751
- this._experimental = {
36752
- tasks: new ExperimentalServerTasks(this)
36753
- };
36754
- }
36755
- return this._experimental;
36756
- }
36757
- registerCapabilities(capabilities) {
36758
- if (this.transport) {
36759
- throw new Error('Cannot register capabilities after connecting to transport');
36760
- }
36761
- this._capabilities = mergeCapabilities(this._capabilities, capabilities);
36762
- }
36763
- setRequestHandler(requestSchema, handler) {
36764
- const shape = getObjectShape(requestSchema);
36765
- const methodSchema = shape?.method;
36766
- if (!methodSchema) {
36767
- throw new Error('Schema is missing a method literal');
36768
- }
36769
- let methodValue;
36770
- if (isZ4Schema(methodSchema)) {
36771
- const v4Schema = methodSchema;
36772
- const v4Def = v4Schema._zod?.def;
36773
- methodValue = v4Def?.value ?? v4Schema.value;
36774
- }
36775
- else {
36776
- const v3Schema = methodSchema;
36777
- const legacyDef = v3Schema._def;
36778
- methodValue = legacyDef?.value ?? v3Schema.value;
36779
- }
36780
- if (typeof methodValue !== 'string') {
36781
- throw new Error('Schema method literal must be a string');
36782
- }
36783
- const method = methodValue;
36784
- if (method === 'tools/call') {
36785
- const wrappedHandler = async (request, extra) => {
36786
- const validatedRequest = safeParse$1(CallToolRequestSchema, request);
36787
- if (!validatedRequest.success) {
36788
- const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
36789
- throw new McpError(ErrorCode$1.InvalidParams, `Invalid tools/call request: ${errorMessage}`);
36790
- }
36791
- const { params } = validatedRequest.data;
36792
- const result = await Promise.resolve(handler(request, extra));
36793
- if (params.task) {
36794
- const taskValidationResult = safeParse$1(CreateTaskResultSchema, result);
36795
- if (!taskValidationResult.success) {
36796
- const errorMessage = taskValidationResult.error instanceof Error
36797
- ? taskValidationResult.error.message
36798
- : String(taskValidationResult.error);
36799
- throw new McpError(ErrorCode$1.InvalidParams, `Invalid task creation result: ${errorMessage}`);
36800
- }
36801
- return taskValidationResult.data;
36802
- }
36803
- const validationResult = safeParse$1(CallToolResultSchema, result);
36804
- if (!validationResult.success) {
36805
- const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
36806
- throw new McpError(ErrorCode$1.InvalidParams, `Invalid tools/call result: ${errorMessage}`);
36807
- }
36808
- return validationResult.data;
36809
- };
36810
- return super.setRequestHandler(requestSchema, wrappedHandler);
36811
- }
36812
- return super.setRequestHandler(requestSchema, handler);
36813
- }
36814
- assertCapabilityForMethod(method) {
36815
- switch (method) {
36816
- case 'sampling/createMessage':
36817
- if (!this._clientCapabilities?.sampling) {
36818
- throw new Error(`Client does not support sampling (required for ${method})`);
36819
- }
36820
- break;
36821
- case 'elicitation/create':
36822
- if (!this._clientCapabilities?.elicitation) {
36823
- throw new Error(`Client does not support elicitation (required for ${method})`);
36824
- }
36825
- break;
36826
- case 'roots/list':
36827
- if (!this._clientCapabilities?.roots) {
36828
- throw new Error(`Client does not support listing roots (required for ${method})`);
36829
- }
36830
- break;
36831
- }
36832
- }
36833
- assertNotificationCapability(method) {
36834
- switch (method) {
36835
- case 'notifications/message':
36836
- if (!this._capabilities.logging) {
36837
- throw new Error(`Server does not support logging (required for ${method})`);
36838
- }
36839
- break;
36840
- case 'notifications/resources/updated':
36841
- case 'notifications/resources/list_changed':
36842
- if (!this._capabilities.resources) {
36843
- throw new Error(`Server does not support notifying about resources (required for ${method})`);
36844
- }
36845
- break;
36846
- case 'notifications/tools/list_changed':
36847
- if (!this._capabilities.tools) {
36848
- throw new Error(`Server does not support notifying of tool list changes (required for ${method})`);
36849
- }
36850
- break;
36851
- case 'notifications/prompts/list_changed':
36852
- if (!this._capabilities.prompts) {
36853
- throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`);
36854
- }
36855
- break;
36856
- case 'notifications/elicitation/complete':
36857
- if (!this._clientCapabilities?.elicitation?.url) {
36858
- throw new Error(`Client does not support URL elicitation (required for ${method})`);
36859
- }
36860
- break;
36861
- }
36862
- }
36863
- assertRequestHandlerCapability(method) {
36864
- if (!this._capabilities) {
36865
- return;
36866
- }
36867
- switch (method) {
36868
- case 'completion/complete':
36869
- if (!this._capabilities.completions) {
36870
- throw new Error(`Server does not support completions (required for ${method})`);
36871
- }
36872
- break;
36873
- case 'logging/setLevel':
36874
- if (!this._capabilities.logging) {
36875
- throw new Error(`Server does not support logging (required for ${method})`);
36876
- }
36877
- break;
36878
- case 'prompts/get':
36879
- case 'prompts/list':
36880
- if (!this._capabilities.prompts) {
36881
- throw new Error(`Server does not support prompts (required for ${method})`);
36882
- }
36883
- break;
36884
- case 'resources/list':
36885
- case 'resources/templates/list':
36886
- case 'resources/read':
36887
- if (!this._capabilities.resources) {
36888
- throw new Error(`Server does not support resources (required for ${method})`);
36889
- }
36890
- break;
36891
- case 'tools/call':
36892
- case 'tools/list':
36893
- if (!this._capabilities.tools) {
36894
- throw new Error(`Server does not support tools (required for ${method})`);
36895
- }
36896
- break;
36897
- case 'tasks/get':
36898
- case 'tasks/list':
36899
- case 'tasks/result':
36900
- case 'tasks/cancel':
36901
- if (!this._capabilities.tasks) {
36902
- throw new Error(`Server does not support tasks capability (required for ${method})`);
36903
- }
36904
- break;
36905
- }
36906
- }
36907
- assertTaskCapability(method) {
36908
- assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method, 'Client');
36909
- }
36910
- assertTaskHandlerCapability(method) {
36911
- if (!this._capabilities) {
36912
- return;
36913
- }
36914
- assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method, 'Server');
36915
- }
36916
- async _oninitialize(request) {
36917
- const requestedVersion = request.params.protocolVersion;
36918
- this._clientCapabilities = request.params.capabilities;
36919
- this._clientVersion = request.params.clientInfo;
36920
- const protocolVersion = SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) ? requestedVersion : LATEST_PROTOCOL_VERSION;
36921
- return {
36922
- protocolVersion,
36923
- capabilities: this.getCapabilities(),
36924
- serverInfo: this._serverInfo,
36925
- ...(this._instructions && { instructions: this._instructions })
36926
- };
36927
- }
36928
- getClientCapabilities() {
36929
- return this._clientCapabilities;
36930
- }
36931
- getClientVersion() {
36932
- return this._clientVersion;
36933
- }
36934
- getCapabilities() {
36935
- return this._capabilities;
36936
- }
36937
- async ping() {
36938
- return this.request({ method: 'ping' }, EmptyResultSchema);
36939
- }
36940
- async createMessage(params, options) {
36941
- if (params.tools || params.toolChoice) {
36942
- if (!this._clientCapabilities?.sampling?.tools) {
36943
- throw new Error('Client does not support sampling tools capability.');
36944
- }
36680
+ createMessageStream(params, options) {
36681
+ const clientCapabilities = this._server.getClientCapabilities();
36682
+ if ((params.tools || params.toolChoice) && !clientCapabilities?.sampling?.tools) {
36683
+ throw new Error('Client does not support sampling tools capability.');
36684
+ }
36685
+ if (params.messages.length > 0) {
36686
+ const lastMessage = params.messages[params.messages.length - 1];
36687
+ const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
36688
+ const hasToolResults = lastContent.some(c => c.type === 'tool_result');
36689
+ const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined;
36690
+ const previousContent = previousMessage
36691
+ ? Array.isArray(previousMessage.content)
36692
+ ? previousMessage.content
36693
+ : [previousMessage.content]
36694
+ : [];
36695
+ const hasPreviousToolUse = previousContent.some(c => c.type === 'tool_use');
36696
+ if (hasToolResults) {
36697
+ if (lastContent.some(c => c.type !== 'tool_result')) {
36698
+ throw new Error('The last message must contain only tool_result content if any is present');
36699
+ }
36700
+ if (!hasPreviousToolUse) {
36701
+ throw new Error('tool_result blocks are not matching any tool_use from the previous message');
36702
+ }
36703
+ }
36704
+ if (hasPreviousToolUse) {
36705
+ const toolUseIds = new Set(previousContent.filter(c => c.type === 'tool_use').map(c => c.id));
36706
+ const toolResultIds = new Set(lastContent.filter(c => c.type === 'tool_result').map(c => c.toolUseId));
36707
+ if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every(id => toolResultIds.has(id))) {
36708
+ throw new Error('ids of tool_result blocks and tool_use blocks from previous message do not match');
36709
+ }
36710
+ }
36711
+ }
36712
+ return this.requestStream({
36713
+ method: 'sampling/createMessage',
36714
+ params
36715
+ }, CreateMessageResultSchema, options);
36716
+ }
36717
+ elicitInputStream(params, options) {
36718
+ const clientCapabilities = this._server.getClientCapabilities();
36719
+ const mode = params.mode ?? 'form';
36720
+ switch (mode) {
36721
+ case 'url': {
36722
+ if (!clientCapabilities?.elicitation?.url) {
36723
+ throw new Error('Client does not support url elicitation.');
36724
+ }
36725
+ break;
36726
+ }
36727
+ case 'form': {
36728
+ if (!clientCapabilities?.elicitation?.form) {
36729
+ throw new Error('Client does not support form elicitation.');
36730
+ }
36731
+ break;
36732
+ }
36733
+ }
36734
+ const normalizedParams = mode === 'form' && params.mode === undefined ? { ...params, mode: 'form' } : params;
36735
+ return this.requestStream({
36736
+ method: 'elicitation/create',
36737
+ params: normalizedParams
36738
+ }, ElicitResultSchema, options);
36739
+ }
36740
+ async getTask(taskId, options) {
36741
+ return this._server.getTask({ taskId }, options);
36742
+ }
36743
+ async getTaskResult(taskId, resultSchema, options) {
36744
+ return this._server.getTaskResult({ taskId }, resultSchema, options);
36745
+ }
36746
+ async listTasks(cursor, options) {
36747
+ return this._server.listTasks(cursor ? { cursor } : undefined, options);
36748
+ }
36749
+ async cancelTask(taskId, options) {
36750
+ return this._server.cancelTask({ taskId }, options);
36751
+ }
36752
+ }
36753
+
36754
+ function assertToolsCallTaskCapability(requests, method, entityName) {
36755
+ if (!requests) {
36756
+ throw new Error(`${entityName} does not support task creation (required for ${method})`);
36757
+ }
36758
+ switch (method) {
36759
+ case 'tools/call':
36760
+ if (!requests.tools?.call) {
36761
+ throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
36762
+ }
36763
+ break;
36764
+ }
36765
+ }
36766
+ function assertClientRequestTaskCapability(requests, method, entityName) {
36767
+ if (!requests) {
36768
+ throw new Error(`${entityName} does not support task creation (required for ${method})`);
36769
+ }
36770
+ switch (method) {
36771
+ case 'sampling/createMessage':
36772
+ if (!requests.sampling?.createMessage) {
36773
+ throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
36774
+ }
36775
+ break;
36776
+ case 'elicitation/create':
36777
+ if (!requests.elicitation?.create) {
36778
+ throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
36779
+ }
36780
+ break;
36781
+ }
36782
+ }
36783
+
36784
+ class Server extends Protocol {
36785
+ constructor(_serverInfo, options) {
36786
+ super(options);
36787
+ this._serverInfo = _serverInfo;
36788
+ this._loggingLevels = new Map();
36789
+ this.LOG_LEVEL_SEVERITY = new Map(LoggingLevelSchema.options.map((level, index) => [level, index]));
36790
+ this.isMessageIgnored = (level, sessionId) => {
36791
+ const currentLevel = this._loggingLevels.get(sessionId);
36792
+ return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
36793
+ };
36794
+ this._capabilities = options?.capabilities ?? {};
36795
+ this._instructions = options?.instructions;
36796
+ this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
36797
+ this.setRequestHandler(InitializeRequestSchema, request => this._oninitialize(request));
36798
+ this.setNotificationHandler(InitializedNotificationSchema, () => this.oninitialized?.());
36799
+ if (this._capabilities.logging) {
36800
+ this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => {
36801
+ const transportSessionId = extra.sessionId || extra.requestInfo?.headers['mcp-session-id'] || undefined;
36802
+ const { level } = request.params;
36803
+ const parseResult = LoggingLevelSchema.safeParse(level);
36804
+ if (parseResult.success) {
36805
+ this._loggingLevels.set(transportSessionId, parseResult.data);
36806
+ }
36807
+ return {};
36808
+ });
36809
+ }
36810
+ }
36811
+ get experimental() {
36812
+ if (!this._experimental) {
36813
+ this._experimental = {
36814
+ tasks: new ExperimentalServerTasks(this)
36815
+ };
36816
+ }
36817
+ return this._experimental;
36818
+ }
36819
+ registerCapabilities(capabilities) {
36820
+ if (this.transport) {
36821
+ throw new Error('Cannot register capabilities after connecting to transport');
36822
+ }
36823
+ this._capabilities = mergeCapabilities(this._capabilities, capabilities);
36824
+ }
36825
+ setRequestHandler(requestSchema, handler) {
36826
+ const shape = getObjectShape(requestSchema);
36827
+ const methodSchema = shape?.method;
36828
+ if (!methodSchema) {
36829
+ throw new Error('Schema is missing a method literal');
36830
+ }
36831
+ let methodValue;
36832
+ if (isZ4Schema(methodSchema)) {
36833
+ const v4Schema = methodSchema;
36834
+ const v4Def = v4Schema._zod?.def;
36835
+ methodValue = v4Def?.value ?? v4Schema.value;
36836
+ }
36837
+ else {
36838
+ const v3Schema = methodSchema;
36839
+ const legacyDef = v3Schema._def;
36840
+ methodValue = legacyDef?.value ?? v3Schema.value;
36841
+ }
36842
+ if (typeof methodValue !== 'string') {
36843
+ throw new Error('Schema method literal must be a string');
36844
+ }
36845
+ const method = methodValue;
36846
+ if (method === 'tools/call') {
36847
+ const wrappedHandler = async (request, extra) => {
36848
+ const validatedRequest = safeParse$1(CallToolRequestSchema, request);
36849
+ if (!validatedRequest.success) {
36850
+ const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
36851
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid tools/call request: ${errorMessage}`);
36852
+ }
36853
+ const { params } = validatedRequest.data;
36854
+ const result = await Promise.resolve(handler(request, extra));
36855
+ if (params.task) {
36856
+ const taskValidationResult = safeParse$1(CreateTaskResultSchema, result);
36857
+ if (!taskValidationResult.success) {
36858
+ const errorMessage = taskValidationResult.error instanceof Error
36859
+ ? taskValidationResult.error.message
36860
+ : String(taskValidationResult.error);
36861
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid task creation result: ${errorMessage}`);
36862
+ }
36863
+ return taskValidationResult.data;
36864
+ }
36865
+ const validationResult = safeParse$1(CallToolResultSchema, result);
36866
+ if (!validationResult.success) {
36867
+ const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
36868
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid tools/call result: ${errorMessage}`);
36869
+ }
36870
+ return validationResult.data;
36871
+ };
36872
+ return super.setRequestHandler(requestSchema, wrappedHandler);
36873
+ }
36874
+ return super.setRequestHandler(requestSchema, handler);
36875
+ }
36876
+ assertCapabilityForMethod(method) {
36877
+ switch (method) {
36878
+ case 'sampling/createMessage':
36879
+ if (!this._clientCapabilities?.sampling) {
36880
+ throw new Error(`Client does not support sampling (required for ${method})`);
36881
+ }
36882
+ break;
36883
+ case 'elicitation/create':
36884
+ if (!this._clientCapabilities?.elicitation) {
36885
+ throw new Error(`Client does not support elicitation (required for ${method})`);
36886
+ }
36887
+ break;
36888
+ case 'roots/list':
36889
+ if (!this._clientCapabilities?.roots) {
36890
+ throw new Error(`Client does not support listing roots (required for ${method})`);
36891
+ }
36892
+ break;
36893
+ }
36894
+ }
36895
+ assertNotificationCapability(method) {
36896
+ switch (method) {
36897
+ case 'notifications/message':
36898
+ if (!this._capabilities.logging) {
36899
+ throw new Error(`Server does not support logging (required for ${method})`);
36900
+ }
36901
+ break;
36902
+ case 'notifications/resources/updated':
36903
+ case 'notifications/resources/list_changed':
36904
+ if (!this._capabilities.resources) {
36905
+ throw new Error(`Server does not support notifying about resources (required for ${method})`);
36906
+ }
36907
+ break;
36908
+ case 'notifications/tools/list_changed':
36909
+ if (!this._capabilities.tools) {
36910
+ throw new Error(`Server does not support notifying of tool list changes (required for ${method})`);
36911
+ }
36912
+ break;
36913
+ case 'notifications/prompts/list_changed':
36914
+ if (!this._capabilities.prompts) {
36915
+ throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`);
36916
+ }
36917
+ break;
36918
+ case 'notifications/elicitation/complete':
36919
+ if (!this._clientCapabilities?.elicitation?.url) {
36920
+ throw new Error(`Client does not support URL elicitation (required for ${method})`);
36921
+ }
36922
+ break;
36923
+ }
36924
+ }
36925
+ assertRequestHandlerCapability(method) {
36926
+ if (!this._capabilities) {
36927
+ return;
36928
+ }
36929
+ switch (method) {
36930
+ case 'completion/complete':
36931
+ if (!this._capabilities.completions) {
36932
+ throw new Error(`Server does not support completions (required for ${method})`);
36933
+ }
36934
+ break;
36935
+ case 'logging/setLevel':
36936
+ if (!this._capabilities.logging) {
36937
+ throw new Error(`Server does not support logging (required for ${method})`);
36938
+ }
36939
+ break;
36940
+ case 'prompts/get':
36941
+ case 'prompts/list':
36942
+ if (!this._capabilities.prompts) {
36943
+ throw new Error(`Server does not support prompts (required for ${method})`);
36944
+ }
36945
+ break;
36946
+ case 'resources/list':
36947
+ case 'resources/templates/list':
36948
+ case 'resources/read':
36949
+ if (!this._capabilities.resources) {
36950
+ throw new Error(`Server does not support resources (required for ${method})`);
36951
+ }
36952
+ break;
36953
+ case 'tools/call':
36954
+ case 'tools/list':
36955
+ if (!this._capabilities.tools) {
36956
+ throw new Error(`Server does not support tools (required for ${method})`);
36957
+ }
36958
+ break;
36959
+ case 'tasks/get':
36960
+ case 'tasks/list':
36961
+ case 'tasks/result':
36962
+ case 'tasks/cancel':
36963
+ if (!this._capabilities.tasks) {
36964
+ throw new Error(`Server does not support tasks capability (required for ${method})`);
36965
+ }
36966
+ break;
36967
+ }
36968
+ }
36969
+ assertTaskCapability(method) {
36970
+ assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method, 'Client');
36971
+ }
36972
+ assertTaskHandlerCapability(method) {
36973
+ if (!this._capabilities) {
36974
+ return;
36975
+ }
36976
+ assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method, 'Server');
36977
+ }
36978
+ async _oninitialize(request) {
36979
+ const requestedVersion = request.params.protocolVersion;
36980
+ this._clientCapabilities = request.params.capabilities;
36981
+ this._clientVersion = request.params.clientInfo;
36982
+ const protocolVersion = SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) ? requestedVersion : LATEST_PROTOCOL_VERSION;
36983
+ return {
36984
+ protocolVersion,
36985
+ capabilities: this.getCapabilities(),
36986
+ serverInfo: this._serverInfo,
36987
+ ...(this._instructions && { instructions: this._instructions })
36988
+ };
36989
+ }
36990
+ getClientCapabilities() {
36991
+ return this._clientCapabilities;
36992
+ }
36993
+ getClientVersion() {
36994
+ return this._clientVersion;
36995
+ }
36996
+ getCapabilities() {
36997
+ return this._capabilities;
36998
+ }
36999
+ async ping() {
37000
+ return this.request({ method: 'ping' }, EmptyResultSchema);
37001
+ }
37002
+ async createMessage(params, options) {
37003
+ if (params.tools || params.toolChoice) {
37004
+ if (!this._clientCapabilities?.sampling?.tools) {
37005
+ throw new Error('Client does not support sampling tools capability.');
37006
+ }
36945
37007
  }
36946
37008
  if (params.messages.length > 0) {
36947
37009
  const lastMessage = params.messages[params.messages.length - 1];
@@ -37965,6 +38027,1238 @@ class StdioServerTransport {
37965
38027
  }
37966
38028
  }
37967
38029
 
38030
+ var crossSpawn = {exports: {}};
38031
+
38032
+ var windows;
38033
+ var hasRequiredWindows;
38034
+
38035
+ function requireWindows () {
38036
+ if (hasRequiredWindows) return windows;
38037
+ hasRequiredWindows = 1;
38038
+ windows = isexe;
38039
+ isexe.sync = sync;
38040
+ var fs = require$$0$3;
38041
+ function checkPathExt (path, options) {
38042
+ var pathext = options.pathExt !== undefined ?
38043
+ options.pathExt : process.env.PATHEXT;
38044
+ if (!pathext) {
38045
+ return true
38046
+ }
38047
+ pathext = pathext.split(';');
38048
+ if (pathext.indexOf('') !== -1) {
38049
+ return true
38050
+ }
38051
+ for (var i = 0; i < pathext.length; i++) {
38052
+ var p = pathext[i].toLowerCase();
38053
+ if (p && path.substr(-p.length).toLowerCase() === p) {
38054
+ return true
38055
+ }
38056
+ }
38057
+ return false
38058
+ }
38059
+ function checkStat (stat, path, options) {
38060
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
38061
+ return false
38062
+ }
38063
+ return checkPathExt(path, options)
38064
+ }
38065
+ function isexe (path, options, cb) {
38066
+ fs.stat(path, function (er, stat) {
38067
+ cb(er, er ? false : checkStat(stat, path, options));
38068
+ });
38069
+ }
38070
+ function sync (path, options) {
38071
+ return checkStat(fs.statSync(path), path, options)
38072
+ }
38073
+ return windows;
38074
+ }
38075
+
38076
+ var mode;
38077
+ var hasRequiredMode;
38078
+
38079
+ function requireMode () {
38080
+ if (hasRequiredMode) return mode;
38081
+ hasRequiredMode = 1;
38082
+ mode = isexe;
38083
+ isexe.sync = sync;
38084
+ var fs = require$$0$3;
38085
+ function isexe (path, options, cb) {
38086
+ fs.stat(path, function (er, stat) {
38087
+ cb(er, er ? false : checkStat(stat, options));
38088
+ });
38089
+ }
38090
+ function sync (path, options) {
38091
+ return checkStat(fs.statSync(path), options)
38092
+ }
38093
+ function checkStat (stat, options) {
38094
+ return stat.isFile() && checkMode(stat, options)
38095
+ }
38096
+ function checkMode (stat, options) {
38097
+ var mod = stat.mode;
38098
+ var uid = stat.uid;
38099
+ var gid = stat.gid;
38100
+ var myUid = options.uid !== undefined ?
38101
+ options.uid : process.getuid && process.getuid();
38102
+ var myGid = options.gid !== undefined ?
38103
+ options.gid : process.getgid && process.getgid();
38104
+ var u = parseInt('100', 8);
38105
+ var g = parseInt('010', 8);
38106
+ var o = parseInt('001', 8);
38107
+ var ug = u | g;
38108
+ var ret = (mod & o) ||
38109
+ (mod & g) && gid === myGid ||
38110
+ (mod & u) && uid === myUid ||
38111
+ (mod & ug) && myUid === 0;
38112
+ return ret
38113
+ }
38114
+ return mode;
38115
+ }
38116
+
38117
+ var isexe_1;
38118
+ var hasRequiredIsexe;
38119
+
38120
+ function requireIsexe () {
38121
+ if (hasRequiredIsexe) return isexe_1;
38122
+ hasRequiredIsexe = 1;
38123
+ var core;
38124
+ if (process.platform === 'win32' || commonjsGlobal.TESTING_WINDOWS) {
38125
+ core = requireWindows();
38126
+ } else {
38127
+ core = requireMode();
38128
+ }
38129
+ isexe_1 = isexe;
38130
+ isexe.sync = sync;
38131
+ function isexe (path, options, cb) {
38132
+ if (typeof options === 'function') {
38133
+ cb = options;
38134
+ options = {};
38135
+ }
38136
+ if (!cb) {
38137
+ if (typeof Promise !== 'function') {
38138
+ throw new TypeError('callback not provided')
38139
+ }
38140
+ return new Promise(function (resolve, reject) {
38141
+ isexe(path, options || {}, function (er, is) {
38142
+ if (er) {
38143
+ reject(er);
38144
+ } else {
38145
+ resolve(is);
38146
+ }
38147
+ });
38148
+ })
38149
+ }
38150
+ core(path, options || {}, function (er, is) {
38151
+ if (er) {
38152
+ if (er.code === 'EACCES' || options && options.ignoreErrors) {
38153
+ er = null;
38154
+ is = false;
38155
+ }
38156
+ }
38157
+ cb(er, is);
38158
+ });
38159
+ }
38160
+ function sync (path, options) {
38161
+ try {
38162
+ return core.sync(path, options || {})
38163
+ } catch (er) {
38164
+ if (options && options.ignoreErrors || er.code === 'EACCES') {
38165
+ return false
38166
+ } else {
38167
+ throw er
38168
+ }
38169
+ }
38170
+ }
38171
+ return isexe_1;
38172
+ }
38173
+
38174
+ var which_1;
38175
+ var hasRequiredWhich;
38176
+
38177
+ function requireWhich () {
38178
+ if (hasRequiredWhich) return which_1;
38179
+ hasRequiredWhich = 1;
38180
+ const isWindows = process.platform === 'win32' ||
38181
+ process.env.OSTYPE === 'cygwin' ||
38182
+ process.env.OSTYPE === 'msys';
38183
+ const path = require$$0$4;
38184
+ const COLON = isWindows ? ';' : ':';
38185
+ const isexe = requireIsexe();
38186
+ const getNotFoundError = (cmd) =>
38187
+ Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' });
38188
+ const getPathInfo = (cmd, opt) => {
38189
+ const colon = opt.colon || COLON;
38190
+ const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? ['']
38191
+ : (
38192
+ [
38193
+ ...(isWindows ? [process.cwd()] : []),
38194
+ ...(opt.path || process.env.PATH ||
38195
+ '').split(colon),
38196
+ ]
38197
+ );
38198
+ const pathExtExe = isWindows
38199
+ ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'
38200
+ : '';
38201
+ const pathExt = isWindows ? pathExtExe.split(colon) : [''];
38202
+ if (isWindows) {
38203
+ if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
38204
+ pathExt.unshift('');
38205
+ }
38206
+ return {
38207
+ pathEnv,
38208
+ pathExt,
38209
+ pathExtExe,
38210
+ }
38211
+ };
38212
+ const which = (cmd, opt, cb) => {
38213
+ if (typeof opt === 'function') {
38214
+ cb = opt;
38215
+ opt = {};
38216
+ }
38217
+ if (!opt)
38218
+ opt = {};
38219
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
38220
+ const found = [];
38221
+ const step = i => new Promise((resolve, reject) => {
38222
+ if (i === pathEnv.length)
38223
+ return opt.all && found.length ? resolve(found)
38224
+ : reject(getNotFoundError(cmd))
38225
+ const ppRaw = pathEnv[i];
38226
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
38227
+ const pCmd = path.join(pathPart, cmd);
38228
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
38229
+ : pCmd;
38230
+ resolve(subStep(p, i, 0));
38231
+ });
38232
+ const subStep = (p, i, ii) => new Promise((resolve, reject) => {
38233
+ if (ii === pathExt.length)
38234
+ return resolve(step(i + 1))
38235
+ const ext = pathExt[ii];
38236
+ isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
38237
+ if (!er && is) {
38238
+ if (opt.all)
38239
+ found.push(p + ext);
38240
+ else
38241
+ return resolve(p + ext)
38242
+ }
38243
+ return resolve(subStep(p, i, ii + 1))
38244
+ });
38245
+ });
38246
+ return cb ? step(0).then(res => cb(null, res), cb) : step(0)
38247
+ };
38248
+ const whichSync = (cmd, opt) => {
38249
+ opt = opt || {};
38250
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
38251
+ const found = [];
38252
+ for (let i = 0; i < pathEnv.length; i ++) {
38253
+ const ppRaw = pathEnv[i];
38254
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
38255
+ const pCmd = path.join(pathPart, cmd);
38256
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
38257
+ : pCmd;
38258
+ for (let j = 0; j < pathExt.length; j ++) {
38259
+ const cur = p + pathExt[j];
38260
+ try {
38261
+ const is = isexe.sync(cur, { pathExt: pathExtExe });
38262
+ if (is) {
38263
+ if (opt.all)
38264
+ found.push(cur);
38265
+ else
38266
+ return cur
38267
+ }
38268
+ } catch (ex) {}
38269
+ }
38270
+ }
38271
+ if (opt.all && found.length)
38272
+ return found
38273
+ if (opt.nothrow)
38274
+ return null
38275
+ throw getNotFoundError(cmd)
38276
+ };
38277
+ which_1 = which;
38278
+ which.sync = whichSync;
38279
+ return which_1;
38280
+ }
38281
+
38282
+ var pathKey = {exports: {}};
38283
+
38284
+ var hasRequiredPathKey;
38285
+
38286
+ function requirePathKey () {
38287
+ if (hasRequiredPathKey) return pathKey.exports;
38288
+ hasRequiredPathKey = 1;
38289
+ const pathKey$1 = (options = {}) => {
38290
+ const environment = options.env || process.env;
38291
+ const platform = options.platform || process.platform;
38292
+ if (platform !== 'win32') {
38293
+ return 'PATH';
38294
+ }
38295
+ return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
38296
+ };
38297
+ pathKey.exports = pathKey$1;
38298
+ pathKey.exports.default = pathKey$1;
38299
+ return pathKey.exports;
38300
+ }
38301
+
38302
+ var resolveCommand_1;
38303
+ var hasRequiredResolveCommand;
38304
+
38305
+ function requireResolveCommand () {
38306
+ if (hasRequiredResolveCommand) return resolveCommand_1;
38307
+ hasRequiredResolveCommand = 1;
38308
+ const path = require$$0$4;
38309
+ const which = requireWhich();
38310
+ const getPathKey = requirePathKey();
38311
+ function resolveCommandAttempt(parsed, withoutPathExt) {
38312
+ const env = parsed.options.env || process.env;
38313
+ const cwd = process.cwd();
38314
+ const hasCustomCwd = parsed.options.cwd != null;
38315
+ const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
38316
+ if (shouldSwitchCwd) {
38317
+ try {
38318
+ process.chdir(parsed.options.cwd);
38319
+ } catch (err) {
38320
+ }
38321
+ }
38322
+ let resolved;
38323
+ try {
38324
+ resolved = which.sync(parsed.command, {
38325
+ path: env[getPathKey({ env })],
38326
+ pathExt: withoutPathExt ? path.delimiter : undefined,
38327
+ });
38328
+ } catch (e) {
38329
+ } finally {
38330
+ if (shouldSwitchCwd) {
38331
+ process.chdir(cwd);
38332
+ }
38333
+ }
38334
+ if (resolved) {
38335
+ resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
38336
+ }
38337
+ return resolved;
38338
+ }
38339
+ function resolveCommand(parsed) {
38340
+ return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
38341
+ }
38342
+ resolveCommand_1 = resolveCommand;
38343
+ return resolveCommand_1;
38344
+ }
38345
+
38346
+ var _escape = {};
38347
+
38348
+ var hasRequired_escape;
38349
+
38350
+ function require_escape () {
38351
+ if (hasRequired_escape) return _escape;
38352
+ hasRequired_escape = 1;
38353
+ const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
38354
+ function escapeCommand(arg) {
38355
+ arg = arg.replace(metaCharsRegExp, '^$1');
38356
+ return arg;
38357
+ }
38358
+ function escapeArgument(arg, doubleEscapeMetaChars) {
38359
+ arg = `${arg}`;
38360
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
38361
+ arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');
38362
+ arg = `"${arg}"`;
38363
+ arg = arg.replace(metaCharsRegExp, '^$1');
38364
+ if (doubleEscapeMetaChars) {
38365
+ arg = arg.replace(metaCharsRegExp, '^$1');
38366
+ }
38367
+ return arg;
38368
+ }
38369
+ _escape.command = escapeCommand;
38370
+ _escape.argument = escapeArgument;
38371
+ return _escape;
38372
+ }
38373
+
38374
+ var shebangRegex;
38375
+ var hasRequiredShebangRegex;
38376
+
38377
+ function requireShebangRegex () {
38378
+ if (hasRequiredShebangRegex) return shebangRegex;
38379
+ hasRequiredShebangRegex = 1;
38380
+ shebangRegex = /^#!(.*)/;
38381
+ return shebangRegex;
38382
+ }
38383
+
38384
+ var shebangCommand;
38385
+ var hasRequiredShebangCommand;
38386
+
38387
+ function requireShebangCommand () {
38388
+ if (hasRequiredShebangCommand) return shebangCommand;
38389
+ hasRequiredShebangCommand = 1;
38390
+ const shebangRegex = requireShebangRegex();
38391
+ shebangCommand = (string = '') => {
38392
+ const match = string.match(shebangRegex);
38393
+ if (!match) {
38394
+ return null;
38395
+ }
38396
+ const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
38397
+ const binary = path.split('/').pop();
38398
+ if (binary === 'env') {
38399
+ return argument;
38400
+ }
38401
+ return argument ? `${binary} ${argument}` : binary;
38402
+ };
38403
+ return shebangCommand;
38404
+ }
38405
+
38406
+ var readShebang_1;
38407
+ var hasRequiredReadShebang;
38408
+
38409
+ function requireReadShebang () {
38410
+ if (hasRequiredReadShebang) return readShebang_1;
38411
+ hasRequiredReadShebang = 1;
38412
+ const fs = require$$0$3;
38413
+ const shebangCommand = requireShebangCommand();
38414
+ function readShebang(command) {
38415
+ const size = 150;
38416
+ const buffer = Buffer.alloc(size);
38417
+ let fd;
38418
+ try {
38419
+ fd = fs.openSync(command, 'r');
38420
+ fs.readSync(fd, buffer, 0, size, 0);
38421
+ fs.closeSync(fd);
38422
+ } catch (e) { }
38423
+ return shebangCommand(buffer.toString());
38424
+ }
38425
+ readShebang_1 = readShebang;
38426
+ return readShebang_1;
38427
+ }
38428
+
38429
+ var parse_1$1;
38430
+ var hasRequiredParse$1;
38431
+
38432
+ function requireParse$1 () {
38433
+ if (hasRequiredParse$1) return parse_1$1;
38434
+ hasRequiredParse$1 = 1;
38435
+ const path = require$$0$4;
38436
+ const resolveCommand = requireResolveCommand();
38437
+ const escape = require_escape();
38438
+ const readShebang = requireReadShebang();
38439
+ const isWin = process.platform === 'win32';
38440
+ const isExecutableRegExp = /\.(?:com|exe)$/i;
38441
+ const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
38442
+ function detectShebang(parsed) {
38443
+ parsed.file = resolveCommand(parsed);
38444
+ const shebang = parsed.file && readShebang(parsed.file);
38445
+ if (shebang) {
38446
+ parsed.args.unshift(parsed.file);
38447
+ parsed.command = shebang;
38448
+ return resolveCommand(parsed);
38449
+ }
38450
+ return parsed.file;
38451
+ }
38452
+ function parseNonShell(parsed) {
38453
+ if (!isWin) {
38454
+ return parsed;
38455
+ }
38456
+ const commandFile = detectShebang(parsed);
38457
+ const needsShell = !isExecutableRegExp.test(commandFile);
38458
+ if (parsed.options.forceShell || needsShell) {
38459
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
38460
+ parsed.command = path.normalize(parsed.command);
38461
+ parsed.command = escape.command(parsed.command);
38462
+ parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
38463
+ const shellCommand = [parsed.command].concat(parsed.args).join(' ');
38464
+ parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
38465
+ parsed.command = process.env.comspec || 'cmd.exe';
38466
+ parsed.options.windowsVerbatimArguments = true;
38467
+ }
38468
+ return parsed;
38469
+ }
38470
+ function parse(command, args, options) {
38471
+ if (args && !Array.isArray(args)) {
38472
+ options = args;
38473
+ args = null;
38474
+ }
38475
+ args = args ? args.slice(0) : [];
38476
+ options = Object.assign({}, options);
38477
+ const parsed = {
38478
+ command,
38479
+ args,
38480
+ options,
38481
+ file: undefined,
38482
+ original: {
38483
+ command,
38484
+ args,
38485
+ },
38486
+ };
38487
+ return options.shell ? parsed : parseNonShell(parsed);
38488
+ }
38489
+ parse_1$1 = parse;
38490
+ return parse_1$1;
38491
+ }
38492
+
38493
+ var enoent;
38494
+ var hasRequiredEnoent;
38495
+
38496
+ function requireEnoent () {
38497
+ if (hasRequiredEnoent) return enoent;
38498
+ hasRequiredEnoent = 1;
38499
+ const isWin = process.platform === 'win32';
38500
+ function notFoundError(original, syscall) {
38501
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
38502
+ code: 'ENOENT',
38503
+ errno: 'ENOENT',
38504
+ syscall: `${syscall} ${original.command}`,
38505
+ path: original.command,
38506
+ spawnargs: original.args,
38507
+ });
38508
+ }
38509
+ function hookChildProcess(cp, parsed) {
38510
+ if (!isWin) {
38511
+ return;
38512
+ }
38513
+ const originalEmit = cp.emit;
38514
+ cp.emit = function (name, arg1) {
38515
+ if (name === 'exit') {
38516
+ const err = verifyENOENT(arg1, parsed);
38517
+ if (err) {
38518
+ return originalEmit.call(cp, 'error', err);
38519
+ }
38520
+ }
38521
+ return originalEmit.apply(cp, arguments);
38522
+ };
38523
+ }
38524
+ function verifyENOENT(status, parsed) {
38525
+ if (isWin && status === 1 && !parsed.file) {
38526
+ return notFoundError(parsed.original, 'spawn');
38527
+ }
38528
+ return null;
38529
+ }
38530
+ function verifyENOENTSync(status, parsed) {
38531
+ if (isWin && status === 1 && !parsed.file) {
38532
+ return notFoundError(parsed.original, 'spawnSync');
38533
+ }
38534
+ return null;
38535
+ }
38536
+ enoent = {
38537
+ hookChildProcess,
38538
+ verifyENOENT,
38539
+ verifyENOENTSync,
38540
+ notFoundError,
38541
+ };
38542
+ return enoent;
38543
+ }
38544
+
38545
+ var hasRequiredCrossSpawn;
38546
+
38547
+ function requireCrossSpawn () {
38548
+ if (hasRequiredCrossSpawn) return crossSpawn.exports;
38549
+ hasRequiredCrossSpawn = 1;
38550
+ const cp = require$$0$5;
38551
+ const parse = requireParse$1();
38552
+ const enoent = requireEnoent();
38553
+ function spawn(command, args, options) {
38554
+ const parsed = parse(command, args, options);
38555
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
38556
+ enoent.hookChildProcess(spawned, parsed);
38557
+ return spawned;
38558
+ }
38559
+ function spawnSync(command, args, options) {
38560
+ const parsed = parse(command, args, options);
38561
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
38562
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
38563
+ return result;
38564
+ }
38565
+ crossSpawn.exports = spawn;
38566
+ crossSpawn.exports.spawn = spawn;
38567
+ crossSpawn.exports.sync = spawnSync;
38568
+ crossSpawn.exports._parse = parse;
38569
+ crossSpawn.exports._enoent = enoent;
38570
+ return crossSpawn.exports;
38571
+ }
38572
+
38573
+ var crossSpawnExports = requireCrossSpawn();
38574
+ var spawn = /*@__PURE__*/getDefaultExportFromCjs(crossSpawnExports);
38575
+
38576
+ const DEFAULT_INHERITED_ENV_VARS = process$2.platform === 'win32'
38577
+ ? [
38578
+ 'APPDATA',
38579
+ 'HOMEDRIVE',
38580
+ 'HOMEPATH',
38581
+ 'LOCALAPPDATA',
38582
+ 'PATH',
38583
+ 'PROCESSOR_ARCHITECTURE',
38584
+ 'SYSTEMDRIVE',
38585
+ 'SYSTEMROOT',
38586
+ 'TEMP',
38587
+ 'USERNAME',
38588
+ 'USERPROFILE',
38589
+ 'PROGRAMFILES'
38590
+ ]
38591
+ :
38592
+ ['HOME', 'LOGNAME', 'PATH', 'SHELL', 'TERM', 'USER'];
38593
+ function getDefaultEnvironment() {
38594
+ const env = {};
38595
+ for (const key of DEFAULT_INHERITED_ENV_VARS) {
38596
+ const value = process$2.env[key];
38597
+ if (value === undefined) {
38598
+ continue;
38599
+ }
38600
+ if (value.startsWith('()')) {
38601
+ continue;
38602
+ }
38603
+ env[key] = value;
38604
+ }
38605
+ return env;
38606
+ }
38607
+ class StdioClientTransport {
38608
+ constructor(server) {
38609
+ this._readBuffer = new ReadBuffer();
38610
+ this._stderrStream = null;
38611
+ this._serverParams = server;
38612
+ if (server.stderr === 'pipe' || server.stderr === 'overlapped') {
38613
+ this._stderrStream = new PassThrough();
38614
+ }
38615
+ }
38616
+ async start() {
38617
+ if (this._process) {
38618
+ throw new Error('StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.');
38619
+ }
38620
+ return new Promise((resolve, reject) => {
38621
+ this._process = spawn(this._serverParams.command, this._serverParams.args ?? [], {
38622
+ env: {
38623
+ ...getDefaultEnvironment(),
38624
+ ...this._serverParams.env
38625
+ },
38626
+ stdio: ['pipe', 'pipe', this._serverParams.stderr ?? 'inherit'],
38627
+ shell: false,
38628
+ windowsHide: process$2.platform === 'win32' && isElectron(),
38629
+ cwd: this._serverParams.cwd
38630
+ });
38631
+ this._process.on('error', error => {
38632
+ reject(error);
38633
+ this.onerror?.(error);
38634
+ });
38635
+ this._process.on('spawn', () => {
38636
+ resolve();
38637
+ });
38638
+ this._process.on('close', _code => {
38639
+ this._process = undefined;
38640
+ this.onclose?.();
38641
+ });
38642
+ this._process.stdin?.on('error', error => {
38643
+ this.onerror?.(error);
38644
+ });
38645
+ this._process.stdout?.on('data', chunk => {
38646
+ this._readBuffer.append(chunk);
38647
+ this.processReadBuffer();
38648
+ });
38649
+ this._process.stdout?.on('error', error => {
38650
+ this.onerror?.(error);
38651
+ });
38652
+ if (this._stderrStream && this._process.stderr) {
38653
+ this._process.stderr.pipe(this._stderrStream);
38654
+ }
38655
+ });
38656
+ }
38657
+ get stderr() {
38658
+ if (this._stderrStream) {
38659
+ return this._stderrStream;
38660
+ }
38661
+ return this._process?.stderr ?? null;
38662
+ }
38663
+ get pid() {
38664
+ return this._process?.pid ?? null;
38665
+ }
38666
+ processReadBuffer() {
38667
+ while (true) {
38668
+ try {
38669
+ const message = this._readBuffer.readMessage();
38670
+ if (message === null) {
38671
+ break;
38672
+ }
38673
+ this.onmessage?.(message);
38674
+ }
38675
+ catch (error) {
38676
+ this.onerror?.(error);
38677
+ }
38678
+ }
38679
+ }
38680
+ async close() {
38681
+ if (this._process) {
38682
+ const processToClose = this._process;
38683
+ this._process = undefined;
38684
+ const closePromise = new Promise(resolve => {
38685
+ processToClose.once('close', () => {
38686
+ resolve();
38687
+ });
38688
+ });
38689
+ try {
38690
+ processToClose.stdin?.end();
38691
+ }
38692
+ catch {
38693
+ }
38694
+ await Promise.race([closePromise, new Promise(resolve => setTimeout(resolve, 2000).unref())]);
38695
+ if (processToClose.exitCode === null) {
38696
+ try {
38697
+ processToClose.kill('SIGTERM');
38698
+ }
38699
+ catch {
38700
+ }
38701
+ await Promise.race([closePromise, new Promise(resolve => setTimeout(resolve, 2000).unref())]);
38702
+ }
38703
+ if (processToClose.exitCode === null) {
38704
+ try {
38705
+ processToClose.kill('SIGKILL');
38706
+ }
38707
+ catch {
38708
+ }
38709
+ }
38710
+ }
38711
+ this._readBuffer.clear();
38712
+ }
38713
+ send(message) {
38714
+ return new Promise(resolve => {
38715
+ if (!this._process?.stdin) {
38716
+ throw new Error('Not connected');
38717
+ }
38718
+ const json = serializeMessage(message);
38719
+ if (this._process.stdin.write(json)) {
38720
+ resolve();
38721
+ }
38722
+ else {
38723
+ this._process.stdin.once('drain', resolve);
38724
+ }
38725
+ });
38726
+ }
38727
+ }
38728
+ function isElectron() {
38729
+ return 'type' in process$2;
38730
+ }
38731
+
38732
+ class ExperimentalClientTasks {
38733
+ constructor(_client) {
38734
+ this._client = _client;
38735
+ }
38736
+ async *callToolStream(params, resultSchema = CallToolResultSchema, options) {
38737
+ const clientInternal = this._client;
38738
+ const optionsWithTask = {
38739
+ ...options,
38740
+ task: options?.task ?? (clientInternal.isToolTask(params.name) ? {} : undefined)
38741
+ };
38742
+ const stream = clientInternal.requestStream({ method: 'tools/call', params }, resultSchema, optionsWithTask);
38743
+ const validator = clientInternal.getToolOutputValidator(params.name);
38744
+ for await (const message of stream) {
38745
+ if (message.type === 'result' && validator) {
38746
+ const result = message.result;
38747
+ if (!result.structuredContent && !result.isError) {
38748
+ yield {
38749
+ type: 'error',
38750
+ error: new McpError(ErrorCode$1.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`)
38751
+ };
38752
+ return;
38753
+ }
38754
+ if (result.structuredContent) {
38755
+ try {
38756
+ const validationResult = validator(result.structuredContent);
38757
+ if (!validationResult.valid) {
38758
+ yield {
38759
+ type: 'error',
38760
+ error: new McpError(ErrorCode$1.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`)
38761
+ };
38762
+ return;
38763
+ }
38764
+ }
38765
+ catch (error) {
38766
+ if (error instanceof McpError) {
38767
+ yield { type: 'error', error };
38768
+ return;
38769
+ }
38770
+ yield {
38771
+ type: 'error',
38772
+ error: new McpError(ErrorCode$1.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`)
38773
+ };
38774
+ return;
38775
+ }
38776
+ }
38777
+ }
38778
+ yield message;
38779
+ }
38780
+ }
38781
+ async getTask(taskId, options) {
38782
+ return this._client.getTask({ taskId }, options);
38783
+ }
38784
+ async getTaskResult(taskId, resultSchema, options) {
38785
+ return this._client.getTaskResult({ taskId }, resultSchema, options);
38786
+ }
38787
+ async listTasks(cursor, options) {
38788
+ return this._client.listTasks(cursor ? { cursor } : undefined, options);
38789
+ }
38790
+ async cancelTask(taskId, options) {
38791
+ return this._client.cancelTask({ taskId }, options);
38792
+ }
38793
+ requestStream(request, resultSchema, options) {
38794
+ return this._client.requestStream(request, resultSchema, options);
38795
+ }
38796
+ }
38797
+
38798
+ function applyElicitationDefaults(schema, data) {
38799
+ if (!schema || data === null || typeof data !== 'object')
38800
+ return;
38801
+ if (schema.type === 'object' && schema.properties && typeof schema.properties === 'object') {
38802
+ const obj = data;
38803
+ const props = schema.properties;
38804
+ for (const key of Object.keys(props)) {
38805
+ const propSchema = props[key];
38806
+ if (obj[key] === undefined && Object.prototype.hasOwnProperty.call(propSchema, 'default')) {
38807
+ obj[key] = propSchema.default;
38808
+ }
38809
+ if (obj[key] !== undefined) {
38810
+ applyElicitationDefaults(propSchema, obj[key]);
38811
+ }
38812
+ }
38813
+ }
38814
+ if (Array.isArray(schema.anyOf)) {
38815
+ for (const sub of schema.anyOf) {
38816
+ if (typeof sub !== 'boolean') {
38817
+ applyElicitationDefaults(sub, data);
38818
+ }
38819
+ }
38820
+ }
38821
+ if (Array.isArray(schema.oneOf)) {
38822
+ for (const sub of schema.oneOf) {
38823
+ if (typeof sub !== 'boolean') {
38824
+ applyElicitationDefaults(sub, data);
38825
+ }
38826
+ }
38827
+ }
38828
+ }
38829
+ function getSupportedElicitationModes(capabilities) {
38830
+ if (!capabilities) {
38831
+ return { supportsFormMode: false, supportsUrlMode: false };
38832
+ }
38833
+ const hasFormCapability = capabilities.form !== undefined;
38834
+ const hasUrlCapability = capabilities.url !== undefined;
38835
+ const supportsFormMode = hasFormCapability || (!hasFormCapability && !hasUrlCapability);
38836
+ const supportsUrlMode = hasUrlCapability;
38837
+ return { supportsFormMode, supportsUrlMode };
38838
+ }
38839
+ let Client$1 = class Client extends Protocol {
38840
+ constructor(_clientInfo, options) {
38841
+ super(options);
38842
+ this._clientInfo = _clientInfo;
38843
+ this._cachedToolOutputValidators = new Map();
38844
+ this._cachedKnownTaskTools = new Set();
38845
+ this._cachedRequiredTaskTools = new Set();
38846
+ this._listChangedDebounceTimers = new Map();
38847
+ this._capabilities = options?.capabilities ?? {};
38848
+ this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
38849
+ if (options?.listChanged) {
38850
+ this._pendingListChangedConfig = options.listChanged;
38851
+ }
38852
+ }
38853
+ _setupListChangedHandlers(config) {
38854
+ if (config.tools && this._serverCapabilities?.tools?.listChanged) {
38855
+ this._setupListChangedHandler('tools', ToolListChangedNotificationSchema, config.tools, async () => {
38856
+ const result = await this.listTools();
38857
+ return result.tools;
38858
+ });
38859
+ }
38860
+ if (config.prompts && this._serverCapabilities?.prompts?.listChanged) {
38861
+ this._setupListChangedHandler('prompts', PromptListChangedNotificationSchema, config.prompts, async () => {
38862
+ const result = await this.listPrompts();
38863
+ return result.prompts;
38864
+ });
38865
+ }
38866
+ if (config.resources && this._serverCapabilities?.resources?.listChanged) {
38867
+ this._setupListChangedHandler('resources', ResourceListChangedNotificationSchema, config.resources, async () => {
38868
+ const result = await this.listResources();
38869
+ return result.resources;
38870
+ });
38871
+ }
38872
+ }
38873
+ get experimental() {
38874
+ if (!this._experimental) {
38875
+ this._experimental = {
38876
+ tasks: new ExperimentalClientTasks(this)
38877
+ };
38878
+ }
38879
+ return this._experimental;
38880
+ }
38881
+ registerCapabilities(capabilities) {
38882
+ if (this.transport) {
38883
+ throw new Error('Cannot register capabilities after connecting to transport');
38884
+ }
38885
+ this._capabilities = mergeCapabilities(this._capabilities, capabilities);
38886
+ }
38887
+ setRequestHandler(requestSchema, handler) {
38888
+ const shape = getObjectShape(requestSchema);
38889
+ const methodSchema = shape?.method;
38890
+ if (!methodSchema) {
38891
+ throw new Error('Schema is missing a method literal');
38892
+ }
38893
+ let methodValue;
38894
+ if (isZ4Schema(methodSchema)) {
38895
+ const v4Schema = methodSchema;
38896
+ const v4Def = v4Schema._zod?.def;
38897
+ methodValue = v4Def?.value ?? v4Schema.value;
38898
+ }
38899
+ else {
38900
+ const v3Schema = methodSchema;
38901
+ const legacyDef = v3Schema._def;
38902
+ methodValue = legacyDef?.value ?? v3Schema.value;
38903
+ }
38904
+ if (typeof methodValue !== 'string') {
38905
+ throw new Error('Schema method literal must be a string');
38906
+ }
38907
+ const method = methodValue;
38908
+ if (method === 'elicitation/create') {
38909
+ const wrappedHandler = async (request, extra) => {
38910
+ const validatedRequest = safeParse$1(ElicitRequestSchema, request);
38911
+ if (!validatedRequest.success) {
38912
+ const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
38913
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid elicitation request: ${errorMessage}`);
38914
+ }
38915
+ const { params } = validatedRequest.data;
38916
+ params.mode = params.mode ?? 'form';
38917
+ const { supportsFormMode, supportsUrlMode } = getSupportedElicitationModes(this._capabilities.elicitation);
38918
+ if (params.mode === 'form' && !supportsFormMode) {
38919
+ throw new McpError(ErrorCode$1.InvalidParams, 'Client does not support form-mode elicitation requests');
38920
+ }
38921
+ if (params.mode === 'url' && !supportsUrlMode) {
38922
+ throw new McpError(ErrorCode$1.InvalidParams, 'Client does not support URL-mode elicitation requests');
38923
+ }
38924
+ const result = await Promise.resolve(handler(request, extra));
38925
+ if (params.task) {
38926
+ const taskValidationResult = safeParse$1(CreateTaskResultSchema, result);
38927
+ if (!taskValidationResult.success) {
38928
+ const errorMessage = taskValidationResult.error instanceof Error
38929
+ ? taskValidationResult.error.message
38930
+ : String(taskValidationResult.error);
38931
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid task creation result: ${errorMessage}`);
38932
+ }
38933
+ return taskValidationResult.data;
38934
+ }
38935
+ const validationResult = safeParse$1(ElicitResultSchema, result);
38936
+ if (!validationResult.success) {
38937
+ const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
38938
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid elicitation result: ${errorMessage}`);
38939
+ }
38940
+ const validatedResult = validationResult.data;
38941
+ const requestedSchema = params.mode === 'form' ? params.requestedSchema : undefined;
38942
+ if (params.mode === 'form' && validatedResult.action === 'accept' && validatedResult.content && requestedSchema) {
38943
+ if (this._capabilities.elicitation?.form?.applyDefaults) {
38944
+ try {
38945
+ applyElicitationDefaults(requestedSchema, validatedResult.content);
38946
+ }
38947
+ catch {
38948
+ }
38949
+ }
38950
+ }
38951
+ return validatedResult;
38952
+ };
38953
+ return super.setRequestHandler(requestSchema, wrappedHandler);
38954
+ }
38955
+ if (method === 'sampling/createMessage') {
38956
+ const wrappedHandler = async (request, extra) => {
38957
+ const validatedRequest = safeParse$1(CreateMessageRequestSchema, request);
38958
+ if (!validatedRequest.success) {
38959
+ const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
38960
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid sampling request: ${errorMessage}`);
38961
+ }
38962
+ const { params } = validatedRequest.data;
38963
+ const result = await Promise.resolve(handler(request, extra));
38964
+ if (params.task) {
38965
+ const taskValidationResult = safeParse$1(CreateTaskResultSchema, result);
38966
+ if (!taskValidationResult.success) {
38967
+ const errorMessage = taskValidationResult.error instanceof Error
38968
+ ? taskValidationResult.error.message
38969
+ : String(taskValidationResult.error);
38970
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid task creation result: ${errorMessage}`);
38971
+ }
38972
+ return taskValidationResult.data;
38973
+ }
38974
+ const hasTools = params.tools || params.toolChoice;
38975
+ const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
38976
+ const validationResult = safeParse$1(resultSchema, result);
38977
+ if (!validationResult.success) {
38978
+ const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
38979
+ throw new McpError(ErrorCode$1.InvalidParams, `Invalid sampling result: ${errorMessage}`);
38980
+ }
38981
+ return validationResult.data;
38982
+ };
38983
+ return super.setRequestHandler(requestSchema, wrappedHandler);
38984
+ }
38985
+ return super.setRequestHandler(requestSchema, handler);
38986
+ }
38987
+ assertCapability(capability, method) {
38988
+ if (!this._serverCapabilities?.[capability]) {
38989
+ throw new Error(`Server does not support ${capability} (required for ${method})`);
38990
+ }
38991
+ }
38992
+ async connect(transport, options) {
38993
+ await super.connect(transport);
38994
+ if (transport.sessionId !== undefined) {
38995
+ return;
38996
+ }
38997
+ try {
38998
+ const result = await this.request({
38999
+ method: 'initialize',
39000
+ params: {
39001
+ protocolVersion: LATEST_PROTOCOL_VERSION,
39002
+ capabilities: this._capabilities,
39003
+ clientInfo: this._clientInfo
39004
+ }
39005
+ }, InitializeResultSchema, options);
39006
+ if (result === undefined) {
39007
+ throw new Error(`Server sent invalid initialize result: ${result}`);
39008
+ }
39009
+ if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {
39010
+ throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
39011
+ }
39012
+ this._serverCapabilities = result.capabilities;
39013
+ this._serverVersion = result.serverInfo;
39014
+ if (transport.setProtocolVersion) {
39015
+ transport.setProtocolVersion(result.protocolVersion);
39016
+ }
39017
+ this._instructions = result.instructions;
39018
+ await this.notification({
39019
+ method: 'notifications/initialized'
39020
+ });
39021
+ if (this._pendingListChangedConfig) {
39022
+ this._setupListChangedHandlers(this._pendingListChangedConfig);
39023
+ this._pendingListChangedConfig = undefined;
39024
+ }
39025
+ }
39026
+ catch (error) {
39027
+ void this.close();
39028
+ throw error;
39029
+ }
39030
+ }
39031
+ getServerCapabilities() {
39032
+ return this._serverCapabilities;
39033
+ }
39034
+ getServerVersion() {
39035
+ return this._serverVersion;
39036
+ }
39037
+ getInstructions() {
39038
+ return this._instructions;
39039
+ }
39040
+ assertCapabilityForMethod(method) {
39041
+ switch (method) {
39042
+ case 'logging/setLevel':
39043
+ if (!this._serverCapabilities?.logging) {
39044
+ throw new Error(`Server does not support logging (required for ${method})`);
39045
+ }
39046
+ break;
39047
+ case 'prompts/get':
39048
+ case 'prompts/list':
39049
+ if (!this._serverCapabilities?.prompts) {
39050
+ throw new Error(`Server does not support prompts (required for ${method})`);
39051
+ }
39052
+ break;
39053
+ case 'resources/list':
39054
+ case 'resources/templates/list':
39055
+ case 'resources/read':
39056
+ case 'resources/subscribe':
39057
+ case 'resources/unsubscribe':
39058
+ if (!this._serverCapabilities?.resources) {
39059
+ throw new Error(`Server does not support resources (required for ${method})`);
39060
+ }
39061
+ if (method === 'resources/subscribe' && !this._serverCapabilities.resources.subscribe) {
39062
+ throw new Error(`Server does not support resource subscriptions (required for ${method})`);
39063
+ }
39064
+ break;
39065
+ case 'tools/call':
39066
+ case 'tools/list':
39067
+ if (!this._serverCapabilities?.tools) {
39068
+ throw new Error(`Server does not support tools (required for ${method})`);
39069
+ }
39070
+ break;
39071
+ case 'completion/complete':
39072
+ if (!this._serverCapabilities?.completions) {
39073
+ throw new Error(`Server does not support completions (required for ${method})`);
39074
+ }
39075
+ break;
39076
+ }
39077
+ }
39078
+ assertNotificationCapability(method) {
39079
+ switch (method) {
39080
+ case 'notifications/roots/list_changed':
39081
+ if (!this._capabilities.roots?.listChanged) {
39082
+ throw new Error(`Client does not support roots list changed notifications (required for ${method})`);
39083
+ }
39084
+ break;
39085
+ }
39086
+ }
39087
+ assertRequestHandlerCapability(method) {
39088
+ if (!this._capabilities) {
39089
+ return;
39090
+ }
39091
+ switch (method) {
39092
+ case 'sampling/createMessage':
39093
+ if (!this._capabilities.sampling) {
39094
+ throw new Error(`Client does not support sampling capability (required for ${method})`);
39095
+ }
39096
+ break;
39097
+ case 'elicitation/create':
39098
+ if (!this._capabilities.elicitation) {
39099
+ throw new Error(`Client does not support elicitation capability (required for ${method})`);
39100
+ }
39101
+ break;
39102
+ case 'roots/list':
39103
+ if (!this._capabilities.roots) {
39104
+ throw new Error(`Client does not support roots capability (required for ${method})`);
39105
+ }
39106
+ break;
39107
+ case 'tasks/get':
39108
+ case 'tasks/list':
39109
+ case 'tasks/result':
39110
+ case 'tasks/cancel':
39111
+ if (!this._capabilities.tasks) {
39112
+ throw new Error(`Client does not support tasks capability (required for ${method})`);
39113
+ }
39114
+ break;
39115
+ }
39116
+ }
39117
+ assertTaskCapability(method) {
39118
+ assertToolsCallTaskCapability(this._serverCapabilities?.tasks?.requests, method, 'Server');
39119
+ }
39120
+ assertTaskHandlerCapability(method) {
39121
+ if (!this._capabilities) {
39122
+ return;
39123
+ }
39124
+ assertClientRequestTaskCapability(this._capabilities.tasks?.requests, method, 'Client');
39125
+ }
39126
+ async ping(options) {
39127
+ return this.request({ method: 'ping' }, EmptyResultSchema, options);
39128
+ }
39129
+ async complete(params, options) {
39130
+ return this.request({ method: 'completion/complete', params }, CompleteResultSchema, options);
39131
+ }
39132
+ async setLoggingLevel(level, options) {
39133
+ return this.request({ method: 'logging/setLevel', params: { level } }, EmptyResultSchema, options);
39134
+ }
39135
+ async getPrompt(params, options) {
39136
+ return this.request({ method: 'prompts/get', params }, GetPromptResultSchema, options);
39137
+ }
39138
+ async listPrompts(params, options) {
39139
+ return this.request({ method: 'prompts/list', params }, ListPromptsResultSchema, options);
39140
+ }
39141
+ async listResources(params, options) {
39142
+ return this.request({ method: 'resources/list', params }, ListResourcesResultSchema, options);
39143
+ }
39144
+ async listResourceTemplates(params, options) {
39145
+ return this.request({ method: 'resources/templates/list', params }, ListResourceTemplatesResultSchema, options);
39146
+ }
39147
+ async readResource(params, options) {
39148
+ return this.request({ method: 'resources/read', params }, ReadResourceResultSchema, options);
39149
+ }
39150
+ async subscribeResource(params, options) {
39151
+ return this.request({ method: 'resources/subscribe', params }, EmptyResultSchema, options);
39152
+ }
39153
+ async unsubscribeResource(params, options) {
39154
+ return this.request({ method: 'resources/unsubscribe', params }, EmptyResultSchema, options);
39155
+ }
39156
+ async callTool(params, resultSchema = CallToolResultSchema, options) {
39157
+ if (this.isToolTaskRequired(params.name)) {
39158
+ throw new McpError(ErrorCode$1.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);
39159
+ }
39160
+ const result = await this.request({ method: 'tools/call', params }, resultSchema, options);
39161
+ const validator = this.getToolOutputValidator(params.name);
39162
+ if (validator) {
39163
+ if (!result.structuredContent && !result.isError) {
39164
+ throw new McpError(ErrorCode$1.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
39165
+ }
39166
+ if (result.structuredContent) {
39167
+ try {
39168
+ const validationResult = validator(result.structuredContent);
39169
+ if (!validationResult.valid) {
39170
+ throw new McpError(ErrorCode$1.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`);
39171
+ }
39172
+ }
39173
+ catch (error) {
39174
+ if (error instanceof McpError) {
39175
+ throw error;
39176
+ }
39177
+ throw new McpError(ErrorCode$1.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`);
39178
+ }
39179
+ }
39180
+ }
39181
+ return result;
39182
+ }
39183
+ isToolTask(toolName) {
39184
+ if (!this._serverCapabilities?.tasks?.requests?.tools?.call) {
39185
+ return false;
39186
+ }
39187
+ return this._cachedKnownTaskTools.has(toolName);
39188
+ }
39189
+ isToolTaskRequired(toolName) {
39190
+ return this._cachedRequiredTaskTools.has(toolName);
39191
+ }
39192
+ cacheToolMetadata(tools) {
39193
+ this._cachedToolOutputValidators.clear();
39194
+ this._cachedKnownTaskTools.clear();
39195
+ this._cachedRequiredTaskTools.clear();
39196
+ for (const tool of tools) {
39197
+ if (tool.outputSchema) {
39198
+ const toolValidator = this._jsonSchemaValidator.getValidator(tool.outputSchema);
39199
+ this._cachedToolOutputValidators.set(tool.name, toolValidator);
39200
+ }
39201
+ const taskSupport = tool.execution?.taskSupport;
39202
+ if (taskSupport === 'required' || taskSupport === 'optional') {
39203
+ this._cachedKnownTaskTools.add(tool.name);
39204
+ }
39205
+ if (taskSupport === 'required') {
39206
+ this._cachedRequiredTaskTools.add(tool.name);
39207
+ }
39208
+ }
39209
+ }
39210
+ getToolOutputValidator(toolName) {
39211
+ return this._cachedToolOutputValidators.get(toolName);
39212
+ }
39213
+ async listTools(params, options) {
39214
+ const result = await this.request({ method: 'tools/list', params }, ListToolsResultSchema, options);
39215
+ this.cacheToolMetadata(result.tools);
39216
+ return result;
39217
+ }
39218
+ _setupListChangedHandler(listType, notificationSchema, options, fetcher) {
39219
+ const parseResult = ListChangedOptionsBaseSchema.safeParse(options);
39220
+ if (!parseResult.success) {
39221
+ throw new Error(`Invalid ${listType} listChanged options: ${parseResult.error.message}`);
39222
+ }
39223
+ if (typeof options.onChanged !== 'function') {
39224
+ throw new Error(`Invalid ${listType} listChanged options: onChanged must be a function`);
39225
+ }
39226
+ const { autoRefresh, debounceMs } = parseResult.data;
39227
+ const { onChanged } = options;
39228
+ const refresh = async () => {
39229
+ if (!autoRefresh) {
39230
+ onChanged(null, null);
39231
+ return;
39232
+ }
39233
+ try {
39234
+ const items = await fetcher();
39235
+ onChanged(null, items);
39236
+ }
39237
+ catch (e) {
39238
+ const error = e instanceof Error ? e : new Error(String(e));
39239
+ onChanged(error, null);
39240
+ }
39241
+ };
39242
+ const handler = () => {
39243
+ if (debounceMs) {
39244
+ const existingTimer = this._listChangedDebounceTimers.get(listType);
39245
+ if (existingTimer) {
39246
+ clearTimeout(existingTimer);
39247
+ }
39248
+ const timer = setTimeout(refresh, debounceMs);
39249
+ this._listChangedDebounceTimers.set(listType, timer);
39250
+ }
39251
+ else {
39252
+ refresh();
39253
+ }
39254
+ };
39255
+ this.setNotificationHandler(notificationSchema, handler);
39256
+ }
39257
+ async sendRootsListChanged() {
39258
+ return this.notification({ method: 'notifications/roots/list_changed' });
39259
+ }
39260
+ };
39261
+
37968
39262
  /**
37969
39263
  Apache License
37970
39264
  Version 2.0, January 2004
@@ -40599,7 +41893,7 @@ function mergeUint8Arrays(items) {
40599
41893
  * Copyright 2025 Google Inc.
40600
41894
  * SPDX-License-Identifier: Apache-2.0
40601
41895
  */
40602
- const packageVersion = '24.37.5';
41896
+ const packageVersion = '24.38.0';
40603
41897
 
40604
41898
  /**
40605
41899
  * @license
@@ -52249,7 +53543,7 @@ class CdpPage extends Page {
52249
53543
  partitionKey: cookie.partitionKey
52250
53544
  ? cookie.partitionKey.topLevelSite
52251
53545
  : undefined,
52252
- sameParty: cookie.sameParty ?? false,
53546
+ sameParty: false,
52253
53547
  };
52254
53548
  });
52255
53549
  }
@@ -52863,7 +54157,7 @@ class CdpBrowserContext extends BrowserContext {
52863
54157
  hasCrossSiteAncestor: cookie.partitionKey.hasCrossSiteAncestor,
52864
54158
  }
52865
54159
  : undefined,
52866
- sameParty: cookie.sameParty ?? false,
54160
+ sameParty: false,
52867
54161
  };
52868
54162
  });
52869
54163
  }
@@ -55541,9 +56835,9 @@ class Puppeteer {
55541
56835
  * SPDX-License-Identifier: Apache-2.0
55542
56836
  */
55543
56837
  const PUPPETEER_REVISIONS = Object.freeze({
55544
- chrome: '145.0.7632.77',
55545
- 'chrome-headless-shell': '145.0.7632.77',
55546
- firefox: 'stable_147.0.4',
56838
+ chrome: '146.0.7680.31',
56839
+ 'chrome-headless-shell': '146.0.7680.31',
56840
+ firefox: 'stable_148.0',
55547
56841
  });
55548
56842
 
55549
56843
  /**
@@ -58860,7 +60154,7 @@ function requireHelpers$2 () {
58860
60154
  };
58861
60155
  Object.defineProperty(helpers$4, "__esModule", { value: true });
58862
60156
  helpers$4.req = helpers$4.json = helpers$4.toBuffer = void 0;
58863
- const http = __importStar(require$$0$3);
60157
+ const http = __importStar(require$$0$6);
58864
60158
  const https = __importStar(require$$1$1);
58865
60159
  async function toBuffer(stream) {
58866
60160
  let length = 0;
@@ -58935,8 +60229,8 @@ function requireDist$b () {
58935
60229
  };
58936
60230
  Object.defineProperty(exports$1, "__esModule", { value: true });
58937
60231
  exports$1.Agent = void 0;
58938
- const net = __importStar(require$$0$4);
58939
- const http = __importStar(require$$0$3);
60232
+ const net = __importStar(require$$0$7);
60233
+ const http = __importStar(require$$0$6);
58940
60234
  const https_1 = require$$1$1;
58941
60235
  __exportStar(requireHelpers$2(), exports$1);
58942
60236
  const INTERNAL = Symbol('AgentBaseInternalState');
@@ -59167,10 +60461,10 @@ function requireDist$a () {
59167
60461
  };
59168
60462
  Object.defineProperty(dist$9, "__esModule", { value: true });
59169
60463
  dist$9.HttpProxyAgent = void 0;
59170
- const net = __importStar(require$$0$4);
60464
+ const net = __importStar(require$$0$7);
59171
60465
  const tls = __importStar(require$$1$2);
59172
60466
  const debug_1 = __importDefault(requireSrc());
59173
- const events_1 = require$$0$5;
60467
+ const events_1 = require$$0$8;
59174
60468
  const agent_base_1 = requireDist$b();
59175
60469
  const url_1 = require$$5;
59176
60470
  const debug = (0, debug_1.default)('http-proxy-agent');
@@ -59410,7 +60704,7 @@ function requireDist$9 () {
59410
60704
  };
59411
60705
  Object.defineProperty(dist$8, "__esModule", { value: true });
59412
60706
  dist$8.HttpsProxyAgent = void 0;
59413
- const net = __importStar(require$$0$4);
60707
+ const net = __importStar(require$$0$7);
59414
60708
  const tls = __importStar(require$$1$2);
59415
60709
  const assert_1 = __importDefault(require$$2);
59416
60710
  const debug_1 = __importDefault(requireSrc());
@@ -59543,7 +60837,7 @@ function requireUtils$1 () {
59543
60837
  if (hasRequiredUtils$1) return utils$1;
59544
60838
  hasRequiredUtils$1 = 1;
59545
60839
  Object.defineProperty(utils$1, "__esModule", { value: true });
59546
- const buffer_1 = require$$0$6;
60840
+ const buffer_1 = require$$0$9;
59547
60841
  const ERRORS = {
59548
60842
  INVALID_ENCODING: 'Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.',
59549
60843
  INVALID_SMARTBUFFER_SIZE: 'Invalid size provided. Size must be a valid integer greater than zero.',
@@ -61415,7 +62709,7 @@ function requireHelpers () {
61415
62709
  const constants_1 = requireConstants$3();
61416
62710
  const stream = require$$1$3;
61417
62711
  const ip_address_1 = requireIpAddress();
61418
- const net = require$$0$4;
62712
+ const net = require$$0$7;
61419
62713
  function validateSocksClientOptions(options, acceptedCommands = ['connect', 'bind', 'associate']) {
61420
62714
  if (!constants_1.SocksCommand[options.command]) {
61421
62715
  throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options);
@@ -61602,8 +62896,8 @@ function requireSocksclient () {
61602
62896
  };
61603
62897
  Object.defineProperty(exports$1, "__esModule", { value: true });
61604
62898
  exports$1.SocksClientError = exports$1.SocksClient = void 0;
61605
- const events_1 = require$$0$5;
61606
- const net = require$$0$4;
62899
+ const events_1 = require$$0$8;
62900
+ const net = require$$0$7;
61607
62901
  const smart_buffer_1 = requireSmartbuffer();
61608
62902
  const constants_1 = requireConstants$3();
61609
62903
  const helpers_1 = requireHelpers();
@@ -62269,7 +63563,7 @@ function requireDist$8 () {
62269
63563
  const agent_base_1 = requireDist$b();
62270
63564
  const debug_1 = __importDefault(requireSrc());
62271
63565
  const dns = __importStar(require$$3$3);
62272
- const net = __importStar(require$$0$4);
63566
+ const net = __importStar(require$$0$7);
62273
63567
  const tls = __importStar(require$$1$2);
62274
63568
  const url_1 = require$$5;
62275
63569
  const debug = (0, debug_1.default)('socks-proxy-agent');
@@ -62616,7 +63910,7 @@ function requireFile () {
62616
63910
  Object.defineProperty(file, "__esModule", { value: true });
62617
63911
  file.file = void 0;
62618
63912
  const debug_1 = __importDefault(requireSrc());
62619
- const fs_1 = require$$0$7;
63913
+ const fs_1 = require$$0$3;
62620
63914
  const notfound_1 = __importDefault(requireNotfound());
62621
63915
  const notmodified_1 = __importDefault(requireNotmodified());
62622
63916
  const url_1 = require$$5;
@@ -62728,7 +64022,7 @@ function requireFtpContext () {
62728
64022
  hasRequiredFtpContext = 1;
62729
64023
  Object.defineProperty(FtpContext, "__esModule", { value: true });
62730
64024
  FtpContext.FTPContext = FtpContext.FTPError = void 0;
62731
- const net_1 = require$$0$4;
64025
+ const net_1 = require$$0$7;
62732
64026
  const parseControlResponse_1 = requireParseControlResponse();
62733
64027
  class FTPError extends Error {
62734
64028
  constructor(res) {
@@ -63773,8 +65067,8 @@ function requireClient () {
63773
65067
  hasRequiredClient = 1;
63774
65068
  Object.defineProperty(Client, "__esModule", { value: true });
63775
65069
  Client.Client = void 0;
63776
- const fs_1 = require$$0$7;
63777
- const path_1 = require$$1$4;
65070
+ const fs_1 = require$$0$3;
65071
+ const path_1 = require$$0$4;
63778
65072
  const tls_1 = require$$1$2;
63779
65073
  const util_1 = require$$0$2;
63780
65074
  const FtpContext_1 = requireFtpContext();
@@ -64169,6 +65463,12 @@ function requireClient () {
64169
65463
  async _downloadFromWorkingDir(localDirPath) {
64170
65464
  await ensureLocalDirectory(localDirPath);
64171
65465
  for (const file of await this.list()) {
65466
+ const hasInvalidName = !file.name || (0, path_1.basename)(file.name) !== file.name;
65467
+ if (hasInvalidName) {
65468
+ const safeName = JSON.stringify(file.name);
65469
+ this.ftp.log(`Invalid filename from server listing, will skip file. (${safeName})`);
65470
+ continue;
65471
+ }
64172
65472
  const localPath = (0, path_1.join)(localDirPath, file.name);
64173
65473
  if (file.isDirectory) {
64174
65474
  await this.cd(file.name);
@@ -64332,7 +65632,7 @@ function requireFtp () {
64332
65632
  ftp.ftp = void 0;
64333
65633
  const basic_ftp_1 = requireDist$6();
64334
65634
  const stream_1 = require$$1$3;
64335
- const path_1 = require$$1$4;
65635
+ const path_1 = require$$0$4;
64336
65636
  const debug_1 = __importDefault(requireSrc());
64337
65637
  const notfound_1 = __importDefault(requireNotfound());
64338
65638
  const notmodified_1 = __importDefault(requireNotmodified());
@@ -64419,7 +65719,7 @@ function requireHttpError () {
64419
65719
  if (hasRequiredHttpError) return httpError;
64420
65720
  hasRequiredHttpError = 1;
64421
65721
  Object.defineProperty(httpError, "__esModule", { value: true });
64422
- const http_1 = require$$0$3;
65722
+ const http_1 = require$$0$6;
64423
65723
  class HTTPError extends Error {
64424
65724
  constructor(statusCode, message = http_1.STATUS_CODES[statusCode]) {
64425
65725
  super(message);
@@ -64442,9 +65742,9 @@ function requireHttp () {
64442
65742
  };
64443
65743
  Object.defineProperty(exports$1, "__esModule", { value: true });
64444
65744
  exports$1.http = void 0;
64445
- const http_1 = __importDefault(require$$0$3);
65745
+ const http_1 = __importDefault(require$$0$6);
64446
65746
  const https_1 = __importDefault(require$$1$1);
64447
- const events_1 = require$$0$5;
65747
+ const events_1 = require$$0$8;
64448
65748
  const debug_1 = __importDefault(requireSrc());
64449
65749
  const http_error_1 = __importDefault(requireHttpError());
64450
65750
  const notfound_1 = __importDefault(requireNotfound());
@@ -81470,7 +82770,7 @@ function requireMyIpAddress () {
81470
82770
  };
81471
82771
  Object.defineProperty(myIpAddress, "__esModule", { value: true });
81472
82772
  const ip_1 = requireIp();
81473
- const net_1 = __importDefault(require$$0$4);
82773
+ const net_1 = __importDefault(require$$0$7);
81474
82774
  async function myIpAddress$1() {
81475
82775
  return new Promise((resolve, reject) => {
81476
82776
  const socket = net_1.default.connect({ host: '8.8.8.8', port: 53 });
@@ -83349,7 +84649,7 @@ function requireEmscriptenModule_WASM_RELEASE_SYNC () {
83349
84649
  a.ready = new Promise(function (b, c) { m = b; n = c; });
83350
84650
  var p = Object.assign({}, a), t = "./this.program", u = "object" == typeof window, v = "function" == typeof importScripts, w = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, x = "", y, z, A;
83351
84651
  if (w) {
83352
- var fs = require$$0$7, B = require$$1$4;
84652
+ var fs = require$$0$3, B = require$$0$4;
83353
84653
  x = v ? B.dirname(x) + "/" : __dirname + "/";
83354
84654
  y = (b, c) => { var d = C(b); if (d)
83355
84655
  return c ? d : d.toString(); b = b.startsWith("file://") ? new URL(b) : B.normalize(b); return fs.readFileSync(b, c ? void 0 : "utf8"); };
@@ -84038,10 +85338,10 @@ function requireDist$1 () {
84038
85338
  };
84039
85339
  Object.defineProperty(dist$6, "__esModule", { value: true });
84040
85340
  dist$6.PacProxyAgent = void 0;
84041
- const net = __importStar(require$$0$4);
85341
+ const net = __importStar(require$$0$7);
84042
85342
  const tls = __importStar(require$$1$2);
84043
85343
  const crypto = __importStar(require$$2$1);
84044
- const events_1 = require$$0$5;
85344
+ const events_1 = require$$0$8;
84045
85345
  const debug_1 = __importDefault(requireSrc());
84046
85346
  const url_1 = require$$5;
84047
85347
  const agent_base_1 = requireDist$b();
@@ -84241,7 +85541,7 @@ function requireDist () {
84241
85541
  };
84242
85542
  Object.defineProperty(exports$1, "__esModule", { value: true });
84243
85543
  exports$1.ProxyAgent = exports$1.proxies = void 0;
84244
- const http = __importStar(require$$0$3);
85544
+ const http = __importStar(require$$0$6);
84245
85545
  const https = __importStar(require$$1$1);
84246
85546
  const url_1 = require$$5;
84247
85547
  const lru_cache_1 = __importDefault(/*@__PURE__*/ requireLruCache());
@@ -86170,7 +87470,7 @@ var hasRequiredPermessageDeflate;
86170
87470
  function requirePermessageDeflate () {
86171
87471
  if (hasRequiredPermessageDeflate) return permessageDeflate;
86172
87472
  hasRequiredPermessageDeflate = 1;
86173
- const zlib = require$$0$8;
87473
+ const zlib = require$$0$a;
86174
87474
  const bufferUtil = requireBufferUtil();
86175
87475
  const Limiter = requireLimiter();
86176
87476
  const { kStatusCode } = requireConstants();
@@ -86495,7 +87795,7 @@ var hasRequiredValidation;
86495
87795
  function requireValidation () {
86496
87796
  if (hasRequiredValidation) return validation.exports;
86497
87797
  hasRequiredValidation = 1;
86498
- const { isUtf8 } = require$$0$6;
87798
+ const { isUtf8 } = require$$0$9;
86499
87799
  const { hasBlob } = requireConstants();
86500
87800
  const tokenChars = [
86501
87801
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -87792,10 +89092,10 @@ var hasRequiredWebsocket;
87792
89092
  function requireWebsocket () {
87793
89093
  if (hasRequiredWebsocket) return websocket;
87794
89094
  hasRequiredWebsocket = 1;
87795
- const EventEmitter = require$$0$5;
89095
+ const EventEmitter = require$$0$8;
87796
89096
  const https = require$$1$1;
87797
- const http = require$$0$3;
87798
- const net = require$$0$4;
89097
+ const http = require$$0$6;
89098
+ const net = require$$0$7;
87799
89099
  const tls = require$$1$2;
87800
89100
  const { randomBytes, createHash } = require$$2$1;
87801
89101
  const { Duplex, Readable } = require$$1$3;
@@ -88759,8 +90059,8 @@ var hasRequiredWebsocketServer;
88759
90059
  function requireWebsocketServer () {
88760
90060
  if (hasRequiredWebsocketServer) return websocketServer;
88761
90061
  hasRequiredWebsocketServer = 1;
88762
- const EventEmitter = require$$0$5;
88763
- const http = require$$0$3;
90062
+ const EventEmitter = require$$0$8;
90063
+ const http = require$$0$6;
88764
90064
  const { Duplex } = require$$1$3;
88765
90065
  const { createHash } = require$$2$1;
88766
90066
  const extension = requireExtension();
@@ -89603,6 +90903,7 @@ class ChromeLauncher extends BrowserLauncher {
89603
90903
  'MediaRouter',
89604
90904
  'OptimizationHints',
89605
90905
  'RenderDocument',
90906
+ 'PartitionAllocSchedulerLoopQuarantineTaskControlledPurge',
89606
90907
  ...(turnOnExperimentalFeaturesForTesting
89607
90908
  ? []
89608
90909
  : [
@@ -90104,7 +91405,7 @@ let ScreenRecorder = (() => {
90104
91405
  if (path) {
90105
91406
  fs.mkdirSync(dirname$1(path), { recursive: overwrite });
90106
91407
  }
90107
- this.#process = spawn(ffmpegPath,
91408
+ this.#process = spawn$1(ffmpegPath,
90108
91409
  [
90109
91410
  ['-loglevel', 'error'],
90110
91411
  ['-avioflags', 'direct'],
@@ -90295,6 +91596,8 @@ var ExperimentName;
90295
91596
  ExperimentName["USE_SOURCE_MAP_SCOPES"] = "use-source-map-scopes";
90296
91597
  ExperimentName["TIMELINE_SHOW_POST_MESSAGE_EVENTS"] = "timeline-show-postmessage-events";
90297
91598
  ExperimentName["TIMELINE_DEBUG_MODE"] = "timeline-debug-mode";
91599
+ ExperimentName["DURABLE_MESSAGES"] = "durable-messages";
91600
+ ExperimentName["JPEG_XL"] = "jpeg-xl";
90298
91601
  })(ExperimentName || (ExperimentName = {}));
90299
91602
 
90300
91603
  function getChromeVersion() { return ''; }const hostConfig = {};
@@ -90313,7 +91616,7 @@ function registerAppProvider(registration) {
90313
91616
  }
90314
91617
  function getRegisteredAppProviders() {
90315
91618
  return registeredAppProvider
90316
- .filter(provider => Runtime.isDescriptorEnabled({ experiment: undefined, condition: provider.condition }))
91619
+ .filter(provider => Runtime.isDescriptorEnabled({ condition: provider.condition }))
90317
91620
  .sort((firstProvider, secondProvider) => {
90318
91621
  const order1 = firstProvider.order || 0;
90319
91622
  const order2 = secondProvider.order || 0;
@@ -93273,7 +94576,7 @@ class Legacy {
93273
94576
  }
93274
94577
  toProtocolRGBA() {
93275
94578
  const rgba = this.canonicalRGBA();
93276
- const result = { r: rgba[0], g: rgba[1], b: rgba[2], a: undefined };
94579
+ const result = { r: rgba[0], g: rgba[1], b: rgba[2] };
93277
94580
  if (rgba[3] !== 1) {
93278
94581
  result.a = rgba[3];
93279
94582
  }
@@ -93513,7 +94816,7 @@ class Generator {
93513
94816
  #alphaSpace;
93514
94817
  #colors = new Map();
93515
94818
  constructor(hueSpace, satSpace, lightnessSpace, alphaSpace) {
93516
- this.#hueSpace = hueSpace || { min: 0, max: 360, count: undefined };
94819
+ this.#hueSpace = hueSpace || { min: 0, max: 360 };
93517
94820
  this.#satSpace = satSpace || 67;
93518
94821
  this.#lightnessSpace = lightnessSpace || 80;
93519
94822
  this.#alphaSpace = alphaSpace || 1;
@@ -96140,11 +97443,21 @@ async function fileToString(file) {
96140
97443
  const str = new TextDecoder('utf-8').decode(arrayBuffer);
96141
97444
  return str;
96142
97445
  }
96143
- async function decompress(gzippedBuffer) {
97446
+ async function decompress(gzippedBuffer, charset = 'utf-8') {
96144
97447
  const buffer = await gzipCodec(gzippedBuffer, new DecompressionStream('gzip'));
96145
- const str = new TextDecoder('utf-8').decode(buffer);
97448
+ const str = new TextDecoder(charset).decode(buffer);
96146
97449
  return str;
96147
97450
  }
97451
+ async function decompressDeflate(buffer, charset = 'utf-8') {
97452
+ let decompressedBuffer;
97453
+ try {
97454
+ decompressedBuffer = await gzipCodec(buffer, new DecompressionStream('deflate'));
97455
+ }
97456
+ catch {
97457
+ decompressedBuffer = await gzipCodec(buffer, new DecompressionStream('deflate-raw'));
97458
+ }
97459
+ return new TextDecoder(charset).decode(decompressedBuffer);
97460
+ }
96148
97461
  async function compress(str) {
96149
97462
  const encoded = new TextEncoder().encode(str);
96150
97463
  const buffer = await gzipCodec(encoded, new CompressionStream('gzip'));
@@ -96187,6 +97500,7 @@ var Gzip = /*#__PURE__*/Object.freeze({
96187
97500
  compressStream: compressStream,
96188
97501
  createMonitoredStream: createMonitoredStream,
96189
97502
  decompress: decompress,
97503
+ decompressDeflate: decompressDeflate,
96190
97504
  decompressStream: decompressStream,
96191
97505
  fileToString: fileToString,
96192
97506
  isGzip: isGzip
@@ -96724,7 +98038,7 @@ var ParsedURL$1 = /*#__PURE__*/Object.freeze({
96724
98038
  class Progress {
96725
98039
  totalWork = 0;
96726
98040
  worked = 0;
96727
- title = undefined;
98041
+ title;
96728
98042
  canceled = false;
96729
98043
  done = false;
96730
98044
  }
@@ -98060,7 +99374,7 @@ class VersionController {
98060
99374
  static GLOBAL_VERSION_SETTING_NAME = 'inspectorVersion';
98061
99375
  static SYNCED_VERSION_SETTING_NAME = 'syncedInspectorVersion';
98062
99376
  static LOCAL_VERSION_SETTING_NAME = 'localInspectorVersion';
98063
- static CURRENT_VERSION = 40;
99377
+ static CURRENT_VERSION = 41;
98064
99378
  #settings;
98065
99379
  #globalVersionSetting;
98066
99380
  #syncedVersionSetting;
@@ -98631,6 +99945,24 @@ class VersionController {
98631
99945
  this.#settings.globalStorage.remove(PREFERRED_NETWORK_COND_SETTING);
98632
99946
  }
98633
99947
  }
99948
+ updateVersionFrom40To41() {
99949
+ if (this.#settings.syncedStorage.has('hide-network-messages')) {
99950
+ const oldNetworkSetting = this.#settings.createSetting('hide-network-messages', false, "Synced" );
99951
+ if (!this.#settings.syncedStorage.has('network-messages')) {
99952
+ const newNetworkSetting = this.#settings.createSetting('network-messages', true, "Synced" );
99953
+ newNetworkSetting.set(!oldNetworkSetting.get());
99954
+ }
99955
+ this.#removeSetting(oldNetworkSetting);
99956
+ }
99957
+ if (this.#settings.syncedStorage.has('frame-viewer-hide-chrome-window')) {
99958
+ const oldChromeFrameSetting = this.#settings.createSetting('frame-viewer-hide-chrome-window', false, "Synced" );
99959
+ if (!this.#settings.syncedStorage.has('frame-viewer-chrome-window')) {
99960
+ const newChromeFrameSetting = this.#settings.createSetting('frame-viewer-chrome-window', true, "Synced" );
99961
+ newChromeFrameSetting.set(!oldChromeFrameSetting.get());
99962
+ }
99963
+ this.#removeSetting(oldChromeFrameSetting);
99964
+ }
99965
+ }
98634
99966
  migrateSettingsFromLocalStorage() {
98635
99967
  const localSettings = new Set([
98636
99968
  'advancedSearchConfig',
@@ -99219,6 +100551,8 @@ const UIStrings$18 = {
99219
100551
  enableLocalFonts: 'Enable local fonts',
99220
100552
  disableAvifFormat: 'Disable `AVIF` format',
99221
100553
  enableAvifFormat: 'Enable `AVIF` format',
100554
+ disableJpegXlFormat: 'Disable `JPEG XL` format',
100555
+ enableJpegXlFormat: 'Enable `JPEG XL` format',
99222
100556
  disableWebpFormat: 'Disable `WebP` format',
99223
100557
  enableWebpFormat: 'Enable `WebP` format',
99224
100558
  customFormatters: 'Custom formatters',
@@ -99887,6 +101221,23 @@ registerSettingExtension({
99887
101221
  ],
99888
101222
  defaultValue: false,
99889
101223
  });
101224
+ registerSettingExtension({
101225
+ category: "RENDERING" ,
101226
+ settingName: 'jpeg-xl-format-disabled',
101227
+ settingType: "boolean" ,
101228
+ storageType: "Session" ,
101229
+ options: [
101230
+ {
101231
+ value: true,
101232
+ title: i18nLazyString$f(UIStrings$18.disableJpegXlFormat),
101233
+ },
101234
+ {
101235
+ value: false,
101236
+ title: i18nLazyString$f(UIStrings$18.enableJpegXlFormat),
101237
+ },
101238
+ ],
101239
+ defaultValue: false,
101240
+ });
99890
101241
  registerSettingExtension({
99891
101242
  category: "RENDERING" ,
99892
101243
  settingName: 'webp-format-disabled',
@@ -100489,21 +101840,11 @@ class InspectorFrontendHostStub {
100489
101840
  streamWrite(streamId, text);
100490
101841
  callback({
100491
101842
  statusCode: 200,
100492
- headers: undefined,
100493
- messageOverride: undefined,
100494
- netError: undefined,
100495
- netErrorName: undefined,
100496
- urlValid: undefined,
100497
101843
  });
100498
101844
  })
100499
101845
  .catch(function () {
100500
101846
  callback({
100501
101847
  statusCode: 404,
100502
- headers: undefined,
100503
- messageOverride: undefined,
100504
- netError: undefined,
100505
- netErrorName: undefined,
100506
- urlValid: undefined,
100507
101848
  });
100508
101849
  });
100509
101850
  }
@@ -101041,7 +102382,7 @@ function registerCommands(inspectorBackend) {
101041
102382
  inspectorBackend.registerEnum("Audits.PropertyRuleIssueReason", { InvalidSyntax: "InvalidSyntax", InvalidInitialValue: "InvalidInitialValue", InvalidInherits: "InvalidInherits", InvalidName: "InvalidName" });
101042
102383
  inspectorBackend.registerEnum("Audits.UserReidentificationIssueType", { BlockedFrameNavigation: "BlockedFrameNavigation", BlockedSubresource: "BlockedSubresource", NoisedCanvasReadback: "NoisedCanvasReadback" });
101043
102384
  inspectorBackend.registerEnum("Audits.PermissionElementIssueType", { InvalidType: "InvalidType", FencedFrameDisallowed: "FencedFrameDisallowed", CspFrameAncestorsMissing: "CspFrameAncestorsMissing", PermissionsPolicyBlocked: "PermissionsPolicyBlocked", PaddingRightUnsupported: "PaddingRightUnsupported", PaddingBottomUnsupported: "PaddingBottomUnsupported", InsetBoxShadowUnsupported: "InsetBoxShadowUnsupported", RequestInProgress: "RequestInProgress", UntrustedEvent: "UntrustedEvent", RegistrationFailed: "RegistrationFailed", TypeNotSupported: "TypeNotSupported", InvalidTypeActivation: "InvalidTypeActivation", SecurityChecksFailed: "SecurityChecksFailed", ActivationDisabled: "ActivationDisabled", GeolocationDeprecated: "GeolocationDeprecated", InvalidDisplayStyle: "InvalidDisplayStyle", NonOpaqueColor: "NonOpaqueColor", LowContrast: "LowContrast", FontSizeTooSmall: "FontSizeTooSmall", FontSizeTooLarge: "FontSizeTooLarge", InvalidSizeValue: "InvalidSizeValue" });
101044
- inspectorBackend.registerEnum("Audits.InspectorIssueCode", { CookieIssue: "CookieIssue", MixedContentIssue: "MixedContentIssue", BlockedByResponseIssue: "BlockedByResponseIssue", HeavyAdIssue: "HeavyAdIssue", ContentSecurityPolicyIssue: "ContentSecurityPolicyIssue", SharedArrayBufferIssue: "SharedArrayBufferIssue", LowTextContrastIssue: "LowTextContrastIssue", CorsIssue: "CorsIssue", AttributionReportingIssue: "AttributionReportingIssue", QuirksModeIssue: "QuirksModeIssue", PartitioningBlobURLIssue: "PartitioningBlobURLIssue", NavigatorUserAgentIssue: "NavigatorUserAgentIssue", GenericIssue: "GenericIssue", DeprecationIssue: "DeprecationIssue", ClientHintIssue: "ClientHintIssue", FederatedAuthRequestIssue: "FederatedAuthRequestIssue", BounceTrackingIssue: "BounceTrackingIssue", CookieDeprecationMetadataIssue: "CookieDeprecationMetadataIssue", StylesheetLoadingIssue: "StylesheetLoadingIssue", FederatedAuthUserInfoRequestIssue: "FederatedAuthUserInfoRequestIssue", PropertyRuleIssue: "PropertyRuleIssue", SharedDictionaryIssue: "SharedDictionaryIssue", ElementAccessibilityIssue: "ElementAccessibilityIssue", SRIMessageSignatureIssue: "SRIMessageSignatureIssue", UnencodedDigestIssue: "UnencodedDigestIssue", ConnectionAllowlistIssue: "ConnectionAllowlistIssue", UserReidentificationIssue: "UserReidentificationIssue", PermissionElementIssue: "PermissionElementIssue", PerformanceIssue: "PerformanceIssue" });
102385
+ inspectorBackend.registerEnum("Audits.InspectorIssueCode", { CookieIssue: "CookieIssue", MixedContentIssue: "MixedContentIssue", BlockedByResponseIssue: "BlockedByResponseIssue", HeavyAdIssue: "HeavyAdIssue", ContentSecurityPolicyIssue: "ContentSecurityPolicyIssue", SharedArrayBufferIssue: "SharedArrayBufferIssue", LowTextContrastIssue: "LowTextContrastIssue", CorsIssue: "CorsIssue", AttributionReportingIssue: "AttributionReportingIssue", QuirksModeIssue: "QuirksModeIssue", PartitioningBlobURLIssue: "PartitioningBlobURLIssue", NavigatorUserAgentIssue: "NavigatorUserAgentIssue", GenericIssue: "GenericIssue", DeprecationIssue: "DeprecationIssue", ClientHintIssue: "ClientHintIssue", FederatedAuthRequestIssue: "FederatedAuthRequestIssue", BounceTrackingIssue: "BounceTrackingIssue", CookieDeprecationMetadataIssue: "CookieDeprecationMetadataIssue", StylesheetLoadingIssue: "StylesheetLoadingIssue", FederatedAuthUserInfoRequestIssue: "FederatedAuthUserInfoRequestIssue", PropertyRuleIssue: "PropertyRuleIssue", SharedDictionaryIssue: "SharedDictionaryIssue", ElementAccessibilityIssue: "ElementAccessibilityIssue", SRIMessageSignatureIssue: "SRIMessageSignatureIssue", UnencodedDigestIssue: "UnencodedDigestIssue", ConnectionAllowlistIssue: "ConnectionAllowlistIssue", UserReidentificationIssue: "UserReidentificationIssue", PermissionElementIssue: "PermissionElementIssue", PerformanceIssue: "PerformanceIssue", SelectivePermissionsInterventionIssue: "SelectivePermissionsInterventionIssue" });
101045
102386
  inspectorBackend.registerEvent("Audits.issueAdded", ["issue"]);
101046
102387
  inspectorBackend.registerEnum("Audits.GetEncodedResponseRequestEncoding", { Webp: "webp", Jpeg: "jpeg", Png: "png" });
101047
102388
  inspectorBackend.registerCommand("Audits.getEncodedResponse", [{ "name": "requestId", "type": "string", "optional": false, "description": "Identifier of the network request to get content for.", "typeRef": "Network.RequestId" }, { "name": "encoding", "type": "string", "optional": false, "description": "The encoding to use.", "typeRef": "Audits.GetEncodedResponseRequestEncoding" }, { "name": "quality", "type": "number", "optional": true, "description": "The quality of the encoding (0-1). (defaults to 1)", "typeRef": null }, { "name": "sizeOnly", "type": "boolean", "optional": true, "description": "Whether to only return the size information (defaults to false).", "typeRef": null }], ["body", "originalSize", "encodedSize"], "Returns the response body and size if it were re-encoded with the specified settings. Only applies to images.");
@@ -101084,7 +102425,10 @@ function registerCommands(inspectorBackend) {
101084
102425
  inspectorBackend.registerType("Audits.PropertyRuleIssueDetails", [{ "name": "sourceCodeLocation", "type": "object", "optional": false, "description": "Source code position of the property rule.", "typeRef": "Audits.SourceCodeLocation" }, { "name": "propertyRuleIssueReason", "type": "string", "optional": false, "description": "Reason why the property rule was discarded.", "typeRef": "Audits.PropertyRuleIssueReason" }, { "name": "propertyValue", "type": "string", "optional": true, "description": "The value of the property rule property that failed to parse", "typeRef": null }]);
101085
102426
  inspectorBackend.registerType("Audits.UserReidentificationIssueDetails", [{ "name": "type", "type": "string", "optional": false, "description": "", "typeRef": "Audits.UserReidentificationIssueType" }, { "name": "request", "type": "object", "optional": true, "description": "Applies to BlockedFrameNavigation and BlockedSubresource issue types.", "typeRef": "Audits.AffectedRequest" }, { "name": "sourceCodeLocation", "type": "object", "optional": true, "description": "Applies to NoisedCanvasReadback issue type.", "typeRef": "Audits.SourceCodeLocation" }]);
101086
102427
  inspectorBackend.registerType("Audits.PermissionElementIssueDetails", [{ "name": "issueType", "type": "string", "optional": false, "description": "", "typeRef": "Audits.PermissionElementIssueType" }, { "name": "type", "type": "string", "optional": true, "description": "The value of the type attribute.", "typeRef": null }, { "name": "nodeId", "type": "number", "optional": true, "description": "The node ID of the <permission> element.", "typeRef": "DOM.BackendNodeId" }, { "name": "isWarning", "type": "boolean", "optional": true, "description": "True if the issue is a warning, false if it is an error.", "typeRef": null }, { "name": "permissionName", "type": "string", "optional": true, "description": "Fields for message construction: Used for messages that reference a specific permission name", "typeRef": null }, { "name": "occluderNodeInfo", "type": "string", "optional": true, "description": "Used for messages about occlusion", "typeRef": null }, { "name": "occluderParentNodeInfo", "type": "string", "optional": true, "description": "Used for messages about occluder's parent", "typeRef": null }, { "name": "disableReason", "type": "string", "optional": true, "description": "Used for messages about activation disabled reason", "typeRef": null }]);
101087
- inspectorBackend.registerType("Audits.InspectorIssueDetails", [{ "name": "cookieIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieIssueDetails" }, { "name": "mixedContentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.MixedContentIssueDetails" }, { "name": "blockedByResponseIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BlockedByResponseIssueDetails" }, { "name": "heavyAdIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.HeavyAdIssueDetails" }, { "name": "contentSecurityPolicyIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ContentSecurityPolicyIssueDetails" }, { "name": "sharedArrayBufferIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedArrayBufferIssueDetails" }, { "name": "lowTextContrastIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.LowTextContrastIssueDetails" }, { "name": "corsIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CorsIssueDetails" }, { "name": "attributionReportingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.AttributionReportingIssueDetails" }, { "name": "quirksModeIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.QuirksModeIssueDetails" }, { "name": "partitioningBlobURLIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PartitioningBlobURLIssueDetails" }, { "name": "navigatorUserAgentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.NavigatorUserAgentIssueDetails" }, { "name": "genericIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.GenericIssueDetails" }, { "name": "deprecationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.DeprecationIssueDetails" }, { "name": "clientHintIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ClientHintIssueDetails" }, { "name": "federatedAuthRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthRequestIssueDetails" }, { "name": "bounceTrackingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BounceTrackingIssueDetails" }, { "name": "cookieDeprecationMetadataIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieDeprecationMetadataIssueDetails" }, { "name": "stylesheetLoadingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.StylesheetLoadingIssueDetails" }, { "name": "propertyRuleIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PropertyRuleIssueDetails" }, { "name": "federatedAuthUserInfoRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthUserInfoRequestIssueDetails" }, { "name": "sharedDictionaryIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedDictionaryIssueDetails" }, { "name": "elementAccessibilityIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ElementAccessibilityIssueDetails" }, { "name": "sriMessageSignatureIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SRIMessageSignatureIssueDetails" }, { "name": "unencodedDigestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UnencodedDigestIssueDetails" }, { "name": "connectionAllowlistIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ConnectionAllowlistIssueDetails" }, { "name": "userReidentificationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UserReidentificationIssueDetails" }, { "name": "permissionElementIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PermissionElementIssueDetails" }, { "name": "performanceIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PerformanceIssueDetails" }]);
102428
+ inspectorBackend.registerType("Audits.AdScriptIdentifier", [{ "name": "scriptId", "type": "string", "optional": false, "description": "The script's v8 identifier.", "typeRef": "Runtime.ScriptId" }, { "name": "debuggerId", "type": "string", "optional": false, "description": "v8's debugging id for the v8::Context.", "typeRef": "Runtime.UniqueDebuggerId" }, { "name": "name", "type": "string", "optional": false, "description": "The script's url (or generated name based on id if inline script).", "typeRef": null }]);
102429
+ inspectorBackend.registerType("Audits.AdAncestry", [{ "name": "adAncestryChain", "type": "array", "optional": false, "description": "The ad-script in the stack when the offending script was loaded. This is recursive down to the root script that was tagged due to the filterlist rule.", "typeRef": "Audits.AdScriptIdentifier" }, { "name": "rootScriptFilterlistRule", "type": "string", "optional": true, "description": "The filterlist rule that caused the root (last) script in `adAncestry` to be ad-tagged.", "typeRef": null }]);
102430
+ inspectorBackend.registerType("Audits.SelectivePermissionsInterventionIssueDetails", [{ "name": "apiName", "type": "string", "optional": false, "description": "Which API was intervened on.", "typeRef": null }, { "name": "adAncestry", "type": "object", "optional": false, "description": "Why the ad script using the API is considered an ad.", "typeRef": "Audits.AdAncestry" }, { "name": "stackTrace", "type": "object", "optional": true, "description": "The stack trace at the time of the intervention.", "typeRef": "Runtime.StackTrace" }]);
102431
+ inspectorBackend.registerType("Audits.InspectorIssueDetails", [{ "name": "cookieIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieIssueDetails" }, { "name": "mixedContentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.MixedContentIssueDetails" }, { "name": "blockedByResponseIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BlockedByResponseIssueDetails" }, { "name": "heavyAdIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.HeavyAdIssueDetails" }, { "name": "contentSecurityPolicyIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ContentSecurityPolicyIssueDetails" }, { "name": "sharedArrayBufferIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedArrayBufferIssueDetails" }, { "name": "lowTextContrastIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.LowTextContrastIssueDetails" }, { "name": "corsIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CorsIssueDetails" }, { "name": "attributionReportingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.AttributionReportingIssueDetails" }, { "name": "quirksModeIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.QuirksModeIssueDetails" }, { "name": "partitioningBlobURLIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PartitioningBlobURLIssueDetails" }, { "name": "navigatorUserAgentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.NavigatorUserAgentIssueDetails" }, { "name": "genericIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.GenericIssueDetails" }, { "name": "deprecationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.DeprecationIssueDetails" }, { "name": "clientHintIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ClientHintIssueDetails" }, { "name": "federatedAuthRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthRequestIssueDetails" }, { "name": "bounceTrackingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BounceTrackingIssueDetails" }, { "name": "cookieDeprecationMetadataIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieDeprecationMetadataIssueDetails" }, { "name": "stylesheetLoadingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.StylesheetLoadingIssueDetails" }, { "name": "propertyRuleIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PropertyRuleIssueDetails" }, { "name": "federatedAuthUserInfoRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthUserInfoRequestIssueDetails" }, { "name": "sharedDictionaryIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedDictionaryIssueDetails" }, { "name": "elementAccessibilityIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ElementAccessibilityIssueDetails" }, { "name": "sriMessageSignatureIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SRIMessageSignatureIssueDetails" }, { "name": "unencodedDigestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UnencodedDigestIssueDetails" }, { "name": "connectionAllowlistIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ConnectionAllowlistIssueDetails" }, { "name": "userReidentificationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UserReidentificationIssueDetails" }, { "name": "permissionElementIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PermissionElementIssueDetails" }, { "name": "performanceIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PerformanceIssueDetails" }, { "name": "selectivePermissionsInterventionIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SelectivePermissionsInterventionIssueDetails" }]);
101088
102432
  inspectorBackend.registerType("Audits.InspectorIssue", [{ "name": "code", "type": "string", "optional": false, "description": "", "typeRef": "Audits.InspectorIssueCode" }, { "name": "details", "type": "object", "optional": false, "description": "", "typeRef": "Audits.InspectorIssueDetails" }, { "name": "issueId", "type": "string", "optional": true, "description": "A unique id for this issue. May be omitted if no other entity (e.g. exception, CDP message, etc.) is referencing this issue.", "typeRef": "Audits.IssueId" }]);
101089
102433
  inspectorBackend.registerEnum("Autofill.FillingStrategy", { AutocompleteAttribute: "autocompleteAttribute", AutofillInferred: "autofillInferred" });
101090
102434
  inspectorBackend.registerEvent("Autofill.addressFormFilled", ["filledFields", "addressUi"]);
@@ -101295,6 +102639,7 @@ function registerCommands(inspectorBackend) {
101295
102639
  inspectorBackend.registerEvent("DOM.pseudoElementAdded", ["parentId", "pseudoElement"]);
101296
102640
  inspectorBackend.registerEvent("DOM.topLayerElementsUpdated", []);
101297
102641
  inspectorBackend.registerEvent("DOM.scrollableFlagUpdated", ["nodeId", "isScrollable"]);
102642
+ inspectorBackend.registerEvent("DOM.adRelatedStateUpdated", ["nodeId", "isAdRelated"]);
101298
102643
  inspectorBackend.registerEvent("DOM.affectedByStartingStylesFlagUpdated", ["nodeId", "affectedByStartingStyles"]);
101299
102644
  inspectorBackend.registerEvent("DOM.pseudoElementRemoved", ["parentId", "pseudoElementId"]);
101300
102645
  inspectorBackend.registerEvent("DOM.setChildNodes", ["parentId", "nodes"]);
@@ -101356,7 +102701,7 @@ function registerCommands(inspectorBackend) {
101356
102701
  inspectorBackend.registerCommand("DOM.getAnchorElement", [{ "name": "nodeId", "type": "number", "optional": false, "description": "Id of the positioned element from which to find the anchor.", "typeRef": "DOM.NodeId" }, { "name": "anchorSpecifier", "type": "string", "optional": true, "description": "An optional anchor specifier, as defined in https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier. If not provided, it will return the implicit anchor element for the given positioned element.", "typeRef": null }], ["nodeId"], "Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.");
101357
102702
  inspectorBackend.registerCommand("DOM.forceShowPopover", [{ "name": "nodeId", "type": "number", "optional": false, "description": "Id of the popover HTMLElement", "typeRef": "DOM.NodeId" }, { "name": "enable", "type": "boolean", "optional": false, "description": "If true, opens the popover and keeps it open. If false, closes the popover if it was previously force-opened.", "typeRef": null }], ["nodeIds"], "When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.");
101358
102703
  inspectorBackend.registerType("DOM.BackendNode", [{ "name": "nodeType", "type": "number", "optional": false, "description": "`Node`'s nodeType.", "typeRef": null }, { "name": "nodeName", "type": "string", "optional": false, "description": "`Node`'s nodeName.", "typeRef": null }, { "name": "backendNodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.BackendNodeId" }]);
101359
- inspectorBackend.registerType("DOM.Node", [{ "name": "nodeId", "type": "number", "optional": false, "description": "Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend will only push node with given `id` once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client.", "typeRef": "DOM.NodeId" }, { "name": "parentId", "type": "number", "optional": true, "description": "The id of the parent node if any.", "typeRef": "DOM.NodeId" }, { "name": "backendNodeId", "type": "number", "optional": false, "description": "The BackendNodeId for this node.", "typeRef": "DOM.BackendNodeId" }, { "name": "nodeType", "type": "number", "optional": false, "description": "`Node`'s nodeType.", "typeRef": null }, { "name": "nodeName", "type": "string", "optional": false, "description": "`Node`'s nodeName.", "typeRef": null }, { "name": "localName", "type": "string", "optional": false, "description": "`Node`'s localName.", "typeRef": null }, { "name": "nodeValue", "type": "string", "optional": false, "description": "`Node`'s nodeValue.", "typeRef": null }, { "name": "childNodeCount", "type": "number", "optional": true, "description": "Child count for `Container` nodes.", "typeRef": null }, { "name": "children", "type": "array", "optional": true, "description": "Child nodes of this node when requested with children.", "typeRef": "DOM.Node" }, { "name": "attributes", "type": "array", "optional": true, "description": "Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`.", "typeRef": "string" }, { "name": "documentURL", "type": "string", "optional": true, "description": "Document URL that `Document` or `FrameOwner` node points to.", "typeRef": null }, { "name": "baseURL", "type": "string", "optional": true, "description": "Base URL that `Document` or `FrameOwner` node uses for URL completion.", "typeRef": null }, { "name": "publicId", "type": "string", "optional": true, "description": "`DocumentType`'s publicId.", "typeRef": null }, { "name": "systemId", "type": "string", "optional": true, "description": "`DocumentType`'s systemId.", "typeRef": null }, { "name": "internalSubset", "type": "string", "optional": true, "description": "`DocumentType`'s internalSubset.", "typeRef": null }, { "name": "xmlVersion", "type": "string", "optional": true, "description": "`Document`'s XML version in case of XML documents.", "typeRef": null }, { "name": "name", "type": "string", "optional": true, "description": "`Attr`'s name.", "typeRef": null }, { "name": "value", "type": "string", "optional": true, "description": "`Attr`'s value.", "typeRef": null }, { "name": "pseudoType", "type": "string", "optional": true, "description": "Pseudo element type for this node.", "typeRef": "DOM.PseudoType" }, { "name": "pseudoIdentifier", "type": "string", "optional": true, "description": "Pseudo element identifier for this node. Only present if there is a valid pseudoType.", "typeRef": null }, { "name": "shadowRootType", "type": "string", "optional": true, "description": "Shadow root type.", "typeRef": "DOM.ShadowRootType" }, { "name": "frameId", "type": "string", "optional": true, "description": "Frame ID for frame owner elements.", "typeRef": "Page.FrameId" }, { "name": "contentDocument", "type": "object", "optional": true, "description": "Content document for frame owner elements.", "typeRef": "DOM.Node" }, { "name": "shadowRoots", "type": "array", "optional": true, "description": "Shadow root list for given element host.", "typeRef": "DOM.Node" }, { "name": "templateContent", "type": "object", "optional": true, "description": "Content document fragment for template elements.", "typeRef": "DOM.Node" }, { "name": "pseudoElements", "type": "array", "optional": true, "description": "Pseudo elements associated with this node.", "typeRef": "DOM.Node" }, { "name": "importedDocument", "type": "object", "optional": true, "description": "Deprecated, as the HTML Imports API has been removed (crbug.com/937746). This property used to return the imported document for the HTMLImport links. The property is always undefined now.", "typeRef": "DOM.Node" }, { "name": "distributedNodes", "type": "array", "optional": true, "description": "Distributed nodes for given insertion point.", "typeRef": "DOM.BackendNode" }, { "name": "isSVG", "type": "boolean", "optional": true, "description": "Whether the node is SVG.", "typeRef": null }, { "name": "compatibilityMode", "type": "string", "optional": true, "description": "", "typeRef": "DOM.CompatibilityMode" }, { "name": "assignedSlot", "type": "object", "optional": true, "description": "", "typeRef": "DOM.BackendNode" }, { "name": "isScrollable", "type": "boolean", "optional": true, "description": "", "typeRef": null }, { "name": "affectedByStartingStyles", "type": "boolean", "optional": true, "description": "", "typeRef": null }, { "name": "adoptedStyleSheets", "type": "array", "optional": true, "description": "", "typeRef": "DOM.StyleSheetId" }]);
102704
+ inspectorBackend.registerType("DOM.Node", [{ "name": "nodeId", "type": "number", "optional": false, "description": "Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend will only push node with given `id` once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client.", "typeRef": "DOM.NodeId" }, { "name": "parentId", "type": "number", "optional": true, "description": "The id of the parent node if any.", "typeRef": "DOM.NodeId" }, { "name": "backendNodeId", "type": "number", "optional": false, "description": "The BackendNodeId for this node.", "typeRef": "DOM.BackendNodeId" }, { "name": "nodeType", "type": "number", "optional": false, "description": "`Node`'s nodeType.", "typeRef": null }, { "name": "nodeName", "type": "string", "optional": false, "description": "`Node`'s nodeName.", "typeRef": null }, { "name": "localName", "type": "string", "optional": false, "description": "`Node`'s localName.", "typeRef": null }, { "name": "nodeValue", "type": "string", "optional": false, "description": "`Node`'s nodeValue.", "typeRef": null }, { "name": "childNodeCount", "type": "number", "optional": true, "description": "Child count for `Container` nodes.", "typeRef": null }, { "name": "children", "type": "array", "optional": true, "description": "Child nodes of this node when requested with children.", "typeRef": "DOM.Node" }, { "name": "attributes", "type": "array", "optional": true, "description": "Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`.", "typeRef": "string" }, { "name": "documentURL", "type": "string", "optional": true, "description": "Document URL that `Document` or `FrameOwner` node points to.", "typeRef": null }, { "name": "baseURL", "type": "string", "optional": true, "description": "Base URL that `Document` or `FrameOwner` node uses for URL completion.", "typeRef": null }, { "name": "publicId", "type": "string", "optional": true, "description": "`DocumentType`'s publicId.", "typeRef": null }, { "name": "systemId", "type": "string", "optional": true, "description": "`DocumentType`'s systemId.", "typeRef": null }, { "name": "internalSubset", "type": "string", "optional": true, "description": "`DocumentType`'s internalSubset.", "typeRef": null }, { "name": "xmlVersion", "type": "string", "optional": true, "description": "`Document`'s XML version in case of XML documents.", "typeRef": null }, { "name": "name", "type": "string", "optional": true, "description": "`Attr`'s name.", "typeRef": null }, { "name": "value", "type": "string", "optional": true, "description": "`Attr`'s value.", "typeRef": null }, { "name": "pseudoType", "type": "string", "optional": true, "description": "Pseudo element type for this node.", "typeRef": "DOM.PseudoType" }, { "name": "pseudoIdentifier", "type": "string", "optional": true, "description": "Pseudo element identifier for this node. Only present if there is a valid pseudoType.", "typeRef": null }, { "name": "shadowRootType", "type": "string", "optional": true, "description": "Shadow root type.", "typeRef": "DOM.ShadowRootType" }, { "name": "frameId", "type": "string", "optional": true, "description": "Frame ID for frame owner elements.", "typeRef": "Page.FrameId" }, { "name": "contentDocument", "type": "object", "optional": true, "description": "Content document for frame owner elements.", "typeRef": "DOM.Node" }, { "name": "shadowRoots", "type": "array", "optional": true, "description": "Shadow root list for given element host.", "typeRef": "DOM.Node" }, { "name": "templateContent", "type": "object", "optional": true, "description": "Content document fragment for template elements.", "typeRef": "DOM.Node" }, { "name": "pseudoElements", "type": "array", "optional": true, "description": "Pseudo elements associated with this node.", "typeRef": "DOM.Node" }, { "name": "importedDocument", "type": "object", "optional": true, "description": "Deprecated, as the HTML Imports API has been removed (crbug.com/937746). This property used to return the imported document for the HTMLImport links. The property is always undefined now.", "typeRef": "DOM.Node" }, { "name": "distributedNodes", "type": "array", "optional": true, "description": "Distributed nodes for given insertion point.", "typeRef": "DOM.BackendNode" }, { "name": "isSVG", "type": "boolean", "optional": true, "description": "Whether the node is SVG.", "typeRef": null }, { "name": "compatibilityMode", "type": "string", "optional": true, "description": "", "typeRef": "DOM.CompatibilityMode" }, { "name": "assignedSlot", "type": "object", "optional": true, "description": "", "typeRef": "DOM.BackendNode" }, { "name": "isScrollable", "type": "boolean", "optional": true, "description": "", "typeRef": null }, { "name": "affectedByStartingStyles", "type": "boolean", "optional": true, "description": "", "typeRef": null }, { "name": "adoptedStyleSheets", "type": "array", "optional": true, "description": "", "typeRef": "DOM.StyleSheetId" }, { "name": "isAdRelated", "type": "boolean", "optional": true, "description": "", "typeRef": null }]);
101360
102705
  inspectorBackend.registerType("DOM.DetachedElementInfo", [{ "name": "treeNode", "type": "object", "optional": false, "description": "", "typeRef": "DOM.Node" }, { "name": "retainedNodeIds", "type": "array", "optional": false, "description": "", "typeRef": "DOM.NodeId" }]);
101361
102706
  inspectorBackend.registerType("DOM.RGBA", [{ "name": "r", "type": "number", "optional": false, "description": "The red component, in the [0-255] range.", "typeRef": null }, { "name": "g", "type": "number", "optional": false, "description": "The green component, in the [0-255] range.", "typeRef": null }, { "name": "b", "type": "number", "optional": false, "description": "The blue component, in the [0-255] range.", "typeRef": null }, { "name": "a", "type": "number", "optional": true, "description": "The alpha component, in the [0-1] range (default: 1).", "typeRef": null }]);
101362
102707
  inspectorBackend.registerType("DOM.Quad", [{ "name": "Quad", "type": "array", "optional": false, "description": "An array of quad vertices, x immediately followed by y for each point, points clock-wise.", "typeRef": "number" }]);
@@ -101422,8 +102767,9 @@ function registerCommands(inspectorBackend) {
101422
102767
  inspectorBackend.registerEnum("Emulation.SensorType", { AbsoluteOrientation: "absolute-orientation", Accelerometer: "accelerometer", AmbientLight: "ambient-light", Gravity: "gravity", Gyroscope: "gyroscope", LinearAcceleration: "linear-acceleration", Magnetometer: "magnetometer", RelativeOrientation: "relative-orientation" });
101423
102768
  inspectorBackend.registerEnum("Emulation.PressureSource", { Cpu: "cpu" });
101424
102769
  inspectorBackend.registerEnum("Emulation.PressureState", { Nominal: "nominal", Fair: "fair", Serious: "serious", Critical: "critical" });
101425
- inspectorBackend.registerEnum("Emulation.DisabledImageType", { Avif: "avif", Webp: "webp" });
102770
+ inspectorBackend.registerEnum("Emulation.DisabledImageType", { Avif: "avif", Jxl: "jxl", Webp: "webp" });
101426
102771
  inspectorBackend.registerEvent("Emulation.virtualTimeBudgetExpired", []);
102772
+ inspectorBackend.registerEvent("Emulation.screenOrientationLockChanged", ["locked", "orientation"]);
101427
102773
  inspectorBackend.registerCommand("Emulation.canEmulate", [], ["result"], "Tells whether emulation is supported.");
101428
102774
  inspectorBackend.registerCommand("Emulation.clearDeviceMetricsOverride", [], [], "Clears the overridden device metrics.");
101429
102775
  inspectorBackend.registerCommand("Emulation.clearGeolocationOverride", [], [], "Clears the overridden Geolocation Position and Error.");
@@ -101433,7 +102779,8 @@ function registerCommands(inspectorBackend) {
101433
102779
  inspectorBackend.registerCommand("Emulation.setCPUThrottlingRate", [{ "name": "rate", "type": "number", "optional": false, "description": "Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).", "typeRef": null }], [], "Enables CPU throttling to emulate slow CPUs.");
101434
102780
  inspectorBackend.registerCommand("Emulation.setDefaultBackgroundColorOverride", [{ "name": "color", "type": "object", "optional": true, "description": "RGBA of the default background color. If not specified, any existing override will be cleared.", "typeRef": "DOM.RGBA" }], [], "Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.");
101435
102781
  inspectorBackend.registerCommand("Emulation.setSafeAreaInsetsOverride", [{ "name": "insets", "type": "object", "optional": false, "description": "", "typeRef": "Emulation.SafeAreaInsets" }], [], "Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the respective variables to be undefined, even if previously overridden.");
101436
- inspectorBackend.registerCommand("Emulation.setDeviceMetricsOverride", [{ "name": "width", "type": "number", "optional": false, "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.", "typeRef": null }, { "name": "height", "type": "number", "optional": false, "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.", "typeRef": null }, { "name": "deviceScaleFactor", "type": "number", "optional": false, "description": "Overriding device scale factor value. 0 disables the override.", "typeRef": null }, { "name": "mobile", "type": "boolean", "optional": false, "description": "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.", "typeRef": null }, { "name": "scale", "type": "number", "optional": true, "description": "Scale to apply to resulting view image.", "typeRef": null }, { "name": "screenWidth", "type": "number", "optional": true, "description": "Overriding screen width value in pixels (minimum 0, maximum 10000000).", "typeRef": null }, { "name": "screenHeight", "type": "number", "optional": true, "description": "Overriding screen height value in pixels (minimum 0, maximum 10000000).", "typeRef": null }, { "name": "positionX", "type": "number", "optional": true, "description": "Overriding view X position on screen in pixels (minimum 0, maximum 10000000).", "typeRef": null }, { "name": "positionY", "type": "number", "optional": true, "description": "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).", "typeRef": null }, { "name": "dontSetVisibleSize", "type": "boolean", "optional": true, "description": "Do not set visible view size, rely upon explicit setVisibleSize call.", "typeRef": null }, { "name": "screenOrientation", "type": "object", "optional": true, "description": "Screen orientation override.", "typeRef": "Emulation.ScreenOrientation" }, { "name": "viewport", "type": "object", "optional": true, "description": "If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.", "typeRef": "Page.Viewport" }, { "name": "displayFeature", "type": "object", "optional": true, "description": "If set, the display feature of a multi-segment screen. If not set, multi-segment support is turned-off. Deprecated, use Emulation.setDisplayFeaturesOverride.", "typeRef": "Emulation.DisplayFeature" }, { "name": "devicePosture", "type": "object", "optional": true, "description": "If set, the posture of a foldable device. If not set the posture is set to continuous. Deprecated, use Emulation.setDevicePostureOverride.", "typeRef": "Emulation.DevicePosture" }], [], "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results).");
102782
+ inspectorBackend.registerEnum("Emulation.SetDeviceMetricsOverrideRequestScrollbarType", { Overlay: "overlay", Default: "default" });
102783
+ inspectorBackend.registerCommand("Emulation.setDeviceMetricsOverride", [{ "name": "width", "type": "number", "optional": false, "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.", "typeRef": null }, { "name": "height", "type": "number", "optional": false, "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.", "typeRef": null }, { "name": "deviceScaleFactor", "type": "number", "optional": false, "description": "Overriding device scale factor value. 0 disables the override.", "typeRef": null }, { "name": "mobile", "type": "boolean", "optional": false, "description": "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.", "typeRef": null }, { "name": "scale", "type": "number", "optional": true, "description": "Scale to apply to resulting view image.", "typeRef": null }, { "name": "screenWidth", "type": "number", "optional": true, "description": "Overriding screen width value in pixels (minimum 0, maximum 10000000).", "typeRef": null }, { "name": "screenHeight", "type": "number", "optional": true, "description": "Overriding screen height value in pixels (minimum 0, maximum 10000000).", "typeRef": null }, { "name": "positionX", "type": "number", "optional": true, "description": "Overriding view X position on screen in pixels (minimum 0, maximum 10000000).", "typeRef": null }, { "name": "positionY", "type": "number", "optional": true, "description": "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).", "typeRef": null }, { "name": "dontSetVisibleSize", "type": "boolean", "optional": true, "description": "Do not set visible view size, rely upon explicit setVisibleSize call.", "typeRef": null }, { "name": "screenOrientation", "type": "object", "optional": true, "description": "Screen orientation override.", "typeRef": "Emulation.ScreenOrientation" }, { "name": "viewport", "type": "object", "optional": true, "description": "If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.", "typeRef": "Page.Viewport" }, { "name": "displayFeature", "type": "object", "optional": true, "description": "If set, the display feature of a multi-segment screen. If not set, multi-segment support is turned-off. Deprecated, use Emulation.setDisplayFeaturesOverride.", "typeRef": "Emulation.DisplayFeature" }, { "name": "devicePosture", "type": "object", "optional": true, "description": "If set, the posture of a foldable device. If not set the posture is set to continuous. Deprecated, use Emulation.setDevicePostureOverride.", "typeRef": "Emulation.DevicePosture" }, { "name": "scrollbarType", "type": "string", "optional": true, "description": "Scrollbar type. Default: `default`.", "typeRef": "Emulation.SetDeviceMetricsOverrideRequestScrollbarType" }], [], "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results).");
101437
102784
  inspectorBackend.registerCommand("Emulation.setDevicePostureOverride", [{ "name": "posture", "type": "object", "optional": false, "description": "", "typeRef": "Emulation.DevicePosture" }], [], "Start reporting the given posture value to the Device Posture API. This override can also be set in setDeviceMetricsOverride().");
101438
102785
  inspectorBackend.registerCommand("Emulation.clearDevicePostureOverride", [], [], "Clears a device posture override set with either setDeviceMetricsOverride() or setDevicePostureOverride() and starts using posture information from the platform again. Does nothing if no override is set.");
101439
102786
  inspectorBackend.registerCommand("Emulation.setDisplayFeaturesOverride", [{ "name": "features", "type": "array", "optional": false, "description": "", "typeRef": "Emulation.DisplayFeature" }], [], "Start using the given display features to pupulate the Viewport Segments API. This override can also be set in setDeviceMetricsOverride().");
@@ -101472,6 +102819,7 @@ function registerCommands(inspectorBackend) {
101472
102819
  inspectorBackend.registerCommand("Emulation.getScreenInfos", [], ["screenInfos"], "Returns device's screen configuration. In headful mode, the physical screens configuration is returned, whereas in headless mode, a virtual headless screen configuration is provided instead.");
101473
102820
  inspectorBackend.registerCommand("Emulation.addScreen", [{ "name": "left", "type": "number", "optional": false, "description": "Offset of the left edge of the screen in pixels.", "typeRef": null }, { "name": "top", "type": "number", "optional": false, "description": "Offset of the top edge of the screen in pixels.", "typeRef": null }, { "name": "width", "type": "number", "optional": false, "description": "The width of the screen in pixels.", "typeRef": null }, { "name": "height", "type": "number", "optional": false, "description": "The height of the screen in pixels.", "typeRef": null }, { "name": "workAreaInsets", "type": "object", "optional": true, "description": "Specifies the screen's work area. Default is entire screen.", "typeRef": "Emulation.WorkAreaInsets" }, { "name": "devicePixelRatio", "type": "number", "optional": true, "description": "Specifies the screen's device pixel ratio. Default is 1.", "typeRef": null }, { "name": "rotation", "type": "number", "optional": true, "description": "Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0.", "typeRef": null }, { "name": "colorDepth", "type": "number", "optional": true, "description": "Specifies the screen's color depth in bits. Default is 24.", "typeRef": null }, { "name": "label", "type": "string", "optional": true, "description": "Specifies the descriptive label for the screen. Default is none.", "typeRef": null }, { "name": "isInternal", "type": "boolean", "optional": true, "description": "Indicates whether the screen is internal to the device or external, attached to the device. Default is false.", "typeRef": null }], ["screenInfo"], "Add a new screen to the device. Only supported in headless mode.");
101474
102821
  inspectorBackend.registerCommand("Emulation.removeScreen", [{ "name": "screenId", "type": "string", "optional": false, "description": "", "typeRef": "Emulation.ScreenId" }], [], "Remove screen from the device. Only supported in headless mode.");
102822
+ inspectorBackend.registerCommand("Emulation.setPrimaryScreen", [{ "name": "screenId", "type": "string", "optional": false, "description": "", "typeRef": "Emulation.ScreenId" }], [], "Set primary screen. Only supported in headless mode. Note that this changes the coordinate system origin to the top-left of the new primary screen, updating the bounds and work areas of all existing screens accordingly.");
101475
102823
  inspectorBackend.registerType("Emulation.SafeAreaInsets", [{ "name": "top", "type": "number", "optional": true, "description": "Overrides safe-area-inset-top.", "typeRef": null }, { "name": "topMax", "type": "number", "optional": true, "description": "Overrides safe-area-max-inset-top.", "typeRef": null }, { "name": "left", "type": "number", "optional": true, "description": "Overrides safe-area-inset-left.", "typeRef": null }, { "name": "leftMax", "type": "number", "optional": true, "description": "Overrides safe-area-max-inset-left.", "typeRef": null }, { "name": "bottom", "type": "number", "optional": true, "description": "Overrides safe-area-inset-bottom.", "typeRef": null }, { "name": "bottomMax", "type": "number", "optional": true, "description": "Overrides safe-area-max-inset-bottom.", "typeRef": null }, { "name": "right", "type": "number", "optional": true, "description": "Overrides safe-area-inset-right.", "typeRef": null }, { "name": "rightMax", "type": "number", "optional": true, "description": "Overrides safe-area-max-inset-right.", "typeRef": null }]);
101476
102824
  inspectorBackend.registerType("Emulation.ScreenOrientation", [{ "name": "type", "type": "string", "optional": false, "description": "Orientation type.", "typeRef": null }, { "name": "angle", "type": "number", "optional": false, "description": "Orientation angle.", "typeRef": null }]);
101477
102825
  inspectorBackend.registerType("Emulation.DisplayFeature", [{ "name": "orientation", "type": "string", "optional": false, "description": "Orientation of a display feature in relation to screen", "typeRef": null }, { "name": "offset", "type": "number", "optional": false, "description": "The offset from the screen origin in either the x (for vertical orientation) or y (for horizontal orientation) direction.", "typeRef": null }, { "name": "maskLength", "type": "number", "optional": false, "description": "A display feature may mask content such that it is not physically displayed - this length along with the offset describes this area. A display feature that only splits content will have a 0 mask_length.", "typeRef": null }]);
@@ -101493,11 +102841,13 @@ function registerCommands(inspectorBackend) {
101493
102841
  inspectorBackend.registerEnum("Extensions.StorageArea", { Session: "session", Local: "local", Sync: "sync", Managed: "managed" });
101494
102842
  inspectorBackend.registerCommand("Extensions.triggerAction", [{ "name": "id", "type": "string", "optional": false, "description": "Extension id.", "typeRef": null }, { "name": "targetId", "type": "string", "optional": false, "description": "A tab target ID to trigger the default extension action on.", "typeRef": null }], [], "Runs an extension default action. Available if the client is connected using the --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging flag is set.");
101495
102843
  inspectorBackend.registerCommand("Extensions.loadUnpacked", [{ "name": "path", "type": "string", "optional": false, "description": "Absolute file path.", "typeRef": null }, { "name": "enableInIncognito", "type": "boolean", "optional": true, "description": "Enable the extension in incognito", "typeRef": null }], ["id"], "Installs an unpacked extension from the filesystem similar to --load-extension CLI flags. Returns extension ID once the extension has been installed. Available if the client is connected using the --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging flag is set.");
102844
+ inspectorBackend.registerCommand("Extensions.getExtensions", [], ["extensions"], "Gets a list of all unpacked extensions. Available if the client is connected using the --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging flag is set.");
101496
102845
  inspectorBackend.registerCommand("Extensions.uninstall", [{ "name": "id", "type": "string", "optional": false, "description": "Extension id.", "typeRef": null }], [], "Uninstalls an unpacked extension (others not supported) from the profile. Available if the client is connected using the --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging.");
101497
102846
  inspectorBackend.registerCommand("Extensions.getStorageItems", [{ "name": "id", "type": "string", "optional": false, "description": "ID of extension.", "typeRef": null }, { "name": "storageArea", "type": "string", "optional": false, "description": "StorageArea to retrieve data from.", "typeRef": "Extensions.StorageArea" }, { "name": "keys", "type": "array", "optional": true, "description": "Keys to retrieve.", "typeRef": "string" }], ["data"], "Gets data from extension storage in the given `storageArea`. If `keys` is specified, these are used to filter the result.");
101498
102847
  inspectorBackend.registerCommand("Extensions.removeStorageItems", [{ "name": "id", "type": "string", "optional": false, "description": "ID of extension.", "typeRef": null }, { "name": "storageArea", "type": "string", "optional": false, "description": "StorageArea to remove data from.", "typeRef": "Extensions.StorageArea" }, { "name": "keys", "type": "array", "optional": false, "description": "Keys to remove.", "typeRef": "string" }], [], "Removes `keys` from extension storage in the given `storageArea`.");
101499
102848
  inspectorBackend.registerCommand("Extensions.clearStorageItems", [{ "name": "id", "type": "string", "optional": false, "description": "ID of extension.", "typeRef": null }, { "name": "storageArea", "type": "string", "optional": false, "description": "StorageArea to remove data from.", "typeRef": "Extensions.StorageArea" }], [], "Clears extension storage in the given `storageArea`.");
101500
102849
  inspectorBackend.registerCommand("Extensions.setStorageItems", [{ "name": "id", "type": "string", "optional": false, "description": "ID of extension.", "typeRef": null }, { "name": "storageArea", "type": "string", "optional": false, "description": "StorageArea to set data in.", "typeRef": "Extensions.StorageArea" }, { "name": "values", "type": "object", "optional": false, "description": "Values to set.", "typeRef": null }], [], "Sets `values` in extension storage in the given `storageArea`. The provided `values` will be merged with existing values in the storage area.");
102850
+ inspectorBackend.registerType("Extensions.ExtensionInfo", [{ "name": "id", "type": "string", "optional": false, "description": "Extension id.", "typeRef": null }, { "name": "name", "type": "string", "optional": false, "description": "Extension name.", "typeRef": null }, { "name": "version", "type": "string", "optional": false, "description": "Extension version.", "typeRef": null }, { "name": "path", "type": "string", "optional": false, "description": "The path from which the extension was loaded.", "typeRef": null }, { "name": "enabled", "type": "boolean", "optional": false, "description": "Extension enabled status.", "typeRef": null }]);
101501
102851
  inspectorBackend.registerEnum("FedCm.LoginState", { SignIn: "SignIn", SignUp: "SignUp" });
101502
102852
  inspectorBackend.registerEnum("FedCm.DialogType", { AccountChooser: "AccountChooser", AutoReauthn: "AutoReauthn", ConfirmIdpLogin: "ConfirmIdpLogin", Error: "Error" });
101503
102853
  inspectorBackend.registerEnum("FedCm.DialogButton", { ConfirmIdpLoginContinue: "ConfirmIdpLoginContinue", ErrorGotIt: "ErrorGotIt", ErrorMoreDetails: "ErrorMoreDetails" });
@@ -101820,8 +103170,9 @@ function registerCommands(inspectorBackend) {
101820
103170
  inspectorBackend.registerType("Network.DeviceBoundSessionUrlRule", [{ "name": "ruleType", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`.", "typeRef": null }, { "name": "hostPattern", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern`.", "typeRef": null }, { "name": "pathPrefix", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix`.", "typeRef": null }]);
101821
103171
  inspectorBackend.registerType("Network.DeviceBoundSessionInclusionRules", [{ "name": "origin", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::origin_`.", "typeRef": null }, { "name": "includeSite", "type": "boolean", "optional": false, "description": "Whether the whole site is included. See comments on `net::device_bound_sessions::SessionInclusionRules::include_site_` for more details; this boolean is true if that value is populated.", "typeRef": null }, { "name": "urlRules", "type": "array", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::url_rules_`.", "typeRef": "Network.DeviceBoundSessionUrlRule" }]);
101822
103172
  inspectorBackend.registerType("Network.DeviceBoundSession", [{ "name": "key", "type": "object", "optional": false, "description": "The site and session ID of the session.", "typeRef": "Network.DeviceBoundSessionKey" }, { "name": "refreshUrl", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::refresh_url_`.", "typeRef": null }, { "name": "inclusionRules", "type": "object", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::inclusion_rules_`.", "typeRef": "Network.DeviceBoundSessionInclusionRules" }, { "name": "cookieCravings", "type": "array", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::cookie_cravings_`.", "typeRef": "Network.DeviceBoundSessionCookieCraving" }, { "name": "expiryDate", "type": "number", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::expiry_date_`.", "typeRef": "Network.TimeSinceEpoch" }, { "name": "cachedChallenge", "type": "string", "optional": true, "description": "See comments on `net::device_bound_sessions::Session::cached_challenge__`.", "typeRef": null }, { "name": "allowedRefreshInitiators", "type": "array", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::allowed_refresh_initiators_`.", "typeRef": "string" }]);
101823
- inspectorBackend.registerType("Network.CreationEventDetails", [{ "name": "fetchResult", "type": "string", "optional": false, "description": "The result of the fetch attempt.", "typeRef": "Network.DeviceBoundSessionFetchResult" }, { "name": "newSession", "type": "object", "optional": true, "description": "The session if there was a newly created session. This is populated for all successful creation events.", "typeRef": "Network.DeviceBoundSession" }]);
101824
- inspectorBackend.registerType("Network.RefreshEventDetails", [{ "name": "refreshResult", "type": "string", "optional": false, "description": "The result of a refresh.", "typeRef": null }, { "name": "fetchResult", "type": "string", "optional": true, "description": "If there was a fetch attempt, the result of that.", "typeRef": "Network.DeviceBoundSessionFetchResult" }, { "name": "newSession", "type": "object", "optional": true, "description": "The session display if there was a newly created session. This is populated for any refresh event that modifies the session config.", "typeRef": "Network.DeviceBoundSession" }, { "name": "wasFullyProactiveRefresh", "type": "boolean", "optional": false, "description": "See comments on `net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh`.", "typeRef": null }]);
103173
+ inspectorBackend.registerType("Network.DeviceBoundSessionFailedRequest", [{ "name": "requestUrl", "type": "string", "optional": false, "description": "The failed request URL.", "typeRef": null }, { "name": "netError", "type": "string", "optional": true, "description": "The net error of the response if it was not OK.", "typeRef": null }, { "name": "responseError", "type": "number", "optional": true, "description": "The response code if the net error was OK and the response code was not 200.", "typeRef": null }, { "name": "responseErrorBody", "type": "string", "optional": true, "description": "The body of the response if the net error was OK, the response code was not 200, and the response body was not empty.", "typeRef": null }]);
103174
+ inspectorBackend.registerType("Network.CreationEventDetails", [{ "name": "fetchResult", "type": "string", "optional": false, "description": "The result of the fetch attempt.", "typeRef": "Network.DeviceBoundSessionFetchResult" }, { "name": "newSession", "type": "object", "optional": true, "description": "The session if there was a newly created session. This is populated for all successful creation events.", "typeRef": "Network.DeviceBoundSession" }, { "name": "failedRequest", "type": "object", "optional": true, "description": "Details about a failed device bound session network request if there was one.", "typeRef": "Network.DeviceBoundSessionFailedRequest" }]);
103175
+ inspectorBackend.registerType("Network.RefreshEventDetails", [{ "name": "refreshResult", "type": "string", "optional": false, "description": "The result of a refresh.", "typeRef": null }, { "name": "fetchResult", "type": "string", "optional": true, "description": "If there was a fetch attempt, the result of that.", "typeRef": "Network.DeviceBoundSessionFetchResult" }, { "name": "newSession", "type": "object", "optional": true, "description": "The session display if there was a newly created session. This is populated for any refresh event that modifies the session config.", "typeRef": "Network.DeviceBoundSession" }, { "name": "wasFullyProactiveRefresh", "type": "boolean", "optional": false, "description": "See comments on `net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh`.", "typeRef": null }, { "name": "failedRequest", "type": "object", "optional": true, "description": "Details about a failed device bound session network request if there was one.", "typeRef": "Network.DeviceBoundSessionFailedRequest" }]);
101825
103176
  inspectorBackend.registerType("Network.TerminationEventDetails", [{ "name": "deletionReason", "type": "string", "optional": false, "description": "The reason for a session being deleted.", "typeRef": null }]);
101826
103177
  inspectorBackend.registerType("Network.ChallengeEventDetails", [{ "name": "challengeResult", "type": "string", "optional": false, "description": "The result of a challenge.", "typeRef": null }, { "name": "challenge", "type": "string", "optional": false, "description": "The challenge set.", "typeRef": null }]);
101827
103178
  inspectorBackend.registerType("Network.LoadNetworkResourcePageResult", [{ "name": "success", "type": "boolean", "optional": false, "description": "", "typeRef": null }, { "name": "netError", "type": "number", "optional": true, "description": "Optional values used for error reporting.", "typeRef": null }, { "name": "netErrorName", "type": "string", "optional": true, "description": "", "typeRef": null }, { "name": "httpStatusCode", "type": "number", "optional": true, "description": "", "typeRef": null }, { "name": "stream", "type": "string", "optional": true, "description": "If successful, one of the following two fields holds the result.", "typeRef": "IO.StreamHandle" }, { "name": "headers", "type": "object", "optional": true, "description": "Response headers.", "typeRef": "Network.Headers" }]);
@@ -102857,6 +104208,9 @@ class TargetBase {
102857
104208
  registerDOMStorageDispatcher(dispatcher) {
102858
104209
  this.registerDispatcher('DOMStorage', dispatcher);
102859
104210
  }
104211
+ registerEmulationDispatcher(dispatcher) {
104212
+ this.registerDispatcher('Emulation', dispatcher);
104213
+ }
102860
104214
  registerFetchDispatcher(dispatcher) {
102861
104215
  this.registerDispatcher('Fetch', dispatcher);
102862
104216
  }
@@ -105375,7 +106729,9 @@ var DevtoolsExperiments;
105375
106729
  DevtoolsExperiments[DevtoolsExperiments["use-source-map-scopes"] = 76] = "use-source-map-scopes";
105376
106730
  DevtoolsExperiments[DevtoolsExperiments["timeline-show-postmessage-events"] = 86] = "timeline-show-postmessage-events";
105377
106731
  DevtoolsExperiments[DevtoolsExperiments["timeline-debug-mode"] = 93] = "timeline-debug-mode";
105378
- DevtoolsExperiments[DevtoolsExperiments["MAX_VALUE"] = 110] = "MAX_VALUE";
106732
+ DevtoolsExperiments[DevtoolsExperiments["durable-messages"] = 110] = "durable-messages";
106733
+ DevtoolsExperiments[DevtoolsExperiments["jpeg-xl"] = 111] = "jpeg-xl";
106734
+ DevtoolsExperiments[DevtoolsExperiments["MAX_VALUE"] = 112] = "MAX_VALUE";
105379
106735
  })(DevtoolsExperiments || (DevtoolsExperiments = {}));
105380
106736
  var IssueExpanded;
105381
106737
  (function (IssueExpanded) {
@@ -107400,6 +108756,20 @@ const generatedProperties = [
107400
108756
  ],
107401
108757
  "name": "column-rule-inset"
107402
108758
  },
108759
+ {
108760
+ "longhands": [
108761
+ "column-rule-edge-inset-end",
108762
+ "column-rule-interior-inset-end"
108763
+ ],
108764
+ "name": "column-rule-inset-end"
108765
+ },
108766
+ {
108767
+ "longhands": [
108768
+ "column-rule-edge-inset-start",
108769
+ "column-rule-interior-inset-start"
108770
+ ],
108771
+ "name": "column-rule-inset-start"
108772
+ },
107403
108773
  {
107404
108774
  "longhands": [
107405
108775
  "column-rule-interior-inset-start",
@@ -109447,6 +110817,20 @@ const generatedProperties = [
109447
110817
  ],
109448
110818
  "name": "row-rule-inset"
109449
110819
  },
110820
+ {
110821
+ "longhands": [
110822
+ "row-rule-edge-inset-end",
110823
+ "row-rule-interior-inset-end"
110824
+ ],
110825
+ "name": "row-rule-inset-end"
110826
+ },
110827
+ {
110828
+ "longhands": [
110829
+ "row-rule-edge-inset-start",
110830
+ "row-rule-interior-inset-start"
110831
+ ],
110832
+ "name": "row-rule-inset-start"
110833
+ },
109450
110834
  {
109451
110835
  "longhands": [
109452
110836
  "row-rule-interior-inset-start",
@@ -109568,6 +110952,24 @@ const generatedProperties = [
109568
110952
  ],
109569
110953
  "name": "rule-inset"
109570
110954
  },
110955
+ {
110956
+ "longhands": [
110957
+ "column-rule-edge-inset-end",
110958
+ "column-rule-interior-inset-end",
110959
+ "row-rule-edge-inset-end",
110960
+ "row-rule-interior-inset-end"
110961
+ ],
110962
+ "name": "rule-inset-end"
110963
+ },
110964
+ {
110965
+ "longhands": [
110966
+ "column-rule-edge-inset-start",
110967
+ "column-rule-interior-inset-start",
110968
+ "row-rule-edge-inset-start",
110969
+ "row-rule-interior-inset-start"
110970
+ ],
110971
+ "name": "rule-inset-start"
110972
+ },
109571
110973
  {
109572
110974
  "longhands": [
109573
110975
  "row-rule-interior-inset-start",
@@ -114586,6 +115988,23 @@ const extraPropertyValues = new Map([
114586
115988
  ['-webkit-transform-origin-x', new Set(['left', 'right', 'center'])],
114587
115989
  ['-webkit-transform-origin-y', new Set(['top', 'bottom', 'center'])],
114588
115990
  ['width', new Set(['-webkit-fill-available', 'stretch'])],
115991
+ [
115992
+ 'animation-trigger',
115993
+ new Set([
115994
+ 'play',
115995
+ 'pause',
115996
+ 'play-once',
115997
+ 'play-alternate',
115998
+ 'play-forwards',
115999
+ 'play-backwards',
116000
+ 'play-pause',
116001
+ 'replay',
116002
+ ]),
116003
+ ],
116004
+ ['timeline-trigger-activation-range-start', new Set(['normal'])],
116005
+ ['timeline-trigger-activation-range-end', new Set(['normal'])],
116006
+ ['timeline-trigger-active-range-start', new Set(['normal'])],
116007
+ ['timeline-trigger-active-range-end', new Set(['normal'])],
114589
116008
  ['contain-intrinsic-width', new Set(['auto none', 'auto 100px'])],
114590
116009
  ['contain-intrinsic-height', new Set(['auto none', 'auto 100px'])],
114591
116010
  ['contain-intrinsic-size', new Set(['auto none', 'auto 100px'])],
@@ -116826,6 +118245,32 @@ class CSSProperty extends ObjectWrapper {
116826
118245
  getLonghandProperties() {
116827
118246
  return this.#longhandProperties;
116828
118247
  }
118248
+ ignoreErrors() {
118249
+ function hasUnknownVendorPrefix(string) {
118250
+ return !string.startsWith('-webkit-') && /^[-_][\w\d]+-\w/.test(string);
118251
+ }
118252
+ const name = this.name.toLowerCase();
118253
+ if (name.charAt(0) === '_') {
118254
+ return true;
118255
+ }
118256
+ if (name === 'filter') {
118257
+ return true;
118258
+ }
118259
+ if (name.startsWith('scrollbar-')) {
118260
+ return true;
118261
+ }
118262
+ if (hasUnknownVendorPrefix(name)) {
118263
+ return true;
118264
+ }
118265
+ const value = this.value.toLowerCase();
118266
+ if (value.endsWith('\\9')) {
118267
+ return true;
118268
+ }
118269
+ if (hasUnknownVendorPrefix(value)) {
118270
+ return true;
118271
+ }
118272
+ return false;
118273
+ }
116829
118274
  }
116830
118275
 
116831
118276
  // Copyright 2021 The Chromium Authors
@@ -117504,7 +118949,7 @@ class CSSStyleRule extends CSSRule {
117504
118949
  const dummyPayload = {
117505
118950
  selectorList: {
117506
118951
  text: '',
117507
- selectors: [{ text: selectorText, value: undefined }],
118952
+ selectors: [{ text: selectorText }],
117508
118953
  },
117509
118954
  style: {
117510
118955
  styleSheetId: '0',
@@ -117588,7 +119033,6 @@ class CSSPropertyRule extends CSSRule {
117588
119033
  origin: payload.origin,
117589
119034
  style: payload.style,
117590
119035
  header: styleSheetHeaderForRule(cssModel, payload),
117591
- originTreeScopeNodeId: undefined,
117592
119036
  });
117593
119037
  this.#name = new CSSValue(payload.propertyName);
117594
119038
  }
@@ -117625,7 +119069,6 @@ class CSSAtRule extends CSSRule {
117625
119069
  origin: payload.origin,
117626
119070
  style: payload.style,
117627
119071
  header: styleSheetHeaderForRule(cssModel, payload),
117628
- originTreeScopeNodeId: undefined
117629
119072
  });
117630
119073
  this.#name = payload.name ? new CSSValue(payload.name) : null;
117631
119074
  this.#type = payload.type;
@@ -117664,7 +119107,6 @@ class CSSKeyframeRule extends CSSRule {
117664
119107
  origin: payload.origin,
117665
119108
  style: payload.style,
117666
119109
  header: styleSheetHeaderForRule(cssModel, payload),
117667
- originTreeScopeNodeId: undefined
117668
119110
  });
117669
119111
  this.reinitializeKey(payload.keyText);
117670
119112
  this.#parentRuleName = parentRuleName;
@@ -117713,7 +119155,6 @@ class CSSPositionTryRule extends CSSRule {
117713
119155
  origin: payload.origin,
117714
119156
  style: payload.style,
117715
119157
  header: styleSheetHeaderForRule(cssModel, payload),
117716
- originTreeScopeNodeId: undefined
117717
119158
  });
117718
119159
  this.#name = new CSSValue(payload.name);
117719
119160
  this.#active = payload.active;
@@ -117734,7 +119175,6 @@ class CSSFunctionRule extends CSSRule {
117734
119175
  origin: payload.origin,
117735
119176
  style: { cssProperties: [], shorthandEntries: [] },
117736
119177
  header: styleSheetHeaderForRule(cssModel, payload),
117737
- originTreeScopeNodeId: undefined
117738
119178
  });
117739
119179
  this.#name = new CSSValue(payload.name);
117740
119180
  this.#parameters = payload.parameters.map(({ name }) => name);
@@ -119663,7 +121103,6 @@ class CookieModel extends SDKModel {
119663
121103
  this.#cookieToBlockedReasons.clear();
119664
121104
  await Promise.all(cookies.map(cookie => networkAgent.invoke_deleteCookies({
119665
121105
  name: cookie.name(),
119666
- url: undefined,
119667
121106
  domain: cookie.domain(),
119668
121107
  path: cookie.path(),
119669
121108
  partitionKey: cookie.partitionKey(),
@@ -121439,6 +122878,9 @@ class NetworkRequest extends ObjectWrapper {
121439
122878
  requestContentType() {
121440
122879
  return this.requestHeaderValue('Content-Type');
121441
122880
  }
122881
+ requestContentEncoding() {
122882
+ return this.requestHeaderValue('Content-Encoding');
122883
+ }
121442
122884
  hasErrorStatusCode() {
121443
122885
  return this.statusCode >= 400;
121444
122886
  }
@@ -122345,13 +123787,44 @@ class NetworkManager extends SDKModel {
122345
123787
  return null;
122346
123788
  }
122347
123789
  try {
122348
- const { postData } = await manager.#networkAgent.invoke_getRequestPostData({ requestId });
123790
+ const { postData, base64Encoded } = await manager.#networkAgent.invoke_getRequestPostData({ requestId });
123791
+ if (base64Encoded && postData) {
123792
+ const binaryString = window.atob(postData);
123793
+ const bytes = new Uint8Array(binaryString.length);
123794
+ for (let i = 0; i < binaryString.length; i++) {
123795
+ bytes[i] = binaryString.charCodeAt(i);
123796
+ }
123797
+ const requestContentType = request.requestContentType();
123798
+ const charset = requestContentType ? parseContentType(requestContentType).charset ?? 'utf-8' : 'utf-8';
123799
+ const contentEncoding = request.requestContentEncoding()?.toLowerCase();
123800
+ if (contentEncoding) {
123801
+ const decompressed = await NetworkManager.#tryDecompressBody(bytes.buffer, contentEncoding, charset);
123802
+ if (decompressed !== null) {
123803
+ return decompressed;
123804
+ }
123805
+ }
123806
+ return new TextDecoder(charset).decode(bytes);
123807
+ }
122349
123808
  return postData;
122350
123809
  }
122351
123810
  catch (e) {
122352
123811
  return e.message;
122353
123812
  }
122354
123813
  }
123814
+ static async #tryDecompressBody(buffer, encoding, charset) {
123815
+ try {
123816
+ if (encoding.includes('gzip') && isGzip(buffer)) {
123817
+ return await decompress(buffer, charset);
123818
+ }
123819
+ if (encoding.includes('deflate')) {
123820
+ return await decompressDeflate(buffer, charset);
123821
+ }
123822
+ }
123823
+ catch (e) {
123824
+ console.warn('Failed to decompress request body:', e);
123825
+ }
123826
+ return null;
123827
+ }
122355
123828
  static connectionType(conditions) {
122356
123829
  if (!conditions.download && !conditions.upload) {
122357
123830
  return "none" ;
@@ -122536,7 +124009,8 @@ class NetworkDispatcher {
122536
124009
  updateNetworkRequestWithRequest(networkRequest, request) {
122537
124010
  networkRequest.requestMethod = request.method;
122538
124011
  networkRequest.setRequestHeaders(this.headersMapToHeadersArray(request.headers));
122539
- networkRequest.setRequestFormData(Boolean(request.hasPostData), request.postData || null);
124012
+ const isCompressed = Boolean(networkRequest.requestContentEncoding());
124013
+ networkRequest.setRequestFormData(Boolean(request.hasPostData), isCompressed ? null : (request.postData || null));
122540
124014
  networkRequest.setInitialPriority(request.initialPriority);
122541
124015
  networkRequest.mixedContentType = request.mixedContentType || "none" ;
122542
124016
  networkRequest.setReferrerPolicy(request.referrerPolicy);
@@ -124213,7 +125687,13 @@ class PageResourceLoader extends ObjectWrapper {
124213
125687
  throw new Error('Invalid initiator');
124214
125688
  }
124215
125689
  const key = PageResourceLoader.makeKey(url, initiator);
124216
- const pageResource = { success: null, size: null, duration: null, errorMessage: undefined, url, initiator };
125690
+ const pageResource = {
125691
+ success: null,
125692
+ size: null,
125693
+ duration: null,
125694
+ url,
125695
+ initiator,
125696
+ };
124217
125697
  this.#pageResources.set(key, pageResource);
124218
125698
  this.dispatchEventToListeners("Update" );
124219
125699
  const startTime = performance.now();
@@ -124269,7 +125749,10 @@ class PageResourceLoader extends ObjectWrapper {
124269
125749
  return {
124270
125750
  success: false,
124271
125751
  content: '',
124272
- errorDescription: { statusCode: 0, netError: undefined, netErrorName: undefined, message: e.message, urlValid: undefined }
125752
+ errorDescription: {
125753
+ statusCode: 0,
125754
+ message: e.message,
125755
+ }
124273
125756
  };
124274
125757
  }
124275
125758
  }
@@ -124327,7 +125810,6 @@ class PageResourceLoader extends ObjectWrapper {
124327
125810
  netErrorName: resource.netErrorName,
124328
125811
  message: netErrorToMessage(resource.netError, resource.httpStatusCode, resource.netErrorName) ||
124329
125812
  '',
124330
- urlValid: undefined,
124331
125813
  },
124332
125814
  };
124333
125815
  }
@@ -125070,6 +126552,9 @@ var formatter = /*#__PURE__*/Object.freeze({
125070
126552
  // Copyright 2023 The Chromium Authors
125071
126553
  const scopeTrees = new WeakMap();
125072
126554
  function scopeTreeForScript(script) {
126555
+ if (script.isWasm()) {
126556
+ return Promise.resolve(null);
126557
+ }
125073
126558
  let promise = scopeTrees.get(script);
125074
126559
  if (promise === undefined) {
125075
126560
  promise = script.requestContentData().then(content => {
@@ -125811,7 +127296,6 @@ class SourceMap {
125811
127296
  sourceURL: this.sourceURLs()[callsite.sourceIndex],
125812
127297
  sourceLineNumber: callsite.line,
125813
127298
  sourceColumnNumber: callsite.column,
125814
- name: undefined,
125815
127299
  };
125816
127300
  }
125817
127301
  const mappings = this.mappings();
@@ -126390,7 +127874,6 @@ class SourceMapManager extends ObjectWrapper {
126390
127874
  let clientData = {
126391
127875
  relativeSourceURL,
126392
127876
  relativeSourceMapURL,
126393
- sourceMap: undefined,
126394
127877
  sourceMapPromise: Promise.resolve(undefined),
126395
127878
  };
126396
127879
  if (this.#isEnabled) {
@@ -129031,7 +130514,8 @@ class RuntimeModel extends SDKModel {
129031
130514
  }
129032
130515
  }
129033
130516
  if (object.isNode()) {
129034
- void reveal(object).then(object.release.bind(object));
130517
+ const omitFocus = hints !== null && typeof hints === 'object' && 'omitFocus' in hints && Boolean(hints.omitFocus);
130518
+ void reveal(object, omitFocus).then(object.release.bind(object));
129035
130519
  return;
129036
130520
  }
129037
130521
  if (object.type === 'function') {
@@ -129365,6 +130849,7 @@ var DOMNodeEvents;
129365
130849
  (function (DOMNodeEvents) {
129366
130850
  DOMNodeEvents["TOP_LAYER_INDEX_CHANGED"] = "TopLayerIndexChanged";
129367
130851
  DOMNodeEvents["SCROLLABLE_FLAG_UPDATED"] = "ScrollableFlagUpdated";
130852
+ DOMNodeEvents["AD_RELATED_STATE_UPDATED"] = "AdRelatedStateUpdated";
129368
130853
  DOMNodeEvents["GRID_OVERLAY_STATE_CHANGED"] = "GridOverlayStateChanged";
129369
130854
  DOMNodeEvents["FLEX_CONTAINER_OVERLAY_STATE_CHANGED"] = "FlexContainerOverlayStateChanged";
129370
130855
  DOMNodeEvents["SCROLL_SNAP_OVERLAY_STATE_CHANGED"] = "ScrollSnapOverlayStateChanged";
@@ -129419,6 +130904,7 @@ class DOMNode extends ObjectWrapper {
129419
130904
  #retainedNodes;
129420
130905
  #adoptedStyleSheets = [];
129421
130906
  #topLayerIndex = -1;
130907
+ #isAdRelatedInternal = false;
129422
130908
  constructor(domModel) {
129423
130909
  super();
129424
130910
  this.#domModel = domModel;
@@ -129499,6 +130985,9 @@ class DOMNode extends ObjectWrapper {
129499
130985
  this.setChildrenPayload(payload.children);
129500
130986
  }
129501
130987
  this.setPseudoElements(payload.pseudoElements);
130988
+ if (payload.isAdRelated) {
130989
+ this.#isAdRelatedInternal = true;
130990
+ }
129502
130991
  if (this.#nodeType === Node.ELEMENT_NODE) {
129503
130992
  if (this.ownerDocument && !this.ownerDocument.documentElement && this.#nodeName === 'HTML') {
129504
130993
  this.ownerDocument.documentElement = this;
@@ -129532,7 +131021,7 @@ class DOMNode extends ObjectWrapper {
129532
131021
  topLayerIndex() {
129533
131022
  return this.#topLayerIndex;
129534
131023
  }
129535
- isAdFrameNode() {
131024
+ isAdRelatedNode() {
129536
131025
  if (this.isIframe() && this.#frameOwnerFrameId) {
129537
131026
  const frame = FrameManager.instance().getFrame(this.#frameOwnerFrameId);
129538
131027
  if (!frame) {
@@ -129540,7 +131029,7 @@ class DOMNode extends ObjectWrapper {
129540
131029
  }
129541
131030
  return frame.adFrameType() !== "none" ;
129542
131031
  }
129543
- return false;
131032
+ return this.#isAdRelatedInternal;
129544
131033
  }
129545
131034
  isRootNode() {
129546
131035
  if (this.nodeType() === Node.ELEMENT_NODE && this.nodeName() === 'HTML') {
@@ -129603,6 +131092,10 @@ class DOMNode extends ObjectWrapper {
129603
131092
  this.ownerDocument?.documentElement?.setIsScrollable(isScrollable);
129604
131093
  }
129605
131094
  }
131095
+ setIsAdRelated(isAdRelated) {
131096
+ this.#isAdRelatedInternal = isAdRelated;
131097
+ this.dispatchEventToListeners(DOMNodeEvents.AD_RELATED_STATE_UPDATED);
131098
+ }
129606
131099
  setAffectedByStartingStyles(affectedByStartingStyles) {
129607
131100
  this.#affectedByStartingStyles = affectedByStartingStyles;
129608
131101
  }
@@ -130148,13 +131641,17 @@ class DOMNode extends ObjectWrapper {
130148
131641
  return null;
130149
131642
  }
130150
131643
  highlight(mode) {
130151
- this.#domModel.overlayModel().highlightInOverlay({ node: this, selectorList: undefined }, mode);
131644
+ this.#domModel.overlayModel().highlightInOverlay({ node: this }, mode);
130152
131645
  }
130153
131646
  highlightForTwoSeconds() {
130154
- this.#domModel.overlayModel().highlightInOverlayForTwoSeconds({ node: this, selectorList: undefined });
131647
+ this.#domModel.overlayModel().highlightInOverlayForTwoSeconds({ node: this });
130155
131648
  }
130156
131649
  async resolveToObject(objectGroup, executionContextId) {
130157
- const { object } = await this.#agent.invoke_resolveNode({ nodeId: this.id, backendNodeId: undefined, executionContextId, objectGroup });
131650
+ const { object } = await this.#agent.invoke_resolveNode({
131651
+ nodeId: this.id,
131652
+ executionContextId,
131653
+ objectGroup,
131654
+ });
130158
131655
  return object && this.#domModel.runtimeModelInternal.createRemoteObject(object) || null;
130159
131656
  }
130160
131657
  async boxModel() {
@@ -130688,6 +132185,13 @@ class DOMModel extends SDKModel {
130688
132185
  }
130689
132186
  node.setIsScrollable(isScrollable);
130690
132187
  }
132188
+ adRelatedStateUpdated(nodeId, isAdRelated) {
132189
+ const node = this.nodeForId(nodeId);
132190
+ if (!node || node.isAdRelatedNode() === isAdRelated) {
132191
+ return;
132192
+ }
132193
+ node.setIsAdRelated(isAdRelated);
132194
+ }
130691
132195
  affectedByStartingStylesFlagUpdated(nodeId, affectedByStartingStyles) {
130692
132196
  const node = this.nodeForId(nodeId);
130693
132197
  if (!node || node.affectedByStartingStyles() === affectedByStartingStyles) {
@@ -130971,6 +132475,9 @@ class DOMDispatcher {
130971
132475
  affectedByStartingStylesFlagUpdated({ nodeId, affectedByStartingStyles }) {
130972
132476
  this.#domModel.affectedByStartingStylesFlagUpdated(nodeId, affectedByStartingStyles);
130973
132477
  }
132478
+ adRelatedStateUpdated({ nodeId, isAdRelated }) {
132479
+ this.#domModel.adRelatedStateUpdated(nodeId, isAdRelated);
132480
+ }
130974
132481
  }
130975
132482
  let domModelUndoStackInstance = null;
130976
132483
  class DOMModelUndoStack {
@@ -131766,9 +133273,7 @@ class ResourceTreeFrame {
131766
133273
  #childFrames = new Set();
131767
133274
  resourcesMap = new Map();
131768
133275
  backForwardCacheDetails = {
131769
- restoredFromCache: undefined,
131770
133276
  explanations: [],
131771
- explanationsTree: undefined,
131772
133277
  };
131773
133278
  constructor(model, parentFrame, frameId, payload, creationStackTrace) {
131774
133279
  this.#model = model;
@@ -131827,9 +133332,7 @@ class ResourceTreeFrame {
131827
133332
  this.#crossOriginIsolatedContextType = framePayload.crossOriginIsolatedContextType;
131828
133333
  this.#gatedAPIFeatures = framePayload.gatedAPIFeatures;
131829
133334
  this.backForwardCacheDetails = {
131830
- restoredFromCache: undefined,
131831
133335
  explanations: [],
131832
- explanationsTree: undefined,
131833
133336
  };
131834
133337
  const mainResource = this.resourcesMap.get(this.#url);
131835
133338
  this.resourcesMap.clear();
@@ -135552,10 +137055,14 @@ class EmulationModel extends SDKModel {
135552
137055
  #touchEmulationAllowed;
135553
137056
  #customTouchEnabled;
135554
137057
  #touchConfiguration;
137058
+ #screenOrientationLocked;
137059
+ #lockedOrientation;
135555
137060
  constructor(target) {
135556
137061
  super(target);
135557
137062
  this.#emulationAgent = target.emulationAgent();
135558
137063
  this.#deviceOrientationAgent = target.deviceOrientationAgent();
137064
+ this.#screenOrientationLocked = false;
137065
+ this.#lockedOrientation = null;
135559
137066
  this.#cssModel = target.model(CSSModel);
135560
137067
  this.#overlayModel = target.model(OverlayModel);
135561
137068
  if (this.#overlayModel) {
@@ -135678,20 +137185,25 @@ class EmulationModel extends SDKModel {
135678
137185
  this.setLocalFontsDisabled(localFontsDisabledSetting.get());
135679
137186
  }
135680
137187
  const avifFormatDisabledSetting = Settings.instance().moduleSetting('avif-format-disabled');
137188
+ const jpegXlFormatDisabledSetting = Settings.instance().moduleSetting('jpeg-xl-format-disabled');
135681
137189
  const webpFormatDisabledSetting = Settings.instance().moduleSetting('webp-format-disabled');
135682
137190
  const updateDisabledImageFormats = () => {
135683
137191
  const types = [];
135684
137192
  if (avifFormatDisabledSetting.get()) {
135685
137193
  types.push("avif" );
135686
137194
  }
137195
+ if (jpegXlFormatDisabledSetting.get()) {
137196
+ types.push("jxl" );
137197
+ }
135687
137198
  if (webpFormatDisabledSetting.get()) {
135688
137199
  types.push("webp" );
135689
137200
  }
135690
137201
  this.setDisabledImageTypes(types);
135691
137202
  };
135692
137203
  avifFormatDisabledSetting.addChangeListener(updateDisabledImageFormats);
137204
+ jpegXlFormatDisabledSetting.addChangeListener(updateDisabledImageFormats);
135693
137205
  webpFormatDisabledSetting.addChangeListener(updateDisabledImageFormats);
135694
- if (avifFormatDisabledSetting.get() || webpFormatDisabledSetting.get()) {
137206
+ if (avifFormatDisabledSetting.get() || jpegXlFormatDisabledSetting.get() || webpFormatDisabledSetting.get()) {
135695
137207
  updateDisabledImageFormats();
135696
137208
  }
135697
137209
  this.#cpuPressureEnabled = false;
@@ -135703,6 +137215,7 @@ class EmulationModel extends SDKModel {
135703
137215
  enabled: false,
135704
137216
  configuration: "mobile" ,
135705
137217
  };
137218
+ target.registerEmulationDispatcher(this);
135706
137219
  }
135707
137220
  setTouchEmulationAllowed(touchEmulationAllowed) {
135708
137221
  this.#touchEmulationAllowed = touchEmulationAllowed;
@@ -135917,6 +137430,19 @@ class EmulationModel extends SDKModel {
135917
137430
  ];
135918
137431
  return await this.emulateCSSMedia(type, features);
135919
137432
  }
137433
+ virtualTimeBudgetExpired() {
137434
+ }
137435
+ screenOrientationLockChanged(event) {
137436
+ this.#screenOrientationLocked = event.locked;
137437
+ this.#lockedOrientation = event.orientation ?? null;
137438
+ this.dispatchEventToListeners("ScreenOrientationLockChanged" , { locked: event.locked, orientation: event.orientation ?? null });
137439
+ }
137440
+ isScreenOrientationLocked() {
137441
+ return this.#screenOrientationLocked;
137442
+ }
137443
+ lockedOrientation() {
137444
+ return this.#lockedOrientation;
137445
+ }
135920
137446
  }
135921
137447
  SDKModel.register(EmulationModel, { capabilities: 256 , autostart: true });
135922
137448
 
@@ -136503,6 +138029,18 @@ class PreloadingModel extends SDKModel {
136503
138029
  TargetManager.instance().removeModelListener(ResourceTreeModel, Events$6.PrimaryPageChanged, this.onPrimaryPageChanged, this);
136504
138030
  void this.agent.invoke_disable();
136505
138031
  }
138032
+ reset() {
138033
+ this.documents.clear();
138034
+ this.loaderIds = [];
138035
+ this.targetJustAttached = true;
138036
+ this.dispatchEventToListeners("ModelUpdated" );
138037
+ }
138038
+ maybeInferLoaderId(loaderId) {
138039
+ if (this.currentLoaderId() === null) {
138040
+ this.loaderIds = [loaderId];
138041
+ this.targetJustAttached = false;
138042
+ }
138043
+ }
136506
138044
  ensureDocumentPreloadingData(loaderId) {
136507
138045
  if (this.documents.get(loaderId) === undefined) {
136508
138046
  this.documents.set(loaderId, new DocumentPreloadingData());
@@ -136615,10 +138153,7 @@ class PreloadingModel extends SDKModel {
136615
138153
  onRuleSetUpdated(event) {
136616
138154
  const ruleSet = event.ruleSet;
136617
138155
  const loaderId = ruleSet.loaderId;
136618
- if (this.currentLoaderId() === null) {
136619
- this.loaderIds = [loaderId];
136620
- this.targetJustAttached = false;
136621
- }
138156
+ this.maybeInferLoaderId(loaderId);
136622
138157
  this.ensureDocumentPreloadingData(loaderId);
136623
138158
  this.documents.get(loaderId)?.ruleSets.upsert(ruleSet);
136624
138159
  this.dispatchEventToListeners("ModelUpdated" );
@@ -141283,9 +142818,9 @@ class DebuggerLanguagePluginManager {
141283
142818
  try {
141284
142819
  const object = await plugin.evaluate(expression, location, this.stopIdForCallFrame(callFrame));
141285
142820
  if (object) {
141286
- return { object: await wrapRemoteObject(callFrame, object, plugin), exceptionDetails: undefined };
142821
+ return { object: await wrapRemoteObject(callFrame, object, plugin) };
141287
142822
  }
141288
- return { object: new LocalJSONObject(undefined), exceptionDetails: undefined };
142823
+ return { object: new LocalJSONObject(undefined) };
141289
142824
  }
141290
142825
  catch (error) {
141291
142826
  if (error instanceof FormattingError) {
@@ -141530,14 +143065,12 @@ class DebuggerLanguagePluginManager {
141530
143065
  if (uiLocation) {
141531
143066
  return {
141532
143067
  uiSourceCode: uiLocation.uiSourceCode,
141533
- url: undefined,
141534
143068
  name,
141535
143069
  line: uiLocation.lineNumber,
141536
143070
  column: uiLocation.columnNumber ?? -1,
141537
143071
  };
141538
143072
  }
141539
143073
  return {
141540
- uiSourceCode: undefined,
141541
143074
  url: fallback.url,
141542
143075
  name: fallback.functionName,
141543
143076
  line: fallback.lineNumber,
@@ -145481,10 +147014,7 @@ function makeZeroBasedCallFrame(callFrame) {
145481
147014
  }
145482
147015
  function getRawLineAndColumnNumbersForEvent(event) {
145483
147016
  if (!event.args?.data) {
145484
- return {
145485
- lineNumber: undefined,
145486
- columnNumber: undefined,
145487
- };
147017
+ return {};
145488
147018
  }
145489
147019
  let lineNumber = undefined;
145490
147020
  let columnNumber = undefined;
@@ -156461,13 +157991,13 @@ var NetworkDependencyTree = /*#__PURE__*/Object.freeze({
156461
157991
 
156462
157992
  // Copyright 2024 The Chromium Authors
156463
157993
  const UIStrings$w = {
156464
- title: 'Render blocking requests',
157994
+ title: 'Render-blocking requests',
156465
157995
  description: 'Requests are blocking the page\'s initial render, which may delay LCP. ' +
156466
157996
  '[Deferring or inlining](https://developer.chrome.com/docs/performance/insights/render-blocking) ' +
156467
157997
  'can move these network requests out of the critical path.',
156468
157998
  renderBlockingRequest: 'Request',
156469
157999
  duration: 'Duration',
156470
- noRenderBlocking: 'No render blocking requests for this navigation',
158000
+ noRenderBlocking: 'No render-blocking requests for this navigation',
156471
158001
  };
156472
158002
  const str_$v = registerUIStrings('models/trace/insights/RenderBlocking.ts', UIStrings$w);
156473
158003
  const i18nString$h = getLocalizedString.bind(undefined, str_$v);
@@ -159586,11 +161116,7 @@ function createLanternRequest(parsedTrace, workerThreads, request) {
159586
161116
  priority: request.args.data.priority,
159587
161117
  frameId: request.args.data.frame,
159588
161118
  fromWorker,
159589
- serverResponseTime: request.args.data.lrServerResponseTime ?? undefined,
159590
- redirects: undefined,
159591
- redirectSource: undefined,
159592
- redirectDestination: undefined,
159593
- initiatorRequest: undefined,
161119
+ serverResponseTime: request.args.data.lrServerResponseTime,
159594
161120
  };
159595
161121
  }
159596
161122
  function chooseInitiatorRequest(request, requestsByURL) {
@@ -160867,7 +162393,8 @@ class Prototypes {
160867
162393
  const settings = Settings.instance();
160868
162394
  const aiAnnotations = settings.createSetting('greendev-ai-annotations-enabled', false, "Local" );
160869
162395
  const copyToGemini = settings.createSetting('greendev-copy-to-gemini-enabled', false, "Local" );
160870
- return { aiAnnotations, copyToGemini };
162396
+ const breakpointDebuggerAgent = settings.createSetting('greendev-breakpoint-debugger-agent-enabled', false, "Local" );
162397
+ return { aiAnnotations, copyToGemini, breakpointDebuggerAgent };
160871
162398
  }
160872
162399
  }
160873
162400
 
@@ -162306,6 +163833,7 @@ class DeviceModeModel extends ObjectWrapper {
162306
163833
  #emulationModel;
162307
163834
  #onModelAvailable;
162308
163835
  #outlineRect;
163836
+ #screenOrientationLocked;
162309
163837
  constructor() {
162310
163838
  super();
162311
163839
  this.#screenRect = new Rect(0, 0, 1, 1);
@@ -162354,6 +163882,7 @@ class DeviceModeModel extends ObjectWrapper {
162354
163882
  this.#touchMobile = false;
162355
163883
  this.#emulationModel = null;
162356
163884
  this.#onModelAvailable = null;
163885
+ this.#screenOrientationLocked = false;
162357
163886
  TargetManager.instance().observeModels(EmulationModel, this);
162358
163887
  }
162359
163888
  static instance(opts) {
@@ -162576,6 +164105,7 @@ class DeviceModeModel extends ObjectWrapper {
162576
164105
  this.#onModelAvailable = null;
162577
164106
  callback();
162578
164107
  }
164108
+ emulationModel.addEventListener("ScreenOrientationLockChanged" , this.onScreenOrientationLockChanged, this);
162579
164109
  const resourceTreeModel = emulationModel.target().model(ResourceTreeModel);
162580
164110
  if (resourceTreeModel) {
162581
164111
  resourceTreeModel.addEventListener(Events$6.FrameResized, this.onFrameChange, this);
@@ -162588,7 +164118,10 @@ class DeviceModeModel extends ObjectWrapper {
162588
164118
  }
162589
164119
  modelRemoved(emulationModel) {
162590
164120
  if (this.#emulationModel === emulationModel) {
164121
+ emulationModel.removeEventListener("ScreenOrientationLockChanged" , this.onScreenOrientationLockChanged, this);
162591
164122
  this.#emulationModel = null;
164123
+ this.#screenOrientationLocked = false;
164124
+ this.dispatchEventToListeners("Updated" );
162592
164125
  }
162593
164126
  }
162594
164127
  inspectedURL() {
@@ -162601,6 +164134,36 @@ class DeviceModeModel extends ObjectWrapper {
162601
164134
  }
162602
164135
  this.showHingeIfApplicable(overlayModel);
162603
164136
  }
164137
+ onScreenOrientationLockChanged(event) {
164138
+ this.#screenOrientationLocked = event.data.locked;
164139
+ if (event.data.locked && event.data.orientation) {
164140
+ this.applyOrientationLock(event.data.orientation);
164141
+ }
164142
+ this.dispatchEventToListeners("Updated" );
164143
+ }
164144
+ applyOrientationLock(orientation) {
164145
+ const wantsLandscape = orientation.type === "landscapePrimary" ||
164146
+ orientation.type === "landscapeSecondary" ;
164147
+ if (this.#type === Type.Device && this.#device && this.#mode) {
164148
+ const isCurrentlyLandscape = this.#mode.orientation === Horizontal || this.#mode.orientation === HorizontalSpanned;
164149
+ if (wantsLandscape !== isCurrentlyLandscape) {
164150
+ const rotationPartner = this.#device.getRotationPartner(this.#mode);
164151
+ if (rotationPartner) {
164152
+ this.emulate(this.#type, this.#device, rotationPartner);
164153
+ }
164154
+ }
164155
+ }
164156
+ else if (this.#type === Type.Responsive) {
164157
+ const appliedSize = this.appliedDeviceSize();
164158
+ const isCurrentlyLandscape = appliedSize.width > appliedSize.height;
164159
+ if (wantsLandscape !== isCurrentlyLandscape) {
164160
+ this.setSizeAndScaleToFit(appliedSize.height, appliedSize.width);
164161
+ }
164162
+ }
164163
+ }
164164
+ isScreenOrientationLocked() {
164165
+ return this.#screenOrientationLocked;
164166
+ }
162604
164167
  scaleSettingChanged() {
162605
164168
  this.calculateAndEmulate(false);
162606
164169
  }
@@ -162785,9 +164348,6 @@ class DeviceModeModel extends ObjectWrapper {
162785
164348
  positionX,
162786
164349
  positionY,
162787
164350
  dontSetVisibleSize: true,
162788
- displayFeature: undefined,
162789
- devicePosture: undefined,
162790
- screenOrientation: undefined,
162791
164351
  };
162792
164352
  if (displayFeature) {
162793
164353
  metrics.displayFeature = displayFeature;
@@ -163940,7 +165500,6 @@ class NetworkLog extends ObjectWrapper {
163940
165500
  initiatorInfo = {
163941
165501
  info: null,
163942
165502
  chain: null,
163943
- request: undefined,
163944
165503
  };
163945
165504
  this.#initiatorData.set(request, initiatorInfo);
163946
165505
  return initiatorInfo;
@@ -165359,7 +166918,7 @@ Status code: ${statusCode}
165359
166918
  MIME Type: ${mimeType}
165360
166919
  Protocol: ${protocol}
165361
166920
  ${priorityLines.join('\n')}
165362
- Render blocking: ${renderBlocking ? 'Yes' : 'No'}
166921
+ Render-blocking: ${renderBlocking ? 'Yes' : 'No'}
165363
166922
  From a service worker: ${fromServiceWorker ? 'Yes' : 'No'}
165364
166923
  Initiators (root request to the request that directly loaded this one): ${initiatorUrls.join(', ') || 'none'}
165365
166924
  ${NetworkRequestFormatter.formatHeaders('Response headers', responseHeaders ?? [], true)}`;
@@ -165688,8 +167247,8 @@ class PerformanceInsightFormatter {
165688
167247
  return [{ title: 'How do I optimize my network dependency tree?' }];
165689
167248
  case 'RenderBlocking':
165690
167249
  return [
165691
- { title: 'Show me the most impactful render blocking requests that I should focus on' },
165692
- { title: 'How can I reduce the number of render blocking requests?' }
167250
+ { title: 'Show me the most impactful render-blocking requests that I should focus on' },
167251
+ { title: 'How can I reduce the number of render-blocking requests?' }
165693
167252
  ];
165694
167253
  case 'SlowCSSSelector':
165695
167254
  return [{ title: 'How can I optimize my CSS to increase the performance of CSS selectors?' }];
@@ -166092,9 +167651,9 @@ ${requestSummary}`;
166092
167651
  formatRenderBlockingInsight(insight) {
166093
167652
  const requestSummary = this.#traceFormatter.formatNetworkRequests(insight.renderBlockingRequests);
166094
167653
  if (requestSummary.length === 0) {
166095
- return 'There are no network requests that are render blocking.';
167654
+ return 'There are no network requests that are render-blocking.';
166096
167655
  }
166097
- return `Here is a list of the network requests that were render blocking on this page and their duration:
167656
+ return `Here is a list of the network requests that were render-blocking on this page and their duration:
166098
167657
 
166099
167658
  ${requestSummary}`;
166100
167659
  }
@@ -166371,7 +167930,7 @@ It is important that all of these checks pass to minimize the delay between the
166371
167930
  3. The maximum of 4 preconnects should be respected.
166372
167931
  - Opportunities to add [preconnect] for a faster loading experience.`;
166373
167932
  case 'RenderBlocking':
166374
- return 'This insight identifies network requests that were render blocking. Render blocking requests are impactful because they are deemed critical to the page and therefore the browser stops rendering the page until it has dealt with these resources. For this insight make sure you fully inspect the details of each render blocking network request and prioritize your suggestions to the user based on the impact of each render blocking request.';
167933
+ return 'This insight identifies network requests that were render-blocking. Render-blocking requests are impactful because they are deemed critical to the page and therefore the browser stops rendering the page until it has dealt with these resources. For this insight make sure you fully inspect the details of each render-blocking network request and prioritize your suggestions to the user based on the impact of each render-blocking request.';
166375
167934
  case 'SlowCSSSelector':
166376
167935
  return `This insight identifies CSS selectors that are slowing down your page's rendering performance.`;
166377
167936
  case 'ThirdParties':
@@ -170109,6 +171668,10 @@ const UIStrings$g = {
170109
171668
  InsecurePrivateNetworkSubresourceRequest: "The website requested a subresource from a network that it could only access because of its users' privileged network position. These requests expose non-public devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage. To mitigate these risks, Chrome deprecates requests to non-public subresources when initiated from non-secure contexts, and will start blocking them.",
170110
171669
  InterestGroupDailyUpdateUrl: "The `dailyUpdateUrl` field of `InterestGroups` passed to `joinAdInterestGroup()` has been renamed to `updateUrl`, to more accurately reflect its behavior.",
170111
171670
  IntlV8BreakIterator: "`Intl.v8BreakIterator` is deprecated. Please use `Intl.Segmenter` instead.",
171671
+ LanguageModel_InputQuota: "LanguageModel.inputQuota is deprecated. Please use LanguageModel.contextWindow instead. This alias is only available in extensions.",
171672
+ LanguageModel_InputUsage: "LanguageModel.inputUsage is deprecated. Please use LanguageModel.contextUsage instead. This alias is only available in extensions.",
171673
+ LanguageModel_MeasureInputUsage: "LanguageModel.measureInputUsage() is deprecated. Please use LanguageModel.measureContextUsage() instead. This alias is only available in extensions.",
171674
+ LanguageModel_OnQuotaOverflow: "LanguageModel.onquotaoverflow is deprecated. Please use LanguageModel.oncontextoverflow instead. The LanguageModel.onquotaoverflow alias is only available in extensions.",
170112
171675
  LanguageModelParams: "LanguageModel.params() is deprecated and now only available in extension contexts. The topK and temperature related fields within its result are also deprecated.",
170113
171676
  LanguageModelTemperature: "The 'temperature' parameter/attribute for LanguageModel is deprecated. It is only functional within extensions and may be removed in the future.",
170114
171677
  LanguageModelTopK: "The 'topK' parameter/attribute for LanguageModel is deprecated. It is only functional within extensions and may be removed in the future.",
@@ -170199,6 +171762,18 @@ const DEPRECATIONS_METADATA = {
170199
171762
  "LanguageModelTopK": {
170200
171763
  "chromeStatusFeature": 5134603979063296
170201
171764
  },
171765
+ "LanguageModel_InputQuota": {
171766
+ "chromeStatusFeature": 5134603979063296
171767
+ },
171768
+ "LanguageModel_InputUsage": {
171769
+ "chromeStatusFeature": 5134603979063296
171770
+ },
171771
+ "LanguageModel_MeasureInputUsage": {
171772
+ "chromeStatusFeature": 5134603979063296
171773
+ },
171774
+ "LanguageModel_OnQuotaOverflow": {
171775
+ "chromeStatusFeature": 5134603979063296
171776
+ },
170202
171777
  "LocalCSSFileExtensionRejected": {
170203
171778
  "milestone": 64
170204
171779
  },
@@ -172867,4 +174442,13 @@ var mcp = /*#__PURE__*/Object.freeze({
172867
174442
  createIssuesFromProtocolIssue: createIssuesFromProtocolIssue
172868
174443
  });
172869
174444
 
172870
- export { Browser as BrowserEnum, CDPSessionEvent, mcp as DevTools, KnownDevices, Locator, McpServer, PipeTransport, PredefinedNetworkConditions, SetLevelRequestSchema, StdioServerTransport, debug$2 as debug, detectBrowserPlatform, hideBin, puppeteer, resolveDefaultUserDataDir, Yargs as yargs, z as zod };
174445
+ /**
174446
+ * @license
174447
+ * Copyright 2025 Google LLC
174448
+ * SPDX-License-Identifier: Apache-2.0
174449
+ */
174450
+ const snapshot = snapshot$1;
174451
+ const navigation = navigation$1;
174452
+ const generateReport = generateReport$1;
174453
+
174454
+ export { Browser as BrowserEnum, CDPSessionEvent, Client$1 as Client, mcp as DevTools, KnownDevices, Locator, McpServer, PipeTransport, PredefinedNetworkConditions, SetLevelRequestSchema, StdioClientTransport, StdioServerTransport, debug$2 as debug, detectBrowserPlatform, generateReport, hideBin, navigation, puppeteer, resolveDefaultUserDataDir, snapshot, Yargs as yargs, z as zod };