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.147.0"
".": "0.148.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 178
configured_endpoints: 179
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.148.0](https://github.com/kernel/kernel-node-sdk/compare/v0.147.0...v0.148.0) (2026-11-12)


### Features

* Add scoped live view URLs ([a2b9c8f](https://github.com/kernel/kernel-node-sdk/commit/a2b9c8f6e8a42427c92ea239d61c6bb30b00be73))
* Pace 1Password status checks on the partner schedule ([a2b9c8f](https://github.com/kernel/kernel-node-sdk/commit/a2b9c8f6e8a42427c92ea239d61c6bb30b00be73))
* Return the 1Password access request reference on the approval action ([a2b9c8f](https://github.com/kernel/kernel-node-sdk/commit/a2b9c8f6e8a42427c92ea239d61c6bb30b00be73))

## [0.147.0](https://github.com/kernel/kernel-node-sdk/compare/v0.146.0...v0.147.0) (2026-11-12)


Expand Down
12 changes: 12 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ Methods:
- <code title="get /browsers/{id_or_name}/telemetry/events">client.browsers.telemetry.<a href="./src/resources/browsers/telemetry.ts">events</a>(idOrName, { ...params }) -> TelemetryEventsResponsesOffsetPagination</code>
- <code title="get /browsers/{id_or_name}/telemetry/stream">client.browsers.telemetry.<a href="./src/resources/browsers/telemetry.ts">stream</a>(idOrName, { ...params }) -> TelemetryStreamResponse</code>

## LiveView

Types:

- <code><a href="./src/resources/browsers/live-view.ts">BrowserLiveView</a></code>
- <code><a href="./src/resources/browsers/live-view.ts">BrowserLiveViewRequest</a></code>
- <code><a href="./src/resources/browsers/live-view.ts">BrowserLiveViewScope</a></code>

Methods:

- <code title="post /browsers/{id_or_name}/live_view">client.browsers.liveView.<a href="./src/resources/browsers/live-view.ts">create</a>(idOrName, { ...params }) -> BrowserLiveView</code>

## Replays

Types:
Expand Down
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.147.0",
"version": "0.148.0",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
Expand Down
18 changes: 18 additions & 0 deletions src/resources/browsers/browsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ import {
ComputerTypeTextParams,
ComputerWriteClipboardParams,
} from './computer';
import * as LiveViewAPI from './live-view';
import {
BrowserLiveView,
BrowserLiveViewRequest,
BrowserLiveViewScope,
LiveView,
LiveViewCreateParams,
} from './live-view';
import * as LogsAPI from './logs';
import { LogStreamParams, Logs } from './logs';
import * as ProcessAPI from './process';
Expand Down Expand Up @@ -161,6 +169,7 @@ import { browserFetch, type BrowserFetchInit } from '../../lib/browser-fetch';

export class Browsers extends APIResource {
telemetry: TelemetryAPI.Telemetry = new TelemetryAPI.Telemetry(this._client);
liveView: LiveViewAPI.LiveView = new LiveViewAPI.LiveView(this._client);
replays: ReplaysAPI.Replays = new ReplaysAPI.Replays(this._client);
fs: FsAPI.Fs = new FsAPI.Fs(this._client);
process: ProcessAPI.Process = new ProcessAPI.Process(this._client);
Expand Down Expand Up @@ -2441,6 +2450,7 @@ export interface BrowserSaveProfileParams {
}

Browsers.Telemetry = TelemetryAPITelemetry;
Browsers.LiveView = LiveView;
Browsers.Replays = Replays;
Browsers.Fs = Fs;
Browsers.Process = Process;
Expand Down Expand Up @@ -2551,6 +2561,14 @@ export declare namespace Browsers {
type TelemetryStreamParams as TelemetryStreamParams,
};

export {
LiveView as LiveView,
type BrowserLiveView as BrowserLiveView,
type BrowserLiveViewRequest as BrowserLiveViewRequest,
type BrowserLiveViewScope as BrowserLiveViewScope,
type LiveViewCreateParams as LiveViewCreateParams,
};

export {
Replays as Replays,
type ReplayListResponse as ReplayListResponse,
Expand Down
7 changes: 7 additions & 0 deletions src/resources/browsers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ export {
type FUploadZipParams,
type FWriteFileParams,
} from './fs/index';
export {
LiveView,
type BrowserLiveView,
type BrowserLiveViewRequest,
type BrowserLiveViewScope,
type LiveViewCreateParams,
} from './live-view';
export { Logs, type LogStreamParams } from './logs';
export {
Playwright,
Expand Down
97 changes: 97 additions & 0 deletions src/resources/browsers/live-view.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../core/resource';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';

/**
* Create and manage browser sessions.
*/
export class LiveView extends APIResource {
/**
* Creates a live view URL for a headful browser that grants either read-only or
* control access. The URL works only for the live view: it cannot connect to CDP,
* WebDriver, or any other browser endpoint. A read-only URL shows the browser but
* cannot send input, regardless of query parameters. The URL stays valid until the
* browser is deleted, or until `ttl_seconds` elapse when set. For a browser
* acquired from a pool, it stops working when the browser is released. Nothing is
* stored, so a URL cannot be revoked before then.
*
* @example
* ```ts
* const browserLiveView =
* await client.browsers.liveView.create(
* 'htzv5orfit78e1m2biiifpbv',
* );
* ```
*/
create(
idOrName: string,
body: LiveViewCreateParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<BrowserLiveView> {
return this._client.post(path`/browsers/${idOrName}/live_view`, { body, ...options });
}
}

export interface BrowserLiveView {
/**
* `read` shows the browser without accepting input. `control` also lets the viewer
* drive the browser through the live view.
*/
scope: BrowserLiveViewScope;

/**
* Live view URL. Treat it as a credential.
*/
url: string;

/**
* When the URL expires. Absent when it stays valid until the browser is deleted.
*/
expires_at?: string;
}

export interface BrowserLiveViewRequest {
/**
* `read` shows the browser without accepting input. `control` also lets the viewer
* drive the browser through the live view.
*/
scope?: BrowserLiveViewScope;

/**
* Seconds until the URL expires. Omit to keep it valid until the browser is
* deleted.
*/
ttl_seconds?: number;
}

/**
* `read` shows the browser without accepting input. `control` also lets the viewer
* drive the browser through the live view.
*/
export type BrowserLiveViewScope = 'read' | 'control';

export interface LiveViewCreateParams {
/**
* `read` shows the browser without accepting input. `control` also lets the viewer
* drive the browser through the live view.
*/
scope?: BrowserLiveViewScope;

/**
* Seconds until the URL expires. Omit to keep it valid until the browser is
* deleted.
*/
ttl_seconds?: number;
}

export declare namespace LiveView {
export {
type BrowserLiveView as BrowserLiveView,
type BrowserLiveViewRequest as BrowserLiveViewRequest,
type BrowserLiveViewScope as BrowserLiveViewScope,
type LiveViewCreateParams as LiveViewCreateParams,
};
}
29 changes: 22 additions & 7 deletions src/resources/vaults/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1170,9 +1170,10 @@ export interface CredentialVaultItem {
/**
* Kernel credentials advertise collect and fill when eligible. 1Password
* credentials advertise 1pw_create_access_request until a request is made,
* 1pw_access_request_status while its approval is pending, and 1pw_fill after
* access is granted. Managed auth credentials advertise fill while ready and
* nothing otherwise.
* 1pw_access_request_status while its approval is pending (and
* 1pw_create_access_request again once the 3-minute status-check window has
* passed), and 1pw_fill after access is granted. Managed auth credentials
* advertise fill while ready and nothing otherwise.
*/
available_operations: Array<CredentialVaultItem.AvailableOperation>;

Expand Down Expand Up @@ -1273,6 +1274,15 @@ export namespace CredentialVaultItem {
}

export interface OnePasswordAccessApprovalAction {
/**
* The access_request_reference value from url, for approving inside your own iOS
* or Android app with 1Password's action extension or authorization activity. Pass
* it unchanged; the grant comes back to your app, and 1pw_access_request_status
* records it in Kernel. Treat it like url, which carries the same request text,
* and keep it out of logs.
*/
access_request_reference: string;

/**
* Steps for the agent to hand approval to the human and poll the resulting
* decision.
Expand All @@ -1282,8 +1292,10 @@ export namespace CredentialVaultItem {
name: '1password_access_approval';

/**
* Native 1Password approval link. Present it to the account owner without
* modifying it; it does not grant access until they approve in their app.
* Native 1Password approval link. Present it to the account owner unchanged,
* except that you may append `&return_url=<URL-encoded URL>` so 1Password sends
* them back to your app after they decide (1Password 8.12.46 or later on iOS,
* Android and desktop). It does not grant access until they approve in their app.
*/
url: string;
}
Expand Down Expand Up @@ -2395,7 +2407,9 @@ export namespace OnePasswordCredentialVaultItemState {
has_autofill_token: boolean;

/**
* One of pending, resolved, denied, or failed.
* One of pending, resolved, denied, failed, expired, or unknown. expired returns
* the item to pending_authorization so access can be requested again; unknown is a
* state 1Password added later and is treated as failed.
*/
state: string;

Expand Down Expand Up @@ -4822,7 +4836,8 @@ export declare namespace ItemPerformOperationParams {
type: '1pw_access_request_status';

/**
* Body param
* Body param: How long to keep checking on the schedule. The call still waits for
* its first scheduled check, at most 20 seconds, when that comes later.
*/
timeout_seconds?: number;
}
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.147.0'; // x-release-please-version
export const VERSION = '0.148.0'; // x-release-please-version
34 changes: 34 additions & 0 deletions tests/api-resources/browsers/live-view.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource liveView', () => {
// Mock server tests are disabled
test.skip('create', async () => {
const responsePromise = client.browsers.liveView.create('htzv5orfit78e1m2biiifpbv');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

// Mock server tests are disabled
test.skip('create: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
client.browsers.liveView.create(
'htzv5orfit78e1m2biiifpbv',
{ scope: 'read', ttl_seconds: 3600 },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Kernel.NotFoundError);
});
});
Loading