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.22.0"
".": "0.23.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: 74
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-003e9afa15f0765009d2c7d34e8eb62268d818e628e3c84361b21138e30cc423.yml
openapi_spec_hash: c1b8309f60385bf2b02d245363ca47c1
config_hash: a4124701ae0a474e580d7416adbcfb00
configured_endpoints: 82
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-dac11bdb857e700a8c39d183e753ddd1ebaaca69fd9fc5ee57d6b56b70b00e6e.yml
openapi_spec_hash: 78fbc50dd0b61cdc87564fbea278ee23
config_hash: a4b4d14bdf6af723b235a6981977627c
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.23.0 (2025-12-11)

Full Changelog: [v0.22.0...v0.23.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.22.0...v0.23.0)

### Features

* [wip] Browser pools polish pass ([7c8a464](https://github.com/onkernel/kernel-node-sdk/commit/7c8a4641cb87a76a3248e2d1df713df929957262))
* enhance agent authentication API with new endpoints and request… ([0ef28fd](https://github.com/onkernel/kernel-node-sdk/commit/0ef28fddbf7c7d03b24a56d4157d1eb3966c0a7f))
* Enhance agent authentication with optional login page URL and auth ch… ([7ea4b07](https://github.com/onkernel/kernel-node-sdk/commit/7ea4b076cc5255f76945ae370a8f686349a28a30))
* Enhance AuthAgent model with last_auth_check_at field ([29d43d1](https://github.com/onkernel/kernel-node-sdk/commit/29d43d10a026f25cf1a1de2579c06f90ca246054))


### Bug Fixes

* **mcp:** correct code tool API endpoint ([4f60927](https://github.com/onkernel/kernel-node-sdk/commit/4f6092702503c6dafb0d310c8123bf8dccce60e1))
* **mcp:** return correct lines on typescript errors ([8ccaae1](https://github.com/onkernel/kernel-node-sdk/commit/8ccaae1b63ee9ca371c4f32033486e6e9ba1c351))


### Chores

* **internal:** codegen related update ([3ffeaa7](https://github.com/onkernel/kernel-node-sdk/commit/3ffeaa72b3cb5c7cd5baea0ddeaf5fad60979235))
* **internal:** codegen related update ([c9461e7](https://github.com/onkernel/kernel-node-sdk/commit/c9461e7e02592559c3592f8916bf1351d32cce9a))


### Refactors

* **browser:** remove persistence option UI ([f3fdc89](https://github.com/onkernel/kernel-node-sdk/commit/f3fdc89088feeb32983da39700e47e922f767126))

## 0.22.0 (2025-12-05)

Full Changelog: [v0.21.0...v0.22.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.21.0...v0.22.0)
Expand Down
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const client = new Kernel({
environment: 'development', // defaults to 'production'
});

const browser = await client.browsers.create({ persistence: { id: 'browser-for-user-1234' } });
const browser = await client.browsers.create({ stealth: true });

console.log(browser.session_id);
```
Expand All @@ -45,7 +45,7 @@ const client = new Kernel({
environment: 'development', // defaults to 'production'
});

const params: Kernel.BrowserCreateParams = { persistence: { id: 'browser-for-user-1234' } };
const params: Kernel.BrowserCreateParams = { stealth: true };
const browser: Kernel.BrowserCreateResponse = await client.browsers.create(params);
```

Expand Down Expand Up @@ -88,17 +88,15 @@ a subclass of `APIError` will be thrown:

<!-- prettier-ignore -->
```ts
const browser = await client.browsers
.create({ persistence: { id: 'browser-for-user-1234' } })
.catch(async (err) => {
if (err instanceof Kernel.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
const browser = await client.browsers.create({ stealth: true }).catch(async (err) => {
if (err instanceof Kernel.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
```

Error codes are as follows:
Expand Down Expand Up @@ -130,7 +128,7 @@ const client = new Kernel({
});

// Or, configure per-request:
await client.browsers.create({ persistence: { id: 'browser-for-user-1234' } }, {
await client.browsers.create({ stealth: true }, {
maxRetries: 5,
});
```
Expand All @@ -147,7 +145,7 @@ const client = new Kernel({
});

// Override per-request:
await client.browsers.create({ persistence: { id: 'browser-for-user-1234' } }, {
await client.browsers.create({ stealth: true }, {
timeout: 5 * 1000,
});
```
Expand Down Expand Up @@ -201,13 +199,11 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
```ts
const client = new Kernel();

const response = await client.browsers.create({ persistence: { id: 'browser-for-user-1234' } }).asResponse();
const response = await client.browsers.create({ stealth: true }).asResponse();
console.log(response.headers.get('X-My-Header'));
console.log(response.statusText); // access the underlying Response object

const { data: browser, response: raw } = await client.browsers
.create({ persistence: { id: 'browser-for-user-1234' } })
.withResponse();
const { data: browser, response: raw } = await client.browsers.create({ stealth: true }).withResponse();
console.log(raw.headers.get('X-My-Header'));
console.log(browser.session_id);
```
Expand Down
35 changes: 35 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,38 @@ Methods:
- <code title="post /browser_pools/{id_or_name}/acquire">client.browserPools.<a href="./src/resources/browser-pools.ts">acquire</a>(idOrName, { ...params }) -> BrowserPoolAcquireResponse</code>
- <code title="post /browser_pools/{id_or_name}/flush">client.browserPools.<a href="./src/resources/browser-pools.ts">flush</a>(idOrName) -> void</code>
- <code title="post /browser_pools/{id_or_name}/release">client.browserPools.<a href="./src/resources/browser-pools.ts">release</a>(idOrName, { ...params }) -> void</code>

# Agents

## Auth

Types:

- <code><a href="./src/resources/agents/auth/auth.ts">AgentAuthDiscoverResponse</a></code>
- <code><a href="./src/resources/agents/auth/auth.ts">AgentAuthInvocationResponse</a></code>
- <code><a href="./src/resources/agents/auth/auth.ts">AgentAuthSubmitResponse</a></code>
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgent</a></code>
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgentCreateRequest</a></code>
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgentInvocationCreateRequest</a></code>
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgentInvocationCreateResponse</a></code>
- <code><a href="./src/resources/agents/auth/auth.ts">DiscoveredField</a></code>

Methods:

- <code title="post /agents/auth">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">create</a>({ ...params }) -> AuthAgent</code>
- <code title="get /agents/auth/{id}">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">retrieve</a>(id) -> AuthAgent</code>
- <code title="get /agents/auth">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">list</a>({ ...params }) -> AuthAgentsOffsetPagination</code>

### Invocations

Types:

- <code><a href="./src/resources/agents/auth/invocations.ts">InvocationExchangeResponse</a></code>

Methods:

- <code title="post /agents/auth/invocations">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">create</a>({ ...params }) -> AuthAgentInvocationCreateResponse</code>
- <code title="get /agents/auth/invocations/{invocation_id}">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">retrieve</a>(invocationID) -> AgentAuthInvocationResponse</code>
- <code title="post /agents/auth/invocations/{invocation_id}/discover">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">discover</a>(invocationID, { ...params }) -> AgentAuthDiscoverResponse</code>
- <code title="post /agents/auth/invocations/{invocation_id}/exchange">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">exchange</a>(invocationID, { ...params }) -> InvocationExchangeResponse</code>
- <code title="post /agents/auth/invocations/{invocation_id}/submit">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">submit</a>(invocationID, { ...params }) -> AgentAuthSubmitResponse</code>
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.22.0",
"version": "0.23.0",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import {
ProxyListResponse,
ProxyRetrieveResponse,
} from './resources/proxies';
import { Agents } from './resources/agents/agents';
import {
BrowserCreateParams,
BrowserCreateResponse,
Expand Down Expand Up @@ -859,6 +860,7 @@ export class Kernel {
proxies: API.Proxies = new API.Proxies(this);
extensions: API.Extensions = new API.Extensions(this);
browserPools: API.BrowserPools = new API.BrowserPools(this);
agents: API.Agents = new API.Agents(this);
}

Kernel.Deployments = Deployments;
Expand All @@ -869,6 +871,7 @@ Kernel.Profiles = Profiles;
Kernel.Proxies = Proxies;
Kernel.Extensions = Extensions;
Kernel.BrowserPools = BrowserPools;
Kernel.Agents = Agents;

export declare namespace Kernel {
export type RequestOptions = Opts.RequestOptions;
Expand Down Expand Up @@ -966,6 +969,8 @@ export declare namespace Kernel {
type BrowserPoolReleaseParams as BrowserPoolReleaseParams,
};

export { Agents as Agents };

export type AppAction = API.AppAction;
export type BrowserExtension = API.BrowserExtension;
export type BrowserProfile = API.BrowserProfile;
Expand Down
3 changes: 3 additions & 0 deletions src/resources/agents.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export * from './agents/index';
41 changes: 41 additions & 0 deletions src/resources/agents/agents.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../core/resource';
import * as AuthAPI from './auth/auth';
import {
AgentAuthDiscoverResponse,
AgentAuthInvocationResponse,
AgentAuthSubmitResponse,
Auth,
AuthAgent,
AuthAgentCreateRequest,
AuthAgentInvocationCreateRequest,
AuthAgentInvocationCreateResponse,
AuthAgentsOffsetPagination,
AuthCreateParams,
AuthListParams,
DiscoveredField,
} from './auth/auth';

export class Agents extends APIResource {
auth: AuthAPI.Auth = new AuthAPI.Auth(this._client);
}

Agents.Auth = Auth;

export declare namespace Agents {
export {
Auth as Auth,
type AgentAuthDiscoverResponse as AgentAuthDiscoverResponse,
type AgentAuthInvocationResponse as AgentAuthInvocationResponse,
type AgentAuthSubmitResponse as AgentAuthSubmitResponse,
type AuthAgent as AuthAgent,
type AuthAgentCreateRequest as AuthAgentCreateRequest,
type AuthAgentInvocationCreateRequest as AuthAgentInvocationCreateRequest,
type AuthAgentInvocationCreateResponse as AuthAgentInvocationCreateResponse,
type DiscoveredField as DiscoveredField,
type AuthAgentsOffsetPagination as AuthAgentsOffsetPagination,
type AuthCreateParams as AuthCreateParams,
type AuthListParams as AuthListParams,
};
}
3 changes: 3 additions & 0 deletions src/resources/agents/auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export * from './auth/index';
Loading