feat(core): moving sessions (#30640)
This commit is contained in:
@@ -34,6 +34,8 @@ import type {
|
||||
ExperimentalConsoleListOrgsErrors,
|
||||
ExperimentalConsoleListOrgsResponses,
|
||||
ExperimentalConsoleSwitchOrgResponses,
|
||||
ExperimentalControlPlaneMoveSessionErrors,
|
||||
ExperimentalControlPlaneMoveSessionResponses,
|
||||
ExperimentalProjectCopyCreateErrors,
|
||||
ExperimentalProjectCopyCreateResponses,
|
||||
ExperimentalProjectCopyRefreshErrors,
|
||||
@@ -108,6 +110,7 @@ import type {
|
||||
McpRemoteConfig,
|
||||
McpStatusErrors,
|
||||
McpStatusResponses,
|
||||
MoveSessionDestination,
|
||||
OutputFormat,
|
||||
Part as Part2,
|
||||
PartDeleteErrors,
|
||||
@@ -532,33 +535,38 @@ export class App extends HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
export class Config extends HeyApiClient {
|
||||
export class ControlPlane extends HeyApiClient {
|
||||
/**
|
||||
* Get global configuration
|
||||
* Move session
|
||||
*
|
||||
* Retrieve the current global OpenCode configuration settings and preferences.
|
||||
* Move a session to another project directory, optionally transferring local changes.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalConfigGetResponses, GlobalConfigGetErrors, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update global configuration
|
||||
*
|
||||
* Update global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
public moveSession<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
config?: Config3
|
||||
sessionID?: string
|
||||
destination?: MoveSessionDestination
|
||||
moveChanges?: boolean
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }])
|
||||
return (options?.client ?? this.client).patch<GlobalConfigUpdateResponses, GlobalConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "body", key: "sessionID" },
|
||||
{ in: "body", key: "destination" },
|
||||
{ in: "body", key: "moveChanges" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
ExperimentalControlPlaneMoveSessionResponses,
|
||||
ExperimentalControlPlaneMoveSessionErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/control-plane/move-session",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
@@ -570,204 +578,6 @@ export class Config extends HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
export class Global extends HeyApiClient {
|
||||
/**
|
||||
* Get health
|
||||
*
|
||||
* Get health information about the OpenCode server.
|
||||
*/
|
||||
public health<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalHealthResponses, GlobalHealthErrors, ThrowOnError>({
|
||||
url: "/global/health",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get global events
|
||||
*
|
||||
* Subscribe to global events from the OpenCode system using server-sent events.
|
||||
*/
|
||||
public event<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).sse.get<GlobalEventResponses, GlobalEventErrors, ThrowOnError>({
|
||||
url: "/global/event",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose instance
|
||||
*
|
||||
* Clean up and dispose all OpenCode instances, releasing all resources.
|
||||
*/
|
||||
public dispose<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<GlobalDisposeResponses, GlobalDisposeErrors, ThrowOnError>({
|
||||
url: "/global/dispose",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade opencode
|
||||
*
|
||||
* Upgrade opencode to the specified version or latest if not specified.
|
||||
*/
|
||||
public upgrade<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
target?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }])
|
||||
return (options?.client ?? this.client).post<GlobalUpgradeResponses, GlobalUpgradeErrors, ThrowOnError>({
|
||||
url: "/global/upgrade",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
private _config?: Config
|
||||
get config(): Config {
|
||||
return (this._config ??= new Config({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Event extends HeyApiClient {
|
||||
/**
|
||||
* Subscribe to events
|
||||
*
|
||||
* Get events
|
||||
*/
|
||||
public subscribe<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).sse.get<EventSubscribeResponses, unknown, ThrowOnError>({
|
||||
url: "/event",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Config2 extends HeyApiClient {
|
||||
/**
|
||||
* Get configuration
|
||||
*
|
||||
* Retrieve the current OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public get<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<ConfigGetResponses, ConfigGetErrors, ThrowOnError>({
|
||||
url: "/config",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update configuration
|
||||
*
|
||||
* Update OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
config?: Config3
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "directory" },
|
||||
{ in: "query", key: "workspace" },
|
||||
{ key: "config", map: "body" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).patch<ConfigUpdateResponses, ConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/config",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List config providers
|
||||
*
|
||||
* Get a list of all configured AI providers and their default models.
|
||||
*/
|
||||
public providers<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<ConfigProvidersResponses, ConfigProvidersErrors, ThrowOnError>({
|
||||
url: "/config/providers",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Console extends HeyApiClient {
|
||||
/**
|
||||
* Get active Console provider metadata
|
||||
@@ -1021,10 +831,11 @@ export class ProjectCopy extends HeyApiClient {
|
||||
public create<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
projectID: string
|
||||
query_directory?: string
|
||||
workspace?: string
|
||||
strategy?: "git_worktree"
|
||||
body_directory?: string
|
||||
directory?: string
|
||||
name?: string
|
||||
context?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
@@ -1034,18 +845,11 @@ export class ProjectCopy extends HeyApiClient {
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "projectID" },
|
||||
{
|
||||
in: "query",
|
||||
key: "query_directory",
|
||||
map: "directory",
|
||||
},
|
||||
{ in: "query", key: "workspace" },
|
||||
{ in: "body", key: "strategy" },
|
||||
{
|
||||
in: "body",
|
||||
key: "body_directory",
|
||||
map: "directory",
|
||||
},
|
||||
{ in: "body", key: "directory" },
|
||||
{ in: "body", key: "name" },
|
||||
{ in: "body", key: "context" },
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -1377,6 +1181,11 @@ export class Workspace extends HeyApiClient {
|
||||
}
|
||||
|
||||
export class Experimental extends HeyApiClient {
|
||||
private _controlPlane?: ControlPlane
|
||||
get controlPlane(): ControlPlane {
|
||||
return (this._controlPlane ??= new ControlPlane({ client: this.client }))
|
||||
}
|
||||
|
||||
private _console?: Console
|
||||
get console(): Console {
|
||||
return (this._console ??= new Console({ client: this.client }))
|
||||
@@ -1403,6 +1212,242 @@ export class Experimental extends HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
export class Config extends HeyApiClient {
|
||||
/**
|
||||
* Get global configuration
|
||||
*
|
||||
* Retrieve the current global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalConfigGetResponses, GlobalConfigGetErrors, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update global configuration
|
||||
*
|
||||
* Update global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
config?: Config3
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }])
|
||||
return (options?.client ?? this.client).patch<GlobalConfigUpdateResponses, GlobalConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Global extends HeyApiClient {
|
||||
/**
|
||||
* Get health
|
||||
*
|
||||
* Get health information about the OpenCode server.
|
||||
*/
|
||||
public health<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalHealthResponses, GlobalHealthErrors, ThrowOnError>({
|
||||
url: "/global/health",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get global events
|
||||
*
|
||||
* Subscribe to global events from the OpenCode system using server-sent events.
|
||||
*/
|
||||
public event<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).sse.get<GlobalEventResponses, GlobalEventErrors, ThrowOnError>({
|
||||
url: "/global/event",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose instance
|
||||
*
|
||||
* Clean up and dispose all OpenCode instances, releasing all resources.
|
||||
*/
|
||||
public dispose<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<GlobalDisposeResponses, GlobalDisposeErrors, ThrowOnError>({
|
||||
url: "/global/dispose",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade opencode
|
||||
*
|
||||
* Upgrade opencode to the specified version or latest if not specified.
|
||||
*/
|
||||
public upgrade<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
target?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }])
|
||||
return (options?.client ?? this.client).post<GlobalUpgradeResponses, GlobalUpgradeErrors, ThrowOnError>({
|
||||
url: "/global/upgrade",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
private _config?: Config
|
||||
get config(): Config {
|
||||
return (this._config ??= new Config({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Event extends HeyApiClient {
|
||||
/**
|
||||
* Subscribe to events
|
||||
*
|
||||
* Get events
|
||||
*/
|
||||
public subscribe<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).sse.get<EventSubscribeResponses, unknown, ThrowOnError>({
|
||||
url: "/event",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Config2 extends HeyApiClient {
|
||||
/**
|
||||
* Get configuration
|
||||
*
|
||||
* Retrieve the current OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public get<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<ConfigGetResponses, ConfigGetErrors, ThrowOnError>({
|
||||
url: "/config",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update configuration
|
||||
*
|
||||
* Update OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
config?: Config3
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "directory" },
|
||||
{ in: "query", key: "workspace" },
|
||||
{ key: "config", map: "body" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).patch<ConfigUpdateResponses, ConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/config",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List config providers
|
||||
*
|
||||
* Get a list of all configured AI providers and their default models.
|
||||
*/
|
||||
public providers<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<ConfigProvidersResponses, ConfigProvidersErrors, ThrowOnError>({
|
||||
url: "/config/providers",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Tool extends HeyApiClient {
|
||||
/**
|
||||
* List tools
|
||||
@@ -5712,6 +5757,11 @@ export class OpencodeClient extends HeyApiClient {
|
||||
return (this._app ??= new App({ client: this.client }))
|
||||
}
|
||||
|
||||
private _experimental?: Experimental
|
||||
get experimental(): Experimental {
|
||||
return (this._experimental ??= new Experimental({ client: this.client }))
|
||||
}
|
||||
|
||||
private _global?: Global
|
||||
get global(): Global {
|
||||
return (this._global ??= new Global({ client: this.client }))
|
||||
@@ -5727,11 +5777,6 @@ export class OpencodeClient extends HeyApiClient {
|
||||
return (this._config ??= new Config2({ client: this.client }))
|
||||
}
|
||||
|
||||
private _experimental?: Experimental
|
||||
get experimental(): Experimental {
|
||||
return (this._experimental ??= new Experimental({ client: this.client }))
|
||||
}
|
||||
|
||||
private _tool?: Tool
|
||||
get tool(): Tool {
|
||||
return (this._tool ??= new Tool({ client: this.client }))
|
||||
|
||||
@@ -17,6 +17,7 @@ export type Event =
|
||||
| EventMessagePartRemoved
|
||||
| EventSessionNextAgentSwitched
|
||||
| EventSessionNextModelSwitched
|
||||
| EventSessionNextMoved
|
||||
| EventSessionNextPrompted
|
||||
| EventSessionNextSynthetic
|
||||
| EventSessionNextShellStarted
|
||||
@@ -136,6 +137,13 @@ export type InvalidRequestError = {
|
||||
field?: string
|
||||
}
|
||||
|
||||
export type MoveSessionError = {
|
||||
name: "MoveSessionError"
|
||||
data: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SnapshotFileDiff = {
|
||||
file?: string
|
||||
patch?: string
|
||||
@@ -812,6 +820,16 @@ export type GlobalEvent = {
|
||||
}
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "session.next.moved"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
location: LocationRef
|
||||
subdirectory?: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "session.next.prompted"
|
||||
@@ -1556,6 +1574,7 @@ export type GlobalEvent = {
|
||||
| SyncEventMessagePartRemoved
|
||||
| SyncEventSessionNextAgentSwitched
|
||||
| SyncEventSessionNextModelSwitched
|
||||
| SyncEventSessionNextMoved
|
||||
| SyncEventSessionNextPrompted
|
||||
| SyncEventSessionNextSynthetic
|
||||
| SyncEventSessionNextShellStarted
|
||||
@@ -2397,6 +2416,13 @@ export type ProjectNotFoundError = {
|
||||
message: string
|
||||
}
|
||||
|
||||
export type ProjectCopyError = {
|
||||
name: "ProjectCopyError"
|
||||
data: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export type PtyNotFoundError = {
|
||||
_tag: "PtyNotFoundError"
|
||||
ptyID: string
|
||||
@@ -2751,6 +2777,10 @@ export type EventTuiSessionSelect2 = {
|
||||
}
|
||||
}
|
||||
|
||||
export type MoveSessionDestination = {
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type ModelV2Info = {
|
||||
id: string
|
||||
providerID: string
|
||||
@@ -2821,6 +2851,11 @@ export type ModelV2Info = {
|
||||
}
|
||||
}
|
||||
|
||||
export type LocationRef = {
|
||||
directory: string
|
||||
workspaceID?: string
|
||||
}
|
||||
|
||||
export type PromptSource = {
|
||||
start: number
|
||||
end: number
|
||||
@@ -3112,6 +3147,23 @@ export type SyncEventSessionNextModelSwitched = {
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextMoved = {
|
||||
type: "sync"
|
||||
id: string
|
||||
syncEvent: {
|
||||
type: "session.next.moved.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: string
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
location: LocationRef
|
||||
subdirectory?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextPrompted = {
|
||||
type: "sync"
|
||||
id: string
|
||||
@@ -3588,11 +3640,6 @@ export type AgentV2Info = {
|
||||
permissions: PermissionV2Ruleset
|
||||
}
|
||||
|
||||
export type LocationRef = {
|
||||
directory: string
|
||||
workspaceID?: string
|
||||
}
|
||||
|
||||
export type SessionV2Info = {
|
||||
id: string
|
||||
parentID?: string
|
||||
@@ -4147,6 +4194,17 @@ export type EventSessionNextModelSwitched = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextMoved = {
|
||||
id: string
|
||||
type: "session.next.moved"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
location: LocationRef
|
||||
subdirectory?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextPrompted = {
|
||||
id: string
|
||||
type: "session.next.prompted"
|
||||
@@ -5002,6 +5060,37 @@ export type AppLogResponses = {
|
||||
|
||||
export type AppLogResponse = AppLogResponses[keyof AppLogResponses]
|
||||
|
||||
export type ExperimentalControlPlaneMoveSessionData = {
|
||||
body?: {
|
||||
sessionID: string
|
||||
destination: MoveSessionDestination
|
||||
moveChanges?: boolean
|
||||
}
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/experimental/control-plane/move-session"
|
||||
}
|
||||
|
||||
export type ExperimentalControlPlaneMoveSessionErrors = {
|
||||
/**
|
||||
* MoveSessionError | InvalidRequestError
|
||||
*/
|
||||
400: MoveSessionError | InvalidRequestError
|
||||
}
|
||||
|
||||
export type ExperimentalControlPlaneMoveSessionError =
|
||||
ExperimentalControlPlaneMoveSessionErrors[keyof ExperimentalControlPlaneMoveSessionErrors]
|
||||
|
||||
export type ExperimentalControlPlaneMoveSessionResponses = {
|
||||
/**
|
||||
* Session moved
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type ExperimentalControlPlaneMoveSessionResponse =
|
||||
ExperimentalControlPlaneMoveSessionResponses[keyof ExperimentalControlPlaneMoveSessionResponses]
|
||||
|
||||
export type GlobalHealthData = {
|
||||
body?: never
|
||||
path?: never
|
||||
@@ -6596,9 +6685,9 @@ export type ExperimentalProjectCopyRemoveData = {
|
||||
|
||||
export type ExperimentalProjectCopyRemoveErrors = {
|
||||
/**
|
||||
* BadRequest | InvalidRequestError
|
||||
* ProjectCopyError | InvalidRequestError
|
||||
*/
|
||||
400: EffectHttpApiErrorBadRequest | InvalidRequestError
|
||||
400: ProjectCopyError | InvalidRequestError
|
||||
}
|
||||
|
||||
export type ExperimentalProjectCopyRemoveError =
|
||||
@@ -6618,12 +6707,13 @@ export type ExperimentalProjectCopyCreateData = {
|
||||
body?: {
|
||||
strategy: "git_worktree"
|
||||
directory: string
|
||||
name?: string
|
||||
context?: string
|
||||
}
|
||||
path: {
|
||||
projectID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/project/{projectID}/copy"
|
||||
@@ -6631,9 +6721,9 @@ export type ExperimentalProjectCopyCreateData = {
|
||||
|
||||
export type ExperimentalProjectCopyCreateErrors = {
|
||||
/**
|
||||
* BadRequest | InvalidRequestError
|
||||
* ProjectCopyError | InvalidRequestError
|
||||
*/
|
||||
400: EffectHttpApiErrorBadRequest | InvalidRequestError
|
||||
400: ProjectCopyError | InvalidRequestError
|
||||
}
|
||||
|
||||
export type ExperimentalProjectCopyCreateError =
|
||||
@@ -6663,9 +6753,9 @@ export type ExperimentalProjectCopyRefreshData = {
|
||||
|
||||
export type ExperimentalProjectCopyRefreshErrors = {
|
||||
/**
|
||||
* BadRequest | InvalidRequestError
|
||||
* ProjectCopyError | InvalidRequestError
|
||||
*/
|
||||
400: EffectHttpApiErrorBadRequest | InvalidRequestError
|
||||
400: ProjectCopyError | InvalidRequestError
|
||||
}
|
||||
|
||||
export type ExperimentalProjectCopyRefreshError =
|
||||
|
||||
@@ -212,6 +212,66 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/experimental/control-plane/move-session": {
|
||||
"post": {
|
||||
"tags": ["controlPlane"],
|
||||
"operationId": "experimental.controlPlane.moveSession",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "Session moved"
|
||||
},
|
||||
"400": {
|
||||
"description": "MoveSessionError | InvalidRequestError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/MoveSessionError"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/InvalidRequestError"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Move a session to another project directory, optionally transferring local changes.",
|
||||
"summary": "Move session",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sessionID": {
|
||||
"type": "string",
|
||||
"pattern": "^ses"
|
||||
},
|
||||
"destination": {
|
||||
"$ref": "#/components/schemas/MoveSessionDestination"
|
||||
},
|
||||
"moveChanges": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["sessionID", "destination"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.controlPlane.moveSession({\n ...\n})"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/global/health": {
|
||||
"get": {
|
||||
"tags": ["global"],
|
||||
@@ -3774,14 +3834,6 @@
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "directory",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "workspace",
|
||||
"in": "query",
|
||||
@@ -3803,13 +3855,13 @@
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "BadRequest | InvalidRequestError",
|
||||
"description": "ProjectCopyError | InvalidRequestError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
|
||||
"$ref": "#/components/schemas/ProjectCopyError"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/InvalidRequestError"
|
||||
@@ -3834,6 +3886,12 @@
|
||||
},
|
||||
"directory": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"context": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["strategy", "directory"],
|
||||
@@ -3883,13 +3941,13 @@
|
||||
"description": "Project copy removed"
|
||||
},
|
||||
"400": {
|
||||
"description": "BadRequest | InvalidRequestError",
|
||||
"description": "ProjectCopyError | InvalidRequestError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
|
||||
"$ref": "#/components/schemas/ProjectCopyError"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/InvalidRequestError"
|
||||
@@ -3961,13 +4019,13 @@
|
||||
"description": "Project copies refreshed"
|
||||
},
|
||||
"400": {
|
||||
"description": "BadRequest | InvalidRequestError",
|
||||
"description": "ProjectCopyError | InvalidRequestError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
|
||||
"$ref": "#/components/schemas/ProjectCopyError"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/InvalidRequestError"
|
||||
@@ -11953,6 +12011,9 @@
|
||||
{
|
||||
"$ref": "#/components/schemas/EventSessionNextModelSwitched"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/EventSessionNextMoved"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/EventSessionNextPrompted"
|
||||
},
|
||||
@@ -12312,6 +12373,27 @@
|
||||
"required": ["_tag", "message"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"MoveSessionError": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["MoveSessionError"]
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["message"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["name", "data"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"SnapshotFileDiff": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -14356,6 +14438,40 @@
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["session.next.moved"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "number"
|
||||
},
|
||||
"sessionID": {
|
||||
"type": "string",
|
||||
"pattern": "^ses"
|
||||
},
|
||||
"location": {
|
||||
"$ref": "#/components/schemas/LocationRef"
|
||||
},
|
||||
"subdirectory": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["timestamp", "sessionID", "location"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -16782,6 +16898,9 @@
|
||||
{
|
||||
"$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/SyncEventSessionNextMoved"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/SyncEventSessionNextPrompted"
|
||||
},
|
||||
@@ -19094,6 +19213,27 @@
|
||||
"required": ["_tag", "projectID", "message"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ProjectCopyError": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["ProjectCopyError"]
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["message"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["name", "data"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"PtyNotFoundError": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -20117,6 +20257,16 @@
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"MoveSessionDestination": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"directory": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ModelV2Info": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -20355,6 +20505,20 @@
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"LocationRef": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"directory": {
|
||||
"type": "string"
|
||||
},
|
||||
"workspaceID": {
|
||||
"type": "string",
|
||||
"pattern": "^wrk"
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"PromptSource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -21200,6 +21364,60 @@
|
||||
"required": ["type", "id", "syncEvent"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"SyncEventSessionNextMoved": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["sync"]
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"syncEvent": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["session.next.moved.1"]
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"seq": {
|
||||
"type": "number"
|
||||
},
|
||||
"aggregateID": {
|
||||
"type": "string"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "number"
|
||||
},
|
||||
"sessionID": {
|
||||
"type": "string",
|
||||
"pattern": "^ses"
|
||||
},
|
||||
"location": {
|
||||
"$ref": "#/components/schemas/LocationRef"
|
||||
},
|
||||
"subdirectory": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["timestamp", "sessionID", "location"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["type", "id", "seq", "aggregateID", "data"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["type", "id", "syncEvent"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"SyncEventSessionNextPrompted": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -22653,20 +22871,6 @@
|
||||
"required": ["id", "request", "mode", "hidden", "permissions"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"LocationRef": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"directory": {
|
||||
"type": "string"
|
||||
},
|
||||
"workspaceID": {
|
||||
"type": "string",
|
||||
"pattern": "^wrk"
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"SessionV2Info": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -24279,6 +24483,40 @@
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"EventSessionNextMoved": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["session.next.moved"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "number"
|
||||
},
|
||||
"sessionID": {
|
||||
"type": "string",
|
||||
"pattern": "^ses"
|
||||
},
|
||||
"location": {
|
||||
"$ref": "#/components/schemas/LocationRef"
|
||||
},
|
||||
"subdirectory": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["timestamp", "sessionID", "location"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"EventSessionNextPrompted": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -26564,6 +26802,10 @@
|
||||
"name": "control",
|
||||
"description": "Control plane routes."
|
||||
},
|
||||
{
|
||||
"name": "controlPlane",
|
||||
"description": "Control-plane orchestration routes."
|
||||
},
|
||||
{
|
||||
"name": "global",
|
||||
"description": "Global server routes."
|
||||
|
||||
Reference in New Issue
Block a user