Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ import license from 'rollup-plugin-license';

const isProduction = process.env.NODE_ENV === 'production';

/** @type {import('rollup').RollupOptions} */
const sdk = {
input: './build/src/third_party/modelcontextprotocol-sdk/index.js',
const allowed_licenses = ['MIT', 'Apache 2.0', 'Apache-2.0', 'BSD-3-Clause', 'BSD-2-Clause', 'ISC', '0BSD'];

/** @returns {import('rollup').RollupOptions} */
const bundleDependency = (wrapperIndexPath, extraOutputOptions = {}) => ({
input: wrapperIndexPath,
output: {
file: './build/src/third_party/modelcontextprotocol-sdk/index.js',
...extraOutputOptions,
file: wrapperIndexPath,
sourcemap: !isProduction,
format: 'esm',
},
Expand All @@ -48,7 +51,6 @@ const sdk = {
thirdParty: {
allow: {
test: dependency => {
let allowed_licenses = ['MIT', 'Apache 2.0', 'BSD-2-Clause', 'ISC'];
return allowed_licenses.includes(dependency.license);
},
failOnUnlicensed: true,
Expand Down Expand Up @@ -90,6 +92,9 @@ const sdk = {
json(),
nodeResolve(),
],
};
});

export default [sdk];
export default [
bundleDependency('./build/src/third_party/modelcontextprotocol-sdk/index.js'),
bundleDependency('./build/src/third_party/puppeteer-core/index.js', {inlineDynamicImports: true}),
];
3 changes: 2 additions & 1 deletion src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import type {
LaunchOptions,
Target,
} from 'puppeteer-core';
import puppeteer from 'puppeteer-core';

import {puppeteer} from './third_party/puppeteer-core/index.js';

let browser: Browser | undefined;

Expand Down
8 changes: 8 additions & 0 deletions src/third_party/puppeteer-core/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

export {Locator,PredefinedNetworkConditions} from 'puppeteer-core';
export {default as puppeteer} from 'puppeteer-core';
2 changes: 1 addition & 1 deletion src/tools/emulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {PredefinedNetworkConditions} from 'puppeteer-core';

import {zod} from '../third_party/modelcontextprotocol-sdk/index.js';
import {PredefinedNetworkConditions} from '../third_party/puppeteer-core/index.js';

import {ToolCategories} from './categories.js';
import {defineTool} from './ToolDefinition.js';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {Locator} from 'puppeteer-core';

import {zod} from '../third_party/modelcontextprotocol-sdk/index.js';
import {Locator} from '../third_party/puppeteer-core/index.js';

import {ToolCategories} from './categories.js';
import {defineTool, timeoutSchema} from './ToolDefinition.js';
Expand Down
Loading