Skip to content

Commit f48215c

Browse files
authored
Merge pull request #23 from onkernel/release-please--branches--main--changes--next--components--sdk
release: 0.4.0
2 parents ef27cbe + bf67bd6 commit f48215c

File tree

11 files changed

+157
-14
lines changed

11 files changed

+157
-14
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.3.0"
2+
".": "0.4.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-3edc7a0eef4a0d4495782efbdb0d9b777a55aee058dab119f90de56019441326.yml
3-
openapi_spec_hash: dff0b1efa1c1614cf770ed8327cefab2
4-
config_hash: cb04a4d88ee9f530b303ca57ff7090b3
1+
configured_endpoints: 11
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-64ccdff4ca5d73d79d89e817fe83ccfd3d529696df3e6818c3c75e586ae00801.yml
3+
openapi_spec_hash: 21c7b8757fc0cc9415cda1bc06251de6
4+
config_hash: b3fcacd707da56b21d31ce0baf4fb87d

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.4.0 (2025-05-28)
4+
5+
Full Changelog: [v0.3.0...v0.4.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.3.0...v0.4.0)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([4c5b6b6](https://github.com/onkernel/kernel-node-sdk/commit/4c5b6b6ecf8e34ced647b42dca75c5a2b5deaf87))
10+
11+
12+
### Chores
13+
14+
* improve publish-npm script --latest tag logic ([ac1ab4f](https://github.com/onkernel/kernel-node-sdk/commit/ac1ab4f2c79dc4df0b405007e9d64999ce8ed362))
15+
316
## 0.3.0 (2025-05-22)
417

518
Full Changelog: [v0.2.0...v0.3.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.2.0...v0.3.0)

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ Types:
2626

2727
- <code><a href="./src/resources/apps/invocations.ts">InvocationCreateResponse</a></code>
2828
- <code><a href="./src/resources/apps/invocations.ts">InvocationRetrieveResponse</a></code>
29+
- <code><a href="./src/resources/apps/invocations.ts">InvocationUpdateResponse</a></code>
2930

3031
Methods:
3132

3233
- <code title="post /invocations">client.apps.invocations.<a href="./src/resources/apps/invocations.ts">create</a>({ ...params }) -> InvocationCreateResponse</code>
3334
- <code title="get /invocations/{id}">client.apps.invocations.<a href="./src/resources/apps/invocations.ts">retrieve</a>(id) -> InvocationRetrieveResponse</code>
35+
- <code title="patch /invocations/{id}">client.apps.invocations.<a href="./src/resources/apps/invocations.ts">update</a>(id, { ...params }) -> InvocationUpdateResponse</code>
3436

3537
# Browsers
3638

bin/publish-npm

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,35 @@ set -eux
44

55
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
66

7-
# Build the project
87
yarn build
9-
10-
# Navigate to the dist directory
118
cd dist
129

13-
# Get the version from package.json
10+
# Get latest version from npm
11+
#
12+
# If the package doesn't exist, yarn will return
13+
# {"type":"error","data":"Received invalid response from npm."}
14+
# where .data.version doesn't exist so LAST_VERSION will be an empty string.
15+
LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')"
16+
17+
# Get current version from package.json
1418
VERSION="$(node -p "require('./package.json').version")"
1519

16-
# Extract the pre-release tag if it exists
20+
# Check if current version is pre-release (e.g. alpha / beta / rc)
21+
CURRENT_IS_PRERELEASE=false
1722
if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then
18-
# Extract the part before any dot in the pre-release identifier
19-
TAG="${BASH_REMATCH[1]}"
23+
CURRENT_IS_PRERELEASE=true
24+
CURRENT_TAG="${BASH_REMATCH[1]}"
25+
fi
26+
27+
# Check if last version is a stable release
28+
LAST_IS_STABLE_RELEASE=true
29+
if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then
30+
LAST_IS_STABLE_RELEASE=false
31+
fi
32+
33+
# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease.
34+
if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then
35+
TAG="$CURRENT_TAG"
2036
else
2137
TAG="latest"
2238
fi

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@onkernel/sdk",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "The official TypeScript library for the Kernel API",
55
"author": "Kernel <>",
66
"types": "dist/index.d.ts",

src/resources/apps/apps.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
InvocationCreateParams,
1414
InvocationCreateResponse,
1515
InvocationRetrieveResponse,
16+
InvocationUpdateParams,
17+
InvocationUpdateResponse,
1618
Invocations,
1719
} from './invocations';
1820
import { APIPromise } from '../../core/api-promise';
@@ -99,6 +101,8 @@ export declare namespace Apps {
99101
Invocations as Invocations,
100102
type InvocationCreateResponse as InvocationCreateResponse,
101103
type InvocationRetrieveResponse as InvocationRetrieveResponse,
104+
type InvocationUpdateResponse as InvocationUpdateResponse,
102105
type InvocationCreateParams as InvocationCreateParams,
106+
type InvocationUpdateParams as InvocationUpdateParams,
103107
};
104108
}

src/resources/apps/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ export {
1111
Invocations,
1212
type InvocationCreateResponse,
1313
type InvocationRetrieveResponse,
14+
type InvocationUpdateResponse,
1415
type InvocationCreateParams,
16+
type InvocationUpdateParams,
1517
} from './invocations';

src/resources/apps/invocations.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ export class Invocations extends APIResource {
3535
retrieve(id: string, options?: RequestOptions): APIPromise<InvocationRetrieveResponse> {
3636
return this._client.get(path`/invocations/${id}`, options);
3737
}
38+
39+
/**
40+
* Update invocation status or output
41+
*
42+
* @example
43+
* ```ts
44+
* const invocation = await client.apps.invocations.update(
45+
* 'id',
46+
* { status: 'succeeded' },
47+
* );
48+
* ```
49+
*/
50+
update(
51+
id: string,
52+
body: InvocationUpdateParams,
53+
options?: RequestOptions,
54+
): APIPromise<InvocationUpdateResponse> {
55+
return this._client.patch(path`/invocations/${id}`, { body, ...options });
56+
}
3857
}
3958

4059
export interface InvocationCreateResponse {
@@ -109,6 +128,55 @@ export interface InvocationRetrieveResponse {
109128
status_reason?: string;
110129
}
111130

131+
export interface InvocationUpdateResponse {
132+
/**
133+
* ID of the invocation
134+
*/
135+
id: string;
136+
137+
/**
138+
* Name of the action invoked
139+
*/
140+
action_name: string;
141+
142+
/**
143+
* Name of the application
144+
*/
145+
app_name: string;
146+
147+
/**
148+
* RFC 3339 Nanoseconds timestamp when the invocation started
149+
*/
150+
started_at: string;
151+
152+
/**
153+
* Status of the invocation
154+
*/
155+
status: 'queued' | 'running' | 'succeeded' | 'failed';
156+
157+
/**
158+
* RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
159+
* running)
160+
*/
161+
finished_at?: string | null;
162+
163+
/**
164+
* Output produced by the action, rendered as a JSON string. This could be: string,
165+
* number, boolean, array, object, or null.
166+
*/
167+
output?: string;
168+
169+
/**
170+
* Payload provided to the invocation. This is a string that can be parsed as JSON.
171+
*/
172+
payload?: string;
173+
174+
/**
175+
* Status reason
176+
*/
177+
status_reason?: string;
178+
}
179+
112180
export interface InvocationCreateParams {
113181
/**
114182
* Name of the action to invoke
@@ -125,16 +193,36 @@ export interface InvocationCreateParams {
125193
*/
126194
version: string;
127195

196+
/**
197+
* If true, invoke asynchronously. When set, the API responds 202 Accepted with
198+
* status "queued".
199+
*/
200+
async?: boolean;
201+
128202
/**
129203
* Input data for the action, sent as a JSON string.
130204
*/
131205
payload?: string;
132206
}
133207

208+
export interface InvocationUpdateParams {
209+
/**
210+
* New status for the invocation.
211+
*/
212+
status: 'succeeded' | 'failed';
213+
214+
/**
215+
* Updated output of the invocation rendered as JSON string.
216+
*/
217+
output?: string;
218+
}
219+
134220
export declare namespace Invocations {
135221
export {
136222
type InvocationCreateResponse as InvocationCreateResponse,
137223
type InvocationRetrieveResponse as InvocationRetrieveResponse,
224+
type InvocationUpdateResponse as InvocationUpdateResponse,
138225
type InvocationCreateParams as InvocationCreateParams,
226+
type InvocationUpdateParams as InvocationUpdateParams,
139227
};
140228
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.3.0'; // x-release-please-version
1+
export const VERSION = '0.4.0'; // x-release-please-version

0 commit comments

Comments
 (0)