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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.97.0"
".": "0.98.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 145
configured_endpoints: 147
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.98.0](https://github.com/kernel/kernel-node-sdk/compare/v0.97.0...v0.98.0) (2026-09-02)


### Features

* Accept browser session name on all /browsers/{id_or_name} sub-resource routes ([d1006ba](https://github.com/kernel/kernel-node-sdk/commit/d1006ba6723ae641097635a8d803db04b8f4e5bd))

## [0.97.0](https://github.com/kernel/kernel-node-sdk/compare/v0.96.0...v0.97.0) (2026-08-31)


Expand Down
106 changes: 62 additions & 44 deletions api.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onkernel/sdk",
"version": "0.97.0",
"version": "0.98.0",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
Expand Down
66 changes: 51 additions & 15 deletions src/resources/browsers/browsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ import {
TelemetryStreamParams,
TelemetryStreamResponse,
} from './telemetry';
import * as WebmcpAPI from './webmcp';
import {
InvocationFailure,
InvocationResult,
InvokeRequest,
Tool,
ToolAnnotations,
ToolFrame,
ToolSource,
ToolsResponse,
Webmcp,
WebmcpInvokeToolParams,
} from './webmcp';
import * as FsAPI from './fs/fs';
import {
FCreateDirectoryParams,
Expand Down Expand Up @@ -147,6 +160,7 @@ export class Browsers extends APIResource {
logs: LogsAPI.Logs = new LogsAPI.Logs(this._client);
computer: ComputerAPI.Computer = new ComputerAPI.Computer(this._client);
playwright: PlaywrightAPI.Playwright = new PlaywrightAPI.Playwright(this._client);
webmcp: WebmcpAPI.Webmcp = new WebmcpAPI.Webmcp(this._client);

/**
* Create a new browser session from within an action.
Expand Down Expand Up @@ -225,13 +239,14 @@ export class Browsers extends APIResource {
*
* @example
* ```ts
* const response = await client.browsers.curl('id', {
* url: 'url',
* });
* const response = await client.browsers.curl(
* 'htzv5orfit78e1m2biiifpbv',
* { url: 'url' },
* );
* ```
*/
curl(id: string, body: BrowserCurlParams, options?: RequestOptions): APIPromise<BrowserCurlResponse> {
return this._client.post(path`/browsers/${id}/curl`, { body, ...options });
curl(idOrName: string, body: BrowserCurlParams, options?: RequestOptions): APIPromise<BrowserCurlResponse> {
return this._client.post(path`/browsers/${idOrName}/curl`, { body, ...options });
}

/**
Expand Down Expand Up @@ -265,19 +280,26 @@ export class Browsers extends APIResource {
*
* @example
* ```ts
* await client.browsers.loadExtensions('id', {
* extensions: [
* {
* name: 'name',
* zip_file: fs.createReadStream('path/to/file'),
* },
* ],
* });
* await client.browsers.loadExtensions(
* 'htzv5orfit78e1m2biiifpbv',
* {
* extensions: [
* {
* name: 'name',
* zip_file: fs.createReadStream('path/to/file'),
* },
* ],
* },
* );
* ```
*/
loadExtensions(id: string, body: BrowserLoadExtensionsParams, options?: RequestOptions): APIPromise<void> {
loadExtensions(
idOrName: string,
body: BrowserLoadExtensionsParams,
options?: RequestOptions,
): APIPromise<void> {
return this._client.post(
path`/browsers/${id}/extensions`,
path`/browsers/${idOrName}/extensions`,
multipartFormRequestOptions(
{ body, ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) },
this._client,
Expand Down Expand Up @@ -1621,6 +1643,7 @@ Browsers.Process = Process;
Browsers.Logs = Logs;
Browsers.Computer = Computer;
Browsers.Playwright = Playwright;
Browsers.Webmcp = Webmcp;

export declare namespace Browsers {
export {
Expand Down Expand Up @@ -1775,4 +1798,17 @@ export declare namespace Browsers {
type PlaywrightExecuteResponse as PlaywrightExecuteResponse,
type PlaywrightExecuteParams as PlaywrightExecuteParams,
};

export {
Webmcp as Webmcp,
type InvocationFailure as InvocationFailure,
type InvocationResult as InvocationResult,
type InvokeRequest as InvokeRequest,
type Tool as Tool,
type ToolAnnotations as ToolAnnotations,
type ToolFrame as ToolFrame,
type ToolSource as ToolSource,
type ToolsResponse as ToolsResponse,
type WebmcpInvokeToolParams as WebmcpInvokeToolParams,
};
}
135 changes: 78 additions & 57 deletions src/resources/browsers/computer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ export class Computer extends APIResource {
*
* @example
* ```ts
* await client.browsers.computer.batch('id', {
* actions: [{ type: 'click_mouse' }],
* });
* await client.browsers.computer.batch(
* 'htzv5orfit78e1m2biiifpbv',
* { actions: [{ type: 'click_mouse' }] },
* );
* ```
*/
batch(id: string, body: ComputerBatchParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${id}/computer/batch`, {
batch(idOrName: string, body: ComputerBatchParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${idOrName}/computer/batch`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
Expand All @@ -36,18 +37,20 @@ export class Computer extends APIResource {
* @example
* ```ts
* const response =
* await client.browsers.computer.captureScreenshot('id');
* await client.browsers.computer.captureScreenshot(
* 'htzv5orfit78e1m2biiifpbv',
* );
*
* const content = await response.blob();
* console.log(content);
* ```
*/
captureScreenshot(
id: string,
idOrName: string,
body: ComputerCaptureScreenshotParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<Response> {
return this._client.post(path`/browsers/${id}/computer/screenshot`, {
return this._client.post(path`/browsers/${idOrName}/computer/screenshot`, {
body,
...options,
headers: buildHeaders([{ Accept: 'image/png' }, options?.headers]),
Expand All @@ -60,14 +63,14 @@ export class Computer extends APIResource {
*
* @example
* ```ts
* await client.browsers.computer.clickMouse('id', {
* x: 0,
* y: 0,
* });
* await client.browsers.computer.clickMouse(
* 'htzv5orfit78e1m2biiifpbv',
* { x: 0, y: 0 },
* );
* ```
*/
clickMouse(id: string, body: ComputerClickMouseParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${id}/computer/click_mouse`, {
clickMouse(idOrName: string, body: ComputerClickMouseParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${idOrName}/computer/click_mouse`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
Expand All @@ -79,16 +82,19 @@ export class Computer extends APIResource {
*
* @example
* ```ts
* await client.browsers.computer.dragMouse('id', {
* path: [
* [0, 0],
* [0, 0],
* ],
* });
* await client.browsers.computer.dragMouse(
* 'htzv5orfit78e1m2biiifpbv',
* {
* path: [
* [0, 0],
* [0, 0],
* ],
* },
* );
* ```
*/
dragMouse(id: string, body: ComputerDragMouseParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${id}/computer/drag_mouse`, {
dragMouse(idOrName: string, body: ComputerDragMouseParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${idOrName}/computer/drag_mouse`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
Expand All @@ -101,26 +107,28 @@ export class Computer extends APIResource {
* @example
* ```ts
* const response =
* await client.browsers.computer.getMousePosition('id');
* await client.browsers.computer.getMousePosition(
* 'htzv5orfit78e1m2biiifpbv',
* );
* ```
*/
getMousePosition(id: string, options?: RequestOptions): APIPromise<ComputerGetMousePositionResponse> {
return this._client.post(path`/browsers/${id}/computer/get_mouse_position`, options);
getMousePosition(idOrName: string, options?: RequestOptions): APIPromise<ComputerGetMousePositionResponse> {
return this._client.post(path`/browsers/${idOrName}/computer/get_mouse_position`, options);
}

/**
* Move the mouse cursor to the specified coordinates on the browser instance
*
* @example
* ```ts
* await client.browsers.computer.moveMouse('id', {
* x: 0,
* y: 0,
* });
* await client.browsers.computer.moveMouse(
* 'htzv5orfit78e1m2biiifpbv',
* { x: 0, y: 0 },
* );
* ```
*/
moveMouse(id: string, body: ComputerMoveMouseParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${id}/computer/move_mouse`, {
moveMouse(idOrName: string, body: ComputerMoveMouseParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${idOrName}/computer/move_mouse`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
Expand All @@ -132,13 +140,14 @@ export class Computer extends APIResource {
*
* @example
* ```ts
* await client.browsers.computer.pressKey('id', {
* keys: ['string'],
* });
* await client.browsers.computer.pressKey(
* 'htzv5orfit78e1m2biiifpbv',
* { keys: ['string'] },
* );
* ```
*/
pressKey(id: string, body: ComputerPressKeyParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${id}/computer/press_key`, {
pressKey(idOrName: string, body: ComputerPressKeyParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${idOrName}/computer/press_key`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
Expand All @@ -151,23 +160,28 @@ export class Computer extends APIResource {
* @example
* ```ts
* const response =
* await client.browsers.computer.readClipboard('id');
* await client.browsers.computer.readClipboard(
* 'htzv5orfit78e1m2biiifpbv',
* );
* ```
*/
readClipboard(id: string, options?: RequestOptions): APIPromise<ComputerReadClipboardResponse> {
return this._client.post(path`/browsers/${id}/computer/clipboard/read`, options);
readClipboard(idOrName: string, options?: RequestOptions): APIPromise<ComputerReadClipboardResponse> {
return this._client.post(path`/browsers/${idOrName}/computer/clipboard/read`, options);
}

/**
* Scroll the mouse wheel at a position on the host computer
*
* @example
* ```ts
* await client.browsers.computer.scroll('id', { x: 0, y: 0 });
* await client.browsers.computer.scroll(
* 'htzv5orfit78e1m2biiifpbv',
* { x: 0, y: 0 },
* );
* ```
*/
scroll(id: string, body: ComputerScrollParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${id}/computer/scroll`, {
scroll(idOrName: string, body: ComputerScrollParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${idOrName}/computer/scroll`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
Expand All @@ -180,31 +194,33 @@ export class Computer extends APIResource {
* @example
* ```ts
* const response =
* await client.browsers.computer.setCursorVisibility('id', {
* hidden: true,
* });
* await client.browsers.computer.setCursorVisibility(
* 'htzv5orfit78e1m2biiifpbv',
* { hidden: true },
* );
* ```
*/
setCursorVisibility(
id: string,
idOrName: string,
body: ComputerSetCursorVisibilityParams,
options?: RequestOptions,
): APIPromise<ComputerSetCursorVisibilityResponse> {
return this._client.post(path`/browsers/${id}/computer/cursor`, { body, ...options });
return this._client.post(path`/browsers/${idOrName}/computer/cursor`, { body, ...options });
}

/**
* Type text on the browser instance
*
* @example
* ```ts
* await client.browsers.computer.typeText('id', {
* text: 'text',
* });
* await client.browsers.computer.typeText(
* 'htzv5orfit78e1m2biiifpbv',
* { text: 'text' },
* );
* ```
*/
typeText(id: string, body: ComputerTypeTextParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${id}/computer/type`, {
typeText(idOrName: string, body: ComputerTypeTextParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${idOrName}/computer/type`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
Expand All @@ -216,13 +232,18 @@ export class Computer extends APIResource {
*
* @example
* ```ts
* await client.browsers.computer.writeClipboard('id', {
* text: 'text',
* });
* await client.browsers.computer.writeClipboard(
* 'htzv5orfit78e1m2biiifpbv',
* { text: 'text' },
* );
* ```
*/
writeClipboard(id: string, body: ComputerWriteClipboardParams, options?: RequestOptions): APIPromise<void> {
return this._client.post(path`/browsers/${id}/computer/clipboard/write`, {
writeClipboard(
idOrName: string,
body: ComputerWriteClipboardParams,
options?: RequestOptions,
): APIPromise<void> {
return this._client.post(path`/browsers/${idOrName}/computer/clipboard/write`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
Expand Down
Loading
Loading