turno-browser 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/LICENSE +202 -0
- package/NOTICE +18 -0
- package/README.md +30 -2
- package/dist/argv.d.ts +33 -0
- package/dist/argv.js +66 -0
- package/dist/bench.d.ts +54 -0
- package/dist/bench.js +188 -0
- package/dist/bin/mcp.d.ts +2 -0
- package/dist/bin/mcp.js +30 -0
- package/dist/detectors.d.ts +44 -0
- package/dist/detectors.js +108 -0
- package/dist/identities.d.ts +25 -0
- package/dist/identities.js +94 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +28 -0
- package/dist/login.d.ts +11 -0
- package/dist/login.js +40 -0
- package/dist/patchright.d.ts +10 -0
- package/dist/patchright.js +30 -0
- package/dist/paths.d.ts +17 -0
- package/dist/paths.js +17 -0
- package/package.json +65 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# turno-browser
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 35a3c4a: The README links to the `turno-cli` package, the name the CLI is published under.
|
|
8
|
+
- ce52d03: The repository moved to `github.com/wimo-dev/turno`. turno-browser is listed in the MCP
|
|
9
|
+
Registry as `io.github.wimo-dev/turno-browser`.
|
|
10
|
+
|
|
11
|
+
## 0.1.0
|
|
12
|
+
|
|
13
|
+
First public release: an MCP server that drives your installed Google Chrome with a persistent
|
|
14
|
+
profile per identity (`turno-browser-mcp --identity <name>`), headed by default, plus the
|
|
15
|
+
`turno browser bench` checks.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
turno
|
|
2
|
+
Copyright 2026 William Frank Monroy Mamani
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
The turno-fonts package redistributes MesloLGS Nerd Font 3.4.0: Meslo LG,
|
|
7
|
+
Copyright 2009, 2010, 2013 Andre Berg, under the Apache License 2.0, patched with
|
|
8
|
+
the Nerd Fonts icon sets, which carry their own licenses (SIL OFL 1.1, MIT,
|
|
9
|
+
CC BY 4.0, Apache 2.0). The full texts and attributions are in
|
|
10
|
+
packages/fonts/LICENSE.txt.
|
|
11
|
+
|
|
12
|
+
Third-party npm dependencies are installed from the registry with their own
|
|
13
|
+
licenses; THIRD_PARTY_NOTICES.md lists them.
|
|
14
|
+
|
|
15
|
+
turno is an independent project. It is not affiliated with, endorsed by or
|
|
16
|
+
sponsored by Anthropic, OpenAI, GitHub, Google, Anysphere or any other vendor
|
|
17
|
+
whose tools it can launch. Product names are used only to say what turno works
|
|
18
|
+
with.
|
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# turno-browser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An MCP server that lets a coding agent drive your installed Google Chrome with a persistent
|
|
4
|
+
profile per identity: you sign into a site once by hand, and the agent works in that same
|
|
5
|
+
signed-in browser afterwards. It is the Playwright MCP program, run on Patchright (a Playwright
|
|
6
|
+
fork that drives Chrome without the automation flags Playwright adds).
|
|
7
|
+
|
|
8
|
+
It is an optional part of [turno](https://www.npmjs.com/package/turno-cli); turno works without it.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install --global turno-browser
|
|
12
|
+
turno identity add browser:school # prints the mcp.toml entry for this identity
|
|
13
|
+
turno identity login browser:school # sign in by hand once; cookies persist
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or run it directly as an MCP server: `turno-browser-mcp --identity school`.
|
|
17
|
+
|
|
18
|
+
Defaults: headed, the installed Chrome channel, a persistent user data dir per identity, no
|
|
19
|
+
injected init scripts. The reasons, and what these settings do and do not change, are in
|
|
20
|
+
[ADR 0005](https://github.com/wimo-dev/turno/blob/main/docs/decisions/0005-stealth-browser-defaults.md).
|
|
21
|
+
|
|
22
|
+
## Acceptable use
|
|
23
|
+
|
|
24
|
+
Use it with your own accounts, on sites whose terms allow automated access by you, and at a
|
|
25
|
+
human pace. Do not use it to get around access controls, paywalls, CAPTCHAs or rate limits, to
|
|
26
|
+
scrape at scale, or to access accounts that are not yours. You are responsible for how you use
|
|
27
|
+
it. The software is provided "as is", without warranty (Apache License 2.0).
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
Apache-2.0. Patchright and Playwright are Apache-2.0 and install as regular npm dependencies.
|
package/dist/argv.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns `turno-browser-mcp [--identity <id>] [playwright-mcp flags]` into the argv for the
|
|
3
|
+
* Patchright MCP program, adding stealth defaults the user did not set (see ADR 0005):
|
|
4
|
+
*
|
|
5
|
+
* - `--browser chrome`: the installed Google Chrome, not a bundled Chromium.
|
|
6
|
+
* - `--user-data-dir <dir>`: the identity's persistent profile, or a fresh temporary one.
|
|
7
|
+
* Patchright recommends persistent contexts, and the upstream default (a profile shared by
|
|
8
|
+
* every server started in the same folder) is neither isolated nor per identity.
|
|
9
|
+
*
|
|
10
|
+
* Headed mode and `viewport: null` are already the program's defaults for headed runs, so
|
|
11
|
+
* nothing is added for them; no init scripts are ever added.
|
|
12
|
+
*/
|
|
13
|
+
export interface BuiltArgv {
|
|
14
|
+
/** Arguments for the MCP program (without node and script path). */
|
|
15
|
+
args: string[];
|
|
16
|
+
identity?: string;
|
|
17
|
+
/** Profile dir passed to the program, when we chose it. */
|
|
18
|
+
userDataDir?: string;
|
|
19
|
+
/** Temporary dir to delete on exit (only for runs without an identity). */
|
|
20
|
+
tempDir?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface BuildOptions {
|
|
23
|
+
env?: NodeJS.ProcessEnv;
|
|
24
|
+
/** Creates the temporary profile root. Injected by tests. */
|
|
25
|
+
makeTempDir?: () => string;
|
|
26
|
+
}
|
|
27
|
+
/** Removes `--identity <id>` / `--identity=<id>` from args and returns the id. */
|
|
28
|
+
export declare function extractIdentity(args: string[]): {
|
|
29
|
+
identity?: string;
|
|
30
|
+
rest: string[];
|
|
31
|
+
};
|
|
32
|
+
export declare function defaultTempDir(): string;
|
|
33
|
+
export declare function buildArgv(rawArgs: string[], options?: BuildOptions): BuiltArgv;
|
package/dist/argv.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { mkdtempSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { assertIdentityId, identityDir } from "./identities.js";
|
|
5
|
+
/** Flags that point the program at a browser it does not launch itself. */
|
|
6
|
+
const EXTERNAL_BROWSER = ["--cdp-endpoint", "--endpoint", "--extension"];
|
|
7
|
+
function hasFlag(args, flag) {
|
|
8
|
+
return args.some((a) => a === flag || a.startsWith(`${flag}=`));
|
|
9
|
+
}
|
|
10
|
+
function hasAny(args, flags) {
|
|
11
|
+
return flags.some((f) => hasFlag(args, f));
|
|
12
|
+
}
|
|
13
|
+
/** Removes `--identity <id>` / `--identity=<id>` from args and returns the id. */
|
|
14
|
+
export function extractIdentity(args) {
|
|
15
|
+
const rest = [];
|
|
16
|
+
let identity;
|
|
17
|
+
for (let i = 0; i < args.length; i++) {
|
|
18
|
+
const a = args[i];
|
|
19
|
+
if (a === "--identity") {
|
|
20
|
+
const v = args[i + 1];
|
|
21
|
+
if (v === undefined || v.startsWith("--"))
|
|
22
|
+
throw new Error("--identity needs a value");
|
|
23
|
+
identity = v;
|
|
24
|
+
i++;
|
|
25
|
+
}
|
|
26
|
+
else if (a.startsWith("--identity=")) {
|
|
27
|
+
identity = a.slice("--identity=".length);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
rest.push(a);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (identity !== undefined)
|
|
34
|
+
assertIdentityId(identity);
|
|
35
|
+
return identity === undefined ? { rest } : { identity, rest };
|
|
36
|
+
}
|
|
37
|
+
export function defaultTempDir() {
|
|
38
|
+
return mkdtempSync(join(tmpdir(), "turno-browser-"));
|
|
39
|
+
}
|
|
40
|
+
export function buildArgv(rawArgs, options = {}) {
|
|
41
|
+
const env = options.env ?? process.env;
|
|
42
|
+
const { identity, rest } = extractIdentity(rawArgs);
|
|
43
|
+
const args = [...rest];
|
|
44
|
+
const external = hasAny(args, EXTERNAL_BROWSER);
|
|
45
|
+
const out = { args };
|
|
46
|
+
if (identity !== undefined) {
|
|
47
|
+
const clash = ["--user-data-dir", "--isolated", ...EXTERNAL_BROWSER].find((f) => hasFlag(args, f));
|
|
48
|
+
if (clash)
|
|
49
|
+
throw new Error(`--identity cannot be combined with ${clash}`);
|
|
50
|
+
out.identity = identity;
|
|
51
|
+
}
|
|
52
|
+
if (!external && !hasFlag(args, "--browser"))
|
|
53
|
+
args.push("--browser", "chrome");
|
|
54
|
+
if (!external && !hasFlag(args, "--user-data-dir") && !hasFlag(args, "--isolated")) {
|
|
55
|
+
if (identity !== undefined) {
|
|
56
|
+
out.userDataDir = identityDir(identity, env);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
out.tempDir = (options.makeTempDir ?? defaultTempDir)();
|
|
60
|
+
out.userDataDir = join(out.tempDir, "profile");
|
|
61
|
+
}
|
|
62
|
+
args.push("--user-data-dir", out.userDataDir);
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=argv.js.map
|
package/dist/bench.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `turno browser bench`: runs several browser engines against public bot detectors and the
|
|
3
|
+
* user's own URLs, so engine choices rest on measurements (ADR 0003, 0005).
|
|
4
|
+
*/
|
|
5
|
+
export declare const ENGINES: readonly ["patchright-chrome-headed", "patchright-chrome-headless", "playwright-stock", "camoufox"];
|
|
6
|
+
export type EngineName = (typeof ENGINES)[number];
|
|
7
|
+
export declare const DETECTORS: {
|
|
8
|
+
readonly rebrowser: "https://bot-detector.rebrowser.net/";
|
|
9
|
+
readonly sannysoft: "https://bot.sannysoft.com/";
|
|
10
|
+
};
|
|
11
|
+
export interface BenchOptions {
|
|
12
|
+
/** Engines to run. Default: both patchright engines, plus the optional ones when installed. */
|
|
13
|
+
engines?: EngineName[];
|
|
14
|
+
/** Extra URLs to check for challenges. */
|
|
15
|
+
urls?: string[];
|
|
16
|
+
/** Run the public detectors (default true). */
|
|
17
|
+
detectors?: boolean;
|
|
18
|
+
/** Write the JSON report under <state>/bench (default true). */
|
|
19
|
+
write?: boolean;
|
|
20
|
+
env?: NodeJS.ProcessEnv;
|
|
21
|
+
/** Milliseconds to let detector scripts finish after load (default 5000). */
|
|
22
|
+
settleMs?: number;
|
|
23
|
+
onProgress?: (message: string) => void;
|
|
24
|
+
}
|
|
25
|
+
export interface EngineReport {
|
|
26
|
+
engine: EngineName;
|
|
27
|
+
status: "ran" | "skipped" | "error";
|
|
28
|
+
reason?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface TargetResult {
|
|
31
|
+
engine: EngineName;
|
|
32
|
+
target: "rebrowser" | "sannysoft" | "url";
|
|
33
|
+
url: string;
|
|
34
|
+
ok: boolean;
|
|
35
|
+
summary: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
details?: unknown;
|
|
38
|
+
}
|
|
39
|
+
export interface BenchReport {
|
|
40
|
+
version: 1;
|
|
41
|
+
startedAt: string;
|
|
42
|
+
finishedAt: string;
|
|
43
|
+
engines: EngineReport[];
|
|
44
|
+
results: TargetResult[];
|
|
45
|
+
/** Where the JSON was written, when it was. */
|
|
46
|
+
file?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Why an optional engine cannot run, or undefined when it can. */
|
|
49
|
+
export declare function unavailableReason(engine: EngineName): string | undefined;
|
|
50
|
+
/** Default engine list: both patchright engines, plus optional ones that are installed. */
|
|
51
|
+
export declare function defaultEngines(): EngineName[];
|
|
52
|
+
export declare function runBench(options?: BenchOptions): Promise<BenchReport>;
|
|
53
|
+
/** Plain-text table of a report: one row per engine and target, plus skipped engines. */
|
|
54
|
+
export declare function formatBenchTable(report: BenchReport): string;
|
package/dist/bench.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
import { detectChallenge, parseRebrowser, parseSannysoft } from "./detectors.js";
|
|
6
|
+
import { paths } from "./paths.js";
|
|
7
|
+
import { resolveFrom } from "./patchright.js";
|
|
8
|
+
/**
|
|
9
|
+
* `turno browser bench`: runs several browser engines against public bot detectors and the
|
|
10
|
+
* user's own URLs, so engine choices rest on measurements (ADR 0003, 0005).
|
|
11
|
+
*/
|
|
12
|
+
export const ENGINES = ["patchright-chrome-headed", "patchright-chrome-headless", "playwright-stock", "camoufox"];
|
|
13
|
+
export const DETECTORS = {
|
|
14
|
+
rebrowser: "https://bot-detector.rebrowser.net/",
|
|
15
|
+
sannysoft: "https://bot.sannysoft.com/",
|
|
16
|
+
};
|
|
17
|
+
async function importResolved(name) {
|
|
18
|
+
const file = resolveFrom(name);
|
|
19
|
+
if (!file)
|
|
20
|
+
throw new Error(`${name} is not installed`);
|
|
21
|
+
return (await import(pathToFileURL(file).href));
|
|
22
|
+
}
|
|
23
|
+
async function persistentChrome(chromium, headless) {
|
|
24
|
+
const dir = mkdtempSync(join(tmpdir(), "turno-bench-"));
|
|
25
|
+
try {
|
|
26
|
+
const ctx = await chromium.launchPersistentContext(dir, { channel: "chrome", headless, viewport: null });
|
|
27
|
+
return {
|
|
28
|
+
newPage: () => ctx.newPage(),
|
|
29
|
+
close: async () => {
|
|
30
|
+
await ctx.close().catch(() => undefined);
|
|
31
|
+
rmSync(dir, { recursive: true, force: true });
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
rmSync(dir, { recursive: true, force: true });
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function chromiumOf(mod) {
|
|
41
|
+
const chromium = (mod.chromium ?? mod.default?.chromium);
|
|
42
|
+
if (!chromium)
|
|
43
|
+
throw new Error("module has no chromium export");
|
|
44
|
+
return chromium;
|
|
45
|
+
}
|
|
46
|
+
/** Why an optional engine cannot run, or undefined when it can. */
|
|
47
|
+
export function unavailableReason(engine) {
|
|
48
|
+
if (engine === "playwright-stock" && !resolveFrom("playwright-core"))
|
|
49
|
+
return "playwright-core is not installed";
|
|
50
|
+
if (engine === "camoufox" && !resolveFrom("camoufox-js"))
|
|
51
|
+
return "camoufox-js is not installed; it is never installed automatically";
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
async function launch(engine) {
|
|
55
|
+
switch (engine) {
|
|
56
|
+
case "patchright-chrome-headed":
|
|
57
|
+
return persistentChrome(chromiumOf(await importResolved("patchright-core")), false);
|
|
58
|
+
case "patchright-chrome-headless":
|
|
59
|
+
return persistentChrome(chromiumOf(await importResolved("patchright-core")), true);
|
|
60
|
+
case "playwright-stock":
|
|
61
|
+
return persistentChrome(chromiumOf(await importResolved("playwright-core")), true);
|
|
62
|
+
case "camoufox": {
|
|
63
|
+
const mod = await importResolved("camoufox-js");
|
|
64
|
+
const Camoufox = (mod.Camoufox ?? mod.default?.Camoufox);
|
|
65
|
+
if (!Camoufox)
|
|
66
|
+
throw new Error("camoufox-js has no Camoufox export");
|
|
67
|
+
const browser = await Camoufox({ headless: true });
|
|
68
|
+
return { newPage: () => browser.newPage(), close: () => browser.close().catch(() => undefined) };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Default engine list: both patchright engines, plus optional ones that are installed. */
|
|
73
|
+
export function defaultEngines() {
|
|
74
|
+
return ENGINES.filter((e) => e.startsWith("patchright-") || !unavailableReason(e));
|
|
75
|
+
}
|
|
76
|
+
async function runTarget(session, engine, target, url, settleMs) {
|
|
77
|
+
const page = await session.newPage();
|
|
78
|
+
const response = await page.goto(url, { timeout: 45_000, waitUntil: "load" });
|
|
79
|
+
await page.waitForTimeout(target === "url" ? Math.min(settleMs, 3000) : settleMs);
|
|
80
|
+
const html = await page.content();
|
|
81
|
+
if (target === "rebrowser") {
|
|
82
|
+
const r = parseRebrowser(html);
|
|
83
|
+
const failed = r.tests.filter((t) => t.status === "fail").map((t) => t.name);
|
|
84
|
+
const warned = r.tests.filter((t) => t.status === "warn").map((t) => t.name);
|
|
85
|
+
const parts = [`${r.passed} pass`, `${r.failed} fail${failed.length ? ` (${failed.join(", ")})` : ""}`];
|
|
86
|
+
if (warned.length)
|
|
87
|
+
parts.push(`${r.warned} warn (${warned.join(", ")})`);
|
|
88
|
+
if (!r.tests.length)
|
|
89
|
+
parts.splice(0, parts.length, "no results table found");
|
|
90
|
+
return { engine, target, url, ok: r.tests.length > 0 && r.failed === 0, summary: parts.join(", "), details: r };
|
|
91
|
+
}
|
|
92
|
+
if (target === "sannysoft") {
|
|
93
|
+
const r = parseSannysoft(html);
|
|
94
|
+
const summary = r.rows.length
|
|
95
|
+
? `${r.failed} failed of ${r.rows.length}${r.failed ? ` (${r.failedNames.join(", ")})` : ""}`
|
|
96
|
+
: "no result rows found";
|
|
97
|
+
return { engine, target, url, ok: r.rows.length > 0 && r.failed === 0, summary, details: r };
|
|
98
|
+
}
|
|
99
|
+
const status = response?.status() ?? 0;
|
|
100
|
+
const c = detectChallenge(html);
|
|
101
|
+
const challenge = c.markers.length ? `challenge: ${c.markers.join(", ")}` : "no challenge markers";
|
|
102
|
+
return {
|
|
103
|
+
engine,
|
|
104
|
+
target,
|
|
105
|
+
url,
|
|
106
|
+
ok: status > 0 && status < 400 && c.markers.length === 0,
|
|
107
|
+
summary: `${status || "no response"} "${c.title}" ${challenge}`,
|
|
108
|
+
details: { status, title: c.title, markers: c.markers },
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function stamp(d) {
|
|
112
|
+
return d.toISOString().replace(/[:.]/g, "-");
|
|
113
|
+
}
|
|
114
|
+
export async function runBench(options = {}) {
|
|
115
|
+
const env = options.env ?? process.env;
|
|
116
|
+
const settleMs = options.settleMs ?? 5000;
|
|
117
|
+
const log = options.onProgress ?? (() => undefined);
|
|
118
|
+
const engines = options.engines?.length ? options.engines : defaultEngines();
|
|
119
|
+
const targets = [];
|
|
120
|
+
if (options.detectors !== false) {
|
|
121
|
+
targets.push({ target: "rebrowser", url: DETECTORS.rebrowser }, { target: "sannysoft", url: DETECTORS.sannysoft });
|
|
122
|
+
}
|
|
123
|
+
for (const url of options.urls ?? [])
|
|
124
|
+
targets.push({ target: "url", url });
|
|
125
|
+
const started = new Date();
|
|
126
|
+
const report = { version: 1, startedAt: started.toISOString(), finishedAt: "", engines: [], results: [] };
|
|
127
|
+
for (const engine of engines) {
|
|
128
|
+
const reason = unavailableReason(engine);
|
|
129
|
+
if (reason) {
|
|
130
|
+
report.engines.push({ engine, status: "skipped", reason });
|
|
131
|
+
log(`${engine}: skipped (${reason})`);
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
let session;
|
|
135
|
+
try {
|
|
136
|
+
log(`${engine}: launching`);
|
|
137
|
+
session = await launch(engine);
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
report.engines.push({ engine, status: "error", reason: firstLine(err) });
|
|
141
|
+
log(`${engine}: failed to launch (${firstLine(err)})`);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
report.engines.push({ engine, status: "ran" });
|
|
145
|
+
try {
|
|
146
|
+
for (const t of targets) {
|
|
147
|
+
log(`${engine}: ${t.url}`);
|
|
148
|
+
try {
|
|
149
|
+
report.results.push(await runTarget(session, engine, t.target, t.url, settleMs));
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
report.results.push({ engine, target: t.target, url: t.url, ok: false, summary: "error", error: firstLine(err) });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
await session.close();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
report.finishedAt = new Date().toISOString();
|
|
161
|
+
if (options.write !== false) {
|
|
162
|
+
const dir = paths(env).benchDir;
|
|
163
|
+
mkdirSync(dir, { recursive: true });
|
|
164
|
+
report.file = join(dir, `${stamp(started)}.json`);
|
|
165
|
+
writeFileSync(report.file, `${JSON.stringify(report, null, 2)}\n`);
|
|
166
|
+
}
|
|
167
|
+
return report;
|
|
168
|
+
}
|
|
169
|
+
function firstLine(err) {
|
|
170
|
+
return String(err?.message ?? err).split("\n")[0];
|
|
171
|
+
}
|
|
172
|
+
/** Plain-text table of a report: one row per engine and target, plus skipped engines. */
|
|
173
|
+
export function formatBenchTable(report) {
|
|
174
|
+
const rows = [["ENGINE", "TARGET", "RESULT", "DETAILS"]];
|
|
175
|
+
for (const r of report.results) {
|
|
176
|
+
const target = r.target === "url" ? r.url : r.target;
|
|
177
|
+
rows.push([r.engine, target, r.error ? "ERROR" : r.ok ? "PASS" : "FAIL", r.error ?? r.summary]);
|
|
178
|
+
}
|
|
179
|
+
for (const e of report.engines) {
|
|
180
|
+
if (e.status !== "ran")
|
|
181
|
+
rows.push([e.engine, "-", e.status.toUpperCase(), e.reason ?? ""]);
|
|
182
|
+
}
|
|
183
|
+
const widths = [0, 1, 2].map((i) => Math.max(...rows.map((r) => r[i].length)));
|
|
184
|
+
return rows
|
|
185
|
+
.map((r) => r.map((cell, i) => (i < 3 ? cell.padEnd(widths[i]) : cell)).join(" ").trimEnd())
|
|
186
|
+
.join("\n");
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=bench.js.map
|
package/dist/bin/mcp.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdirSync, rmSync } from "node:fs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { buildArgv } from "../argv.js";
|
|
5
|
+
import { mcpEntryPath } from "../patchright.js";
|
|
6
|
+
/**
|
|
7
|
+
* turno-browser-mcp [--identity <id>] [playwright-mcp flags]
|
|
8
|
+
*
|
|
9
|
+
* Runs the Patchright build of the Playwright MCP program in this process with stealth
|
|
10
|
+
* defaults (ADR 0005). Speaks MCP over stdio unless `--port` is given.
|
|
11
|
+
*/
|
|
12
|
+
let built;
|
|
13
|
+
try {
|
|
14
|
+
built = buildArgv(process.argv.slice(2));
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
process.stderr.write(`turno-browser-mcp: ${err.message}\n`);
|
|
18
|
+
process.exit(2);
|
|
19
|
+
}
|
|
20
|
+
if (built.identity !== undefined && built.userDataDir)
|
|
21
|
+
mkdirSync(built.userDataDir, { recursive: true, mode: 0o700 });
|
|
22
|
+
if (built.tempDir) {
|
|
23
|
+
const dir = built.tempDir;
|
|
24
|
+
process.on("exit", () => rmSync(dir, { recursive: true, force: true }));
|
|
25
|
+
}
|
|
26
|
+
const entry = mcpEntryPath();
|
|
27
|
+
// The program parses process.argv with commander ("node <script> ...flags").
|
|
28
|
+
process.argv = [process.argv[0], entry, ...built.args];
|
|
29
|
+
createRequire(import.meta.url)(entry);
|
|
30
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure parsers for the bench targets. They take page HTML (as returned by `page.content()`)
|
|
3
|
+
* and never touch the network, so tests run them on saved snippets.
|
|
4
|
+
*/
|
|
5
|
+
export type TestStatus = "pass" | "fail" | "warn" | "untriggered";
|
|
6
|
+
export interface DetectorTest {
|
|
7
|
+
name: string;
|
|
8
|
+
status: TestStatus;
|
|
9
|
+
note: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RebrowserResult {
|
|
12
|
+
tests: DetectorTest[];
|
|
13
|
+
passed: number;
|
|
14
|
+
failed: number;
|
|
15
|
+
warned: number;
|
|
16
|
+
untriggered: number;
|
|
17
|
+
}
|
|
18
|
+
export interface SannysoftResult {
|
|
19
|
+
rows: {
|
|
20
|
+
name: string;
|
|
21
|
+
status: "pass" | "fail";
|
|
22
|
+
}[];
|
|
23
|
+
passed: number;
|
|
24
|
+
failed: number;
|
|
25
|
+
failedNames: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface ChallengeResult {
|
|
28
|
+
title: string;
|
|
29
|
+
markers: string[];
|
|
30
|
+
}
|
|
31
|
+
export declare function decodeEntities(text: string): string;
|
|
32
|
+
/** Drops comments, scripts, styles and templates: markup that is never shown as text. */
|
|
33
|
+
export declare function stripInvisible(html: string): string;
|
|
34
|
+
/** Visible-ish text of an HTML fragment, whitespace collapsed. */
|
|
35
|
+
export declare function textOf(html: string): string;
|
|
36
|
+
/** Parses the result table of https://bot-detector.rebrowser.net/. */
|
|
37
|
+
export declare function parseRebrowser(html: string): RebrowserResult;
|
|
38
|
+
/** Counts the passed and failed rows of https://bot.sannysoft.com/. */
|
|
39
|
+
export declare function parseSannysoft(html: string): SannysoftResult;
|
|
40
|
+
/** Phrases that show a bot wall instead of the page. Matched on visible text and the title. */
|
|
41
|
+
export declare const CHALLENGE_MARKERS: string[];
|
|
42
|
+
export declare function titleOf(html: string): string;
|
|
43
|
+
/** Looks for challenge phrases in the page's visible text and title (not in scripts). */
|
|
44
|
+
export declare function detectChallenge(html: string): ChallengeResult;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure parsers for the bench targets. They take page HTML (as returned by `page.content()`)
|
|
3
|
+
* and never touch the network, so tests run them on saved snippets.
|
|
4
|
+
*/
|
|
5
|
+
const ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'", nbsp: " " };
|
|
6
|
+
export function decodeEntities(text) {
|
|
7
|
+
return text.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (whole, code) => {
|
|
8
|
+
if (code[0] === "#") {
|
|
9
|
+
const n = code[1] === "x" || code[1] === "X" ? parseInt(code.slice(2), 16) : parseInt(code.slice(1), 10);
|
|
10
|
+
return Number.isFinite(n) ? String.fromCodePoint(n) : whole;
|
|
11
|
+
}
|
|
12
|
+
return ENTITIES[code.toLowerCase()] ?? whole;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/** Drops comments, scripts, styles and templates: markup that is never shown as text. */
|
|
16
|
+
export function stripInvisible(html) {
|
|
17
|
+
return html
|
|
18
|
+
.replace(/<!--[\s\S]*?-->/g, " ")
|
|
19
|
+
.replace(/<(script|style|template|noscript)\b[\s\S]*?<\/\1\s*>/gi, " ");
|
|
20
|
+
}
|
|
21
|
+
/** Visible-ish text of an HTML fragment, whitespace collapsed. */
|
|
22
|
+
export function textOf(html) {
|
|
23
|
+
return decodeEntities(stripInvisible(html).replace(/<[^>]*>/g, " "))
|
|
24
|
+
.replace(/\s+/g, " ")
|
|
25
|
+
.trim();
|
|
26
|
+
}
|
|
27
|
+
function rowsOf(html) {
|
|
28
|
+
return [...html.matchAll(/<tr\b[^>]*>([\s\S]*?)<\/tr\s*>/gi)].map((m) => m[1]);
|
|
29
|
+
}
|
|
30
|
+
function cellsOf(rowHtml) {
|
|
31
|
+
return [...rowHtml.matchAll(/<td\b([^>]*)>([\s\S]*?)<\/td\s*>/gi)].map((m) => ({ attrs: m[1], inner: m[2] }));
|
|
32
|
+
}
|
|
33
|
+
const STATUS_BY_MARK = [
|
|
34
|
+
["\u{1F7E2}", "pass"], // green circle
|
|
35
|
+
["\u{1F534}", "fail"], // red circle
|
|
36
|
+
["\u{1F7E1}", "warn"], // yellow circle
|
|
37
|
+
["⚪", "untriggered"], // white circle
|
|
38
|
+
];
|
|
39
|
+
/** Parses the result table of https://bot-detector.rebrowser.net/. */
|
|
40
|
+
export function parseRebrowser(html) {
|
|
41
|
+
const start = html.search(/<table\b[^>]*id=["']detections-table["']/i);
|
|
42
|
+
const tests = [];
|
|
43
|
+
if (start >= 0) {
|
|
44
|
+
const end = html.indexOf("</table", start);
|
|
45
|
+
const table = html.slice(start, end < 0 ? undefined : end);
|
|
46
|
+
for (const row of rowsOf(table)) {
|
|
47
|
+
const cells = cellsOf(row);
|
|
48
|
+
if (cells.length < 1)
|
|
49
|
+
continue;
|
|
50
|
+
const label = textOf(cells[0].inner);
|
|
51
|
+
const mark = STATUS_BY_MARK.find(([m]) => label.startsWith(m));
|
|
52
|
+
if (!mark)
|
|
53
|
+
continue;
|
|
54
|
+
const name = label.slice(mark[0].length).replace(/^️/, "").trim();
|
|
55
|
+
const notesHtml = (cells[2]?.inner ?? "").replace(/<pre\b[\s\S]*?<\/pre\s*>/gi, " ");
|
|
56
|
+
const note = textOf(notesHtml).replace(/^[\u{1F534}\u{1F7E1}\u{1F7E2}⚪]️?\s*/u, "");
|
|
57
|
+
tests.push({ name, status: mark[1], note: note.length > 200 ? `${note.slice(0, 197)}...` : note });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const count = (s) => tests.filter((t) => t.status === s).length;
|
|
61
|
+
return { tests, passed: count("pass"), failed: count("fail"), warned: count("warn"), untriggered: count("untriggered") };
|
|
62
|
+
}
|
|
63
|
+
/** Counts the passed and failed rows of https://bot.sannysoft.com/. */
|
|
64
|
+
export function parseSannysoft(html) {
|
|
65
|
+
const rows = [];
|
|
66
|
+
for (const row of rowsOf(stripInvisible(html))) {
|
|
67
|
+
const cells = cellsOf(row);
|
|
68
|
+
if (cells.length < 2)
|
|
69
|
+
continue;
|
|
70
|
+
let status;
|
|
71
|
+
for (const cell of cells.slice(1)) {
|
|
72
|
+
const cls = /\bclass=["']([^"']*)["']/i.exec(cell.attrs)?.[1] ?? "";
|
|
73
|
+
const words = cls.split(/\s+/);
|
|
74
|
+
if (words.includes("failed"))
|
|
75
|
+
status = "fail";
|
|
76
|
+
else if (words.includes("passed") && status === undefined)
|
|
77
|
+
status = "pass";
|
|
78
|
+
}
|
|
79
|
+
if (status)
|
|
80
|
+
rows.push({ name: textOf(cells[0].inner), status });
|
|
81
|
+
}
|
|
82
|
+
const failedNames = rows.filter((r) => r.status === "fail").map((r) => r.name);
|
|
83
|
+
return { rows, passed: rows.length - failedNames.length, failed: failedNames.length, failedNames };
|
|
84
|
+
}
|
|
85
|
+
/** Phrases that show a bot wall instead of the page. Matched on visible text and the title. */
|
|
86
|
+
export const CHALLENGE_MARKERS = [
|
|
87
|
+
"captcha",
|
|
88
|
+
"verify you are human",
|
|
89
|
+
"are you a robot",
|
|
90
|
+
"access denied",
|
|
91
|
+
"unusual traffic",
|
|
92
|
+
"checking your browser",
|
|
93
|
+
"just a moment",
|
|
94
|
+
"attention required",
|
|
95
|
+
"request blocked",
|
|
96
|
+
];
|
|
97
|
+
export function titleOf(html) {
|
|
98
|
+
const m = /<title\b[^>]*>([\s\S]*?)<\/title\s*>/i.exec(html);
|
|
99
|
+
return m ? textOf(m[1]) : "";
|
|
100
|
+
}
|
|
101
|
+
/** Looks for challenge phrases in the page's visible text and title (not in scripts). */
|
|
102
|
+
export function detectChallenge(html) {
|
|
103
|
+
const title = titleOf(html);
|
|
104
|
+
const body = /<body\b[^>]*>([\s\S]*)<\/body\s*>/i.exec(html)?.[1] ?? html;
|
|
105
|
+
const text = `${title} ${textOf(body)}`.toLowerCase();
|
|
106
|
+
return { title, markers: CHALLENGE_MARKERS.filter((m) => text.includes(m)) };
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=detectors.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare class IdentityError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare function isValidIdentityId(id: string): boolean;
|
|
5
|
+
export declare function assertIdentityId(id: string): void;
|
|
6
|
+
export declare function identityDir(id: string, env?: NodeJS.ProcessEnv): string;
|
|
7
|
+
export interface IdentityInfo {
|
|
8
|
+
id: string;
|
|
9
|
+
dir: string;
|
|
10
|
+
/** A live Chrome holds the profile (its SingletonLock points to a running PID). */
|
|
11
|
+
inUse: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function identityExists(id: string, env?: NodeJS.ProcessEnv): boolean;
|
|
14
|
+
export declare function listIdentities(env?: NodeJS.ProcessEnv): IdentityInfo[];
|
|
15
|
+
/** Create the identity dir (mode 700). Returns its info; adding an existing identity is a no-op. */
|
|
16
|
+
export declare function addIdentity(id: string, env?: NodeJS.ProcessEnv): IdentityInfo;
|
|
17
|
+
/** Delete the identity and everything in its profile. Refuses while Chrome holds it. */
|
|
18
|
+
export declare function removeIdentity(id: string, env?: NodeJS.ProcessEnv): void;
|
|
19
|
+
/**
|
|
20
|
+
* Chrome writes `SingletonLock` as a symlink whose target is `<hostname>-<pid>`.
|
|
21
|
+
* Returns the PID, or undefined when the target does not have that shape.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseSingletonLock(target: string): number | undefined;
|
|
24
|
+
/** True when the identity's Chrome profile is locked by a live process. */
|
|
25
|
+
export declare function isInUse(id: string, env?: NodeJS.ProcessEnv): boolean;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readlinkSync, rmSync, statSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { paths } from "./paths.js";
|
|
4
|
+
/**
|
|
5
|
+
* A browser identity is a persistent Chrome user data dir (cookies, local storage, saved
|
|
6
|
+
* logins) under `<data>/browser/identities/<id>`. One identity maps to one mcpd server
|
|
7
|
+
* (`browser-<id>`), so a site login done once by hand is reused by every session.
|
|
8
|
+
*/
|
|
9
|
+
const IDENTITY_ID = /^[a-z0-9][a-z0-9_-]*$/;
|
|
10
|
+
export class IdentityError extends Error {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "IdentityError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function isValidIdentityId(id) {
|
|
17
|
+
return IDENTITY_ID.test(id) && id.length <= 64;
|
|
18
|
+
}
|
|
19
|
+
export function assertIdentityId(id) {
|
|
20
|
+
if (!isValidIdentityId(id)) {
|
|
21
|
+
throw new IdentityError(`invalid identity "${id}": use lowercase letters, digits, "-" and "_", starting with a letter or digit`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function identityDir(id, env = process.env) {
|
|
25
|
+
assertIdentityId(id);
|
|
26
|
+
return join(paths(env).identitiesDir, id);
|
|
27
|
+
}
|
|
28
|
+
export function identityExists(id, env = process.env) {
|
|
29
|
+
const dir = identityDir(id, env);
|
|
30
|
+
return existsSync(dir) && statSync(dir).isDirectory();
|
|
31
|
+
}
|
|
32
|
+
export function listIdentities(env = process.env) {
|
|
33
|
+
const root = paths(env).identitiesDir;
|
|
34
|
+
let names;
|
|
35
|
+
try {
|
|
36
|
+
names = readdirSync(root, { withFileTypes: true })
|
|
37
|
+
.filter((d) => d.isDirectory() && isValidIdentityId(d.name))
|
|
38
|
+
.map((d) => d.name);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
if (err.code === "ENOENT")
|
|
42
|
+
return [];
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
45
|
+
return names.sort().map((id) => ({ id, dir: join(root, id), inUse: isInUse(id, env) }));
|
|
46
|
+
}
|
|
47
|
+
/** Create the identity dir (mode 700). Returns its info; adding an existing identity is a no-op. */
|
|
48
|
+
export function addIdentity(id, env = process.env) {
|
|
49
|
+
const dir = identityDir(id, env);
|
|
50
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
51
|
+
return { id, dir, inUse: isInUse(id, env) };
|
|
52
|
+
}
|
|
53
|
+
/** Delete the identity and everything in its profile. Refuses while Chrome holds it. */
|
|
54
|
+
export function removeIdentity(id, env = process.env) {
|
|
55
|
+
const dir = identityDir(id, env);
|
|
56
|
+
if (!existsSync(dir))
|
|
57
|
+
throw new IdentityError(`identity "${id}" does not exist`);
|
|
58
|
+
if (isInUse(id, env))
|
|
59
|
+
throw new IdentityError(`identity "${id}" is in use by a running Chrome; close it first`);
|
|
60
|
+
rmSync(dir, { recursive: true, force: true });
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Chrome writes `SingletonLock` as a symlink whose target is `<hostname>-<pid>`.
|
|
64
|
+
* Returns the PID, or undefined when the target does not have that shape.
|
|
65
|
+
*/
|
|
66
|
+
export function parseSingletonLock(target) {
|
|
67
|
+
const m = /-(\d+)$/.exec(target);
|
|
68
|
+
if (!m)
|
|
69
|
+
return undefined;
|
|
70
|
+
const pid = Number(m[1]);
|
|
71
|
+
return Number.isSafeInteger(pid) && pid > 0 ? pid : undefined;
|
|
72
|
+
}
|
|
73
|
+
function pidAlive(pid) {
|
|
74
|
+
try {
|
|
75
|
+
process.kill(pid, 0);
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
return err.code === "EPERM";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** True when the identity's Chrome profile is locked by a live process. */
|
|
83
|
+
export function isInUse(id, env = process.env) {
|
|
84
|
+
let target;
|
|
85
|
+
try {
|
|
86
|
+
target = readlinkSync(join(identityDir(id, env), "SingletonLock"));
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
const pid = parseSingletonLock(target);
|
|
92
|
+
return pid !== undefined && pidAlive(pid);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=identities.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { IdentityError, type IdentityInfo, addIdentity, assertIdentityId, identityDir, identityExists, isInUse, isValidIdentityId, listIdentities, parseSingletonLock, removeIdentity, } from "./identities.js";
|
|
2
|
+
export { type BuiltArgv, buildArgv, extractIdentity } from "./argv.js";
|
|
3
|
+
export { type BenchOptions, type BenchReport, DETECTORS, ENGINES, type EngineName, type EngineReport, type TargetResult, defaultEngines, formatBenchTable, runBench, unavailableReason, } from "./bench.js";
|
|
4
|
+
export { CHALLENGE_MARKERS, detectChallenge, parseRebrowser, parseSannysoft } from "./detectors.js";
|
|
5
|
+
export { type LoginOptions, loginIdentity } from "./login.js";
|
|
6
|
+
export { mcpEntryPath } from "./patchright.js";
|
|
7
|
+
export { paths } from "./paths.js";
|
|
8
|
+
/** Absolute path of the `turno-browser-mcp` executable script of this install. */
|
|
9
|
+
export declare function mcpBinPath(): string;
|
|
10
|
+
/** The mcp.toml block that serves one identity through mcpd (one session at a time). */
|
|
11
|
+
export declare function manifestSnippet(id: string): string;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { assertIdentityId } from "./identities.js";
|
|
3
|
+
export { IdentityError, addIdentity, assertIdentityId, identityDir, identityExists, isInUse, isValidIdentityId, listIdentities, parseSingletonLock, removeIdentity, } from "./identities.js";
|
|
4
|
+
export { buildArgv, extractIdentity } from "./argv.js";
|
|
5
|
+
export { DETECTORS, ENGINES, defaultEngines, formatBenchTable, runBench, unavailableReason, } from "./bench.js";
|
|
6
|
+
export { CHALLENGE_MARKERS, detectChallenge, parseRebrowser, parseSannysoft } from "./detectors.js";
|
|
7
|
+
export { loginIdentity } from "./login.js";
|
|
8
|
+
export { mcpEntryPath } from "./patchright.js";
|
|
9
|
+
export { paths } from "./paths.js";
|
|
10
|
+
/** Absolute path of the `turno-browser-mcp` executable script of this install. */
|
|
11
|
+
export function mcpBinPath() {
|
|
12
|
+
return fileURLToPath(new URL("./bin/mcp.js", import.meta.url));
|
|
13
|
+
}
|
|
14
|
+
/** The mcp.toml block that serves one identity through mcpd (one session at a time). */
|
|
15
|
+
export function manifestSnippet(id) {
|
|
16
|
+
assertIdentityId(id);
|
|
17
|
+
return [
|
|
18
|
+
`[server.browser-${id}]`,
|
|
19
|
+
`command = "turno-browser-mcp"`,
|
|
20
|
+
`args = ["--identity", "${id}"]`,
|
|
21
|
+
`scope = "shared"`,
|
|
22
|
+
`exclusive = true`,
|
|
23
|
+
`lease = "10m"`,
|
|
24
|
+
`idle = "30m"`,
|
|
25
|
+
"",
|
|
26
|
+
].join("\n");
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
package/dist/login.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface LoginOptions {
|
|
2
|
+
env?: NodeJS.ProcessEnv;
|
|
3
|
+
/** Page to open first (default: a blank tab). */
|
|
4
|
+
url?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Opens the identity's persistent Chrome headed, with the same stealth settings as the MCP
|
|
8
|
+
* server (Chrome channel, no fixed viewport), and resolves when the user closes the last
|
|
9
|
+
* window or quits Chrome. Used once per site so the user signs in by hand.
|
|
10
|
+
*/
|
|
11
|
+
export declare function loginIdentity(id: string, options?: LoginOptions): Promise<void>;
|
package/dist/login.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { mkdirSync } from "node:fs";
|
|
2
|
+
import { IdentityError, identityDir, isInUse } from "./identities.js";
|
|
3
|
+
/**
|
|
4
|
+
* Opens the identity's persistent Chrome headed, with the same stealth settings as the MCP
|
|
5
|
+
* server (Chrome channel, no fixed viewport), and resolves when the user closes the last
|
|
6
|
+
* window or quits Chrome. Used once per site so the user signs in by hand.
|
|
7
|
+
*/
|
|
8
|
+
export async function loginIdentity(id, options = {}) {
|
|
9
|
+
const env = options.env ?? process.env;
|
|
10
|
+
const dir = identityDir(id, env);
|
|
11
|
+
if (isInUse(id, env))
|
|
12
|
+
throw new IdentityError(`identity "${id}" is in use (an MCP session holds its Chrome); close it first`);
|
|
13
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
14
|
+
const { chromium } = await import("patchright-core");
|
|
15
|
+
const ctx = await chromium.launchPersistentContext(dir, { channel: "chrome", headless: false, viewport: null });
|
|
16
|
+
const closed = new Promise((resolve) => ctx.on("close", () => resolve()));
|
|
17
|
+
// On macOS Chrome keeps running with no windows, so treat "last page closed" as done.
|
|
18
|
+
const watch = (page) => page.on("close", () => {
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
if (ctx.pages().length === 0)
|
|
21
|
+
void ctx.close().catch(() => undefined);
|
|
22
|
+
}, 250);
|
|
23
|
+
});
|
|
24
|
+
ctx.pages().forEach(watch);
|
|
25
|
+
ctx.on("page", watch);
|
|
26
|
+
const stop = () => void ctx.close().catch(() => undefined);
|
|
27
|
+
process.once("SIGINT", stop);
|
|
28
|
+
process.once("SIGTERM", stop);
|
|
29
|
+
try {
|
|
30
|
+
const page = ctx.pages()[0] ?? (await ctx.newPage());
|
|
31
|
+
if (options.url)
|
|
32
|
+
await page.goto(options.url).catch(() => undefined);
|
|
33
|
+
await closed;
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
process.off("SIGINT", stop);
|
|
37
|
+
process.off("SIGTERM", stop);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Install dir of patchright-core, resolved from this package. */
|
|
2
|
+
export declare function patchrightDir(): string;
|
|
3
|
+
/**
|
|
4
|
+
* The Playwright MCP program shipped inside patchright-core (ADR 0003). The subpath is not in
|
|
5
|
+
* the package `exports`, so it is resolved from the install dir.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mcpEntryPath(): string;
|
|
8
|
+
/** True when a package can be resolved from this package or the current folder. */
|
|
9
|
+
export declare function isResolvable(name: string): boolean;
|
|
10
|
+
export declare function resolveFrom(name: string): string | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
/** Install dir of patchright-core, resolved from this package. */
|
|
5
|
+
export function patchrightDir() {
|
|
6
|
+
return dirname(require.resolve("patchright-core/package.json"));
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The Playwright MCP program shipped inside patchright-core (ADR 0003). The subpath is not in
|
|
10
|
+
* the package `exports`, so it is resolved from the install dir.
|
|
11
|
+
*/
|
|
12
|
+
export function mcpEntryPath() {
|
|
13
|
+
return join(patchrightDir(), "lib", "entry", "mcp.js");
|
|
14
|
+
}
|
|
15
|
+
/** True when a package can be resolved from this package or the current folder. */
|
|
16
|
+
export function isResolvable(name) {
|
|
17
|
+
return resolveFrom(name) !== undefined;
|
|
18
|
+
}
|
|
19
|
+
export function resolveFrom(name) {
|
|
20
|
+
for (const base of [import.meta.url, join(process.cwd(), "noop.js")]) {
|
|
21
|
+
try {
|
|
22
|
+
return createRequire(base).resolve(name);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
// try the next base
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=patchright.js.map
|
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The subset of turno's paths this package needs, derived from HOME and the XDG variables
|
|
3
|
+
* exactly like `turno/src/core/paths.ts`. A local copy keeps this package free of a
|
|
4
|
+
* dependency cycle with the CLI. Call it each time: tests change HOME.
|
|
5
|
+
*/
|
|
6
|
+
export interface BrowserPaths {
|
|
7
|
+
home: string;
|
|
8
|
+
state: string;
|
|
9
|
+
data: string;
|
|
10
|
+
/** Root of the browser package data: <data>/browser. */
|
|
11
|
+
browserDir: string;
|
|
12
|
+
/** Persistent Chrome profiles, one per identity. */
|
|
13
|
+
identitiesDir: string;
|
|
14
|
+
/** Bench reports: <state>/bench. */
|
|
15
|
+
benchDir: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function paths(env?: NodeJS.ProcessEnv): BrowserPaths;
|
package/dist/paths.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
export function paths(env = process.env) {
|
|
4
|
+
const home = env.HOME || homedir();
|
|
5
|
+
const state = env.TURNO_STATE_DIR || join(env.XDG_STATE_HOME || join(home, ".local", "state"), "turno");
|
|
6
|
+
const data = env.TURNO_DATA_DIR || join(env.XDG_DATA_HOME || join(home, ".local", "share"), "turno");
|
|
7
|
+
const browserDir = join(data, "browser");
|
|
8
|
+
return {
|
|
9
|
+
home,
|
|
10
|
+
state,
|
|
11
|
+
data,
|
|
12
|
+
browserDir,
|
|
13
|
+
identitiesDir: join(browserDir, "identities"),
|
|
14
|
+
benchDir: join(state, "bench"),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=paths.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turno-browser",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Browser MCP server that drives your installed Chrome with a persistent profile per identity, built on patchright-core.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "William Frank Monroy Mamani (https://github.com/william-monroy)",
|
|
7
|
+
"homepage": "https://github.com/wimo-dev/turno#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/wimo-dev/turno.git",
|
|
11
|
+
"directory": "packages/browser"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/wimo-dev/turno/issues"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=22.11"
|
|
19
|
+
},
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"types": "dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"bin": {
|
|
30
|
+
"turno-browser-mcp": "dist/bin/mcp.js"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"!dist/**/*.map",
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"NOTICE",
|
|
37
|
+
"README.md",
|
|
38
|
+
"CHANGELOG.md"
|
|
39
|
+
],
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"patchright-core": "1.64.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@modelcontextprotocol/sdk": "1.32.2",
|
|
45
|
+
"@types/node": "^26.6.6",
|
|
46
|
+
"typescript": "^7.0.2",
|
|
47
|
+
"vitest": "^5.1.0"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"provenance": true
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"mcp",
|
|
55
|
+
"model-context-protocol",
|
|
56
|
+
"browser",
|
|
57
|
+
"chrome",
|
|
58
|
+
"playwright",
|
|
59
|
+
"patchright",
|
|
60
|
+
"ai-agents"
|
|
61
|
+
],
|
|
62
|
+
"mcpName": "io.github.wimo-dev/turno-browser",
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/bin/mcp.js",
|
|
65
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
66
|
+
"test": "vitest run"
|
|
67
|
+
}
|
|
6
68
|
}
|