refactor(core): move models.dev into core (#27347)

This commit is contained in:
Dax 2026-05-13 20:58:24 -04:00 committed by GitHub
commit 16c457e712
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 345 additions and 153 deletions

View file

@ -4385,10 +4385,20 @@ export class Model extends HeyApiClient {
*
* Retrieve available v2 models ordered by release date.
*/
public list<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
public list<ThrowOnError extends boolean = false>(
parameters?: {
instance?: {
directory?: string
workspace?: string
}
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "instance" }] }])
return (options?.client ?? this.client).get<V2ModelListResponses, unknown, ThrowOnError>({
url: "/api/model",
...options,
...params,
})
}
}
@ -4399,10 +4409,20 @@ export class Provider2 extends HeyApiClient {
*
* Retrieve active v2 AI providers so clients can show provider availability and configuration.
*/
public list<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
public list<ThrowOnError extends boolean = false>(
parameters?: {
instance?: {
directory?: string
workspace?: string
}
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "instance" }] }])
return (options?.client ?? this.client).get<V2ProviderListResponses, unknown, ThrowOnError>({
url: "/api/provider",
...options,
...params,
})
}
@ -4414,10 +4434,24 @@ export class Provider2 extends HeyApiClient {
public get<ThrowOnError extends boolean = false>(
parameters: {
providerID: string
instance?: {
directory?: string
workspace?: string
}
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "providerID" }] }])
const params = buildClientParams(
[parameters],
[
{
args: [
{ in: "path", key: "providerID" },
{ in: "query", key: "instance" },
],
},
],
)
return (options?.client ?? this.client).get<V2ProviderGetResponses, V2ProviderGetErrors, ThrowOnError>({
url: "/api/provider/{providerID}",
...options,

View file

@ -15,8 +15,6 @@ export type Event =
| EventPermissionReplied
| EventSessionDiff
| EventSessionError
| EventInstallationUpdated
| EventInstallationUpdateAvailable
| EventQuestionAsked
| EventQuestionReplied
| EventQuestionRejected
@ -42,6 +40,8 @@ export type Event =
| EventPtyUpdated
| EventPtyExited
| EventPtyDeleted
| EventInstallationUpdated
| EventInstallationUpdateAvailable
| EventMessageUpdated
| EventMessageRemoved
| EventMessagePartUpdated
@ -799,8 +799,6 @@ export type GlobalEvent = {
| EventPermissionReplied
| EventSessionDiff
| EventSessionError
| EventInstallationUpdated
| EventInstallationUpdateAvailable
| EventQuestionAsked
| EventQuestionReplied
| EventQuestionRejected
@ -826,6 +824,8 @@ export type GlobalEvent = {
| EventPtyUpdated
| EventPtyExited
| EventPtyDeleted
| EventInstallationUpdated
| EventInstallationUpdateAvailable
| EventMessageUpdated
| EventMessageRemoved
| EventMessagePartUpdated
@ -2496,22 +2496,6 @@ export type EventSessionError = {
}
}
export type EventInstallationUpdated = {
id: string
type: "installation.updated"
properties: {
version: string
}
}
export type EventInstallationUpdateAvailable = {
id: string
type: "installation.update-available"
properties: {
version: string
}
}
export type EventQuestionAsked = {
id: string
type: "question.asked"
@ -2681,6 +2665,22 @@ export type EventPtyDeleted = {
}
}
export type EventInstallationUpdated = {
id: string
type: "installation.updated"
properties: {
version: string
}
}
export type EventInstallationUpdateAvailable = {
id: string
type: "installation.update-available"
properties: {
version: string
}
}
export type EventMessageUpdated = {
id: string
type: "message.updated"
@ -6673,7 +6673,12 @@ export type V2SessionMessagesResponse2 = V2SessionMessagesResponses[keyof V2Sess
export type V2ModelListData = {
body?: never
path?: never
query?: never
query?: {
instance?: {
directory?: string
workspace?: string
}
}
url: "/api/model"
}
@ -6689,7 +6694,12 @@ export type V2ModelListResponse = V2ModelListResponses[keyof V2ModelListResponse
export type V2ProviderListData = {
body?: never
path?: never
query?: never
query?: {
instance?: {
directory?: string
workspace?: string
}
}
url: "/api/provider"
}
@ -6707,7 +6717,12 @@ export type V2ProviderGetData = {
path: {
providerID: string
}
query?: never
query?: {
instance?: {
directory?: string
workspace?: string
}
}
url: "/api/provider/{providerID}"
}