chore: generate
This commit is contained in:
@@ -25,6 +25,7 @@ import type {
|
|||||||
EventTuiSessionSelect,
|
EventTuiSessionSelect,
|
||||||
EventTuiToastShow,
|
EventTuiToastShow,
|
||||||
ExperimentalResourceListResponses,
|
ExperimentalResourceListResponses,
|
||||||
|
ExperimentalSessionListResponses,
|
||||||
FileListResponses,
|
FileListResponses,
|
||||||
FilePartInput,
|
FilePartInput,
|
||||||
FilePartSource,
|
FilePartSource,
|
||||||
@@ -898,6 +899,48 @@ export class Worktree extends HeyApiClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class Session extends HeyApiClient {
|
||||||
|
/**
|
||||||
|
* List sessions
|
||||||
|
*
|
||||||
|
* Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
|
||||||
|
*/
|
||||||
|
public list<ThrowOnError extends boolean = false>(
|
||||||
|
parameters?: {
|
||||||
|
directory?: string
|
||||||
|
roots?: boolean
|
||||||
|
start?: number
|
||||||
|
cursor?: number
|
||||||
|
search?: string
|
||||||
|
limit?: number
|
||||||
|
archived?: boolean
|
||||||
|
},
|
||||||
|
options?: Options<never, ThrowOnError>,
|
||||||
|
) {
|
||||||
|
const params = buildClientParams(
|
||||||
|
[parameters],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
args: [
|
||||||
|
{ in: "query", key: "directory" },
|
||||||
|
{ in: "query", key: "roots" },
|
||||||
|
{ in: "query", key: "start" },
|
||||||
|
{ in: "query", key: "cursor" },
|
||||||
|
{ in: "query", key: "search" },
|
||||||
|
{ in: "query", key: "limit" },
|
||||||
|
{ in: "query", key: "archived" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
)
|
||||||
|
return (options?.client ?? this.client).get<ExperimentalSessionListResponses, unknown, ThrowOnError>({
|
||||||
|
url: "/experimental/session",
|
||||||
|
...options,
|
||||||
|
...params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class Resource extends HeyApiClient {
|
export class Resource extends HeyApiClient {
|
||||||
/**
|
/**
|
||||||
* Get MCP resources
|
* Get MCP resources
|
||||||
@@ -920,13 +963,18 @@ export class Resource extends HeyApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class Experimental extends HeyApiClient {
|
export class Experimental extends HeyApiClient {
|
||||||
|
private _session?: Session
|
||||||
|
get session(): Session {
|
||||||
|
return (this._session ??= new Session({ client: this.client }))
|
||||||
|
}
|
||||||
|
|
||||||
private _resource?: Resource
|
private _resource?: Resource
|
||||||
get resource(): Resource {
|
get resource(): Resource {
|
||||||
return (this._resource ??= new Resource({ client: this.client }))
|
return (this._resource ??= new Resource({ client: this.client }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Session extends HeyApiClient {
|
export class Session2 extends HeyApiClient {
|
||||||
/**
|
/**
|
||||||
* List sessions
|
* List sessions
|
||||||
*
|
*
|
||||||
@@ -3231,9 +3279,9 @@ export class OpencodeClient extends HeyApiClient {
|
|||||||
return (this._experimental ??= new Experimental({ client: this.client }))
|
return (this._experimental ??= new Experimental({ client: this.client }))
|
||||||
}
|
}
|
||||||
|
|
||||||
private _session?: Session
|
private _session?: Session2
|
||||||
get session(): Session {
|
get session(): Session2 {
|
||||||
return (this._session ??= new Session({ client: this.client }))
|
return (this._session ??= new Session2({ client: this.client }))
|
||||||
}
|
}
|
||||||
|
|
||||||
private _part?: Part
|
private _part?: Part
|
||||||
|
|||||||
@@ -2044,6 +2044,45 @@ export type WorktreeResetInput = {
|
|||||||
directory: string
|
directory: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ProjectSummary = {
|
||||||
|
id: string
|
||||||
|
name?: string
|
||||||
|
worktree: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type GlobalSession = {
|
||||||
|
id: string
|
||||||
|
slug: string
|
||||||
|
projectID: string
|
||||||
|
directory: string
|
||||||
|
parentID?: string
|
||||||
|
summary?: {
|
||||||
|
additions: number
|
||||||
|
deletions: number
|
||||||
|
files: number
|
||||||
|
diffs?: Array<FileDiff>
|
||||||
|
}
|
||||||
|
share?: {
|
||||||
|
url: string
|
||||||
|
}
|
||||||
|
title: string
|
||||||
|
version: string
|
||||||
|
time: {
|
||||||
|
created: number
|
||||||
|
updated: number
|
||||||
|
compacting?: number
|
||||||
|
archived?: number
|
||||||
|
}
|
||||||
|
permission?: PermissionRuleset
|
||||||
|
revert?: {
|
||||||
|
messageID: string
|
||||||
|
partID?: string
|
||||||
|
snapshot?: string
|
||||||
|
diff?: string
|
||||||
|
}
|
||||||
|
project: ProjectSummary | null
|
||||||
|
}
|
||||||
|
|
||||||
export type McpResource = {
|
export type McpResource = {
|
||||||
name: string
|
name: string
|
||||||
uri: string
|
uri: string
|
||||||
@@ -2870,6 +2909,51 @@ export type WorktreeResetResponses = {
|
|||||||
|
|
||||||
export type WorktreeResetResponse = WorktreeResetResponses[keyof WorktreeResetResponses]
|
export type WorktreeResetResponse = WorktreeResetResponses[keyof WorktreeResetResponses]
|
||||||
|
|
||||||
|
export type ExperimentalSessionListData = {
|
||||||
|
body?: never
|
||||||
|
path?: never
|
||||||
|
query?: {
|
||||||
|
/**
|
||||||
|
* Filter sessions by project directory
|
||||||
|
*/
|
||||||
|
directory?: string
|
||||||
|
/**
|
||||||
|
* Only return root sessions (no parentID)
|
||||||
|
*/
|
||||||
|
roots?: boolean
|
||||||
|
/**
|
||||||
|
* Filter sessions updated on or after this timestamp (milliseconds since epoch)
|
||||||
|
*/
|
||||||
|
start?: number
|
||||||
|
/**
|
||||||
|
* Return sessions updated before this timestamp (milliseconds since epoch)
|
||||||
|
*/
|
||||||
|
cursor?: number
|
||||||
|
/**
|
||||||
|
* Filter sessions by title (case-insensitive)
|
||||||
|
*/
|
||||||
|
search?: string
|
||||||
|
/**
|
||||||
|
* Maximum number of sessions to return
|
||||||
|
*/
|
||||||
|
limit?: number
|
||||||
|
/**
|
||||||
|
* Include archived sessions (default false)
|
||||||
|
*/
|
||||||
|
archived?: boolean
|
||||||
|
}
|
||||||
|
url: "/experimental/session"
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ExperimentalSessionListResponses = {
|
||||||
|
/**
|
||||||
|
* List of sessions
|
||||||
|
*/
|
||||||
|
200: Array<GlobalSession>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ExperimentalSessionListResponse = ExperimentalSessionListResponses[keyof ExperimentalSessionListResponses]
|
||||||
|
|
||||||
export type ExperimentalResourceListData = {
|
export type ExperimentalResourceListData = {
|
||||||
body?: never
|
body?: never
|
||||||
path?: never
|
path?: never
|
||||||
|
|||||||
@@ -1202,6 +1202,92 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/experimental/session": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "experimental.session.list",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "directory",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": "Filter sessions by project directory"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "roots",
|
||||||
|
"schema": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"description": "Only return root sessions (no parentID)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "start",
|
||||||
|
"schema": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "cursor",
|
||||||
|
"schema": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"description": "Return sessions updated before this timestamp (milliseconds since epoch)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "search",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": "Filter sessions by title (case-insensitive)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "limit",
|
||||||
|
"schema": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"description": "Maximum number of sessions to return"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "archived",
|
||||||
|
"schema": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"description": "Include archived sessions (default false)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"summary": "List sessions",
|
||||||
|
"description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "List of sessions",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/GlobalSession"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-codeSamples": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/experimental/resource": {
|
"/experimental/resource": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "experimental.resource.list",
|
"operationId": "experimental.resource.list",
|
||||||
@@ -10499,6 +10585,129 @@
|
|||||||
},
|
},
|
||||||
"required": ["directory"]
|
"required": ["directory"]
|
||||||
},
|
},
|
||||||
|
"ProjectSummary": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"worktree": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "worktree"]
|
||||||
|
},
|
||||||
|
"GlobalSession": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^ses.*"
|
||||||
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"projectID": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"directory": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parentID": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^ses.*"
|
||||||
|
},
|
||||||
|
"summary": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"additions": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"deletions": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"files": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"diffs": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/FileDiff"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["additions", "deletions", "files"]
|
||||||
|
},
|
||||||
|
"share": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"url": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["url"]
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"created": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"updated": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"compacting": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"archived": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["created", "updated"]
|
||||||
|
},
|
||||||
|
"permission": {
|
||||||
|
"$ref": "#/components/schemas/PermissionRuleset"
|
||||||
|
},
|
||||||
|
"revert": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"messageID": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"partID": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"snapshot": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"diff": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["messageID"]
|
||||||
|
},
|
||||||
|
"project": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/ProjectSummary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
|
||||||
|
},
|
||||||
"McpResource": {
|
"McpResource": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
Reference in New Issue
Block a user