Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessions.contribution.ts
13401 views
1
/*---------------------------------------------------------------------------------------------
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 { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../../workbench/common/contributions.js';
7
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
8
import { Disposable } from '../../../../base/common/lifecycle.js';
9
import { CopilotChatSessionsProvider, COPILOT_MULTI_CHAT_SETTING, CLAUDE_CODE_ENABLED_SETTING } from '../../copilotChatSessions/browser/copilotChatSessionsProvider.js';
10
import '../../copilotChatSessions/browser/copilotChatSessionsActions.js';
11
import { ISessionsProvidersService } from '../../../services/sessions/browser/sessionsProvidersService.js';
12
import { Registry } from '../../../../platform/registry/common/platform.js';
13
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from '../../../../platform/configuration/common/configurationRegistry.js';
14
import { localize } from '../../../../nls.js';
15
16
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
17
id: 'sessions',
18
properties: {
19
[COPILOT_MULTI_CHAT_SETTING]: {
20
type: 'boolean',
21
default: true,
22
tags: ['preview'],
23
description: localize('sessions.github.copilot.multiChatSessions', "Whether to enable multiple chats within a single session in the Copilot Chat sessions provider."),
24
},
25
[CLAUDE_CODE_ENABLED_SETTING]: {
26
type: 'boolean',
27
default: true,
28
experiment: { mode: 'startup' },
29
description: localize('sessions.chat.claudeAgent.enabled', "Enable Claude Agent sessions in the Agents app. Start and resume agentic coding sessions powered by Anthropic's Claude Agent SDK directly. Uses your existing Copilot subscription."),
30
},
31
},
32
});
33
34
/**
35
* Registers the {@link CopilotChatSessionsProvider} as a sessions provider.
36
*
37
* Coexists with the local agent host provider when `chat.agentHost.enabled`
38
* is true. The two providers list disjoint sets of sessions:
39
* - The local agent host filters via the per-session Agent Host SQLite DB
40
* (database-existence ownership gate in `CopilotAgent.listSessions`).
41
* - This provider's underlying extension service filters via the per-session
42
* metadata file's `origin` field, which the local agent host never writes.
43
*/
44
class DefaultSessionsProviderContribution extends Disposable implements IWorkbenchContribution {
45
static readonly ID = 'sessions.defaultSessionsProvider';
46
47
constructor(
48
@IInstantiationService instantiationService: IInstantiationService,
49
@ISessionsProvidersService sessionsProvidersService: ISessionsProvidersService,
50
) {
51
super();
52
53
const provider = this._register(instantiationService.createInstance(CopilotChatSessionsProvider));
54
this._register(sessionsProvidersService.registerProvider(provider));
55
}
56
}
57
58
registerWorkbenchContribution2(DefaultSessionsProviderContribution.ID, DefaultSessionsProviderContribution, WorkbenchPhase.AfterRestored);
59
60