2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { CancellationToken } from '../../../base/common/cancellation.js';
7
>
import { URI } from '../../../base/common/uri.js';
8
>
import { localize } from '../../../nls.js';
9
>
import { parseChangesetUri } from '../common/changesetUri.js';
10
>
import type { InvokeChangesetOperationParams, InvokeChangesetOperationResult } from '../common/state/protocol/channels-changeset/commands.js';
11
>
import { AHP_SESSION_NOT_FOUND, JsonRpcErrorCodes, ProtocolError } from '../common/state/sessionProtocol.js';
12
>
import { readSessionGitState, type SessionState } from '../common/state/sessionState.js';
13
>
import { ILogService } from '../../log/common/log.js';
14
>
import { IChangesetOperationHandler } from '../common/agentHostChangesetOperationService.js';
15
>
import { IAgentHostGitService } from '../common/agentHostGitService.js';
16
>
17
>
export class AgentHostSyncOperationHandler implements IChangesetOperationHandler {
18
>
19
>
public static readonly OPERATION_SYNC = 'sync';
20
>
21
>
constructor(
22
private readonly _getSessionState: (sessionKey: string) => SessionState | undefined,
23
private readonly _onSynced: (sessionKey: string) => Promise<void>,