Skip to content
Open
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.81.0"
".": "0.82.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 127
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-1dffe057847b596dd311ce4b6e0e8036126dce3e97d390636c9c8e6d2f4823e1.yml
openapi_spec_hash: c06336c199ee64c222ba3122deae9463
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-5163e8941e42f7fb84e10f572f538202b31722c84bb980db74ccd44a960eb87f.yml
openapi_spec_hash: 8aa974cf7843681d6ae3e6dcf099596d
config_hash: 77ee715aa17061166f9a02b264a21b8d
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.82.0 (2026-07-23)

Full Changelog: [v0.81.0...v0.82.0](https://github.com/kernel/kernel-node-sdk/compare/v0.81.0...v0.82.0)

### Features

* Count project names by Unicode code point ([c8134ef](https://github.com/kernel/kernel-node-sdk/commit/c8134eff380d31547e87ee8b77aac5d3a47a5774))
* Stream profile downloads as tar archives ([cae7386](https://github.com/kernel/kernel-node-sdk/commit/cae7386b5177282c885527ad3a14a6c15a25128a))

## 0.81.0 (2026-07-21)

Full Changelog: [v0.80.0...v0.81.0](https://github.com/kernel/kernel-node-sdk/compare/v0.80.0...v0.81.0)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Methods:
- <code title="patch /profiles/{id_or_name}">client.profiles.<a href="./src/resources/profiles.ts">update</a>(idOrName, { ...params }) -> Profile</code>
- <code title="get /profiles">client.profiles.<a href="./src/resources/profiles.ts">list</a>({ ...params }) -> ProfilesOffsetPagination</code>
- <code title="delete /profiles/{id_or_name}">client.profiles.<a href="./src/resources/profiles.ts">delete</a>(idOrName) -> void</code>
- <code title="get /profiles/{id_or_name}/download">client.profiles.<a href="./src/resources/profiles.ts">download</a>(idOrName) -> Response</code>
- <code title="get /profiles/{id_or_name}/download">client.profiles.<a href="./src/resources/profiles.ts">download</a>(idOrName, { ...params }) -> Response</code>

# Auth

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.81.0",
"version": "0.82.0",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
Expand Down
9 changes: 8 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ import {
InvocationUpdateResponse,
Invocations,
} from './resources/invocations';
import { ProfileCreateParams, ProfileListParams, ProfileUpdateParams, Profiles } from './resources/profiles';
import {
ProfileCreateParams,
ProfileDownloadParams,
ProfileListParams,
ProfileUpdateParams,
Profiles,
} from './resources/profiles';
import {
Proxies,
ProxyCheckParams,
Expand Down Expand Up @@ -1126,6 +1132,7 @@ export declare namespace Kernel {
type ProfileCreateParams as ProfileCreateParams,
type ProfileUpdateParams as ProfileUpdateParams,
type ProfileListParams as ProfileListParams,
type ProfileDownloadParams as ProfileDownloadParams,
};

export { Auth as Auth };
Expand Down
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export {
type ProfileCreateParams,
type ProfileUpdateParams,
type ProfileListParams,
type ProfileDownloadParams,
} from './profiles';
export {
Projects,
Expand Down
23 changes: 20 additions & 3 deletions src/resources/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ export class Profiles extends APIResource {
}

/**
* Returns a zstd-compressed tar file of the full user-data directory.
* Downloads the profile in its stored format by default. Current profiles are
* returned as zstd-compressed tar archives, while legacy profiles remain JSON. Set
* `format=tar` to decompress current profiles during download; legacy profiles
* remain JSON.
*
* @example
* ```ts
Expand All @@ -110,10 +113,15 @@ export class Profiles extends APIResource {
* console.log(content);
* ```
*/
download(idOrName: string, options?: RequestOptions): APIPromise<Response> {
download(
idOrName: string,
query: ProfileDownloadParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<Response> {
return this._client.get(path`/profiles/${idOrName}/download`, {
query,
...options,
headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
headers: buildHeaders([{ Accept: 'application/zstd' }, options?.headers]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong Accept for multi-format downloads

Medium Severity

The profiles.download method hardcodes the Accept: application/zstd header, but the API and its documentation indicate support for other formats, such as uncompressed tar (when format=tar) and JSON for legacy profiles. This mismatch can lead to content negotiation failures or unexpected response payloads.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f3e2a1f. Configure here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Download options silently misrouted

High Severity

download changed from (idOrName, options?) to (idOrName, query?, options?). Existing two-argument calls that pass RequestOptions as the second argument now treat that object as query params, so timeout, signal, headers, and retries are ignored unless moved to the third argument. Typed RequestOptions values still type-check against ProfileDownloadParams, so this can fail silently at runtime.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f3e2a1f. Configure here.

__binaryResponse: true,
});
}
Expand Down Expand Up @@ -152,11 +160,20 @@ export interface ProfileListParams extends OffsetPaginationParams {
query?: string;
}

export interface ProfileDownloadParams {
/**
* Response format for current profile archives. Legacy profiles are always
* returned as JSON.
*/
format?: 'tar.zst' | 'tar';
}

export declare namespace Profiles {
export {
type ProfileCreateParams as ProfileCreateParams,
type ProfileUpdateParams as ProfileUpdateParams,
type ProfileListParams as ProfileListParams,
type ProfileDownloadParams as ProfileDownloadParams,
};
}

Expand Down
8 changes: 4 additions & 4 deletions src/resources/projects/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export type ProjectsOffsetPagination = OffsetPagination<Project>;

export interface CreateProjectRequest {
/**
* Project name (1-255 characters)
* Project name (1-255 Unicode code points)
*/
name: string;
}
Expand Down Expand Up @@ -125,7 +125,7 @@ export interface Project {

export interface UpdateProjectRequest {
/**
* New project name
* New project name (1-255 Unicode code points)
*/
name?: string;

Expand All @@ -137,14 +137,14 @@ export interface UpdateProjectRequest {

export interface ProjectCreateParams {
/**
* Project name (1-255 characters)
* Project name (1-255 Unicode code points)
*/
name: string;
}

export interface ProjectUpdateParams {
/**
* New project name
* New project name (1-255 Unicode code points)
*/
name?: string;

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.81.0'; // x-release-please-version
export const VERSION = '0.82.0'; // x-release-please-version
8 changes: 8 additions & 0 deletions tests/api-resources/profiles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,12 @@ describe('resource profiles', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

// Mock server tests are disabled
test.skip('download: 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.profiles.download('id_or_name', { format: 'tar.zst' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Kernel.NotFoundError);
});
});
Loading