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.25.0"
".": "0.26.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 89
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-8d66dbedea5b240936b338809f272568ca84a452fc13dbda835479f2ec068b41.yml
openapi_spec_hash: 7c499bfce2e996f1fff5e7791cea390e
config_hash: fcc2db3ed48ab4e8d1b588d31d394a23
configured_endpoints: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-4f5307643555b7917e8681b1966ae0b99f770cf59805e2f917ec7528edf11ba8.yml
openapi_spec_hash: 873a9aa3a88b6cec1ad94f848eeb1c45
config_hash: 20337f7888852c165d099faa7589c90a
18 changes: 11 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# Changelog

## 0.25.0 (2026-01-07)
## 0.26.0 (2026-01-16)

Full Changelog: [v0.24.0...v0.25.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.24.0...v0.25.0)
Full Changelog: [v0.24.0...v0.26.0](https://github.com/kernel/kernel-node-sdk/compare/v0.24.0...v0.26.0)

### Features

* **api:** add health check endpoint for proxies ([999dfe5](https://github.com/onkernel/kernel-node-sdk/commit/999dfe58dbdfae072207e03d83efea58eb914a32))
* **auth:** add auto_login credential flow ([3f4eb01](https://github.com/onkernel/kernel-node-sdk/commit/3f4eb01bb73f679828e195a74f41214d69c01453))
* Enhance AuthAgentInvocation with step and last activity tracking ([8380eb6](https://github.com/onkernel/kernel-node-sdk/commit/8380eb6cef2c8229bee4e263bcd0637f9fcb1480))
* add MFA options to agent authentication workflow ([3e2dd3f](https://github.com/kernel/kernel-node-sdk/commit/3e2dd3f657592d6a2e224f0c0238d58514a548f6))
* add WebSocket process attach and PTY support ([b18e46d](https://github.com/kernel/kernel-node-sdk/commit/b18e46d414be71e13a43cace1e4b60411908100d))
* **api:** add IP address logging for residential and custom proxies ([24e37bb](https://github.com/kernel/kernel-node-sdk/commit/24e37bb60de11625aa5a5a67ff4f224977cb8955))
* **api:** manual updates ([b9715f8](https://github.com/kernel/kernel-node-sdk/commit/b9715f89fbd10b6cf48e0d68168750c807f77004))
* **api:** update production repos ([d18f7de](https://github.com/kernel/kernel-node-sdk/commit/d18f7decf64aa26e70a1c018f5b434af502bd82b))
* Support hot swap proxy on a session ([ead291b](https://github.com/kernel/kernel-node-sdk/commit/ead291bff1089bfafe05da4d35a2405f3165f7a7))


### Chores

* break long lines in snippets into multiline ([c546f46](https://github.com/onkernel/kernel-node-sdk/commit/c546f46485ea1e853347db59c4abc5d8c9389b6c))
* **internal:** codegen related update ([00a9097](https://github.com/onkernel/kernel-node-sdk/commit/00a9097ee42022b917f90fa6dd33938a3f1a9866))
* **ci:** update org name from onkernel to kernel ([8197587](https://github.com/kernel/kernel-node-sdk/commit/81975879cc89feaf95334a5bd90ba752bd828453))
* **internal:** upgrade babel, qs, js-yaml ([b695aee](https://github.com/kernel/kernel-node-sdk/commit/b695aee782f55865f912f24fc67041718597c98a))
* sync repo ([3d1de59](https://github.com/kernel/kernel-node-sdk/commit/3d1de59c268cd3029370b762af25a7032a7e2699))

## 0.24.0 (2025-12-17)

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ If you’d like to use the repository from source, you can either install from g
To install via git:

```sh
$ npm install git+ssh://git@github.com:onkernel/kernel-node-sdk.git
$ npm install git+ssh://git@github.com:kernel/kernel-node-sdk.git
```

Alternatively, to link a local copy of the repo:

```sh
# Clone
$ git clone https://www.github.com/onkernel/kernel-node-sdk
$ git clone https://github.com/kernel/kernel-node-sdk
$ cd kernel-node-sdk

# With yarn
$ yarn link
$ cd ../my-package
$ yarn link @onkernel/sdk
$ yarn link @kernel/sdk

# With pnpm
$ pnpm link --global
$ cd ../my-package
$ pnpm link -—global @onkernel/sdk
$ pnpm link -—global @kernel/sdk
```

## Running tests
Expand Down Expand Up @@ -99,7 +99,7 @@ the changes aren't made through the automated pipeline, you may want to make rel

### Publish with a GitHub workflow

You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/onkernel/kernel-node-sdk/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
You can release to package managers by using [the `Publish NPM` GitHub action](https://github.com/kernel/kernel-node-sdk/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Kernel TypeScript API Library

[![NPM version](<https://img.shields.io/npm/v/@onkernel/sdk.svg?label=npm%20(stable)>)](https://npmjs.org/package/@onkernel/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@onkernel/sdk)
[![NPM version](<https://img.shields.io/npm/v/@kernel/sdk.svg?label=npm%20(stable)>)](https://npmjs.org/package/@kernel/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@kernel/sdk)

This library provides convenient access to the Kernel REST API from server-side TypeScript or JavaScript.

The REST API documentation can be found on [docs.onkernel.com](https://docs.onkernel.com). The full API of this library can be found in [api.md](api.md).
The REST API documentation can be found on [docs.onkernel.com](https://www.kernel.sh/docs/api-reference). The full API of this library can be found in [api.md](api.md).

It is generated with [Stainless](https://www.stainless.com/).

## Installation

```sh
npm install @onkernel/sdk
npm install @kernel/sdk
```

## Usage
Expand All @@ -20,7 +20,7 @@ The full API of this library can be found in [api.md](api.md).

<!-- prettier-ignore -->
```js
import Kernel from '@onkernel/sdk';
import Kernel from '@kernel/sdk';

const client = new Kernel({
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
Expand All @@ -38,7 +38,7 @@ This library includes TypeScript definitions for all request params and response

<!-- prettier-ignore -->
```ts
import Kernel from '@onkernel/sdk';
import Kernel from '@kernel/sdk';

const client = new Kernel({
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
Expand All @@ -62,7 +62,7 @@ Request parameters that correspond to file uploads can be passed in many differe

```ts
import fs from 'fs';
import Kernel, { toFile } from '@onkernel/sdk';
import Kernel, { toFile } from '@kernel/sdk';

const client = new Kernel();

Expand Down Expand Up @@ -227,7 +227,7 @@ The log level can be configured in two ways:
2. Using the `logLevel` client option (overrides the environment variable if set)

```ts
import Kernel from '@onkernel/sdk';
import Kernel from '@kernel/sdk';

const client = new Kernel({
logLevel: 'debug', // Show all log messages
Expand Down Expand Up @@ -255,7 +255,7 @@ When providing a custom logger, the `logLevel` option still controls which messa
below the configured level will not be sent to your logger.

```ts
import Kernel from '@onkernel/sdk';
import Kernel from '@kernel/sdk';
import pino from 'pino';

const logger = pino();
Expand Down Expand Up @@ -324,7 +324,7 @@ globalThis.fetch = fetch;
Or pass it to the client:

```ts
import Kernel from '@onkernel/sdk';
import Kernel from '@kernel/sdk';
import fetch from 'my-fetch';

const client = new Kernel({ fetch });
Expand All @@ -335,7 +335,7 @@ const client = new Kernel({ fetch });
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)

```ts
import Kernel from '@onkernel/sdk';
import Kernel from '@kernel/sdk';

const client = new Kernel({
fetchOptions: {
Expand All @@ -352,7 +352,7 @@ options to requests:
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>

```ts
import Kernel from '@onkernel/sdk';
import Kernel from '@kernel/sdk';
import * as undici from 'undici';

const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
Expand All @@ -366,7 +366,7 @@ const client = new Kernel({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>

```ts
import Kernel from '@onkernel/sdk';
import Kernel from '@kernel/sdk';

const client = new Kernel({
fetchOptions: {
Expand All @@ -378,7 +378,7 @@ const client = new Kernel({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>

```ts
import Kernel from 'npm:@onkernel/sdk';
import Kernel from 'npm:@kernel/sdk';

const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
const client = new Kernel({
Expand All @@ -400,7 +400,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/onkernel/kernel-node-sdk/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://github.com/kernel/kernel-node-sdk/issues) with questions, bugs, or suggestions.

## Requirements

Expand Down
4 changes: 4 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ Types:
- <code><a href="./src/resources/browsers/browsers.ts">Profile</a></code>
- <code><a href="./src/resources/browsers/browsers.ts">BrowserCreateResponse</a></code>
- <code><a href="./src/resources/browsers/browsers.ts">BrowserRetrieveResponse</a></code>
- <code><a href="./src/resources/browsers/browsers.ts">BrowserUpdateResponse</a></code>
- <code><a href="./src/resources/browsers/browsers.ts">BrowserListResponse</a></code>

Methods:

- <code title="post /browsers">client.browsers.<a href="./src/resources/browsers/browsers.ts">create</a>({ ...params }) -> BrowserCreateResponse</code>
- <code title="get /browsers/{id}">client.browsers.<a href="./src/resources/browsers/browsers.ts">retrieve</a>(id) -> BrowserRetrieveResponse</code>
- <code title="patch /browsers/{id}">client.browsers.<a href="./src/resources/browsers/browsers.ts">update</a>(id, { ...params }) -> BrowserUpdateResponse</code>
- <code title="get /browsers">client.browsers.<a href="./src/resources/browsers/browsers.ts">list</a>({ ...params }) -> BrowserListResponsesOffsetPagination</code>
- <code title="delete /browsers">client.browsers.<a href="./src/resources/browsers/browsers.ts">delete</a>({ ...params }) -> void</code>
- <code title="delete /browsers/{id}">client.browsers.<a href="./src/resources/browsers/browsers.ts">deleteByID</a>(id) -> void</code>
Expand Down Expand Up @@ -133,6 +135,7 @@ Types:

- <code><a href="./src/resources/browsers/process.ts">ProcessExecResponse</a></code>
- <code><a href="./src/resources/browsers/process.ts">ProcessKillResponse</a></code>
- <code><a href="./src/resources/browsers/process.ts">ProcessResizeResponse</a></code>
- <code><a href="./src/resources/browsers/process.ts">ProcessSpawnResponse</a></code>
- <code><a href="./src/resources/browsers/process.ts">ProcessStatusResponse</a></code>
- <code><a href="./src/resources/browsers/process.ts">ProcessStdinResponse</a></code>
Expand All @@ -142,6 +145,7 @@ Methods:

- <code title="post /browsers/{id}/process/exec">client.browsers.process.<a href="./src/resources/browsers/process.ts">exec</a>(id, { ...params }) -> ProcessExecResponse</code>
- <code title="post /browsers/{id}/process/{process_id}/kill">client.browsers.process.<a href="./src/resources/browsers/process.ts">kill</a>(processID, { ...params }) -> ProcessKillResponse</code>
- <code title="post /browsers/{id}/process/{process_id}/resize">client.browsers.process.<a href="./src/resources/browsers/process.ts">resize</a>(processID, { ...params }) -> ProcessResizeResponse</code>
- <code title="post /browsers/{id}/process/spawn">client.browsers.process.<a href="./src/resources/browsers/process.ts">spawn</a>(id, { ...params }) -> ProcessSpawnResponse</code>
- <code title="get /browsers/{id}/process/{process_id}/status">client.browsers.process.<a href="./src/resources/browsers/process.ts">status</a>(processID, { ...params }) -> ProcessStatusResponse</code>
- <code title="post /browsers/{id}/process/{process_id}/stdin">client.browsers.process.<a href="./src/resources/browsers/process.ts">stdin</a>(processID, { ...params }) -> ProcessStdinResponse</code>
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default tseslint.config(
{
patterns: [
{
regex: '^@onkernel/sdk(/.*)?',
regex: '^@kernel/sdk(/.*)?',
message: 'Use a relative import, not a package import.',
},
],
Expand Down
4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const config: JestConfigWithTsJest = {
'^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }],
},
moduleNameMapper: {
'^@onkernel/sdk$': '<rootDir>/src/index.ts',
'^@onkernel/sdk/(.*)$': '<rootDir>/src/$1',
'^@kernel/sdk$': '<rootDir>/src/index.ts',
'^@kernel/sdk/(.*)$': '<rootDir>/src/$1',
},
modulePathIgnorePatterns: [
'<rootDir>/ecosystem-tests/',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@onkernel/sdk",
"version": "0.25.0",
"name": "@kernel/sdk",
"version": "0.26.0",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
"repository": "github:onkernel/kernel-node-sdk",
"repository": "github:kernel/kernel-node-sdk",
"license": "Apache-2.0",
"packageManager": "yarn@1.22.22",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ node scripts/utils/check-version.cjs

# Build into dist and will publish the package from there,
# so that src/resources/foo.ts becomes <package root>/resources/foo.js
# This way importing from `"@onkernel/sdk/resources/foo"` works
# This way importing from `"@kernel/sdk/resources/foo"` works
# even with `"moduleResolution": "node"`

rm -rf dist; mkdir dist
Expand Down Expand Up @@ -42,8 +42,8 @@ node scripts/utils/postprocess-files.cjs

# make sure that nothing crashes when we require the output CJS or
# import the output ESM
(cd dist && node -e 'require("@onkernel/sdk")')
(cd dist && node -e 'import("@onkernel/sdk")' --input-type=module)
(cd dist && node -e 'require("@kernel/sdk")')
(cd dist && node -e 'import("@kernel/sdk")' --input-type=module)

if [ -e ./scripts/build-deno ]
then
Expand Down
4 changes: 4 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ import {
BrowserLoadExtensionsParams,
BrowserPersistence,
BrowserRetrieveResponse,
BrowserUpdateParams,
BrowserUpdateResponse,
Browsers,
Profile,
} from './resources/browsers/browsers';
Expand Down Expand Up @@ -933,9 +935,11 @@ export declare namespace Kernel {
type Profile as Profile,
type BrowserCreateResponse as BrowserCreateResponse,
type BrowserRetrieveResponse as BrowserRetrieveResponse,
type BrowserUpdateResponse as BrowserUpdateResponse,
type BrowserListResponse as BrowserListResponse,
type BrowserListResponsesOffsetPagination as BrowserListResponsesOffsetPagination,
type BrowserCreateParams as BrowserCreateParams,
type BrowserUpdateParams as BrowserUpdateParams,
type BrowserListParams as BrowserListParams,
type BrowserDeleteParams as BrowserDeleteParams,
type BrowserLoadExtensionsParams as BrowserLoadExtensionsParams,
Expand Down
31 changes: 31 additions & 0 deletions src/resources/agents/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ export interface AgentAuthInvocationResponse {
*/
live_view_url?: string | null;

/**
* MFA method options to choose from (present when step=awaiting_input and MFA
* selection is required)
*/
mfa_options?: Array<AgentAuthInvocationResponse.MfaOption> | null;

/**
* Fields currently awaiting input (present when step=awaiting_input)
*/
Expand All @@ -167,6 +173,31 @@ export interface AgentAuthInvocationResponse {
}

export namespace AgentAuthInvocationResponse {
/**
* An MFA method option for verification
*/
export interface MfaOption {
/**
* The visible option text
*/
label: string;

/**
* The MFA delivery method type
*/
type: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'security_key';

/**
* Additional instructions from the site
*/
description?: string | null;

/**
* The masked destination (phone/email) if shown
*/
target?: string | null;
}

/**
* An SSO button for signing in with an external identity provider
*/
Expand Down
12 changes: 11 additions & 1 deletion src/resources/agents/auth/invocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export interface InvocationExchangeParams {
code: string;
}

export type InvocationSubmitParams = InvocationSubmitParams.Variant0 | InvocationSubmitParams.Variant1;
export type InvocationSubmitParams =
| InvocationSubmitParams.Variant0
| InvocationSubmitParams.Variant1
| InvocationSubmitParams.Variant2;

export declare namespace InvocationSubmitParams {
export interface Variant0 {
Expand All @@ -144,6 +147,13 @@ export declare namespace InvocationSubmitParams {
*/
sso_button: string;
}

export interface Variant2 {
/**
* The MFA delivery method type
*/
selected_mfa_type: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'security_key';
}
}

export declare namespace Invocations {
Expand Down
Loading