diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 5d02000..bf5f1fb 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.6.1"
+ ".": "0.6.2"
}
diff --git a/.stats.yml b/.stats.yml
index 4a84456..b296d07 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 16
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b019e469425a59061f37c5fdc7a131a5291c66134ef0627db4f06bb1f4af0b15.yml
-openapi_spec_hash: f66a3c2efddb168db9539ba2507b10b8
-config_hash: aae6721b2be9ec8565dfc8f7eadfe105
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-2aec229ccf91f7c1ac95aa675ea2a59bd61af9e363a22c3b49677992f1eeb16a.yml
+openapi_spec_hash: c80cd5d52a79cd5366a76d4a825bd27a
+config_hash: b8e1fff080fbaa22656ab0a57b591777
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62f8ab8..dcfc8af 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,28 @@
# Changelog
+## 0.6.2 (2025-06-24)
+
+Full Changelog: [v0.6.1...v0.6.2](https://github.com/onkernel/kernel-node-sdk/compare/v0.6.1...v0.6.2)
+
+### Features
+
+* **api:** add `since` parameter to deployment logs endpoint ([178712c](https://github.com/onkernel/kernel-node-sdk/commit/178712ccb7c7f326df11c6c63e3ca02697a793b4))
+
+
+### Bug Fixes
+
+* **client:** explicitly copy fetch in withOptions ([9859602](https://github.com/onkernel/kernel-node-sdk/commit/98596028a28e39d7b5bf7253f0a950aba5144e57))
+
+
+### Chores
+
+* **readme:** use better example snippet for undocumented params ([e8633e0](https://github.com/onkernel/kernel-node-sdk/commit/e8633e0ef4dbeb73d964ce86e74bc75288c04594))
+
+
+### Refactors
+
+* **types:** replace Record with mapped types ([73ff4fa](https://github.com/onkernel/kernel-node-sdk/commit/73ff4fa307465ad81a01070d9eb4e1ff1f7e5bd8))
+
## 0.6.1 (2025-06-18)
Full Changelog: [v0.6.0...v0.6.1](https://github.com/onkernel/kernel-node-sdk/compare/v0.6.0...v0.6.1)
diff --git a/README.md b/README.md
index 4217f0f..77ae273 100644
--- a/README.md
+++ b/README.md
@@ -283,9 +283,8 @@ parameter. This library doesn't validate at runtime that the request matches the
send will be sent as-is.
```ts
-client.foo.create({
- foo: 'my_param',
- bar: 12,
+client.apps.deployments.create({
+ // ...
// @ts-expect-error baz is not yet public
baz: 'undocumented option',
});
diff --git a/api.md b/api.md
index f81d636..a8ada60 100644
--- a/api.md
+++ b/api.md
@@ -5,6 +5,7 @@ Types:
- ErrorDetail
- ErrorEvent
- ErrorModel
+- HeartbeatEvent
- LogEvent
# Deployments
@@ -20,7 +21,7 @@ Methods:
- client.deployments.create({ ...params }) -> DeploymentCreateResponse
- client.deployments.retrieve(id) -> DeploymentRetrieveResponse
-- client.deployments.follow(id) -> DeploymentFollowResponse
+- client.deployments.follow(id, { ...params }) -> DeploymentFollowResponse
# Apps
diff --git a/package.json b/package.json
index 5ff0a3f..22484c9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@onkernel/sdk",
- "version": "0.6.1",
+ "version": "0.6.2",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
diff --git a/src/client.ts b/src/client.ts
index d27d6c9..8b3fbce 100644
--- a/src/client.ts
+++ b/src/client.ts
@@ -28,6 +28,7 @@ import {
import {
DeploymentCreateParams,
DeploymentCreateResponse,
+ DeploymentFollowParams,
DeploymentFollowResponse,
DeploymentRetrieveResponse,
DeploymentStateEvent,
@@ -233,6 +234,7 @@ export class Kernel {
timeout: this.timeout,
logger: this.logger,
logLevel: this.logLevel,
+ fetch: this.fetch,
fetchOptions: this.fetchOptions,
apiKey: this.apiKey,
...options,
@@ -789,6 +791,7 @@ export declare namespace Kernel {
type DeploymentRetrieveResponse as DeploymentRetrieveResponse,
type DeploymentFollowResponse as DeploymentFollowResponse,
type DeploymentCreateParams as DeploymentCreateParams,
+ type DeploymentFollowParams as DeploymentFollowParams,
};
export { Apps as Apps, type AppListResponse as AppListResponse, type AppListParams as AppListParams };
@@ -817,5 +820,6 @@ export declare namespace Kernel {
export type ErrorDetail = API.ErrorDetail;
export type ErrorEvent = API.ErrorEvent;
export type ErrorModel = API.ErrorModel;
+ export type HeartbeatEvent = API.HeartbeatEvent;
export type LogEvent = API.LogEvent;
}
diff --git a/src/resources/apps/apps.ts b/src/resources/apps/apps.ts
index 7f8831e..227fba8 100644
--- a/src/resources/apps/apps.ts
+++ b/src/resources/apps/apps.ts
@@ -44,6 +44,11 @@ export namespace AppListResponse {
*/
app_name: string;
+ /**
+ * Deployment ID
+ */
+ deployment: string;
+
/**
* Deployment region code
*/
@@ -57,7 +62,7 @@ export namespace AppListResponse {
/**
* Environment variables configured for this app version
*/
- env_vars?: Record;
+ env_vars?: { [key: string]: string };
}
}
diff --git a/src/resources/apps/deployments.ts b/src/resources/apps/deployments.ts
index 1581c8e..fc61979 100644
--- a/src/resources/apps/deployments.ts
+++ b/src/resources/apps/deployments.ts
@@ -97,7 +97,8 @@ export namespace DeploymentCreateResponse {
export type DeploymentFollowResponse =
| DeploymentFollowResponse.StateEvent
| DeploymentFollowResponse.StateUpdateEvent
- | Shared.LogEvent;
+ | Shared.LogEvent
+ | Shared.HeartbeatEvent;
export namespace DeploymentFollowResponse {
/**
@@ -156,7 +157,7 @@ export interface DeploymentCreateParams {
* Map of environment variables to set for the deployed application. Each key-value
* pair represents an environment variable.
*/
- env_vars?: Record;
+ env_vars?: { [key: string]: string };
/**
* Allow overwriting an existing app version
diff --git a/src/resources/deployments.ts b/src/resources/deployments.ts
index bc247fc..33f9dcc 100644
--- a/src/resources/deployments.ts
+++ b/src/resources/deployments.ts
@@ -48,8 +48,13 @@ export class Deployments extends APIResource {
* const response = await client.deployments.follow('id');
* ```
*/
- follow(id: string, options?: RequestOptions): APIPromise> {
+ follow(
+ id: string,
+ query: DeploymentFollowParams | undefined = {},
+ options?: RequestOptions,
+ ): APIPromise> {
return this._client.get(path`/deployments/${id}/events`, {
+ query,
...options,
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
stream: true,
@@ -110,7 +115,7 @@ export namespace DeploymentStateEvent {
/**
* Environment variables configured for this deployment
*/
- env_vars?: Record;
+ env_vars?: { [key: string]: string };
/**
* Status reason
@@ -156,7 +161,7 @@ export interface DeploymentCreateResponse {
/**
* Environment variables configured for this deployment
*/
- env_vars?: Record;
+ env_vars?: { [key: string]: string };
/**
* Status reason
@@ -201,7 +206,7 @@ export interface DeploymentRetrieveResponse {
/**
* Environment variables configured for this deployment
*/
- env_vars?: Record;
+ env_vars?: { [key: string]: string };
/**
* Status reason
@@ -221,7 +226,8 @@ export type DeploymentFollowResponse =
| Shared.LogEvent
| DeploymentStateEvent
| DeploymentFollowResponse.AppVersionSummaryEvent
- | Shared.ErrorEvent;
+ | Shared.ErrorEvent
+ | Shared.HeartbeatEvent;
export namespace DeploymentFollowResponse {
/**
@@ -266,7 +272,7 @@ export namespace DeploymentFollowResponse {
/**
* Environment variables configured for this app version
*/
- env_vars?: Record;
+ env_vars?: { [key: string]: string };
}
export namespace AppVersionSummaryEvent {
@@ -297,7 +303,7 @@ export interface DeploymentCreateParams {
* Map of environment variables to set for the deployed application. Each key-value
* pair represents an environment variable.
*/
- env_vars?: Record;
+ env_vars?: { [key: string]: string };
/**
* Allow overwriting an existing app version
@@ -315,6 +321,13 @@ export interface DeploymentCreateParams {
version?: string;
}
+export interface DeploymentFollowParams {
+ /**
+ * Show logs since the given time (RFC timestamps or durations like 5m).
+ */
+ since?: string;
+}
+
export declare namespace Deployments {
export {
type DeploymentStateEvent as DeploymentStateEvent,
@@ -322,5 +335,6 @@ export declare namespace Deployments {
type DeploymentRetrieveResponse as DeploymentRetrieveResponse,
type DeploymentFollowResponse as DeploymentFollowResponse,
type DeploymentCreateParams as DeploymentCreateParams,
+ type DeploymentFollowParams as DeploymentFollowParams,
};
}
diff --git a/src/resources/index.ts b/src/resources/index.ts
index 8c96ec4..b59024d 100644
--- a/src/resources/index.ts
+++ b/src/resources/index.ts
@@ -18,6 +18,7 @@ export {
type DeploymentRetrieveResponse,
type DeploymentFollowResponse,
type DeploymentCreateParams,
+ type DeploymentFollowParams,
} from './deployments';
export {
Invocations,
diff --git a/src/resources/invocations.ts b/src/resources/invocations.ts
index 6b585e4..24afed1 100644
--- a/src/resources/invocations.ts
+++ b/src/resources/invocations.ts
@@ -283,7 +283,11 @@ export interface InvocationUpdateResponse {
/**
* Union type representing any invocation event.
*/
-export type InvocationFollowResponse = Shared.LogEvent | InvocationStateEvent | Shared.ErrorEvent;
+export type InvocationFollowResponse =
+ | Shared.LogEvent
+ | InvocationStateEvent
+ | Shared.ErrorEvent
+ | Shared.HeartbeatEvent;
export interface InvocationCreateParams {
/**
diff --git a/src/resources/shared.ts b/src/resources/shared.ts
index 1760bd4..d1ac129 100644
--- a/src/resources/shared.ts
+++ b/src/resources/shared.ts
@@ -48,6 +48,21 @@ export interface ErrorModel {
inner_error?: ErrorDetail;
}
+/**
+ * Heartbeat event sent periodically to keep SSE connection alive.
+ */
+export interface HeartbeatEvent {
+ /**
+ * Event type identifier (always "sse_heartbeat").
+ */
+ event: 'sse_heartbeat';
+
+ /**
+ * Time the heartbeat was sent.
+ */
+ timestamp: string;
+}
+
/**
* A log entry from the application.
*/
diff --git a/src/version.ts b/src/version.ts
index 3998d8e..0d52c9a 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '0.6.1'; // x-release-please-version
+export const VERSION = '0.6.2'; // x-release-please-version
diff --git a/tests/api-resources/deployments.test.ts b/tests/api-resources/deployments.test.ts
index d8d0b1d..e7fd3eb 100644
--- a/tests/api-resources/deployments.test.ts
+++ b/tests/api-resources/deployments.test.ts
@@ -58,4 +58,16 @@ describe('resource deployments', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});
+
+ // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail
+ 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.deployments.follow(
+ 'id',
+ { since: '2025-06-20T12:00:00Z' },
+ { path: '/_stainless_unknown_path' },
+ ),
+ ).rejects.toThrow(Kernel.NotFoundError);
+ });
});