Skip to content

Commit 11c2cd0

Browse files
Merge pull request #187 from kernel/release-please--branches--main--changes--next--components--sdk
release: 0.107.0
2 parents 34abc03 + 188745c commit 11c2cd0

13 files changed

Lines changed: 224 additions & 14 deletions

File tree

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.106.0"
2+
".": "0.107.0"
33
}

‎.stats.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 164
1+
configured_endpoints: 165

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [0.107.0](https://github.com/kernel/kernel-node-sdk/compare/v0.106.0...v0.107.0) (2026-09-16)
4+
5+
6+
### Features
7+
8+
* Classify unevaluable config registry targets ([e6d16a7](https://github.com/kernel/kernel-node-sdk/commit/e6d16a732f8581b7c46bc2b47ffd4f77a7bb6ed5))
9+
* Expose persistent Browser REPL through the API ([f7b2e99](https://github.com/kernel/kernel-node-sdk/commit/f7b2e99d2b632ad36ef2f831afa53bc8175a1ae8))
10+
* Return Link spend request errors directly ([25d898f](https://github.com/kernel/kernel-node-sdk/commit/25d898f383e7c712478df9ed62d2d7f460ee68f8))
11+
312
## 0.106.0 (2026-09-16)
413

514
Full Changelog: [v0.104.0...v0.106.0](https://github.com/kernel/kernel-node-sdk/compare/v0.104.0...v0.106.0)

‎api.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ Types:
106106
- <code><a href="./src/resources/browsers/browsers.ts">BrowserProxy</a></code>
107107
- <code><a href="./src/resources/browsers/browsers.ts">BrowserProxyConfig</a></code>
108108
- <code><a href="./src/resources/browsers/browsers.ts">BrowserProxyMode</a></code>
109+
- <code><a href="./src/resources/browsers/browsers.ts">BrowserReplContent</a></code>
110+
- <code><a href="./src/resources/browsers/browsers.ts">BrowserReplImageContent</a></code>
111+
- <code><a href="./src/resources/browsers/browsers.ts">BrowserReplRequest</a></code>
112+
- <code><a href="./src/resources/browsers/browsers.ts">BrowserReplResult</a></code>
113+
- <code><a href="./src/resources/browsers/browsers.ts">BrowserReplTextContent</a></code>
109114
- <code><a href="./src/resources/browsers/browsers.ts">BrowserUsage</a></code>
110115
- <code><a href="./src/resources/browsers/browsers.ts">Profile</a></code>
111116
- <code><a href="./src/resources/browsers/browsers.ts">Tags</a></code>
@@ -125,6 +130,7 @@ Methods:
125130
- <code title="post /browsers/{id_or_name}/curl">client.browsers.<a href="./src/resources/browsers/browsers.ts">curl</a>(idOrName, { ...params }) -> BrowserCurlResponse</code>
126131
- <code title="delete /browsers/{id_or_name}">client.browsers.<a href="./src/resources/browsers/browsers.ts">deleteByID</a>(idOrName) -> void</code>
127132
- <code title="post /browsers/{id_or_name}/extensions">client.browsers.<a href="./src/resources/browsers/browsers.ts">loadExtensions</a>(idOrName, { ...params }) -> void</code>
133+
- <code title="post /browsers/{id_or_name}/repl">client.browsers.<a href="./src/resources/browsers/browsers.ts">repl</a>(idOrName, { ...params }) -> BrowserReplResult</code>
128134

129135
## Telemetry
130136

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@onkernel/sdk",
3-
"version": "0.106.0",
3+
"version": "0.107.0",
44
"description": "The official TypeScript library for the Kernel API",
55
"author": "Kernel <>",
66
"types": "dist/index.d.ts",

‎src/client.ts‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ import {
168168
BrowserProxy,
169169
BrowserProxyConfig,
170170
BrowserProxyMode,
171+
BrowserReplContent,
172+
BrowserReplImageContent,
173+
BrowserReplParams,
174+
BrowserReplRequest,
175+
BrowserReplResult,
176+
BrowserReplTextContent,
171177
BrowserRetrieveParams,
172178
BrowserRetrieveResponse,
173179
BrowserUpdateParams,
@@ -1053,9 +1059,6 @@ export class Kernel {
10531059
* Resolve browser and proxy recommendations for bot-protected sites.
10541060
*/
10551061
configRegistry: API.ConfigRegistry = new API.ConfigRegistry(this);
1056-
/**
1057-
* Create and manage browser sessions.
1058-
*/
10591062
browsers: API.Browsers = new API.Browsers(this);
10601063
/**
10611064
* Create, list, retrieve, and delete browser profiles.
@@ -1205,6 +1208,11 @@ export declare namespace Kernel {
12051208
type BrowserProxy as BrowserProxy,
12061209
type BrowserProxyConfig as BrowserProxyConfig,
12071210
type BrowserProxyMode as BrowserProxyMode,
1211+
type BrowserReplContent as BrowserReplContent,
1212+
type BrowserReplImageContent as BrowserReplImageContent,
1213+
type BrowserReplRequest as BrowserReplRequest,
1214+
type BrowserReplResult as BrowserReplResult,
1215+
type BrowserReplTextContent as BrowserReplTextContent,
12081216
type BrowserUsage as BrowserUsage,
12091217
type Profile as Profile,
12101218
type Tags as Tags,
@@ -1221,6 +1229,7 @@ export declare namespace Kernel {
12211229
type BrowserListParams as BrowserListParams,
12221230
type BrowserCurlParams as BrowserCurlParams,
12231231
type BrowserLoadExtensionsParams as BrowserLoadExtensionsParams,
1232+
type BrowserReplParams as BrowserReplParams,
12241233
};
12251234

12261235
export {

‎src/resources/browsers/browsers.ts‎

Lines changed: 153 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ import { multipartFormRequestOptions } from '../../internal/uploads';
149149
import { path } from '../../internal/utils/path';
150150
import { browserFetch, type BrowserFetchInit } from '../../lib/browser-fetch';
151151

152-
/**
153-
* Create and manage browser sessions.
154-
*/
155152
export class Browsers extends APIResource {
156153
telemetry: TelemetryAPI.Telemetry = new TelemetryAPI.Telemetry(this._client);
157154
replays: ReplaysAPI.Replays = new ReplaysAPI.Replays(this._client);
@@ -306,6 +303,33 @@ export class Browsers extends APIResource {
306303
),
307304
);
308305
}
306+
307+
/**
308+
* Execute JavaScript in a persistent Node.js runtime inside the browser VM.
309+
* Top-level bindings, closures, mutations, and dynamically imported modules
310+
* persist across calls until the REPL is reset or replaced. Start with
311+
* `repl.help()` to list available methods, or call `repl.help("click")` for
312+
* detailed help.
313+
*
314+
* Expression values are ignored. Emit ordered text or image output with
315+
* `repl.write(...)`, console methods, or `repl.emitImage(...)`. The runtime also
316+
* exposes browser-control helpers, WebMCP, Patchright, Playwright, and raw CDP.
317+
*
318+
* Executions are serialized. A timeout, crash, OOM, or protocol failure terminates
319+
* the REPL and changes its `repl_id`. This is unrestricted code execution inside
320+
* the browser VM and is not sandboxed.
321+
*
322+
* @example
323+
* ```ts
324+
* const browserReplResult = await client.browsers.repl(
325+
* 'htzv5orfit78e1m2biiifpbv',
326+
* { code: 'code' },
327+
* );
328+
* ```
329+
*/
330+
repl(idOrName: string, body: BrowserReplParams, options?: RequestOptions): APIPromise<BrowserReplResult> {
331+
return this._client.post(path`/browsers/${idOrName}/repl`, { body, ...options });
332+
}
309333
}
310334

311335
export type BrowserListResponsesOffsetPagination = OffsetPagination<BrowserListResponse>;
@@ -434,6 +458,104 @@ export interface BrowserProxyConfig {
434458
*/
435459
export type BrowserProxyMode = 'direct' | 'default';
436460

461+
/**
462+
* Ordered discriminated union of Browser REPL output items.
463+
*/
464+
export type BrowserReplContent = BrowserReplTextContent | BrowserReplImageContent;
465+
466+
export interface BrowserReplImageContent {
467+
data_b64: string;
468+
469+
mime_type: string;
470+
471+
type: 'image';
472+
}
473+
474+
/**
475+
* Request to execute code in the persistent Browser REPL.
476+
*/
477+
export interface BrowserReplRequest {
478+
/**
479+
* JavaScript evaluated in a persistent Node.js runtime. Top-level bindings persist
480+
* until the browser VM's API process exits, the REPL is reset, or the REPL is
481+
* terminated after a crash or timeout. Static top-level imports are unsupported;
482+
* use dynamic `import()`. Expression values are ignored; emit output with
483+
* `repl.write(...)`, console methods, or `repl.emitImage(...)`. May be empty only
484+
* when `reset` is true.
485+
*/
486+
code: string;
487+
488+
/**
489+
* Terminate the current REPL, start a fresh one, and then evaluate code.
490+
*/
491+
reset?: boolean;
492+
493+
/**
494+
* Maximum execution time in seconds. Default is 60.
495+
*/
496+
timeout_sec?: number;
497+
}
498+
499+
/**
500+
* Result of Browser REPL code execution.
501+
*/
502+
export interface BrowserReplResult {
503+
/**
504+
* CUID2 identifying the exact state-holding REPL process used for this execution.
505+
* Stable across calls and Chromium reconnects; changes after an API restart,
506+
* explicit reset, execution timeout, or REPL crash.
507+
*/
508+
repl_id: string;
509+
510+
/**
511+
* Whether the code executed successfully.
512+
*/
513+
success: boolean;
514+
515+
/**
516+
* Optional ordered text/image output produced by the execution.
517+
*/
518+
content?: Array<BrowserReplContent>;
519+
520+
/**
521+
* True if text or image output was dropped or truncated due to response limits.
522+
*/
523+
content_truncated?: boolean;
524+
525+
/**
526+
* Wall-clock execution time in milliseconds.
527+
*/
528+
duration_ms?: number;
529+
530+
/**
531+
* Error message if execution failed.
532+
*/
533+
error?: string;
534+
535+
/**
536+
* True if the REPL identified by `repl_id` was terminated by this request. The
537+
* next request lazily starts a fresh REPL with a new `repl_id`.
538+
*/
539+
repl_terminated?: boolean;
540+
541+
/**
542+
* Stack trace if execution failed.
543+
*/
544+
stack?: string;
545+
}
546+
547+
export interface BrowserReplTextContent {
548+
/**
549+
* `write` is emitted by `repl.write`; `stdout` and `stderr` are emitted by console
550+
* methods.
551+
*/
552+
channel: 'write' | 'stdout' | 'stderr';
553+
554+
text: string;
555+
556+
type: 'text';
557+
}
558+
437559
/**
438560
* Session usage metrics.
439561
*/
@@ -1703,6 +1825,28 @@ export namespace BrowserLoadExtensionsParams {
17031825
}
17041826
}
17051827

1828+
export interface BrowserReplParams {
1829+
/**
1830+
* JavaScript evaluated in a persistent Node.js runtime. Top-level bindings persist
1831+
* until the browser VM's API process exits, the REPL is reset, or the REPL is
1832+
* terminated after a crash or timeout. Static top-level imports are unsupported;
1833+
* use dynamic `import()`. Expression values are ignored; emit output with
1834+
* `repl.write(...)`, console methods, or `repl.emitImage(...)`. May be empty only
1835+
* when `reset` is true.
1836+
*/
1837+
code: string;
1838+
1839+
/**
1840+
* Terminate the current REPL, start a fresh one, and then evaluate code.
1841+
*/
1842+
reset?: boolean;
1843+
1844+
/**
1845+
* Maximum execution time in seconds. Default is 60.
1846+
*/
1847+
timeout_sec?: number;
1848+
}
1849+
17061850
Browsers.Telemetry = TelemetryAPITelemetry;
17071851
Browsers.Replays = Replays;
17081852
Browsers.Fs = Fs;
@@ -1721,6 +1865,11 @@ export declare namespace Browsers {
17211865
type BrowserProxy as BrowserProxy,
17221866
type BrowserProxyConfig as BrowserProxyConfig,
17231867
type BrowserProxyMode as BrowserProxyMode,
1868+
type BrowserReplContent as BrowserReplContent,
1869+
type BrowserReplImageContent as BrowserReplImageContent,
1870+
type BrowserReplRequest as BrowserReplRequest,
1871+
type BrowserReplResult as BrowserReplResult,
1872+
type BrowserReplTextContent as BrowserReplTextContent,
17241873
type BrowserUsage as BrowserUsage,
17251874
type Profile as Profile,
17261875
type Tags as Tags,
@@ -1737,6 +1886,7 @@ export declare namespace Browsers {
17371886
type BrowserListParams as BrowserListParams,
17381887
type BrowserCurlParams as BrowserCurlParams,
17391888
type BrowserLoadExtensionsParams as BrowserLoadExtensionsParams,
1889+
type BrowserReplParams as BrowserReplParams,
17401890
};
17411891

17421892
export {

‎src/resources/browsers/index.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export {
99
type BrowserProxy,
1010
type BrowserProxyConfig,
1111
type BrowserProxyMode,
12+
type BrowserReplContent,
13+
type BrowserReplImageContent,
14+
type BrowserReplRequest,
15+
type BrowserReplResult,
16+
type BrowserReplTextContent,
1217
type BrowserUsage,
1318
type Profile,
1419
type Tags,
@@ -24,6 +29,7 @@ export {
2429
type BrowserListParams,
2530
type BrowserCurlParams,
2631
type BrowserLoadExtensionsParams,
32+
type BrowserReplParams,
2733
type ProfilesOffsetPagination,
2834
type BrowserListResponsesOffsetPagination,
2935
} from './browsers';

‎src/resources/config-registry/config-registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export interface NoRecommendation {
261261
/**
262262
* Machine-readable reason Kernel cannot currently provide a config recommendation.
263263
*/
264-
code: 'proxy_restricted' | 'no_working_configuration' | 'inconclusive';
264+
code: 'proxy_restricted' | 'target_not_evaluable' | 'no_working_configuration' | 'inconclusive';
265265

266266
/**
267267
* Human-readable explanation suitable for display.

‎src/resources/index.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ export {
4747
type BrowserProxy,
4848
type BrowserProxyConfig,
4949
type BrowserProxyMode,
50+
type BrowserReplContent,
51+
type BrowserReplImageContent,
52+
type BrowserReplRequest,
53+
type BrowserReplResult,
54+
type BrowserReplTextContent,
5055
type BrowserUsage,
5156
type Profile,
5257
type Tags,
@@ -62,6 +67,7 @@ export {
6267
type BrowserListParams,
6368
type BrowserCurlParams,
6469
type BrowserLoadExtensionsParams,
70+
type BrowserReplParams,
6571
type ProfilesOffsetPagination,
6672
type BrowserListResponsesOffsetPagination,
6773
} from './browsers/browsers';

0 commit comments

Comments
 (0)