mirror of
https://github.com/anomalyco/opencode.git
synced 2026-06-01 19:05:38 +00:00
feat(core): session warping (#25768)
This commit is contained in:
@@ -4,58 +4,84 @@ import { client } from "./client.gen.js"
|
||||
import { buildClientParams, type Client, type Options as Options2, type TDataShape } from "./client/index.js"
|
||||
import type {
|
||||
AgentPartInput,
|
||||
AppAgentsErrors,
|
||||
AppAgentsResponses,
|
||||
AppLogErrors,
|
||||
AppLogResponses,
|
||||
AppSkillsErrors,
|
||||
AppSkillsResponses,
|
||||
Auth as Auth3,
|
||||
AuthRemoveErrors,
|
||||
AuthRemoveResponses,
|
||||
AuthSetErrors,
|
||||
AuthSetResponses,
|
||||
CommandListErrors,
|
||||
CommandListResponses,
|
||||
Config as Config3,
|
||||
ConfigGetErrors,
|
||||
ConfigGetResponses,
|
||||
ConfigProvidersErrors,
|
||||
ConfigProvidersResponses,
|
||||
ConfigUpdateErrors,
|
||||
ConfigUpdateResponses,
|
||||
EventSubscribeErrors,
|
||||
EventSubscribeResponses,
|
||||
EventTuiCommandExecute2,
|
||||
EventTuiPromptAppend2,
|
||||
EventTuiSessionSelect2,
|
||||
EventTuiToastShow2,
|
||||
ExperimentalConsoleGetErrors,
|
||||
ExperimentalConsoleGetResponses,
|
||||
ExperimentalConsoleListOrgsErrors,
|
||||
ExperimentalConsoleListOrgsResponses,
|
||||
ExperimentalConsoleSwitchOrgResponses,
|
||||
ExperimentalResourceListErrors,
|
||||
ExperimentalResourceListResponses,
|
||||
ExperimentalSessionListErrors,
|
||||
ExperimentalSessionListResponses,
|
||||
ExperimentalWorkspaceAdapterListErrors,
|
||||
ExperimentalWorkspaceAdapterListResponses,
|
||||
ExperimentalWorkspaceCreateErrors,
|
||||
ExperimentalWorkspaceCreateResponses,
|
||||
ExperimentalWorkspaceListErrors,
|
||||
ExperimentalWorkspaceListResponses,
|
||||
ExperimentalWorkspaceRemoveErrors,
|
||||
ExperimentalWorkspaceRemoveResponses,
|
||||
ExperimentalWorkspaceSessionRestoreErrors,
|
||||
ExperimentalWorkspaceSessionRestoreResponses,
|
||||
ExperimentalWorkspaceStatusErrors,
|
||||
ExperimentalWorkspaceStatusResponses,
|
||||
ExperimentalWorkspaceWarpErrors,
|
||||
ExperimentalWorkspaceWarpResponses,
|
||||
FileListErrors,
|
||||
FileListResponses,
|
||||
FilePartInput,
|
||||
FilePartSource,
|
||||
FileReadErrors,
|
||||
FileReadResponses,
|
||||
FileStatusErrors,
|
||||
FileStatusResponses,
|
||||
FindFilesErrors,
|
||||
FindFilesResponses,
|
||||
FindSymbolsErrors,
|
||||
FindSymbolsResponses,
|
||||
FindTextErrors,
|
||||
FindTextResponses,
|
||||
FormatterStatusErrors,
|
||||
FormatterStatusResponses,
|
||||
GlobalConfigGetErrors,
|
||||
GlobalConfigGetResponses,
|
||||
GlobalConfigUpdateErrors,
|
||||
GlobalConfigUpdateResponses,
|
||||
GlobalDisposeErrors,
|
||||
GlobalDisposeResponses,
|
||||
GlobalEventErrors,
|
||||
GlobalEventResponses,
|
||||
GlobalHealthErrors,
|
||||
GlobalHealthResponses,
|
||||
GlobalUpgradeErrors,
|
||||
GlobalUpgradeResponses,
|
||||
InstanceDisposeErrors,
|
||||
InstanceDisposeResponses,
|
||||
LspStatusErrors,
|
||||
LspStatusResponses,
|
||||
McpAddErrors,
|
||||
McpAddResponses,
|
||||
@@ -67,10 +93,13 @@ import type {
|
||||
McpAuthRemoveResponses,
|
||||
McpAuthStartErrors,
|
||||
McpAuthStartResponses,
|
||||
McpConnectErrors,
|
||||
McpConnectResponses,
|
||||
McpDisconnectErrors,
|
||||
McpDisconnectResponses,
|
||||
McpLocalConfig,
|
||||
McpRemoteConfig,
|
||||
McpStatusErrors,
|
||||
McpStatusResponses,
|
||||
OutputFormat,
|
||||
Part as Part2,
|
||||
@@ -78,20 +107,27 @@ import type {
|
||||
PartDeleteResponses,
|
||||
PartUpdateErrors,
|
||||
PartUpdateResponses,
|
||||
PathGetErrors,
|
||||
PathGetResponses,
|
||||
PermissionListErrors,
|
||||
PermissionListResponses,
|
||||
PermissionReplyErrors,
|
||||
PermissionReplyResponses,
|
||||
PermissionRespondErrors,
|
||||
PermissionRespondResponses,
|
||||
PermissionRuleset,
|
||||
ProjectCurrentErrors,
|
||||
ProjectCurrentResponses,
|
||||
ProjectInitGitErrors,
|
||||
ProjectInitGitResponses,
|
||||
ProjectListErrors,
|
||||
ProjectListResponses,
|
||||
ProjectUpdateErrors,
|
||||
ProjectUpdateResponses,
|
||||
Prompt,
|
||||
ProviderAuthErrors,
|
||||
ProviderAuthResponses,
|
||||
ProviderListErrors,
|
||||
ProviderListResponses,
|
||||
ProviderOauthAuthorizeErrors,
|
||||
ProviderOauthAuthorizeResponses,
|
||||
@@ -105,13 +141,16 @@ import type {
|
||||
PtyCreateResponses,
|
||||
PtyGetErrors,
|
||||
PtyGetResponses,
|
||||
PtyListErrors,
|
||||
PtyListResponses,
|
||||
PtyRemoveErrors,
|
||||
PtyRemoveResponses,
|
||||
PtyShellsErrors,
|
||||
PtyShellsResponses,
|
||||
PtyUpdateErrors,
|
||||
PtyUpdateResponses,
|
||||
QuestionAnswer,
|
||||
QuestionListErrors,
|
||||
QuestionListResponses,
|
||||
QuestionRejectErrors,
|
||||
QuestionRejectResponses,
|
||||
@@ -130,12 +169,15 @@ import type {
|
||||
SessionDeleteMessageResponses,
|
||||
SessionDeleteResponses,
|
||||
SessionDelivery,
|
||||
SessionDiffErrors,
|
||||
SessionDiffResponses,
|
||||
SessionForkErrors,
|
||||
SessionForkResponses,
|
||||
SessionGetErrors,
|
||||
SessionGetResponses,
|
||||
SessionInitErrors,
|
||||
SessionInitResponses,
|
||||
SessionListErrors,
|
||||
SessionListResponses,
|
||||
SessionMessageErrors,
|
||||
SessionMessageResponses,
|
||||
@@ -168,7 +210,10 @@ import type {
|
||||
SyncHistoryListResponses,
|
||||
SyncReplayErrors,
|
||||
SyncReplayResponses,
|
||||
SyncStartErrors,
|
||||
SyncStartResponses,
|
||||
SyncStealErrors,
|
||||
SyncStealResponses,
|
||||
TextPartInput,
|
||||
ToolIdsErrors,
|
||||
ToolIdsResponses,
|
||||
@@ -176,34 +221,50 @@ import type {
|
||||
ToolListResponses,
|
||||
TuiAppendPromptErrors,
|
||||
TuiAppendPromptResponses,
|
||||
TuiClearPromptErrors,
|
||||
TuiClearPromptResponses,
|
||||
TuiControlNextErrors,
|
||||
TuiControlNextResponses,
|
||||
TuiControlResponseErrors,
|
||||
TuiControlResponseResponses,
|
||||
TuiExecuteCommandErrors,
|
||||
TuiExecuteCommandResponses,
|
||||
TuiOpenHelpErrors,
|
||||
TuiOpenHelpResponses,
|
||||
TuiOpenModelsErrors,
|
||||
TuiOpenModelsResponses,
|
||||
TuiOpenSessionsErrors,
|
||||
TuiOpenSessionsResponses,
|
||||
TuiOpenThemesErrors,
|
||||
TuiOpenThemesResponses,
|
||||
TuiPublishErrors,
|
||||
TuiPublishResponses,
|
||||
TuiSelectSessionErrors,
|
||||
TuiSelectSessionResponses,
|
||||
TuiShowToastErrors,
|
||||
TuiShowToastResponses,
|
||||
TuiSubmitPromptErrors,
|
||||
TuiSubmitPromptResponses,
|
||||
V2SessionCompactErrors,
|
||||
V2SessionCompactResponses,
|
||||
V2SessionContextErrors,
|
||||
V2SessionContextResponses,
|
||||
V2SessionListErrors,
|
||||
V2SessionListResponses,
|
||||
V2SessionMessagesErrors,
|
||||
V2SessionMessagesResponses,
|
||||
V2SessionPromptErrors,
|
||||
V2SessionPromptResponses,
|
||||
V2SessionWaitErrors,
|
||||
V2SessionWaitResponses,
|
||||
VcsDiffErrors,
|
||||
VcsDiffResponses,
|
||||
VcsGetErrors,
|
||||
VcsGetResponses,
|
||||
WorktreeCreateErrors,
|
||||
WorktreeCreateInput,
|
||||
WorktreeCreateResponses,
|
||||
WorktreeListErrors,
|
||||
WorktreeListResponses,
|
||||
WorktreeRemoveErrors,
|
||||
WorktreeRemoveInput,
|
||||
@@ -381,7 +442,7 @@ export class App extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<AppAgentsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<AppAgentsResponses, AppAgentsErrors, ThrowOnError>({
|
||||
url: "/agent",
|
||||
...options,
|
||||
...params,
|
||||
@@ -411,7 +472,7 @@ export class App extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<AppSkillsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<AppSkillsResponses, AppSkillsErrors, ThrowOnError>({
|
||||
url: "/skill",
|
||||
...options,
|
||||
...params,
|
||||
@@ -426,7 +487,7 @@ export class Config extends HeyApiClient {
|
||||
* 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, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<GlobalConfigGetResponses, GlobalConfigGetErrors, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
})
|
||||
@@ -464,7 +525,7 @@ export class Global extends HeyApiClient {
|
||||
* Get health information about the OpenCode server.
|
||||
*/
|
||||
public health<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalHealthResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<GlobalHealthResponses, GlobalHealthErrors, ThrowOnError>({
|
||||
url: "/global/health",
|
||||
...options,
|
||||
})
|
||||
@@ -476,7 +537,7 @@ export class Global extends HeyApiClient {
|
||||
* 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, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).sse.get<GlobalEventResponses, GlobalEventErrors, ThrowOnError>({
|
||||
url: "/global/event",
|
||||
...options,
|
||||
})
|
||||
@@ -488,7 +549,7 @@ export class Global extends HeyApiClient {
|
||||
* 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, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<GlobalDisposeResponses, GlobalDisposeErrors, ThrowOnError>({
|
||||
url: "/global/dispose",
|
||||
...options,
|
||||
})
|
||||
@@ -548,7 +609,7 @@ export class Event extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).sse.get<EventSubscribeResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).sse.get<EventSubscribeResponses, EventSubscribeErrors, ThrowOnError>({
|
||||
url: "/event",
|
||||
...options,
|
||||
...params,
|
||||
@@ -580,7 +641,7 @@ export class Config2 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ConfigGetResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<ConfigGetResponses, ConfigGetErrors, ThrowOnError>({
|
||||
url: "/config",
|
||||
...options,
|
||||
...params,
|
||||
@@ -647,7 +708,7 @@ export class Config2 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ConfigProvidersResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<ConfigProvidersResponses, ConfigProvidersErrors, ThrowOnError>({
|
||||
url: "/config/providers",
|
||||
...options,
|
||||
...params,
|
||||
@@ -679,7 +740,11 @@ export class Console extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ExperimentalConsoleGetResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalConsoleGetResponses,
|
||||
ExperimentalConsoleGetErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/console",
|
||||
...options,
|
||||
...params,
|
||||
@@ -709,7 +774,11 @@ export class Console extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ExperimentalConsoleListOrgsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalConsoleListOrgsResponses,
|
||||
ExperimentalConsoleListOrgsErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/console/orgs",
|
||||
...options,
|
||||
...params,
|
||||
@@ -792,7 +861,11 @@ export class Session extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ExperimentalSessionListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalSessionListResponses,
|
||||
ExperimentalSessionListErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/session",
|
||||
...options,
|
||||
...params,
|
||||
@@ -824,7 +897,11 @@ export class Resource extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ExperimentalResourceListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalResourceListResponses,
|
||||
ExperimentalResourceListErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/resource",
|
||||
...options,
|
||||
...params,
|
||||
@@ -856,7 +933,11 @@ export class Adapter extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ExperimentalWorkspaceAdapterListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalWorkspaceAdapterListResponses,
|
||||
ExperimentalWorkspaceAdapterListErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/workspace/adapter",
|
||||
...options,
|
||||
...params,
|
||||
@@ -888,7 +969,11 @@ export class Workspace extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ExperimentalWorkspaceListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalWorkspaceListResponses,
|
||||
ExperimentalWorkspaceListErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/workspace",
|
||||
...options,
|
||||
...params,
|
||||
@@ -965,7 +1050,11 @@ export class Workspace extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ExperimentalWorkspaceStatusResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalWorkspaceStatusResponses,
|
||||
ExperimentalWorkspaceStatusErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/workspace/status",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1009,15 +1098,15 @@ export class Workspace extends HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore session into workspace
|
||||
* Warp session into workspace
|
||||
*
|
||||
* Replay a session's sync events into the target workspace in batches.
|
||||
* Move a session's sync history into the target workspace, or detach it to the local project.
|
||||
*/
|
||||
public sessionRestore<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
id: string
|
||||
public warp<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
id?: string | null
|
||||
sessionID?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
@@ -1027,20 +1116,20 @@ export class Workspace extends HeyApiClient {
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "id" },
|
||||
{ in: "query", key: "directory" },
|
||||
{ in: "query", key: "workspace" },
|
||||
{ in: "body", key: "id" },
|
||||
{ in: "body", key: "sessionID" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
ExperimentalWorkspaceSessionRestoreResponses,
|
||||
ExperimentalWorkspaceSessionRestoreErrors,
|
||||
ExperimentalWorkspaceWarpResponses,
|
||||
ExperimentalWorkspaceWarpErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/workspace/{id}/session-restore",
|
||||
url: "/experimental/workspace/warp",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
@@ -1206,7 +1295,7 @@ export class Worktree extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<WorktreeListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<WorktreeListResponses, WorktreeListErrors, ThrowOnError>({
|
||||
url: "/experimental/worktree",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1314,7 +1403,7 @@ export class Find extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<FindTextResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<FindTextResponses, FindTextErrors, ThrowOnError>({
|
||||
url: "/find",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1352,7 +1441,7 @@ export class Find extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<FindFilesResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<FindFilesResponses, FindFilesErrors, ThrowOnError>({
|
||||
url: "/find/file",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1384,7 +1473,7 @@ export class Find extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<FindSymbolsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<FindSymbolsResponses, FindSymbolsErrors, ThrowOnError>({
|
||||
url: "/find/symbol",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1418,7 +1507,7 @@ export class File extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<FileListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<FileListResponses, FileListErrors, ThrowOnError>({
|
||||
url: "/file",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1450,7 +1539,7 @@ export class File extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<FileReadResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<FileReadResponses, FileReadErrors, ThrowOnError>({
|
||||
url: "/file/content",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1480,7 +1569,7 @@ export class File extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<FileStatusResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<FileStatusResponses, FileStatusErrors, ThrowOnError>({
|
||||
url: "/file/status",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1512,7 +1601,7 @@ export class Instance extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<InstanceDisposeResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<InstanceDisposeResponses, InstanceDisposeErrors, ThrowOnError>({
|
||||
url: "/instance/dispose",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1544,7 +1633,7 @@ export class Path extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<PathGetResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<PathGetResponses, PathGetErrors, ThrowOnError>({
|
||||
url: "/path",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1576,7 +1665,7 @@ export class Vcs extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<VcsGetResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<VcsGetResponses, VcsGetErrors, ThrowOnError>({
|
||||
url: "/vcs",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1608,7 +1697,7 @@ export class Vcs extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<VcsDiffResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<VcsDiffResponses, VcsDiffErrors, ThrowOnError>({
|
||||
url: "/vcs/diff",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1640,7 +1729,7 @@ export class Command extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<CommandListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<CommandListResponses, CommandListErrors, ThrowOnError>({
|
||||
url: "/command",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1672,7 +1761,7 @@ export class Lsp extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<LspStatusResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<LspStatusResponses, LspStatusErrors, ThrowOnError>({
|
||||
url: "/lsp",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1704,7 +1793,7 @@ export class Formatter extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<FormatterStatusResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<FormatterStatusResponses, FormatterStatusErrors, ThrowOnError>({
|
||||
url: "/formatter",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1875,7 +1964,7 @@ export class Mcp extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<McpStatusResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<McpStatusResponses, McpStatusErrors, ThrowOnError>({
|
||||
url: "/mcp",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1944,7 +2033,7 @@ export class Mcp extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<McpConnectResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<McpConnectResponses, McpConnectErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/connect",
|
||||
...options,
|
||||
...params,
|
||||
@@ -1974,7 +2063,7 @@ export class Mcp extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<McpDisconnectResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<McpDisconnectResponses, McpDisconnectErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/disconnect",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2011,7 +2100,7 @@ export class Project extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ProjectListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<ProjectListResponses, ProjectListErrors, ThrowOnError>({
|
||||
url: "/project",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2041,7 +2130,7 @@ export class Project extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ProjectCurrentResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<ProjectCurrentResponses, ProjectCurrentErrors, ThrowOnError>({
|
||||
url: "/project/current",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2071,7 +2160,7 @@ export class Project extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<ProjectInitGitResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<ProjectInitGitResponses, ProjectInitGitErrors, ThrowOnError>({
|
||||
url: "/project/git/init",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2155,7 +2244,7 @@ export class Pty extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<PtyShellsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<PtyShellsResponses, PtyShellsErrors, ThrowOnError>({
|
||||
url: "/pty/shells",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2185,7 +2274,7 @@ export class Pty extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<PtyListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<PtyListResponses, PtyListErrors, ThrowOnError>({
|
||||
url: "/pty",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2436,7 +2525,7 @@ export class Question extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<QuestionListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<QuestionListResponses, QuestionListErrors, ThrowOnError>({
|
||||
url: "/question",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2539,7 +2628,7 @@ export class Permission extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<PermissionListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<PermissionListResponses, PermissionListErrors, ThrowOnError>({
|
||||
url: "/permission",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2749,7 +2838,7 @@ export class Provider extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ProviderListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<ProviderListResponses, ProviderListErrors, ThrowOnError>({
|
||||
url: "/provider",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2779,7 +2868,7 @@ export class Provider extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<ProviderAuthResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<ProviderAuthResponses, ProviderAuthErrors, ThrowOnError>({
|
||||
url: "/provider/auth",
|
||||
...options,
|
||||
...params,
|
||||
@@ -2828,7 +2917,7 @@ export class Session2 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<SessionListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<SessionListResponses, SessionListErrors, ThrowOnError>({
|
||||
url: "/session",
|
||||
...options,
|
||||
...params,
|
||||
@@ -3116,7 +3205,7 @@ export class Session2 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<SessionDiffResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<SessionDiffResponses, SessionDiffErrors, ThrowOnError>({
|
||||
url: "/session/{sessionID}/diff",
|
||||
...options,
|
||||
...params,
|
||||
@@ -3318,7 +3407,7 @@ export class Session2 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<SessionForkResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<SessionForkResponses, SessionForkErrors, ThrowOnError>({
|
||||
url: "/session/{sessionID}/fork",
|
||||
...options,
|
||||
...params,
|
||||
@@ -3894,7 +3983,7 @@ export class Sync extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<SyncStartResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<SyncStartResponses, SyncStartErrors, ThrowOnError>({
|
||||
url: "/sync/start",
|
||||
...options,
|
||||
...params,
|
||||
@@ -3956,6 +4045,43 @@ export class Sync extends HeyApiClient {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Steal session into workspace
|
||||
*
|
||||
* Update a session to belong to the current workspace through the sync event system.
|
||||
*/
|
||||
public steal<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
sessionID?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "directory" },
|
||||
{ in: "query", key: "workspace" },
|
||||
{ in: "body", key: "sessionID" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<SyncStealResponses, SyncStealErrors, ThrowOnError>({
|
||||
url: "/sync/steal",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
private _history?: History
|
||||
get history(): History {
|
||||
return (this._history ??= new History({ client: this.client }))
|
||||
@@ -4022,7 +4148,7 @@ export class Session3 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<V2SessionPromptResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<V2SessionPromptResponses, V2SessionPromptErrors, ThrowOnError>({
|
||||
url: "/api/session/{sessionID}/prompt",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4059,7 +4185,7 @@ export class Session3 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<V2SessionCompactResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<V2SessionCompactResponses, V2SessionCompactErrors, ThrowOnError>({
|
||||
url: "/api/session/{sessionID}/compact",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4091,7 +4217,7 @@ export class Session3 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<V2SessionWaitResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<V2SessionWaitResponses, V2SessionWaitErrors, ThrowOnError>({
|
||||
url: "/api/session/{sessionID}/wait",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4123,7 +4249,7 @@ export class Session3 extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<V2SessionContextResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<V2SessionContextResponses, V2SessionContextErrors, ThrowOnError>({
|
||||
url: "/api/session/{sessionID}/context",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4194,7 +4320,7 @@ export class Control extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<TuiControlNextResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<TuiControlNextResponses, TuiControlNextErrors, ThrowOnError>({
|
||||
url: "/tui/control/next",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4226,7 +4352,7 @@ export class Control extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiControlResponseResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiControlResponseResponses, TuiControlResponseErrors, ThrowOnError>({
|
||||
url: "/tui/control/response",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4300,7 +4426,7 @@ export class Tui extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiOpenHelpResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiOpenHelpResponses, TuiOpenHelpErrors, ThrowOnError>({
|
||||
url: "/tui/open-help",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4330,7 +4456,7 @@ export class Tui extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiOpenSessionsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiOpenSessionsResponses, TuiOpenSessionsErrors, ThrowOnError>({
|
||||
url: "/tui/open-sessions",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4360,7 +4486,7 @@ export class Tui extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiOpenThemesResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiOpenThemesResponses, TuiOpenThemesErrors, ThrowOnError>({
|
||||
url: "/tui/open-themes",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4390,7 +4516,7 @@ export class Tui extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiOpenModelsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiOpenModelsResponses, TuiOpenModelsErrors, ThrowOnError>({
|
||||
url: "/tui/open-models",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4420,7 +4546,7 @@ export class Tui extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiSubmitPromptResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiSubmitPromptResponses, TuiSubmitPromptErrors, ThrowOnError>({
|
||||
url: "/tui/submit-prompt",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4450,7 +4576,7 @@ export class Tui extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiClearPromptResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiClearPromptResponses, TuiClearPromptErrors, ThrowOnError>({
|
||||
url: "/tui/clear-prompt",
|
||||
...options,
|
||||
...params,
|
||||
@@ -4525,7 +4651,7 @@ export class Tui extends HeyApiClient {
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiShowToastResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiShowToastResponses, TuiShowToastErrors, ThrowOnError>({
|
||||
url: "/tui/show-toast",
|
||||
...options,
|
||||
...params,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user