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.
- package/CHANGELOG.md +122 -0
- package/README.md +95 -123
- package/dist/act-model.d.ts +85 -0
- package/dist/act-model.js +117 -0
- package/dist/act.d.ts +37 -0
- package/dist/act.js +600 -0
- package/dist/api.d.ts +90 -2
- package/dist/api.js +41 -4
- package/dist/argv.d.ts +16 -2
- package/dist/argv.js +100 -3
- package/dist/background-state.d.ts +54 -0
- package/dist/background-state.js +97 -0
- package/dist/background.d.ts +69 -0
- package/dist/background.js +458 -0
- package/dist/batch.d.ts +5 -0
- package/dist/batch.js +3 -3
- package/dist/bin/mcp.js +103 -6
- package/dist/captcha.d.ts +77 -0
- package/dist/captcha.js +334 -0
- package/dist/cdp-relay.d.ts +20 -0
- package/dist/cdp-relay.js +101 -0
- package/dist/chrome-features.d.ts +23 -0
- package/dist/chrome-features.js +44 -0
- package/dist/cli/background.d.ts +11 -0
- package/dist/cli/background.js +132 -0
- package/dist/cli/commands.d.ts +16 -0
- package/dist/cli/commands.js +515 -0
- package/dist/cli/context.d.ts +75 -0
- package/dist/cli/context.js +44 -0
- package/dist/cli/do-background.d.ts +27 -0
- package/dist/cli/do-background.js +212 -0
- package/dist/cli/do.d.ts +85 -0
- package/dist/cli/do.js +558 -0
- package/dist/cli/flows.d.ts +28 -0
- package/dist/cli/flows.js +303 -0
- package/dist/cli/identity.d.ts +37 -0
- package/dist/cli/identity.js +906 -0
- package/dist/cli/live.d.ts +7 -0
- package/dist/cli/live.js +99 -0
- package/dist/cli/main.d.ts +16 -0
- package/dist/cli/main.js +171 -0
- package/dist/cli/secret.d.ts +4 -0
- package/dist/cli/secret.js +151 -0
- package/dist/cli/session.d.ts +6 -0
- package/dist/cli/session.js +106 -0
- package/dist/cli/setup.d.ts +7 -0
- package/dist/cli/setup.js +180 -0
- package/dist/cli/vault.d.ts +5 -0
- package/dist/cli/vault.js +192 -0
- package/dist/client.d.ts +82 -0
- package/dist/client.js +303 -0
- package/dist/diagnose.d.ts +7 -0
- package/dist/diagnose.js +61 -6
- package/dist/doctor.d.ts +37 -3
- package/dist/doctor.js +264 -6
- package/dist/engine-attach.d.ts +27 -0
- package/dist/engine-attach.js +165 -0
- package/dist/engine-camoufox.d.ts +32 -0
- package/dist/engine-camoufox.js +271 -0
- package/dist/engine-lightpanda.d.ts +72 -0
- package/dist/engine-lightpanda.js +293 -0
- package/dist/engine.d.ts +63 -11
- package/dist/engine.js +106 -29
- package/dist/flows.d.ts +127 -0
- package/dist/flows.js +294 -0
- package/dist/governor.d.ts +42 -7
- package/dist/governor.js +82 -32
- package/dist/health.js +2 -1
- package/dist/host.d.ts +38 -2
- package/dist/host.js +689 -52
- package/dist/human-input.d.ts +84 -0
- package/dist/human-input.js +448 -0
- package/dist/humanize.d.ts +123 -0
- package/dist/humanize.js +241 -0
- package/dist/identities.js +4 -1
- package/dist/idle-timer.d.ts +12 -0
- package/dist/idle-timer.js +25 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.js +7 -1
- package/dist/lifecycle.d.ts +11 -1
- package/dist/lifecycle.js +11 -2
- package/dist/live-client.d.ts +22 -0
- package/dist/live-client.js +95 -0
- package/dist/live-page.d.ts +4 -0
- package/dist/live-page.js +144 -0
- package/dist/live-server.d.ts +173 -0
- package/dist/live-server.js +643 -0
- package/dist/live.d.ts +120 -0
- package/dist/live.js +204 -0
- package/dist/login-tool.d.ts +13 -0
- package/dist/login-tool.js +8 -3
- package/dist/login.d.ts +4 -1
- package/dist/login.js +12 -2
- package/dist/names.d.ts +28 -0
- package/dist/names.js +25 -0
- package/dist/network-chrome.d.ts +74 -0
- package/dist/network-chrome.js +178 -0
- package/dist/network.d.ts +125 -0
- package/dist/network.js +264 -0
- package/dist/opt-in-settings.d.ts +69 -0
- package/dist/opt-in-settings.js +152 -0
- package/dist/recorder.d.ts +88 -0
- package/dist/recorder.js +538 -0
- package/dist/recordings.d.ts +116 -0
- package/dist/recordings.js +474 -0
- package/dist/redact.d.ts +7 -0
- package/dist/redact.js +18 -0
- package/dist/replay.d.ts +20 -0
- package/dist/replay.js +383 -0
- package/dist/reputation.d.ts +24 -2
- package/dist/reputation.js +63 -17
- package/dist/runtime-lock.js +3 -2
- package/dist/session-export.js +1 -1
- package/dist/session.d.ts +10 -2
- package/dist/session.js +10 -2
- package/dist/settings.d.ts +104 -2
- package/dist/settings.js +204 -6
- package/dist/sharing.d.ts +96 -0
- package/dist/sharing.js +269 -0
- package/dist/snippet.d.ts +8 -2
- package/dist/snippet.js +10 -4
- package/dist/tab-locks.d.ts +63 -0
- package/dist/tab-locks.js +179 -0
- package/dist/tools.d.ts +38 -0
- package/dist/tools.js +20 -1
- package/dist/tuning.d.ts +14 -0
- package/dist/tuning.js +9 -0
- package/dist/upstream.d.ts +11 -0
- package/dist/vault.js +5 -4
- package/npm-shrinkwrap.json +6 -5
- package/package.json +13 -7
package/dist/host.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
2
|
import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
3
3
|
import type { SecretStore } from "turno-core/secrets";
|
|
4
|
-
import { type Engine, type IdentityRef } from "./engine.js";
|
|
5
|
-
import { type
|
|
4
|
+
import { type Engine, type EngineFlags, type IdentityRef } from "./engine.js";
|
|
5
|
+
import { type LiveFlags } from "./live.js";
|
|
6
|
+
import { LiveServer } from "./live-server.js";
|
|
7
|
+
import { type TabLockPolicy } from "./tab-locks.js";
|
|
8
|
+
import { type Providers, type TurnoTool } from "./tools.js";
|
|
6
9
|
import { type Tuning, type TuningFlags } from "./tuning.js";
|
|
7
10
|
import { type IdleTimerLike, type McpConfig, type ServerBackendFactory, type ToolResult, type ToolSchemaJson } from "./upstream.js";
|
|
8
11
|
/** The name and version the server reports in `initialize`. */
|
|
@@ -23,6 +26,14 @@ export interface HostOptions {
|
|
|
23
26
|
tuning?: TuningFlags;
|
|
24
27
|
/** The secret store the vault reads (tests inject a fake); default: this machine's. */
|
|
25
28
|
vaultStore?: SecretStore;
|
|
29
|
+
/** With `"sharing": "tabs"`: how long a call waits for a held tab, and when an idle session lets go. */
|
|
30
|
+
tabLocks?: Partial<TabLockPolicy>;
|
|
31
|
+
/** `--engine` and `--attach`; they win over identity.json. */
|
|
32
|
+
engineFlags?: EngineFlags;
|
|
33
|
+
/** Stand-ins for the opt-in providers (tests inject fakes). */
|
|
34
|
+
providers?: Providers;
|
|
35
|
+
/** `--live` and `--live-wait`; they win over identity.json `live`. */
|
|
36
|
+
live?: LiveFlags;
|
|
26
37
|
}
|
|
27
38
|
export interface Host {
|
|
28
39
|
config: McpConfig;
|
|
@@ -31,6 +42,8 @@ export interface Host {
|
|
|
31
42
|
factory: ServerBackendFactory;
|
|
32
43
|
/** Hides vault values in a text this server is about to send. */
|
|
33
44
|
redact(text: string): string;
|
|
45
|
+
/** The live view server, when the live view is on for the identity served. */
|
|
46
|
+
live?: LiveServer;
|
|
34
47
|
}
|
|
35
48
|
/** Upstream joins the text parts of a result into one (`mergeTextParts`). */
|
|
36
49
|
export declare function mergeTextParts(result: ToolResult): ToolResult;
|
|
@@ -68,6 +81,22 @@ export declare class CallIdleTimer implements IdleTimerLike {
|
|
|
68
81
|
export declare function configForSession(config: McpConfig, cliOptions: Record<string, unknown>, tuning: Tuning): McpConfig;
|
|
69
82
|
/** Builds the host for a resolved config: tool list, engine and session factory. */
|
|
70
83
|
export declare function createHost(options: HostOptions): Host;
|
|
84
|
+
/**
|
|
85
|
+
* One browser for many connections: the background server's host. Each connection gets its own
|
|
86
|
+
* MCP server, and every one of them calls the same session backend, so the connections share the
|
|
87
|
+
* identity's one Chrome the way mcpd's client sessions share one stdio server. The caller puts
|
|
88
|
+
* each connection's client session in the `_meta` of its calls (`SESSION_META_KEY`), which keys
|
|
89
|
+
* the tabs of `"sharing": "tabs"`, and ends it with `endSession`.
|
|
90
|
+
*/
|
|
91
|
+
export interface SharedHost {
|
|
92
|
+
/** Serves one connection on `transport`. Closing it leaves the browser open. */
|
|
93
|
+
connect(transport: Transport): Promise<Server>;
|
|
94
|
+
/** A client session ended: with `"sharing": "tabs"` its tabs are free at once. */
|
|
95
|
+
endSession(session: string): Promise<void>;
|
|
96
|
+
/** Closes the browser. */
|
|
97
|
+
dispose(): Promise<void>;
|
|
98
|
+
}
|
|
99
|
+
export declare function shareHost(host: Host): SharedHost;
|
|
71
100
|
/** Serves the host: stdio by turno, `--port` by upstream's HTTP server. */
|
|
72
101
|
export declare function serve(host: Host, transport?: Transport): Promise<Server | undefined>;
|
|
73
102
|
/**
|
|
@@ -77,4 +106,11 @@ export declare function serve(host: Host, transport?: Transport): Promise<Server
|
|
|
77
106
|
export declare function runHost(args: string[], options?: {
|
|
78
107
|
identity?: IdentityRef;
|
|
79
108
|
tuning?: TuningFlags;
|
|
109
|
+
engineFlags?: EngineFlags;
|
|
110
|
+
live?: LiveFlags;
|
|
111
|
+
/**
|
|
112
|
+
* Serves the host instead of stdio or `--port` (`--background`). Such a server has no client
|
|
113
|
+
* on stdin, so upstream's watchdog, which exits when stdin closes, is not installed.
|
|
114
|
+
*/
|
|
115
|
+
serve?: (host: Host) => Promise<void>;
|
|
80
116
|
}): Promise<void>;
|