refactor(server): canonicalize service API (#31049)
This commit is contained in:
parent
53ff1b57c9
commit
fe0c4f8c74
388 changed files with 7075 additions and 4064 deletions
|
|
@ -172,6 +172,8 @@ import type {
|
|||
QuestionReplyErrors,
|
||||
QuestionReplyResponses,
|
||||
QuestionV2Reply,
|
||||
ReferenceListErrors,
|
||||
ReferenceListResponses,
|
||||
SessionAbortErrors,
|
||||
SessionAbortResponses,
|
||||
SessionChildrenErrors,
|
||||
|
|
@ -3333,6 +3335,38 @@ export class Provider extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Reference extends HeyApiClient {
|
||||
/**
|
||||
* List configured references
|
||||
*
|
||||
* List configured references resolved in the current workspace.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "directory" },
|
||||
{ in: "query", key: "workspace" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ReferenceListResponses, ReferenceListErrors, ThrowOnError>({
|
||||
url: "/reference",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Session2 extends HeyApiClient {
|
||||
/**
|
||||
* List sessions
|
||||
|
|
@ -4997,9 +5031,9 @@ export class Tui extends HeyApiClient {
|
|||
|
||||
export class Health extends HeyApiClient {
|
||||
/**
|
||||
* Check v2 server health
|
||||
* Check server health
|
||||
*
|
||||
* Check whether the v2 API server is ready to accept requests.
|
||||
* Check whether the API server is ready to accept requests.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<V2HealthGetResponses, V2HealthGetErrors, ThrowOnError>({
|
||||
|
|
@ -5011,9 +5045,9 @@ export class Health extends HeyApiClient {
|
|||
|
||||
export class Agent extends HeyApiClient {
|
||||
/**
|
||||
* List v2 agents
|
||||
* List agents
|
||||
*
|
||||
* Retrieve currently registered v2 agents.
|
||||
* Retrieve currently registered agents.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
|
|
@ -5051,7 +5085,7 @@ export class Permission2 extends HeyApiClient {
|
|||
V2SessionPermissionListErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/permission/request",
|
||||
url: "/api/session/{sessionID}/permission",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
|
|
@ -5089,7 +5123,7 @@ export class Permission2 extends HeyApiClient {
|
|||
V2SessionPermissionReplyErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/permission/request/{requestID}/reply",
|
||||
url: "/api/session/{sessionID}/permission/{requestID}/reply",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
|
|
@ -5132,7 +5166,7 @@ export class Question2 extends HeyApiClient {
|
|||
V2SessionQuestionReplyErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/question/request/{requestID}/reply",
|
||||
url: "/api/session/{sessionID}/question/{requestID}/reply",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
|
|
@ -5171,7 +5205,7 @@ export class Question2 extends HeyApiClient {
|
|||
V2SessionQuestionRejectErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/question/request/{requestID}/reject",
|
||||
url: "/api/session/{sessionID}/question/{requestID}/reject",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
|
|
@ -5180,7 +5214,7 @@ export class Question2 extends HeyApiClient {
|
|||
|
||||
export class Session3 extends HeyApiClient {
|
||||
/**
|
||||
* List v2 sessions
|
||||
* List sessions
|
||||
*
|
||||
* Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.
|
||||
*/
|
||||
|
|
@ -5222,9 +5256,9 @@ export class Session3 extends HeyApiClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Send v2 message
|
||||
* Send message
|
||||
*
|
||||
* Durably admit one v2 session input and schedule agent-loop execution unless resume is false.
|
||||
* Durably admit one session input and schedule agent-loop execution unless resume is false.
|
||||
*/
|
||||
public prompt<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
|
|
@ -5263,9 +5297,9 @@ export class Session3 extends HeyApiClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Compact v2 session
|
||||
* Compact session
|
||||
*
|
||||
* Compact a v2 session conversation.
|
||||
* Compact a session conversation.
|
||||
*/
|
||||
public compact<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
|
|
@ -5282,9 +5316,9 @@ export class Session3 extends HeyApiClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Wait for v2 session
|
||||
* Wait for session
|
||||
*
|
||||
* Wait for a v2 session agent loop to become idle.
|
||||
* Wait for a session agent loop to become idle.
|
||||
*/
|
||||
public wait<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
|
|
@ -5301,9 +5335,9 @@ export class Session3 extends HeyApiClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get v2 session context
|
||||
* Get session context
|
||||
*
|
||||
* Retrieve the active context messages for a v2 session (all messages after the last compaction).
|
||||
* Retrieve the active context messages for a session (all messages after the last compaction).
|
||||
*/
|
||||
public context<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
|
|
@ -5320,9 +5354,9 @@ export class Session3 extends HeyApiClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get v2 session messages
|
||||
* Get session messages
|
||||
*
|
||||
* Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.
|
||||
* Retrieve projected messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.
|
||||
*/
|
||||
public messages<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
|
|
@ -5366,9 +5400,9 @@ export class Session3 extends HeyApiClient {
|
|||
|
||||
export class Model extends HeyApiClient {
|
||||
/**
|
||||
* List v2 models
|
||||
* List models
|
||||
*
|
||||
* Retrieve available v2 models ordered by release date.
|
||||
* Retrieve available models ordered by release date.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
|
|
@ -5390,9 +5424,9 @@ export class Model extends HeyApiClient {
|
|||
|
||||
export class Provider2 extends HeyApiClient {
|
||||
/**
|
||||
* List v2 providers
|
||||
* List providers
|
||||
*
|
||||
* Retrieve active v2 AI providers so clients can show provider availability and configuration.
|
||||
* Retrieve active AI providers so clients can show provider availability and configuration.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
|
|
@ -5412,9 +5446,9 @@ export class Provider2 extends HeyApiClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get v2 provider
|
||||
* Get provider
|
||||
*
|
||||
* Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.
|
||||
* Retrieve a single AI provider so clients can inspect its availability and endpoint settings.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
|
|
@ -5607,9 +5641,9 @@ export class Fs extends HeyApiClient {
|
|||
|
||||
export class Command2 extends HeyApiClient {
|
||||
/**
|
||||
* List v2 commands
|
||||
* List commands
|
||||
*
|
||||
* Retrieve currently registered v2 commands.
|
||||
* Retrieve currently registered commands.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
|
|
@ -5631,9 +5665,9 @@ export class Command2 extends HeyApiClient {
|
|||
|
||||
export class Skill extends HeyApiClient {
|
||||
/**
|
||||
* List v2 skills
|
||||
* List skills
|
||||
*
|
||||
* Retrieve currently registered v2 skills.
|
||||
* Retrieve currently registered skills.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
|
|
@ -5655,9 +5689,9 @@ export class Skill extends HeyApiClient {
|
|||
|
||||
export class Event2 extends HeyApiClient {
|
||||
/**
|
||||
* Subscribe to v2 events
|
||||
* Subscribe to events
|
||||
*
|
||||
* Subscribe to native EventV2 payloads for a location.
|
||||
* Subscribe to native event payloads for a location.
|
||||
*/
|
||||
public subscribe<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
|
|
@ -5887,6 +5921,11 @@ export class OpencodeClient extends HeyApiClient {
|
|||
return (this._provider ??= new Provider({ client: this.client }))
|
||||
}
|
||||
|
||||
private _reference?: Reference
|
||||
get reference(): Reference {
|
||||
return (this._reference ??= new Reference({ client: this.client }))
|
||||
}
|
||||
|
||||
private _session?: Session2
|
||||
get session(): Session2 {
|
||||
return (this._session ??= new Session2({ client: this.client }))
|
||||
|
|
|
|||
|
|
@ -2590,6 +2590,26 @@ export type ProviderAuthError1 = {
|
|||
}
|
||||
}
|
||||
|
||||
export type ReferenceDescriptor =
|
||||
| {
|
||||
name: string
|
||||
kind: "local"
|
||||
path: string
|
||||
}
|
||||
| {
|
||||
name: string
|
||||
kind: "git"
|
||||
repository: string
|
||||
path: string
|
||||
branch?: string
|
||||
}
|
||||
| {
|
||||
name: string
|
||||
kind: "invalid"
|
||||
repository?: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export type NotFoundError = {
|
||||
name: "NotFoundError"
|
||||
data: {
|
||||
|
|
@ -2732,7 +2752,7 @@ export type UnauthorizedError = {
|
|||
message: string
|
||||
}
|
||||
|
||||
export type V2SessionsResponse = {
|
||||
export type SessionsResponse = {
|
||||
data: Array<SessionV2Info>
|
||||
cursor: {
|
||||
previous?: string
|
||||
|
|
@ -2769,7 +2789,7 @@ export type UnknownError1 = {
|
|||
ref?: string
|
||||
}
|
||||
|
||||
export type V2SessionMessagesResponse = {
|
||||
export type SessionMessagesResponse = {
|
||||
data: Array<SessionMessage>
|
||||
cursor: {
|
||||
previous?: string
|
||||
|
|
@ -7620,6 +7640,34 @@ export type ProviderOauthCallbackResponses = {
|
|||
|
||||
export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses]
|
||||
|
||||
export type ReferenceListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/reference"
|
||||
}
|
||||
|
||||
export type ReferenceListErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type ReferenceListError = ReferenceListErrors[keyof ReferenceListErrors]
|
||||
|
||||
export type ReferenceListResponses = {
|
||||
/**
|
||||
* Resolved configured references
|
||||
*/
|
||||
200: Array<ReferenceDescriptor>
|
||||
}
|
||||
|
||||
export type ReferenceListResponse = ReferenceListResponses[keyof ReferenceListResponses]
|
||||
|
||||
export type SessionListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
@ -7973,7 +8021,7 @@ export type SessionMessagesResponses = {
|
|||
}>
|
||||
}
|
||||
|
||||
export type SessionMessagesResponse = SessionMessagesResponses[keyof SessionMessagesResponses]
|
||||
export type SessionMessagesResponse2 = SessionMessagesResponses[keyof SessionMessagesResponses]
|
||||
|
||||
export type SessionPromptData = {
|
||||
body?: {
|
||||
|
|
@ -9516,9 +9564,9 @@ export type V2SessionListError = V2SessionListErrors[keyof V2SessionListErrors]
|
|||
|
||||
export type V2SessionListResponses = {
|
||||
/**
|
||||
* V2SessionsResponse
|
||||
* SessionsResponse
|
||||
*/
|
||||
200: V2SessionsResponse
|
||||
200: SessionsResponse
|
||||
}
|
||||
|
||||
export type V2SessionListResponse = V2SessionListResponses[keyof V2SessionListResponses]
|
||||
|
|
@ -9727,12 +9775,12 @@ export type V2SessionMessagesError = V2SessionMessagesErrors[keyof V2SessionMess
|
|||
|
||||
export type V2SessionMessagesResponses = {
|
||||
/**
|
||||
* V2SessionMessagesResponse
|
||||
* SessionMessagesResponse
|
||||
*/
|
||||
200: V2SessionMessagesResponse
|
||||
200: SessionMessagesResponse
|
||||
}
|
||||
|
||||
export type V2SessionMessagesResponse2 = V2SessionMessagesResponses[keyof V2SessionMessagesResponses]
|
||||
export type V2SessionMessagesResponse = V2SessionMessagesResponses[keyof V2SessionMessagesResponses]
|
||||
|
||||
export type V2ModelListData = {
|
||||
body?: never
|
||||
|
|
@ -9900,83 +9948,6 @@ export type V2PermissionRequestListResponses = {
|
|||
|
||||
export type V2PermissionRequestListResponse = V2PermissionRequestListResponses[keyof V2PermissionRequestListResponses]
|
||||
|
||||
export type V2SessionPermissionListData = {
|
||||
body?: never
|
||||
path: {
|
||||
sessionID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/permission/request"
|
||||
}
|
||||
|
||||
export type V2SessionPermissionListErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* SessionNotFoundError
|
||||
*/
|
||||
404: SessionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionPermissionListError = V2SessionPermissionListErrors[keyof V2SessionPermissionListErrors]
|
||||
|
||||
export type V2SessionPermissionListResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
200: {
|
||||
data: Array<PermissionV2Request>
|
||||
}
|
||||
}
|
||||
|
||||
export type V2SessionPermissionListResponse = V2SessionPermissionListResponses[keyof V2SessionPermissionListResponses]
|
||||
|
||||
export type V2SessionPermissionReplyData = {
|
||||
body: {
|
||||
reply: PermissionV2Reply
|
||||
message?: string
|
||||
}
|
||||
path: {
|
||||
sessionID: string
|
||||
requestID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/permission/request/{requestID}/reply"
|
||||
}
|
||||
|
||||
export type V2SessionPermissionReplyErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* SessionNotFoundError | PermissionNotFoundError
|
||||
*/
|
||||
404: SessionNotFoundError | PermissionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionPermissionReplyError = V2SessionPermissionReplyErrors[keyof V2SessionPermissionReplyErrors]
|
||||
|
||||
export type V2SessionPermissionReplyResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2SessionPermissionReplyResponse =
|
||||
V2SessionPermissionReplyResponses[keyof V2SessionPermissionReplyResponses]
|
||||
|
||||
export type V2PermissionSavedListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
@ -10041,6 +10012,83 @@ export type V2PermissionSavedRemoveResponses = {
|
|||
|
||||
export type V2PermissionSavedRemoveResponse = V2PermissionSavedRemoveResponses[keyof V2PermissionSavedRemoveResponses]
|
||||
|
||||
export type V2SessionPermissionListData = {
|
||||
body?: never
|
||||
path: {
|
||||
sessionID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/permission"
|
||||
}
|
||||
|
||||
export type V2SessionPermissionListErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* SessionNotFoundError
|
||||
*/
|
||||
404: SessionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionPermissionListError = V2SessionPermissionListErrors[keyof V2SessionPermissionListErrors]
|
||||
|
||||
export type V2SessionPermissionListResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
200: {
|
||||
data: Array<PermissionV2Request>
|
||||
}
|
||||
}
|
||||
|
||||
export type V2SessionPermissionListResponse = V2SessionPermissionListResponses[keyof V2SessionPermissionListResponses]
|
||||
|
||||
export type V2SessionPermissionReplyData = {
|
||||
body: {
|
||||
reply: PermissionV2Reply
|
||||
message?: string
|
||||
}
|
||||
path: {
|
||||
sessionID: string
|
||||
requestID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/permission/{requestID}/reply"
|
||||
}
|
||||
|
||||
export type V2SessionPermissionReplyErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* SessionNotFoundError | PermissionNotFoundError
|
||||
*/
|
||||
404: PermissionNotFoundError | SessionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionPermissionReplyError = V2SessionPermissionReplyErrors[keyof V2SessionPermissionReplyErrors]
|
||||
|
||||
export type V2SessionPermissionReplyResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2SessionPermissionReplyResponse =
|
||||
V2SessionPermissionReplyResponses[keyof V2SessionPermissionReplyResponses]
|
||||
|
||||
export type V2FsReadData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
@ -10271,7 +10319,7 @@ export type V2SessionQuestionReplyData = {
|
|||
requestID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/question/request/{requestID}/reply"
|
||||
url: "/api/session/{sessionID}/question/{requestID}/reply"
|
||||
}
|
||||
|
||||
export type V2SessionQuestionReplyErrors = {
|
||||
|
|
@ -10286,7 +10334,7 @@ export type V2SessionQuestionReplyErrors = {
|
|||
/**
|
||||
* SessionNotFoundError | QuestionNotFoundError
|
||||
*/
|
||||
404: SessionNotFoundError | QuestionNotFoundError
|
||||
404: QuestionNotFoundError | SessionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionQuestionReplyError = V2SessionQuestionReplyErrors[keyof V2SessionQuestionReplyErrors]
|
||||
|
|
@ -10307,7 +10355,7 @@ export type V2SessionQuestionRejectData = {
|
|||
requestID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/question/request/{requestID}/reject"
|
||||
url: "/api/session/{sessionID}/question/{requestID}/reject"
|
||||
}
|
||||
|
||||
export type V2SessionQuestionRejectErrors = {
|
||||
|
|
@ -10322,7 +10370,7 @@ export type V2SessionQuestionRejectErrors = {
|
|||
/**
|
||||
* SessionNotFoundError | QuestionNotFoundError
|
||||
*/
|
||||
404: SessionNotFoundError | QuestionNotFoundError
|
||||
404: QuestionNotFoundError | SessionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionQuestionRejectError = V2SessionQuestionRejectErrors[keyof V2SessionQuestionRejectErrors]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue