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 { URI } from '../../../base/common/uri.js';
7
>
import { Event } from '../../../base/common/event.js';
8
>
import { createDecorator } from '../../instantiation/common/instantiation.js';
9
>
import { ISessionGitHubState } from './state/sessionState.js';
10
>
11
>
export const META_GIT_STATE = 'agentHost.git';
12
>
export const META_GITHUB_STATE = 'agentHost.github';
13
>
14
>
export const GIT_DB_METADATA_KEYS: Record<string, true> = {
15
>
[META_GIT_STATE]: true,
16
>
[META_GITHUB_STATE]: true,
17
>
};
18
>
19
>
export const IAgentHostGitStateService = createDecorator<IAgentHostGitStateService>('agentHostGitStateService');
20
>
21
>
export interface IAgentHostGitStateService {
22
>
readonly _serviceBrand: undefined;
23
>
24
>
/**
25
>
* Fires when the git state for a session is refreshed.
26
>
*/
27
>
readonly onDidRefreshSessionGitState: Event<string>;
28
>
29
>
/**
30
>
* Refreshes the git state for a given session.
31
>
* @param sessionKey The key of the session for which to refresh the git state.
32
>
* @param workingDirectory Optional working directory override; when omitted, the session summary's working directory is used.
33
>
*/
34
>
refreshSessionGitState(sessionKey: string, workingDirectory?: URI): Promise<void>;
35
>
36
>
/**
37
>
* Sets the GitHub state for a given session.
38
>
* @param sessionKey The key of the session for which to set the GitHub state.
39
>
* @param state The GitHub state to set.
40
>
*/
41
>
setSessionGitHubState(sessionKey: string, state: ISessionGitHubState): Promise<void>;
42
>
43
>
/**
44
>
* Find a GitHub pull request for the given session and save it to the session state.
45
>
* @param sessionKey The key of the session for which to check the GitHub pull request.
46
>
*/
47
>
attachSessionGitHubPullRequest(sessionKey: string): Promise<void>;
48
>
}