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.1.0-alpha.7"
".": "0.1.0-alpha.8"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 3
configured_endpoints: 4
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d168b58fcf39dbd0458d132091793d3e2d0930070b7dda2d5f7f1baff20dd31b.yml
openapi_spec_hash: b7e0fd7ee1656d7dbad57209d1584d92
config_hash: 9139d1eb064baf60fd2265aac382f097
config_hash: eab40627b734534462ae3b8ccd8b263b
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.8 (2025-05-11)

Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/onkernel/kernel-node-sdk/compare/v0.1.0-alpha.7...v0.1.0-alpha.8)

### Features

* **api:** update via SDK Studio ([78d450e](https://github.com/onkernel/kernel-node-sdk/commit/78d450e7f02ea519794247bf6ae1fe341779151f))

## 0.1.0-alpha.7 (2025-05-11)

Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/onkernel/kernel-node-sdk/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ Types:

- <code><a href="./src/resources/apps.ts">AppDeployResponse</a></code>
- <code><a href="./src/resources/apps.ts">AppInvokeResponse</a></code>
- <code><a href="./src/resources/apps.ts">AppRetrieveInvocationResponse</a></code>

Methods:

- <code title="post /apps/deploy">client.apps.<a href="./src/resources/apps.ts">deploy</a>({ ...params }) -> AppDeployResponse</code>
- <code title="post /apps/invoke">client.apps.<a href="./src/resources/apps.ts">invoke</a>({ ...params }) -> AppInvokeResponse</code>
- <code title="get /apps/invocations/{id}">client.apps.<a href="./src/resources/apps.ts">retrieveInvocation</a>(id) -> AppRetrieveInvocationResponse</code>

# Browser

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.1.0-alpha.7",
"version": "0.1.0-alpha.8",
"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 @@ -25,6 +25,7 @@ import {
AppDeployResponse,
AppInvokeParams,
AppInvokeResponse,
AppRetrieveInvocationResponse,
Apps,
} from './resources/apps';
import { Browser, BrowserCreateSessionResponse } from './resources/browser';
Expand Down Expand Up @@ -745,6 +746,7 @@ export declare namespace Kernel {
Apps as Apps,
type AppDeployResponse as AppDeployResponse,
type AppInvokeResponse as AppInvokeResponse,
type AppRetrieveInvocationResponse as AppRetrieveInvocationResponse,
type AppDeployParams as AppDeployParams,
type AppInvokeParams as AppInvokeParams,
};
Expand Down
32 changes: 32 additions & 0 deletions src/resources/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { APIPromise } from '../core/api-promise';
import { type Uploadable } from '../core/uploads';
import { RequestOptions } from '../internal/request-options';
import { multipartFormRequestOptions } from '../internal/uploads';
import { path } from '../internal/utils/path';

export class Apps extends APIResource {
/**
Expand Down Expand Up @@ -39,6 +40,20 @@ export class Apps extends APIResource {
invoke(body: AppInvokeParams, options?: RequestOptions): APIPromise<AppInvokeResponse> {
return this._client.post('/apps/invoke', { body, ...options });
}

/**
* Get an app invocation by id
*
* @example
* ```ts
* const response = await client.apps.retrieveInvocation(
* 'ckqwer3o20000jb9s7abcdef',
* );
* ```
*/
retrieveInvocation(id: string, options?: RequestOptions): APIPromise<AppRetrieveInvocationResponse> {
return this._client.get(path`/apps/invocations/${id}`, options);
}
}

export interface AppDeployResponse {
Expand Down Expand Up @@ -75,6 +90,22 @@ export interface AppInvokeResponse {
output?: string;
}

export interface AppRetrieveInvocationResponse {
id: string;

appName: string;

finishedAt: string | null;

input: string;

output: string;

startedAt: string;

status: string;
}

export interface AppDeployParams {
/**
* Name of the application
Expand Down Expand Up @@ -123,6 +154,7 @@ export declare namespace Apps {
export {
type AppDeployResponse as AppDeployResponse,
type AppInvokeResponse as AppInvokeResponse,
type AppRetrieveInvocationResponse as AppRetrieveInvocationResponse,
type AppDeployParams as AppDeployParams,
type AppInvokeParams as AppInvokeParams,
};
Expand Down
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export {
Apps,
type AppDeployResponse,
type AppInvokeResponse,
type AppRetrieveInvocationResponse,
type AppDeployParams,
type AppInvokeParams,
} from './apps';
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.1.0-alpha.7'; // x-release-please-version
export const VERSION = '0.1.0-alpha.8'; // x-release-please-version
12 changes: 12 additions & 0 deletions tests/api-resources/apps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,16 @@ describe('resource apps', () => {
version: '1.0.0',
});
});

// skipped: tests are disabled for the time being
test.skip('retrieveInvocation', async () => {
const responsePromise = client.apps.retrieveInvocation('ckqwer3o20000jb9s7abcdef');
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);
});
});