Skip to content

Commit dcc8028

Browse files
authored
Merge pull request #62 from onkernel/release-please--branches--main--changes--next--components--sdk
release: 0.24.0
2 parents 4d6f1cd + b72b0a8 commit dcc8028

File tree

18 files changed

+617
-153
lines changed

18 files changed

+617
-153
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.23.0"
2+
".": "0.24.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: 82
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-dac11bdb857e700a8c39d183e753ddd1ebaaca69fd9fc5ee57d6b56b70b00e6e.yml
3-
openapi_spec_hash: 78fbc50dd0b61cdc87564fbea278ee23
4-
config_hash: a4b4d14bdf6af723b235a6981977627c
1+
configured_endpoints: 89
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-13214b99e392aab631aa1ca99b6a51a58df81e34156d21b8d639bea779566123.yml
3+
openapi_spec_hash: a88d175fc3980de3097ac1411d8dcbff
4+
config_hash: 179f33af31ece83563163d5b3d751d13

CHANGELOG.md

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

3+
## 0.24.0 (2025-12-17)
4+
5+
Full Changelog: [v0.23.0...v0.24.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.23.0...v0.24.0)
6+
7+
### Features
8+
9+
* Enhance AuthAgentInvocationCreateResponse to include already_authenti… ([70cd6d6](https://github.com/onkernel/kernel-node-sdk/commit/70cd6d6c44fa9f90a5bfad3e6268bd6264a9f83b))
10+
* Fix browser pool sdk types ([e4b773f](https://github.com/onkernel/kernel-node-sdk/commit/e4b773f9923b1bf4fcda5bd2c9832cbb291981bd))
11+
312
## 0.23.0 (2025-12-11)
413

514
Full Changelog: [v0.22.0...v0.23.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.22.0...v0.23.0)

api.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ Methods:
229229
Types:
230230

231231
- <code><a href="./src/resources/browser-pools.ts">BrowserPool</a></code>
232-
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolAcquireRequest</a></code>
233-
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolReleaseRequest</a></code>
234-
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolRequest</a></code>
235-
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolUpdateRequest</a></code>
236232
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolListResponse</a></code>
237233
- <code><a href="./src/resources/browser-pools.ts">BrowserPoolAcquireResponse</a></code>
238234

@@ -261,12 +257,15 @@ Types:
261257
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgentInvocationCreateRequest</a></code>
262258
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgentInvocationCreateResponse</a></code>
263259
- <code><a href="./src/resources/agents/auth/auth.ts">DiscoveredField</a></code>
260+
- <code><a href="./src/resources/agents/auth/auth.ts">ReauthResponse</a></code>
264261

265262
Methods:
266263

267264
- <code title="post /agents/auth">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">create</a>({ ...params }) -> AuthAgent</code>
268265
- <code title="get /agents/auth/{id}">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">retrieve</a>(id) -> AuthAgent</code>
269266
- <code title="get /agents/auth">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">list</a>({ ...params }) -> AuthAgentsOffsetPagination</code>
267+
- <code title="delete /agents/auth/{id}">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">delete</a>(id) -> void</code>
268+
- <code title="post /agents/auth/{id}/reauth">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">reauth</a>(id) -> ReauthResponse</code>
270269

271270
### Invocations
272271

@@ -281,3 +280,19 @@ Methods:
281280
- <code title="post /agents/auth/invocations/{invocation_id}/discover">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">discover</a>(invocationID, { ...params }) -> AgentAuthDiscoverResponse</code>
282281
- <code title="post /agents/auth/invocations/{invocation_id}/exchange">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">exchange</a>(invocationID, { ...params }) -> InvocationExchangeResponse</code>
283282
- <code title="post /agents/auth/invocations/{invocation_id}/submit">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">submit</a>(invocationID, { ...params }) -> AgentAuthSubmitResponse</code>
283+
284+
# Credentials
285+
286+
Types:
287+
288+
- <code><a href="./src/resources/credentials.ts">CreateCredentialRequest</a></code>
289+
- <code><a href="./src/resources/credentials.ts">Credential</a></code>
290+
- <code><a href="./src/resources/credentials.ts">UpdateCredentialRequest</a></code>
291+
292+
Methods:
293+
294+
- <code title="post /credentials">client.credentials.<a href="./src/resources/credentials.ts">create</a>({ ...params }) -> Credential</code>
295+
- <code title="get /credentials/{id}">client.credentials.<a href="./src/resources/credentials.ts">retrieve</a>(id) -> Credential</code>
296+
- <code title="patch /credentials/{id}">client.credentials.<a href="./src/resources/credentials.ts">update</a>(id, { ...params }) -> Credential</code>
297+
- <code title="get /credentials">client.credentials.<a href="./src/resources/credentials.ts">list</a>({ ...params }) -> CredentialsOffsetPagination</code>
298+
- <code title="delete /credentials/{id}">client.credentials.<a href="./src/resources/credentials.ts">delete</a>(id) -> void</code>

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.23.0",
3+
"version": "0.24.0",
44
"description": "The official TypeScript library for the Kernel API",
55
"author": "Kernel <>",
66
"types": "dist/index.d.ts",

src/client.ts

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,24 @@ import { AppListParams, AppListResponse, AppListResponsesOffsetPagination, Apps
2222
import {
2323
BrowserPool,
2424
BrowserPoolAcquireParams,
25-
BrowserPoolAcquireRequest,
2625
BrowserPoolAcquireResponse,
2726
BrowserPoolCreateParams,
2827
BrowserPoolDeleteParams,
2928
BrowserPoolListResponse,
3029
BrowserPoolReleaseParams,
31-
BrowserPoolReleaseRequest,
32-
BrowserPoolRequest,
3330
BrowserPoolUpdateParams,
34-
BrowserPoolUpdateRequest,
3531
BrowserPools,
3632
} from './resources/browser-pools';
33+
import {
34+
CreateCredentialRequest,
35+
Credential,
36+
CredentialCreateParams,
37+
CredentialListParams,
38+
CredentialUpdateParams,
39+
Credentials,
40+
CredentialsOffsetPagination,
41+
UpdateCredentialRequest,
42+
} from './resources/credentials';
3743
import {
3844
DeploymentCreateParams,
3945
DeploymentCreateResponse,
@@ -861,6 +867,7 @@ export class Kernel {
861867
extensions: API.Extensions = new API.Extensions(this);
862868
browserPools: API.BrowserPools = new API.BrowserPools(this);
863869
agents: API.Agents = new API.Agents(this);
870+
credentials: API.Credentials = new API.Credentials(this);
864871
}
865872

866873
Kernel.Deployments = Deployments;
@@ -872,6 +879,7 @@ Kernel.Proxies = Proxies;
872879
Kernel.Extensions = Extensions;
873880
Kernel.BrowserPools = BrowserPools;
874881
Kernel.Agents = Agents;
882+
Kernel.Credentials = Credentials;
875883

876884
export declare namespace Kernel {
877885
export type RequestOptions = Opts.RequestOptions;
@@ -956,10 +964,6 @@ export declare namespace Kernel {
956964
export {
957965
BrowserPools as BrowserPools,
958966
type BrowserPool as BrowserPool,
959-
type BrowserPoolAcquireRequest as BrowserPoolAcquireRequest,
960-
type BrowserPoolReleaseRequest as BrowserPoolReleaseRequest,
961-
type BrowserPoolRequest as BrowserPoolRequest,
962-
type BrowserPoolUpdateRequest as BrowserPoolUpdateRequest,
963967
type BrowserPoolListResponse as BrowserPoolListResponse,
964968
type BrowserPoolAcquireResponse as BrowserPoolAcquireResponse,
965969
type BrowserPoolCreateParams as BrowserPoolCreateParams,
@@ -971,6 +975,17 @@ export declare namespace Kernel {
971975

972976
export { Agents as Agents };
973977

978+
export {
979+
Credentials as Credentials,
980+
type CreateCredentialRequest as CreateCredentialRequest,
981+
type Credential as Credential,
982+
type UpdateCredentialRequest as UpdateCredentialRequest,
983+
type CredentialsOffsetPagination as CredentialsOffsetPagination,
984+
type CredentialCreateParams as CredentialCreateParams,
985+
type CredentialUpdateParams as CredentialUpdateParams,
986+
type CredentialListParams as CredentialListParams,
987+
};
988+
974989
export type AppAction = API.AppAction;
975990
export type BrowserExtension = API.BrowserExtension;
976991
export type BrowserProfile = API.BrowserProfile;

src/resources/agents/agents.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
AuthCreateParams,
1616
AuthListParams,
1717
DiscoveredField,
18+
ReauthResponse,
1819
} from './auth/auth';
1920

2021
export class Agents extends APIResource {
@@ -34,6 +35,7 @@ export declare namespace Agents {
3435
type AuthAgentInvocationCreateRequest as AuthAgentInvocationCreateRequest,
3536
type AuthAgentInvocationCreateResponse as AuthAgentInvocationCreateResponse,
3637
type DiscoveredField as DiscoveredField,
38+
type ReauthResponse as ReauthResponse,
3739
type AuthAgentsOffsetPagination as AuthAgentsOffsetPagination,
3840
type AuthCreateParams as AuthCreateParams,
3941
type AuthListParams as AuthListParams,

src/resources/agents/auth/auth.ts

Lines changed: 138 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from './invocations';
1313
import { APIPromise } from '../../../core/api-promise';
1414
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../../../core/pagination';
15+
import { buildHeaders } from '../../../internal/headers';
1516
import { RequestOptions } from '../../../internal/request-options';
1617
import { path } from '../../../internal/utils/path';
1718

@@ -66,6 +67,42 @@ export class Auth extends APIResource {
6667
): PagePromise<AuthAgentsOffsetPagination, AuthAgent> {
6768
return this._client.getAPIList('/agents/auth', OffsetPagination<AuthAgent>, { query, ...options });
6869
}
70+
71+
/**
72+
* Deletes an auth agent and terminates its workflow. This will:
73+
*
74+
* - Soft delete the auth agent record
75+
* - Gracefully terminate the agent's Temporal workflow
76+
* - Cancel any in-progress invocations
77+
*
78+
* @example
79+
* ```ts
80+
* await client.agents.auth.delete('id');
81+
* ```
82+
*/
83+
delete(id: string, options?: RequestOptions): APIPromise<void> {
84+
return this._client.delete(path`/agents/auth/${id}`, {
85+
...options,
86+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
87+
});
88+
}
89+
90+
/**
91+
* Triggers automatic re-authentication for an auth agent using stored credentials.
92+
* Requires the auth agent to have a linked credential, stored selectors, and
93+
* login_url. Returns immediately with status indicating whether re-auth was
94+
* started.
95+
*
96+
* @example
97+
* ```ts
98+
* const reauthResponse = await client.agents.auth.reauth(
99+
* 'id',
100+
* );
101+
* ```
102+
*/
103+
reauth(id: string, options?: RequestOptions): APIPromise<ReauthResponse> {
104+
return this._client.post(path`/agents/auth/${id}/reauth`, options);
105+
}
69106
}
70107

71108
export type AuthAgentsOffsetPagination = OffsetPagination<AuthAgent>;
@@ -196,6 +233,27 @@ export interface AuthAgent {
196233
*/
197234
status: 'AUTHENTICATED' | 'NEEDS_AUTH';
198235

236+
/**
237+
* Whether automatic re-authentication is possible (has credential_id, selectors,
238+
* and login_url)
239+
*/
240+
can_reauth?: boolean;
241+
242+
/**
243+
* ID of the linked credential for automatic re-authentication
244+
*/
245+
credential_id?: string;
246+
247+
/**
248+
* Name of the linked credential for automatic re-authentication
249+
*/
250+
credential_name?: string;
251+
252+
/**
253+
* Whether this auth agent has stored selectors for deterministic re-authentication
254+
*/
255+
has_selectors?: boolean;
256+
199257
/**
200258
* When the last authentication check was performed
201259
*/
@@ -216,6 +274,13 @@ export interface AuthAgentCreateRequest {
216274
*/
217275
target_domain: string;
218276

277+
/**
278+
* Optional name of an existing credential to use for this auth agent. If provided,
279+
* the credential will be linked to the agent and its values will be used to
280+
* auto-fill the login form on invocation.
281+
*/
282+
credential_name?: string;
283+
219284
/**
220285
* Optional login page URL. If provided, will be stored on the agent and used to
221286
* skip discovery in future invocations.
@@ -248,31 +313,62 @@ export interface AuthAgentInvocationCreateRequest {
248313
* ID of the auth agent to create an invocation for
249314
*/
250315
auth_agent_id: string;
316+
317+
/**
318+
* If provided, saves the submitted credentials under this name upon successful
319+
* login. The credential will be linked to the auth agent for automatic
320+
* re-authentication.
321+
*/
322+
save_credential_as?: string;
251323
}
252324

253325
/**
254-
* Response from creating an auth agent invocation
326+
* Response when the agent is already authenticated.
255327
*/
256-
export interface AuthAgentInvocationCreateResponse {
257-
/**
258-
* When the handoff code expires
259-
*/
260-
expires_at: string;
328+
export type AuthAgentInvocationCreateResponse =
329+
| AuthAgentInvocationCreateResponse.AuthAgentAlreadyAuthenticated
330+
| AuthAgentInvocationCreateResponse.AuthAgentInvocationCreated;
261331

332+
export namespace AuthAgentInvocationCreateResponse {
262333
/**
263-
* One-time code for handoff
334+
* Response when the agent is already authenticated.
264335
*/
265-
handoff_code: string;
336+
export interface AuthAgentAlreadyAuthenticated {
337+
/**
338+
* Indicates the agent is already authenticated and no invocation was created.
339+
*/
340+
status: 'already_authenticated';
341+
}
266342

267343
/**
268-
* URL to redirect user to
344+
* Response when a new invocation was created.
269345
*/
270-
hosted_url: string;
346+
export interface AuthAgentInvocationCreated {
347+
/**
348+
* When the handoff code expires.
349+
*/
350+
expires_at: string;
271351

272-
/**
273-
* Unique identifier for the invocation
274-
*/
275-
invocation_id: string;
352+
/**
353+
* One-time code for handoff.
354+
*/
355+
handoff_code: string;
356+
357+
/**
358+
* URL to redirect user to.
359+
*/
360+
hosted_url: string;
361+
362+
/**
363+
* Unique identifier for the invocation.
364+
*/
365+
invocation_id: string;
366+
367+
/**
368+
* Indicates an invocation was created.
369+
*/
370+
status: 'invocation_created';
371+
}
276372
}
277373

278374
/**
@@ -310,6 +406,26 @@ export interface DiscoveredField {
310406
required?: boolean;
311407
}
312408

409+
/**
410+
* Response from triggering re-authentication
411+
*/
412+
export interface ReauthResponse {
413+
/**
414+
* Result of the re-authentication attempt
415+
*/
416+
status: 'reauth_started' | 'already_authenticated' | 'cannot_reauth';
417+
418+
/**
419+
* ID of the re-auth invocation if one was created
420+
*/
421+
invocation_id?: string;
422+
423+
/**
424+
* Human-readable description of the result
425+
*/
426+
message?: string;
427+
}
428+
313429
export interface AuthCreateParams {
314430
/**
315431
* Name of the profile to use for this auth agent
@@ -321,6 +437,13 @@ export interface AuthCreateParams {
321437
*/
322438
target_domain: string;
323439

440+
/**
441+
* Optional name of an existing credential to use for this auth agent. If provided,
442+
* the credential will be linked to the agent and its values will be used to
443+
* auto-fill the login form on invocation.
444+
*/
445+
credential_name?: string;
446+
324447
/**
325448
* Optional login page URL. If provided, will be stored on the agent and used to
326449
* skip discovery in future invocations.
@@ -369,6 +492,7 @@ export declare namespace Auth {
369492
type AuthAgentInvocationCreateRequest as AuthAgentInvocationCreateRequest,
370493
type AuthAgentInvocationCreateResponse as AuthAgentInvocationCreateResponse,
371494
type DiscoveredField as DiscoveredField,
495+
type ReauthResponse as ReauthResponse,
372496
type AuthAgentsOffsetPagination as AuthAgentsOffsetPagination,
373497
type AuthCreateParams as AuthCreateParams,
374498
type AuthListParams as AuthListParams,

0 commit comments

Comments
 (0)