refactor(schema): apply session review decisions (#35793)
This commit is contained in:
parent
d27746e5b3
commit
ed6ad272ec
142 changed files with 4239 additions and 3174 deletions
|
|
@ -1,5 +1,9 @@
|
|||
export * from "./gen/types.gen.js"
|
||||
export type { FileSystemEntry as LocationFileSystemEntry } from "./gen/types.gen.js"
|
||||
import type { UserMessage } from "./gen/types.gen.js"
|
||||
|
||||
/** @deprecated V1 snapshot compatibility. Use FileDiffInfo for current API responses. */
|
||||
export type SnapshotFileDiff = NonNullable<NonNullable<UserMessage["summary"]>["diffs"]>[number]
|
||||
|
||||
import { createClient } from "./gen/client/client.gen.js"
|
||||
import { type Config } from "./gen/client/types.gen.js"
|
||||
|
|
|
|||
|
|
@ -5185,86 +5185,6 @@ export class Plugin extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Switch extends HeyApiClient {
|
||||
/**
|
||||
* Switch session agent
|
||||
*
|
||||
* Switch the agent used by subsequent provider turns.
|
||||
*/
|
||||
public agent<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
agent?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "body", key: "agent" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2SessionSwitchAgentResponses,
|
||||
V2SessionSwitchAgentErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/agent",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch session model
|
||||
*
|
||||
* Switch the model used by subsequent provider turns.
|
||||
*/
|
||||
public model<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
model?: ModelRef
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "body", key: "model" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2SessionSwitchModelResponses,
|
||||
V2SessionSwitchModelErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/model",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Revert extends HeyApiClient {
|
||||
/**
|
||||
* Stage session revert
|
||||
|
|
@ -6068,6 +5988,84 @@ export class Session3 extends HeyApiClient {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch session agent
|
||||
*
|
||||
* Switch the agent used by subsequent provider turns.
|
||||
*/
|
||||
public switchAgent<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
agent?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "body", key: "agent" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2SessionSwitchAgentResponses,
|
||||
V2SessionSwitchAgentErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/agent",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch session model
|
||||
*
|
||||
* Switch the model used by subsequent provider turns.
|
||||
*/
|
||||
public switchModel<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
model?: ModelRef
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "body", key: "model" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2SessionSwitchModelResponses,
|
||||
V2SessionSwitchModelErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/model",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename session
|
||||
*
|
||||
|
|
@ -6528,11 +6526,6 @@ export class Session3 extends HeyApiClient {
|
|||
})
|
||||
}
|
||||
|
||||
private _switch?: Switch
|
||||
get switch(): Switch {
|
||||
return (this._switch ??= new Switch({ client: this.client }))
|
||||
}
|
||||
|
||||
private _revert?: Revert
|
||||
get revert(): Revert {
|
||||
return (this._revert ??= new Revert({ client: this.client }))
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue