turno-browser 0.3.0 → 0.5.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 (131) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/README.md +95 -123
  3. package/dist/act-model.d.ts +85 -0
  4. package/dist/act-model.js +117 -0
  5. package/dist/act.d.ts +37 -0
  6. package/dist/act.js +600 -0
  7. package/dist/api.d.ts +90 -2
  8. package/dist/api.js +41 -4
  9. package/dist/argv.d.ts +16 -2
  10. package/dist/argv.js +100 -3
  11. package/dist/background-state.d.ts +54 -0
  12. package/dist/background-state.js +97 -0
  13. package/dist/background.d.ts +69 -0
  14. package/dist/background.js +458 -0
  15. package/dist/batch.d.ts +5 -0
  16. package/dist/batch.js +3 -3
  17. package/dist/bin/mcp.js +103 -6
  18. package/dist/captcha.d.ts +77 -0
  19. package/dist/captcha.js +334 -0
  20. package/dist/cdp-relay.d.ts +20 -0
  21. package/dist/cdp-relay.js +101 -0
  22. package/dist/chrome-features.d.ts +23 -0
  23. package/dist/chrome-features.js +44 -0
  24. package/dist/cli/background.d.ts +11 -0
  25. package/dist/cli/background.js +132 -0
  26. package/dist/cli/commands.d.ts +16 -0
  27. package/dist/cli/commands.js +515 -0
  28. package/dist/cli/context.d.ts +75 -0
  29. package/dist/cli/context.js +44 -0
  30. package/dist/cli/do-background.d.ts +27 -0
  31. package/dist/cli/do-background.js +212 -0
  32. package/dist/cli/do.d.ts +85 -0
  33. package/dist/cli/do.js +558 -0
  34. package/dist/cli/flows.d.ts +28 -0
  35. package/dist/cli/flows.js +303 -0
  36. package/dist/cli/identity.d.ts +37 -0
  37. package/dist/cli/identity.js +906 -0
  38. package/dist/cli/live.d.ts +7 -0
  39. package/dist/cli/live.js +99 -0
  40. package/dist/cli/main.d.ts +16 -0
  41. package/dist/cli/main.js +171 -0
  42. package/dist/cli/secret.d.ts +4 -0
  43. package/dist/cli/secret.js +151 -0
  44. package/dist/cli/session.d.ts +6 -0
  45. package/dist/cli/session.js +106 -0
  46. package/dist/cli/setup.d.ts +7 -0
  47. package/dist/cli/setup.js +180 -0
  48. package/dist/cli/vault.d.ts +5 -0
  49. package/dist/cli/vault.js +192 -0
  50. package/dist/client.d.ts +82 -0
  51. package/dist/client.js +303 -0
  52. package/dist/diagnose.d.ts +7 -0
  53. package/dist/diagnose.js +61 -6
  54. package/dist/doctor.d.ts +37 -3
  55. package/dist/doctor.js +264 -6
  56. package/dist/engine-attach.d.ts +27 -0
  57. package/dist/engine-attach.js +165 -0
  58. package/dist/engine-camoufox.d.ts +32 -0
  59. package/dist/engine-camoufox.js +271 -0
  60. package/dist/engine-lightpanda.d.ts +72 -0
  61. package/dist/engine-lightpanda.js +293 -0
  62. package/dist/engine.d.ts +63 -11
  63. package/dist/engine.js +106 -29
  64. package/dist/flows.d.ts +127 -0
  65. package/dist/flows.js +294 -0
  66. package/dist/governor.d.ts +42 -7
  67. package/dist/governor.js +82 -32
  68. package/dist/health.js +2 -1
  69. package/dist/host.d.ts +38 -2
  70. package/dist/host.js +689 -52
  71. package/dist/human-input.d.ts +84 -0
  72. package/dist/human-input.js +448 -0
  73. package/dist/humanize.d.ts +123 -0
  74. package/dist/humanize.js +241 -0
  75. package/dist/identities.js +4 -1
  76. package/dist/idle-timer.d.ts +12 -0
  77. package/dist/idle-timer.js +25 -0
  78. package/dist/index.d.ts +13 -4
  79. package/dist/index.js +7 -1
  80. package/dist/lifecycle.d.ts +11 -1
  81. package/dist/lifecycle.js +11 -2
  82. package/dist/live-client.d.ts +22 -0
  83. package/dist/live-client.js +95 -0
  84. package/dist/live-page.d.ts +4 -0
  85. package/dist/live-page.js +144 -0
  86. package/dist/live-server.d.ts +173 -0
  87. package/dist/live-server.js +643 -0
  88. package/dist/live.d.ts +120 -0
  89. package/dist/live.js +204 -0
  90. package/dist/login-tool.d.ts +13 -0
  91. package/dist/login-tool.js +8 -3
  92. package/dist/login.d.ts +4 -1
  93. package/dist/login.js +12 -2
  94. package/dist/names.d.ts +28 -0
  95. package/dist/names.js +25 -0
  96. package/dist/network-chrome.d.ts +74 -0
  97. package/dist/network-chrome.js +178 -0
  98. package/dist/network.d.ts +125 -0
  99. package/dist/network.js +264 -0
  100. package/dist/opt-in-settings.d.ts +69 -0
  101. package/dist/opt-in-settings.js +152 -0
  102. package/dist/recorder.d.ts +88 -0
  103. package/dist/recorder.js +538 -0
  104. package/dist/recordings.d.ts +116 -0
  105. package/dist/recordings.js +474 -0
  106. package/dist/redact.d.ts +7 -0
  107. package/dist/redact.js +18 -0
  108. package/dist/replay.d.ts +20 -0
  109. package/dist/replay.js +383 -0
  110. package/dist/reputation.d.ts +24 -2
  111. package/dist/reputation.js +63 -17
  112. package/dist/runtime-lock.js +3 -2
  113. package/dist/session-export.js +1 -1
  114. package/dist/session.d.ts +10 -2
  115. package/dist/session.js +10 -2
  116. package/dist/settings.d.ts +104 -2
  117. package/dist/settings.js +204 -6
  118. package/dist/sharing.d.ts +96 -0
  119. package/dist/sharing.js +269 -0
  120. package/dist/snippet.d.ts +8 -2
  121. package/dist/snippet.js +10 -4
  122. package/dist/tab-locks.d.ts +63 -0
  123. package/dist/tab-locks.js +179 -0
  124. package/dist/tools.d.ts +38 -0
  125. package/dist/tools.js +20 -1
  126. package/dist/tuning.d.ts +14 -0
  127. package/dist/tuning.js +9 -0
  128. package/dist/upstream.d.ts +11 -0
  129. package/dist/vault.js +5 -4
  130. package/npm-shrinkwrap.json +6 -5
  131. package/package.json +13 -7
package/dist/tuning.js CHANGED
@@ -23,6 +23,15 @@ export function resolveTuning(settings, flags = {}) {
23
23
  backgroundThrottling: flags.backgroundThrottling ?? settings?.backgroundThrottling ?? false,
24
24
  ...(settle === undefined ? {} : { settleMs: settle }),
25
25
  resources: resourcePolicy(settings),
26
+ humanize: {
27
+ ...settings?.humanize,
28
+ level: flags.humanize ?? settings?.humanize?.level ?? "off",
29
+ },
30
+ sharing: flags.sharing ?? settings?.sharing ?? "session",
31
+ tabLocks: {
32
+ ...(settings?.tabLocks?.wait === undefined ? {} : { waitMs: ms(settings.tabLocks.wait) }),
33
+ ...(settings?.tabLocks?.release === undefined ? {} : { releaseMs: ms(settings.tabLocks.release) }),
34
+ },
26
35
  };
27
36
  }
28
37
  function resourcePolicy(settings) {
@@ -111,6 +111,15 @@ export interface UpstreamContext {
111
111
  tabs(): UpstreamTab[];
112
112
  /** The tab the stock tools act on. */
113
113
  currentTab(): UpstreamTab | undefined;
114
+ /**
115
+ * Builds the tab list (every page of the browser context, then each new one) on first use.
116
+ * `"sharing": "tabs"` calls it as soon as a session's view exists, so the view knows every tab.
117
+ */
118
+ ensureBrowserContext(): Promise<unknown>;
119
+ /** Opens a page and makes it the current tab (`browser_tabs` action `new`). */
120
+ newTab(): Promise<UpstreamTab>;
121
+ /** Points the stock tools at a tab without bringing it to the front (`"sharing": "tabs"`). */
122
+ _setCurrentTab(tab: UpstreamTab | undefined): void;
114
123
  }
115
124
  /**
116
125
  * The tabs of a `BrowserBackend`, for the tab governor: `initialize` builds the
@@ -185,6 +194,8 @@ interface CoreBundle {
185
194
  tools: UpstreamTools;
186
195
  utils: {
187
196
  gracefullyProcessExitDoNotHang(code: number): void;
197
+ /** What upstream's exit watchdog awaits before the process exits (stdin closed, SIGTERM). */
198
+ gracefullyCloseSet: Set<() => Promise<void>>;
188
199
  };
189
200
  }
190
201
  /** A zod schema of the bundled zod, as far as turno tools build one. */
package/dist/vault.js CHANGED
@@ -4,6 +4,7 @@ import { browserPaths, writePrivateFile } from "turno-core/paths";
4
4
  import { requireSecretStore } from "turno-core/secrets";
5
5
  import { IdentityError, assertIdentityId, identityDir } from "./ids.js";
6
6
  import { parseTotpSecret } from "./totp.js";
7
+ import { names } from "./names.js";
7
8
  /**
8
9
  * The credential vault of a browser identity: a username, a password and optionally
9
10
  * a TOTP secret per site, so `browser_login` can fill a sign-in form without the model ever
@@ -144,7 +145,7 @@ export async function vaultAdd(id, site, input, options = {}) {
144
145
  assertIdentityId(id);
145
146
  assertSiteKey(site);
146
147
  if (!existsDir(identityDir(id, env)))
147
- throw new VaultError(`identity "${id}" does not exist (turno browser add ${id})`);
148
+ throw new VaultError(`identity "${id}" does not exist (${names().browser} add ${id})`);
148
149
  if (!input.urls.length)
149
150
  throw new VaultError("give the sign-in page with --url (for example --url https://github.com/login)");
150
151
  const origins = [...new Set(input.urls.map(vaultOrigin))];
@@ -203,7 +204,7 @@ export function vaultSetSubmit(id, submit, options = {}) {
203
204
  if (submit !== "confirm" && submit !== "auto")
204
205
  throw new VaultError(`submit must be "confirm" or "auto"`);
205
206
  if (!existsDir(identityDir(id, env)))
206
- throw new VaultError(`identity "${id}" does not exist (turno browser add ${id})`);
207
+ throw new VaultError(`identity "${id}" does not exist (${names().browser} add ${id})`);
207
208
  const index = readIndex(id, env);
208
209
  index.submit = submit;
209
210
  writeIndex(id, index, env);
@@ -232,7 +233,7 @@ function isCredential(v) {
232
233
  export async function readCredential(id, site, options = {}) {
233
234
  const raw = await guarded(`reading ${site}`, () => storeOf(options).get(vaultItem(id, site)));
234
235
  if (raw === undefined)
235
- throw new VaultError(`the credentials of "${site}" are missing from the secret store; add them again with turno browser vault add ${id} ${site}`);
236
+ throw new VaultError(`the credentials of "${site}" are missing from the secret store; add them again with ${names().browser} vault add ${id} ${site}`);
236
237
  let v;
237
238
  try {
238
239
  v = JSON.parse(raw);
@@ -241,7 +242,7 @@ export async function readCredential(id, site, options = {}) {
241
242
  v = undefined;
242
243
  }
243
244
  if (!isCredential(v))
244
- throw new VaultError(`the secret store item of "${site}" is not a turno-browser credential; add it again with turno browser vault add ${id} ${site}`);
245
+ throw new VaultError(`the secret store item of "${site}" is not a turno-browser credential; add it again with ${names().browser} vault add ${id} ${site}`);
245
246
  return { username: v.username, password: v.password, ...(v.totp ? { totp: v.totp } : {}) };
246
247
  }
247
248
  /** True when the identity's vault lists any site (an unreadable index counts as yes). */
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "turno-browser",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "turno-browser",
9
- "version": "0.3.0",
9
+ "version": "0.5.0",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@modelcontextprotocol/sdk": "1.32.2",
13
13
  "patchright-core": "1.64.3",
14
- "turno-core": "0.1.0"
14
+ "turno-core": "0.2.0"
15
15
  },
16
16
  "bin": {
17
+ "turno-browser": "dist/cli/main.js",
17
18
  "turno-browser-mcp": "dist/bin/mcp.js"
18
19
  },
19
20
  "engines": {
@@ -1017,8 +1018,8 @@
1017
1018
  }
1018
1019
  },
1019
1020
  "node_modules/turno-core": {
1020
- "version": "0.1.0",
1021
- "resolved": "https://registry.npmjs.org/turno-core/-/turno-core-0.1.0.tgz",
1021
+ "version": "0.2.0",
1022
+ "resolved": "https://registry.npmjs.org/turno-core/-/turno-core-0.2.0.tgz",
1022
1023
  "license": "Apache-2.0",
1023
1024
  "engines": {
1024
1025
  "node": ">=22.11"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "turno-browser",
3
- "version": "0.3.0",
4
- "description": "Browser MCP server that drives your installed Chrome with a persistent profile per identity, built on patchright-core.",
3
+ "version": "0.5.0",
4
+ "description": "A browser your agents use with your accounts. It stays light on your machine, and the model never sees your passwords.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "William Frank Monroy Mamani (https://github.com/william-monroy)",
7
7
  "homepage": "https://turno.wimo.dev",
@@ -27,6 +27,7 @@
27
27
  "./package.json": "./package.json"
28
28
  },
29
29
  "bin": {
30
+ "turno-browser": "dist/cli/main.js",
30
31
  "turno-browser-mcp": "dist/bin/mcp.js"
31
32
  },
32
33
  "files": [
@@ -41,7 +42,7 @@
41
42
  "dependencies": {
42
43
  "@modelcontextprotocol/sdk": "1.32.2",
43
44
  "patchright-core": "1.64.3",
44
- "turno-core": "0.1.0"
45
+ "turno-core": "0.2.0"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@types/node": "^26.6.6",
@@ -55,15 +56,20 @@
55
56
  "keywords": [
56
57
  "mcp",
57
58
  "model-context-protocol",
59
+ "mcp-server",
58
60
  "browser",
59
61
  "chrome",
60
- "playwright",
61
- "patchright",
62
- "ai-agents"
62
+ "browser-automation",
63
+ "ai-agents",
64
+ "coding-agents",
65
+ "browser-identities",
66
+ "signed-in-sessions",
67
+ "credential-vault",
68
+ "playwright"
63
69
  ],
64
70
  "mcpName": "io.github.wimo-dev/turno-browser",
65
71
  "scripts": {
66
- "build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/bin/mcp.js",
72
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/bin/mcp.js dist/cli/main.js",
67
73
  "typecheck": "tsc -p tsconfig.json --noEmit",
68
74
  "test": "vitest run"
69
75
  }