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.11.2"
".": "0.11.3"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 50
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d3a597bbbb25c131e2c06eb9b47d70932d14a97a6f916677a195a128e196f4db.yml
openapi_spec_hash: c967b384624017eed0abff1b53a74530
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-5ee2116982adf46664acf84b8ba4b56ba65780983506c63d9b005dab49def757.yml
openapi_spec_hash: 42a3a519301d0e2bb2b5a71018915b55
config_hash: 0d150b61cae2dc57d3648ceae7784966
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.11.3 (2025-09-24)

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

### Features

* Per Invocation Logs ([927cab6](https://github.com/onkernel/kernel-node-sdk/commit/927cab6e8a599d9737246220ceb54b245b3d4fc5))

## 0.11.2 (2025-09-24)

Full Changelog: [v0.11.1...v0.11.2](https://github.com/onkernel/kernel-node-sdk/compare/v0.11.1...v0.11.2)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Methods:
- <code title="get /invocations/{id}">client.invocations.<a href="./src/resources/invocations.ts">retrieve</a>(id) -> InvocationRetrieveResponse</code>
- <code title="patch /invocations/{id}">client.invocations.<a href="./src/resources/invocations.ts">update</a>(id, { ...params }) -> InvocationUpdateResponse</code>
- <code title="delete /invocations/{id}/browsers">client.invocations.<a href="./src/resources/invocations.ts">deleteBrowsers</a>(id) -> void</code>
- <code title="get /invocations/{id}/events">client.invocations.<a href="./src/resources/invocations.ts">follow</a>(id) -> InvocationFollowResponse</code>
- <code title="get /invocations/{id}/events">client.invocations.<a href="./src/resources/invocations.ts">follow</a>(id, { ...params }) -> InvocationFollowResponse</code>

# Browsers

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.11.2",
"version": "0.11.3",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { KernelApp } from './core/app-framework';
import {
InvocationCreateParams,
InvocationCreateResponse,
InvocationFollowParams,
InvocationFollowResponse,
InvocationRetrieveResponse,
InvocationStateEvent,
Expand Down Expand Up @@ -870,6 +871,7 @@ export declare namespace Kernel {
type InvocationFollowResponse as InvocationFollowResponse,
type InvocationCreateParams as InvocationCreateParams,
type InvocationUpdateParams as InvocationUpdateParams,
type InvocationFollowParams as InvocationFollowParams,
};

export {
Expand Down
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export {
type InvocationFollowResponse,
type InvocationCreateParams,
type InvocationUpdateParams,
type InvocationFollowParams,
} from './invocations';
export { Profiles, type ProfileListResponse, type ProfileCreateParams } from './profiles';
export {
Expand Down
15 changes: 14 additions & 1 deletion src/resources/invocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ export class Invocations extends APIResource {
* const response = await client.invocations.follow('id');
* ```
*/
follow(id: string, options?: RequestOptions): APIPromise<Stream<InvocationFollowResponse>> {
follow(
id: string,
query: InvocationFollowParams | undefined = {},
options?: RequestOptions,
): APIPromise<Stream<InvocationFollowResponse>> {
return this._client.get(path`/invocations/${id}/events`, {
query,
...options,
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
stream: true,
Expand Down Expand Up @@ -335,6 +340,13 @@ export interface InvocationUpdateParams {
output?: string;
}

export interface InvocationFollowParams {
/**
* Show logs since the given time (RFC timestamps or durations like 5m).
*/
since?: string;
}

export declare namespace Invocations {
export {
type InvocationStateEvent as InvocationStateEvent,
Expand All @@ -344,5 +356,6 @@ export declare namespace Invocations {
type InvocationFollowResponse as InvocationFollowResponse,
type InvocationCreateParams as InvocationCreateParams,
type InvocationUpdateParams as InvocationUpdateParams,
type InvocationFollowParams as InvocationFollowParams,
};
}
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.11.2'; // x-release-please-version
export const VERSION = '0.11.3'; // x-release-please-version
12 changes: 12 additions & 0 deletions tests/api-resources/invocations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ describe('resource invocations', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism doesn't support text/event-stream responses
test.skip('follow: 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.invocations.follow(
'id',
{ since: '2025-06-20T12:00:00Z' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Kernel.NotFoundError);
});
});