fix(core): add historical sync on workspace connect (#23121)

This commit is contained in:
James Long
2026-04-17 13:30:09 -04:00
committed by GitHub
parent fcb473ff64
commit a8c78fc005
8 changed files with 234 additions and 24 deletions
+32 -1
View File
@@ -163,6 +163,7 @@ import type {
SyncHistoryListResponses,
SyncReplayErrors,
SyncReplayResponses,
SyncStartResponses,
TextPartInput,
ToolIdsErrors,
ToolIdsResponses,
@@ -3038,7 +3039,7 @@ export class History extends HeyApiClient {
},
],
)
return (options?.client ?? this.client).get<SyncHistoryListResponses, SyncHistoryListErrors, ThrowOnError>({
return (options?.client ?? this.client).post<SyncHistoryListResponses, SyncHistoryListErrors, ThrowOnError>({
url: "/sync/history",
...options,
...params,
@@ -3052,6 +3053,36 @@ export class History extends HeyApiClient {
}
export class Sync extends HeyApiClient {
/**
* Start workspace sync
*
* Start sync loops for workspaces in the current project that have active sessions.
*/
public start<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).post<SyncStartResponses, unknown, ThrowOnError>({
url: "/sync/start",
...options,
...params,
})
}
/**
* Replay sync events
*
+19
View File
@@ -4502,6 +4502,25 @@ export type ProviderOauthCallbackResponses = {
export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses]
export type SyncStartData = {
body?: never
path?: never
query?: {
directory?: string
workspace?: string
}
url: "/sync/start"
}
export type SyncStartResponses = {
/**
* Workspace sync started
*/
200: boolean
}
export type SyncStartResponse = SyncStartResponses[keyof SyncStartResponses]
export type SyncReplayData = {
body?: {
directory: string