Skip to content

Commit 7867ba4

Browse files
chore: generate
1 parent 7419ebc commit 7867ba4

3 files changed

Lines changed: 345 additions & 4 deletions

File tree

packages/sdk/js/src/v2/gen/sdk.gen.ts

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import type {
2525
EventTuiSessionSelect,
2626
EventTuiToastShow,
2727
ExperimentalResourceListResponses,
28+
ExperimentalSessionListResponses,
2829
FileListResponses,
2930
FilePartInput,
3031
FilePartSource,
@@ -898,6 +899,48 @@ export class Worktree extends HeyApiClient {
898899
}
899900
}
900901

902+
export class Session extends HeyApiClient {
903+
/**
904+
* List sessions
905+
*
906+
* Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
907+
*/
908+
public list<ThrowOnError extends boolean = false>(
909+
parameters?: {
910+
directory?: string
911+
roots?: boolean
912+
start?: number
913+
cursor?: number
914+
search?: string
915+
limit?: number
916+
archived?: boolean
917+
},
918+
options?: Options<never, ThrowOnError>,
919+
) {
920+
const params = buildClientParams(
921+
[parameters],
922+
[
923+
{
924+
args: [
925+
{ in: "query", key: "directory" },
926+
{ in: "query", key: "roots" },
927+
{ in: "query", key: "start" },
928+
{ in: "query", key: "cursor" },
929+
{ in: "query", key: "search" },
930+
{ in: "query", key: "limit" },
931+
{ in: "query", key: "archived" },
932+
],
933+
},
934+
],
935+
)
936+
return (options?.client ?? this.client).get<ExperimentalSessionListResponses, unknown, ThrowOnError>({
937+
url: "/experimental/session",
938+
...options,
939+
...params,
940+
})
941+
}
942+
}
943+
901944
export class Resource extends HeyApiClient {
902945
/**
903946
* Get MCP resources
@@ -920,13 +963,18 @@ export class Resource extends HeyApiClient {
920963
}
921964

922965
export class Experimental extends HeyApiClient {
966+
private _session?: Session
967+
get session(): Session {
968+
return (this._session ??= new Session({ client: this.client }))
969+
}
970+
923971
private _resource?: Resource
924972
get resource(): Resource {
925973
return (this._resource ??= new Resource({ client: this.client }))
926974
}
927975
}
928976

929-
export class Session extends HeyApiClient {
977+
export class Session2 extends HeyApiClient {
930978
/**
931979
* List sessions
932980
*
@@ -3231,9 +3279,9 @@ export class OpencodeClient extends HeyApiClient {
32313279
return (this._experimental ??= new Experimental({ client: this.client }))
32323280
}
32333281

3234-
private _session?: Session
3235-
get session(): Session {
3236-
return (this._session ??= new Session({ client: this.client }))
3282+
private _session?: Session2
3283+
get session(): Session2 {
3284+
return (this._session ??= new Session2({ client: this.client }))
32373285
}
32383286

32393287
private _part?: Part

packages/sdk/js/src/v2/gen/types.gen.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,45 @@ export type WorktreeResetInput = {
20442044
directory: string
20452045
}
20462046

2047+
export type ProjectSummary = {
2048+
id: string
2049+
name?: string
2050+
worktree: string
2051+
}
2052+
2053+
export type GlobalSession = {
2054+
id: string
2055+
slug: string
2056+
projectID: string
2057+
directory: string
2058+
parentID?: string
2059+
summary?: {
2060+
additions: number
2061+
deletions: number
2062+
files: number
2063+
diffs?: Array<FileDiff>
2064+
}
2065+
share?: {
2066+
url: string
2067+
}
2068+
title: string
2069+
version: string
2070+
time: {
2071+
created: number
2072+
updated: number
2073+
compacting?: number
2074+
archived?: number
2075+
}
2076+
permission?: PermissionRuleset
2077+
revert?: {
2078+
messageID: string
2079+
partID?: string
2080+
snapshot?: string
2081+
diff?: string
2082+
}
2083+
project: ProjectSummary | null
2084+
}
2085+
20472086
export type McpResource = {
20482087
name: string
20492088
uri: string
@@ -2870,6 +2909,51 @@ export type WorktreeResetResponses = {
28702909

28712910
export type WorktreeResetResponse = WorktreeResetResponses[keyof WorktreeResetResponses]
28722911

2912+
export type ExperimentalSessionListData = {
2913+
body?: never
2914+
path?: never
2915+
query?: {
2916+
/**
2917+
* Filter sessions by project directory
2918+
*/
2919+
directory?: string
2920+
/**
2921+
* Only return root sessions (no parentID)
2922+
*/
2923+
roots?: boolean
2924+
/**
2925+
* Filter sessions updated on or after this timestamp (milliseconds since epoch)
2926+
*/
2927+
start?: number
2928+
/**
2929+
* Return sessions updated before this timestamp (milliseconds since epoch)
2930+
*/
2931+
cursor?: number
2932+
/**
2933+
* Filter sessions by title (case-insensitive)
2934+
*/
2935+
search?: string
2936+
/**
2937+
* Maximum number of sessions to return
2938+
*/
2939+
limit?: number
2940+
/**
2941+
* Include archived sessions (default false)
2942+
*/
2943+
archived?: boolean
2944+
}
2945+
url: "/experimental/session"
2946+
}
2947+
2948+
export type ExperimentalSessionListResponses = {
2949+
/**
2950+
* List of sessions
2951+
*/
2952+
200: Array<GlobalSession>
2953+
}
2954+
2955+
export type ExperimentalSessionListResponse = ExperimentalSessionListResponses[keyof ExperimentalSessionListResponses]
2956+
28732957
export type ExperimentalResourceListData = {
28742958
body?: never
28752959
path?: never

0 commit comments

Comments
 (0)