@jackwener/browsermcp 0.0.37-embedded.1 → 0.0.37

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 (111) hide show
  1. package/CHANGELOG.md +2 -40
  2. package/README.md +0 -91
  3. package/dist/docs/api-reference.md +5 -5
  4. package/dist/docs/api-use.md +2 -2
  5. package/dist/docs/js-tool.md +11 -1
  6. package/dist/src/api/action-input.js +1 -1
  7. package/dist/src/api/action-input.js.map +1 -1
  8. package/dist/src/api/commands.js +3 -3
  9. package/dist/src/api/commands.js.map +1 -1
  10. package/dist/src/api/errors.js +46 -2
  11. package/dist/src/api/errors.js.map +1 -1
  12. package/dist/src/api/observation.js +5 -0
  13. package/dist/src/api/observation.js.map +1 -1
  14. package/dist/src/api/tab.js +28 -3
  15. package/dist/src/api/tab.js.map +1 -1
  16. package/dist/src/docs/manifest.js +3 -6
  17. package/dist/src/docs/manifest.js.map +1 -1
  18. package/dist/src/mcp/js-session.js +22 -3
  19. package/dist/src/mcp/js-session.js.map +1 -1
  20. package/dist/src/mcp/server.js +1 -1
  21. package/dist/src/mcp/server.js.map +1 -1
  22. package/dist/src/shared/aria-tree.js +29 -12
  23. package/dist/src/shared/aria-tree.js.map +1 -1
  24. package/docs/api-reference.md +5 -5
  25. package/docs/api-use.md +2 -2
  26. package/docs/js-tool.md +11 -1
  27. package/extension/dist/background.js +42 -1
  28. package/package.json +3 -12
  29. package/dist/src/api/action-input.d.ts +0 -62
  30. package/dist/src/api/agent.d.ts +0 -10
  31. package/dist/src/api/api.d.ts +0 -54
  32. package/dist/src/api/browser.d.ts +0 -93
  33. package/dist/src/api/commands.d.ts +0 -452
  34. package/dist/src/api/context.d.ts +0 -7
  35. package/dist/src/api/diff.d.ts +0 -8
  36. package/dist/src/api/errors.d.ts +0 -12
  37. package/dist/src/api/network.d.ts +0 -10
  38. package/dist/src/api/observation.d.ts +0 -4
  39. package/dist/src/api/streams.d.ts +0 -13
  40. package/dist/src/api/tab.d.ts +0 -312
  41. package/dist/src/api/webmcp.d.ts +0 -19
  42. package/dist/src/backends/backend.d.ts +0 -14
  43. package/dist/src/backends/browser-helpers.d.ts +0 -17
  44. package/dist/src/backends/extension-page.d.ts +0 -5
  45. package/dist/src/backends/managed-page.d.ts +0 -50
  46. package/dist/src/backends/page-transport.d.ts +0 -10
  47. package/dist/src/backends/page-types.d.ts +0 -82
  48. package/dist/src/docs/embedded.d.ts +0 -2
  49. package/dist/src/docs/embedded.js +0 -40
  50. package/dist/src/docs/embedded.js.map +0 -1
  51. package/dist/src/docs/manifest.d.ts +0 -23
  52. package/dist/src/docs/surface.d.ts +0 -12
  53. package/dist/src/electron/backend.d.ts +0 -50
  54. package/dist/src/electron/backend.js +0 -375
  55. package/dist/src/electron/backend.js.map +0 -1
  56. package/dist/src/electron/chrome.d.ts +0 -24
  57. package/dist/src/electron/chrome.js +0 -133
  58. package/dist/src/electron/chrome.js.map +0 -1
  59. package/dist/src/electron/driver.d.ts +0 -43
  60. package/dist/src/electron/driver.js +0 -241
  61. package/dist/src/electron/driver.js.map +0 -1
  62. package/dist/src/electron/event-buffer.d.ts +0 -16
  63. package/dist/src/electron/event-buffer.js +0 -59
  64. package/dist/src/electron/event-buffer.js.map +0 -1
  65. package/dist/src/electron/page.js +0 -834
  66. package/dist/src/electron/registry.d.ts +0 -104
  67. package/dist/src/electron/registry.js +0 -316
  68. package/dist/src/electron/registry.js.map +0 -1
  69. package/dist/src/electron/streams.d.ts +0 -16
  70. package/dist/src/electron/streams.js +0 -48
  71. package/dist/src/electron/streams.js.map +0 -1
  72. package/dist/src/embedded/index.d.ts +0 -39
  73. package/dist/src/embedded/index.js +0 -72
  74. package/dist/src/embedded/index.js.map +0 -1
  75. package/dist/src/host/bridge.d.ts +0 -50
  76. package/dist/src/host/doctor.d.ts +0 -34
  77. package/dist/src/host/extension.d.ts +0 -3
  78. package/dist/src/host/host.d.ts +0 -3
  79. package/dist/src/host/ipc.d.ts +0 -14
  80. package/dist/src/host/jsonc-config.d.ts +0 -1
  81. package/dist/src/host/launch.d.ts +0 -11
  82. package/dist/src/host/native-messaging.d.ts +0 -28
  83. package/dist/src/host/opencode.d.ts +0 -6
  84. package/dist/src/host/pi.d.ts +0 -6
  85. package/dist/src/host/registration.d.ts +0 -24
  86. package/dist/src/host/setup.d.ts +0 -7
  87. package/dist/src/host/socket.d.ts +0 -25
  88. package/dist/src/host/state.d.ts +0 -39
  89. package/dist/src/launcher/stdio.d.ts +0 -3
  90. package/dist/src/lib/paths.d.ts +0 -1
  91. package/dist/src/lib/sources.d.ts +0 -5
  92. package/dist/src/main.d.ts +0 -2
  93. package/dist/src/mcp/catalog.d.ts +0 -202
  94. package/dist/src/mcp/js-session.d.ts +0 -64
  95. package/dist/src/mcp/server.d.ts +0 -15
  96. package/dist/src/protocol.d.ts +0 -320
  97. package/dist/src/recon/analyzer.d.ts +0 -43
  98. package/dist/src/recon/discover.d.ts +0 -48
  99. package/dist/src/runtime/runtime.d.ts +0 -148
  100. package/dist/src/shared/api-contract.d.ts +0 -86
  101. package/dist/src/shared/aria-tree.d.ts +0 -2
  102. package/dist/src/shared/element-ref.d.ts +0 -4
  103. package/dist/src/shared/engine.d.ts +0 -50
  104. package/dist/src/shared/injected-source.d.ts +0 -2
  105. package/dist/src/shared/page-contract.d.ts +0 -256
  106. package/dist/src/sites/define.d.ts +0 -28
  107. package/dist/src/sites/drafts.d.ts +0 -39
  108. package/dist/src/sites/executor.d.ts +0 -34
  109. package/dist/src/sites/loader.d.ts +0 -84
  110. package/dist/src/sites/schema.d.ts +0 -11
  111. package/dist/src/version.d.ts +0 -2
@@ -1,50 +0,0 @@
1
- /**
2
- * ExtensionBridge — request/response + events over a NativeChannel.
3
- * One bridge per connected extension (Chrome profile). The runtime talks to
4
- * pages exclusively through `send(action, params)`.
5
- */
6
- import { EventEmitter } from 'node:events';
7
- import type { NativeChannel } from './native-messaging.js';
8
- import { type Action, type BrowserEvent, type BrowserFeature, type Command, type ExtToHost } from '../protocol.js';
9
- export declare class BrowserCommandError extends Error {
10
- readonly code: string;
11
- readonly hint?: string | undefined;
12
- readonly data?: unknown | undefined;
13
- constructor(message: string, code?: string, hint?: string | undefined, data?: unknown | undefined);
14
- }
15
- export interface BridgeEvents {
16
- hello: [Extract<ExtToHost, {
17
- type: 'hello';
18
- }>];
19
- event: [BrowserEvent];
20
- close: [];
21
- }
22
- export declare class ExtensionBridge extends EventEmitter<BridgeEvents> {
23
- private readonly channel;
24
- private readonly pending;
25
- extensionVersion: string | null;
26
- browserId: string | null;
27
- protocolRevision: number | null;
28
- extensionFeatures: BrowserFeature[];
29
- connected: boolean;
30
- get protocolMatches(): boolean;
31
- get protocolWarning(): string | null;
32
- /** Set by the host so the extension learns its running version (informational). */
33
- ready: {
34
- version: string;
35
- } | null;
36
- /** Push the ready frame now (used when hello arrived before the host finished starting). */
37
- sendReady(): void;
38
- constructor(channel: NativeChannel);
39
- private onMessage;
40
- private probePending;
41
- /** A fresh extension round trip; concurrent discovery and lifecycle checks share it. */
42
- probe(): Promise<boolean>;
43
- /** Send a command; resolves with `data`, throws BrowserCommandError on `ok:false`. */
44
- send(action: Action, params?: Omit<Command, 'id' | 'action'>, opts?: {
45
- timeoutMs?: number;
46
- }): Promise<{
47
- data: unknown;
48
- page?: string;
49
- }>;
50
- }
@@ -1,34 +0,0 @@
1
- import { type LaunchHealth } from './launch.js';
2
- import { type HostDiagnostic, type HostState } from './state.js';
3
- export interface DoctorResult {
4
- ok: boolean;
5
- node: string;
6
- launch: LaunchHealth;
7
- extension: {
8
- id: string;
9
- storeUrl: string;
10
- };
11
- manifests: Array<{
12
- browser: string;
13
- file: string;
14
- present: boolean;
15
- launcherExists: boolean;
16
- launcherMatches: boolean;
17
- authorized: boolean;
18
- }>;
19
- host: {
20
- registryDirectory: string;
21
- running: boolean;
22
- browserId?: string;
23
- endpoint?: string;
24
- instances: HostState[];
25
- probes: HostDiagnostic[];
26
- backend?: string;
27
- extensionConnected?: boolean;
28
- protocolWarning?: string | null;
29
- error?: string;
30
- };
31
- chromeRunning: boolean | null;
32
- advice: string[];
33
- }
34
- export declare function doctor(): Promise<DoctorResult>;
@@ -1,3 +0,0 @@
1
- /** Published extension identity, independent of bundled development assets. */
2
- export declare const EXTENSION_ID = "lnaoghmfcdnbhgcihkakfobckmfhllkg";
3
- export declare const EXTENSION_STORE_URL = "https://chromewebstore.google.com/detail/browsermcp-connector/lnaoghmfcdnbhgcihkakfobckmfhllkg";
@@ -1,3 +0,0 @@
1
- export declare function runNativeHost(opts: {
2
- version: string;
3
- }): Promise<void>;
@@ -1,14 +0,0 @@
1
- import type { Runtime } from '../runtime/runtime.js';
2
- export interface IpcServerHandle {
3
- endpoint: string;
4
- instanceId: string;
5
- startedAt: number;
6
- close(): Promise<void>;
7
- }
8
- export declare function startIpcServer(rt: Runtime, opts: {
9
- version: string;
10
- probe: () => Promise<{
11
- browserId: string;
12
- extensionResponsive: boolean;
13
- }>;
14
- }): Promise<IpcServerHandle>;
@@ -1 +0,0 @@
1
- export declare function setMcpEntry(file: string, section: string, name: string, entry: object): 'existing' | 'registered';
@@ -1,11 +0,0 @@
1
- export declare const LAUNCHER_PATH: string;
2
- export declare function writeLauncher(main: string): string;
3
- export type LaunchHealth = {
4
- ready: boolean;
5
- launcher: string;
6
- node?: string;
7
- entry?: string;
8
- errors: string[];
9
- };
10
- /** Inspect next-start dependencies even while a previous host process is still healthy. */
11
- export declare function inspectLaunch(): LaunchHealth;
@@ -1,28 +0,0 @@
1
- /**
2
- * Native Messaging framing over stdio: 4-byte little-endian length prefix + UTF-8 JSON.
3
- * Chrome spawns the host and owns stdin/stdout; everything we log goes to stderr.
4
- */
5
- import { EventEmitter } from 'node:events';
6
- import type { Readable, Writable } from 'node:stream';
7
- export declare function encodeFrame(message: unknown): Buffer;
8
- /** Incremental decoder: feed chunks, get complete messages. */
9
- export declare class FrameDecoder {
10
- private buf;
11
- onBadFrame: ((err: Error, preview: string) => void) | null;
12
- push(chunk: Buffer): unknown[];
13
- }
14
- export interface NativeChannelEvents {
15
- message: [unknown];
16
- close: [];
17
- error: [Error];
18
- }
19
- /** Bidirectional Native Messaging channel on a pair of streams (stdin/stdout by default). */
20
- export declare class NativeChannel extends EventEmitter<NativeChannelEvents> {
21
- private readonly output;
22
- private readonly decoder;
23
- private closed;
24
- constructor(input: Readable, output: Writable);
25
- send(message: unknown): void;
26
- get isClosed(): boolean;
27
- close(): void;
28
- }
@@ -1,6 +0,0 @@
1
- type StdioCommand = {
2
- command: string;
3
- args: string[];
4
- };
5
- export declare function registerOpenCode(command: StdioCommand, configHome?: string): 'existing' | 'registered';
6
- export {};
@@ -1,6 +0,0 @@
1
- type StdioCommand = {
2
- command: string;
3
- args: string[];
4
- };
5
- export declare function registerPi(command: StdioCommand, agentDir?: string): 'existing' | 'registered';
6
- export {};
@@ -1,24 +0,0 @@
1
- export declare function projectRoot(): string;
2
- export declare function extensionDir(): string;
3
- export declare function nativeHostDirs(): Array<{
4
- browser: string;
5
- dir: string;
6
- }>;
7
- /**
8
- * Profiles of Chromium browsers running right now with a custom --user-data-dir (Chrome for Testing, dev profiles,
9
- * test harnesses). Chrome resolves user-level Native Messaging hosts under that directory, so the manifest must be
10
- * written there too — the single most common reason initial setup "did nothing".
11
- */
12
- export declare function runningProfileDirs(): string[];
13
- export declare function registerHost(opts?: {
14
- browsers?: string[];
15
- userDataDirs?: string[];
16
- }): {
17
- launcher: string;
18
- manifests: Array<{
19
- browser: string;
20
- file: string;
21
- written: boolean;
22
- }>;
23
- };
24
- export declare function unregisterHost(): string[];
@@ -1,7 +0,0 @@
1
- export declare function setup(opts?: {
2
- waitMs?: number;
3
- noOpen?: boolean;
4
- browsers?: string[];
5
- userDataDirs?: string[];
6
- clients?: string[];
7
- }): Promise<boolean>;
@@ -1,25 +0,0 @@
1
- /** Standard MCP stream framing over local IPC, shared by both ends of the connection. */
2
- import net from 'node:net';
3
- import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
4
- export interface HostProbe {
5
- pid: number;
6
- browserId: string;
7
- instanceId: string;
8
- startedAt: number;
9
- version: string;
10
- extensionResponsive: boolean;
11
- }
12
- /** One bounded control message before the socket becomes an MCP transport. */
13
- export declare function readControl(socket: net.Socket, timeoutMs?: number): Promise<any>;
14
- export declare function probeSocket(transport: SocketTransport): Promise<HostProbe>;
15
- export declare function attachSocket(transport: SocketTransport): void;
16
- export declare class SocketTransport extends StdioServerTransport {
17
- readonly socket: net.Socket;
18
- private closing;
19
- constructor(socket: net.Socket);
20
- get closed(): boolean;
21
- close(): Promise<void>;
22
- }
23
- export declare function connectSocket(endpoint: string, timeoutMs?: number): Promise<SocketTransport>;
24
- /** Only remove our socket and its now-empty directory, never arbitrary directory contents. */
25
- export declare function removeIpcEndpoint(endpoint: string): void;
@@ -1,39 +0,0 @@
1
- import { Client } from '@modelcontextprotocol/client';
2
- import { type SocketTransport } from './socket.js';
3
- export declare const RUN_DIR: string;
4
- export declare const CONFIG_FILE: string;
5
- export interface HostState {
6
- pid: number;
7
- browserId: string;
8
- instanceId: string;
9
- endpoint: string;
10
- version: string;
11
- startedAt: number;
12
- }
13
- export interface Config {
14
- browserId?: string;
15
- cursor?: boolean;
16
- sites?: string[];
17
- sitesWrite?: string[];
18
- }
19
- export declare function readConfig(): Config;
20
- export declare function writeHostState(s: HostState): void;
21
- export declare function clearHostState(instanceId: string): void;
22
- export declare function readHostStates(): HostState[];
23
- export declare class HostConnectionError extends Error {
24
- readonly code: 'host_unavailable' | 'browser_selection_required';
25
- constructor(code: 'host_unavailable' | 'browser_selection_required', message: string);
26
- }
27
- export interface HostConnection {
28
- state: HostState;
29
- client: Client;
30
- transport: SocketTransport;
31
- }
32
- export interface HostDiagnostic {
33
- state: HostState;
34
- status: 'ready' | 'extension_unresponsive' | 'unreachable' | 'identity_mismatch' | 'attach_failed';
35
- error?: string;
36
- selected?: boolean;
37
- }
38
- /** Probe without creating sessions. Browser identity is separate from process incarnation. */
39
- export declare function connectHost(browserId?: string | undefined, states?: HostState[], diagnostics?: HostDiagnostic[]): Promise<HostConnection>;
@@ -1,3 +0,0 @@
1
- export declare function runStdio(opts: {
2
- version: string;
3
- }): Promise<void>;
@@ -1 +0,0 @@
1
- export declare const BROWSERMCP_DIR: string;
@@ -1,5 +0,0 @@
1
- import type { Source } from '../sites/loader.js';
2
- export declare const BUILTIN_ADAPTERS_DIR: string;
3
- export declare const USER_ADAPTERS_DIR: string;
4
- /** Ordered sources; a later one overrides an earlier one for the same `<site>/<command>`. */
5
- export declare function defaultSources(): Source[];
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,202 +0,0 @@
1
- export declare function localCatalog(version: string): Promise<{
2
- tools: {
3
- [x: string]: unknown;
4
- tools: {
5
- inputSchema: {
6
- [x: string]: unknown;
7
- type: "object";
8
- properties?: {
9
- [x: string]: string | number | boolean | {
10
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
11
- } | (string | number | boolean | {
12
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
13
- } | (string | number | boolean | {
14
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
15
- } | (string | number | boolean | {
16
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
17
- } | (string | number | boolean | {
18
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
19
- } | (string | number | boolean | {
20
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null;
21
- } | (string | number | boolean | {
22
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null;
23
- } | (string | number | boolean | {
24
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null;
25
- } | (string | number | boolean | {
26
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null;
27
- } | (string | number | boolean | {
28
- [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null;
29
- } | (string | number | boolean | {
30
- [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
31
- } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
32
- } | undefined;
33
- required?: string[] | undefined;
34
- };
35
- name: string;
36
- description?: string | undefined;
37
- outputSchema?: {
38
- [x: string]: unknown;
39
- $schema?: string | undefined;
40
- } | undefined;
41
- annotations?: {
42
- title?: string | undefined;
43
- readOnlyHint?: boolean | undefined;
44
- destructiveHint?: boolean | undefined;
45
- idempotentHint?: boolean | undefined;
46
- openWorldHint?: boolean | undefined;
47
- } | undefined;
48
- execution?: {
49
- taskSupport?: "optional" | "required" | "forbidden" | undefined;
50
- } | undefined;
51
- _meta?: {
52
- [x: string]: unknown;
53
- } | undefined;
54
- icons?: {
55
- src: string;
56
- mimeType?: string | undefined;
57
- sizes?: string[] | undefined;
58
- theme?: "light" | "dark" | undefined;
59
- }[] | undefined;
60
- title?: string | undefined;
61
- }[];
62
- _meta?: {
63
- [x: string]: unknown;
64
- "io.modelcontextprotocol/serverInfo"?: {
65
- version: string;
66
- name: string;
67
- websiteUrl?: string | undefined;
68
- description?: string | undefined;
69
- icons?: {
70
- src: string;
71
- mimeType?: string | undefined;
72
- sizes?: string[] | undefined;
73
- theme?: "light" | "dark" | undefined;
74
- }[] | undefined;
75
- title?: string | undefined;
76
- } | undefined;
77
- } | undefined;
78
- nextCursor?: string | undefined;
79
- };
80
- resources: {
81
- [x: string]: unknown;
82
- resources: {
83
- uri: string;
84
- name: string;
85
- description?: string | undefined;
86
- mimeType?: string | undefined;
87
- size?: number | undefined;
88
- annotations?: {
89
- audience?: ("user" | "assistant")[] | undefined;
90
- priority?: number | undefined;
91
- lastModified?: string | undefined;
92
- } | undefined;
93
- _meta?: {
94
- [x: string]: unknown;
95
- } | undefined;
96
- icons?: {
97
- src: string;
98
- mimeType?: string | undefined;
99
- sizes?: string[] | undefined;
100
- theme?: "light" | "dark" | undefined;
101
- }[] | undefined;
102
- title?: string | undefined;
103
- }[];
104
- _meta?: {
105
- [x: string]: unknown;
106
- "io.modelcontextprotocol/serverInfo"?: {
107
- version: string;
108
- name: string;
109
- websiteUrl?: string | undefined;
110
- description?: string | undefined;
111
- icons?: {
112
- src: string;
113
- mimeType?: string | undefined;
114
- sizes?: string[] | undefined;
115
- theme?: "light" | "dark" | undefined;
116
- }[] | undefined;
117
- title?: string | undefined;
118
- } | undefined;
119
- } | undefined;
120
- nextCursor?: string | undefined;
121
- };
122
- resourceTemplates: {
123
- [x: string]: unknown;
124
- resourceTemplates: {
125
- uriTemplate: string;
126
- name: string;
127
- description?: string | undefined;
128
- mimeType?: string | undefined;
129
- annotations?: {
130
- audience?: ("user" | "assistant")[] | undefined;
131
- priority?: number | undefined;
132
- lastModified?: string | undefined;
133
- } | undefined;
134
- _meta?: {
135
- [x: string]: unknown;
136
- } | undefined;
137
- icons?: {
138
- src: string;
139
- mimeType?: string | undefined;
140
- sizes?: string[] | undefined;
141
- theme?: "light" | "dark" | undefined;
142
- }[] | undefined;
143
- title?: string | undefined;
144
- }[];
145
- _meta?: {
146
- [x: string]: unknown;
147
- "io.modelcontextprotocol/serverInfo"?: {
148
- version: string;
149
- name: string;
150
- websiteUrl?: string | undefined;
151
- description?: string | undefined;
152
- icons?: {
153
- src: string;
154
- mimeType?: string | undefined;
155
- sizes?: string[] | undefined;
156
- theme?: "light" | "dark" | undefined;
157
- }[] | undefined;
158
- title?: string | undefined;
159
- } | undefined;
160
- } | undefined;
161
- nextCursor?: string | undefined;
162
- };
163
- prompts: {
164
- [x: string]: unknown;
165
- prompts: {
166
- name: string;
167
- description?: string | undefined;
168
- arguments?: {
169
- name: string;
170
- description?: string | undefined;
171
- required?: boolean | undefined;
172
- }[] | undefined;
173
- _meta?: {
174
- [x: string]: unknown;
175
- } | undefined;
176
- icons?: {
177
- src: string;
178
- mimeType?: string | undefined;
179
- sizes?: string[] | undefined;
180
- theme?: "light" | "dark" | undefined;
181
- }[] | undefined;
182
- title?: string | undefined;
183
- }[];
184
- _meta?: {
185
- [x: string]: unknown;
186
- "io.modelcontextprotocol/serverInfo"?: {
187
- version: string;
188
- name: string;
189
- websiteUrl?: string | undefined;
190
- description?: string | undefined;
191
- icons?: {
192
- src: string;
193
- mimeType?: string | undefined;
194
- sizes?: string[] | undefined;
195
- theme?: "light" | "dark" | undefined;
196
- }[] | undefined;
197
- title?: string | undefined;
198
- } | undefined;
199
- } | undefined;
200
- nextCursor?: string | undefined;
201
- };
202
- }>;
@@ -1,64 +0,0 @@
1
- export interface JsRunResult {
2
- value: unknown;
3
- writes: string[];
4
- images: Array<{
5
- mimeType: string;
6
- base64: string;
7
- }>;
8
- error?: {
9
- name: string;
10
- message: string;
11
- stack?: string;
12
- code?: string;
13
- hint?: string;
14
- data?: Record<string, unknown>;
15
- };
16
- }
17
- export interface JsImage {
18
- mimeType?: string;
19
- base64?: string;
20
- bytes?: Uint8Array | ArrayBuffer;
21
- }
22
- export declare class JsSession {
23
- private readonly globals;
24
- private readonly onReset?;
25
- private worker?;
26
- private active?;
27
- private tail;
28
- private generation;
29
- private disposed;
30
- private cleanup?;
31
- private cleanupError?;
32
- private references;
33
- private identities;
34
- private pendingCalls;
35
- private drainWaiters;
36
- runs: number;
37
- constructor(globals: Record<string, unknown>, onReset?: (() => Promise<void>) | undefined);
38
- status(): {
39
- state: 'idle' | 'running' | 'draining';
40
- generation: number;
41
- pendingCalls: number;
42
- cleanupError?: string;
43
- };
44
- reset(): {
45
- reset: true;
46
- pendingCalls: number;
47
- };
48
- dispose(): Promise<void>;
49
- run(code: string, opts?: {
50
- timeoutMs?: number;
51
- signal?: AbortSignal;
52
- }): Promise<JsRunResult>;
53
- private failure;
54
- private stop;
55
- private reference;
56
- private encode;
57
- private decode;
58
- private decodeCall;
59
- private appendWrite;
60
- private startWorker;
61
- private call;
62
- private execute;
63
- }
64
- export declare function safeStringify(v: unknown, limit?: number): string;
@@ -1,15 +0,0 @@
1
- /**
2
- * MCP server per session: REPL entry, dynamic site tools, diagnostics and cleanup,
3
- * resources (docs, sites) and prompts — all backed by the same object model.
4
- */
5
- import { McpServer } from '@modelcontextprotocol/server';
6
- import type { Runtime } from '../runtime/runtime.js';
7
- import { type AgentApi } from '../api/agent.js';
8
- export interface SessionServer {
9
- server: McpServer;
10
- api: AgentApi;
11
- close(): Promise<void>;
12
- }
13
- export declare function createMcpServer(rt: Runtime, sessionId: string, opts?: {
14
- version?: string;
15
- }): SessionServer;