@codingame/monaco-vscode-chat-service-override 38.0.7 → 38.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common.js +0 -53
- package/index.js +0 -3
- package/package.json +5 -5
- package/session.js +0 -3
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHost.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +1 -1
- package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.d.ts +0 -135
- package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.js +0 -510
- package/vscode/src/vs/platform/agentHost/common/agentModelNotices.d.ts +0 -22
- package/vscode/src/vs/platform/agentHost/common/agentModelNotices.js +0 -21
- package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.d.ts +0 -273
- package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.js +0 -61
- package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.d.ts +0 -7
- package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.js +0 -17
- package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.d.ts +0 -12
- package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.js +0 -48
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.d.ts +0 -8
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.js +0 -11
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.d.ts +0 -114
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.js +0 -141
- package/vscode/src/vs/platform/agentHost/common/taskEventReplay.d.ts +0 -48
- package/vscode/src/vs/platform/agentHost/common/taskEventReplay.js +0 -238
- package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.d.ts +0 -102
- package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.js +0 -260
- package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.d.ts +0 -102
- package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.js +0 -115
- package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.d.ts +0 -46
- package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.js +0 -92
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +0 -9
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.d.ts +0 -14
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.js +0 -385
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.d.ts +0 -67
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.js +0 -695
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.d.ts +0 -4
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.js +0 -39
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +0 -59
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +0 -83
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +0 -87
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +0 -176
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +0 -422
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +0 -2444
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.d.ts +0 -91
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.js +0 -620
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +0 -5
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +0 -46
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +0 -321
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +0 -104
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +0 -345
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +0 -611
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +0 -85
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +0 -200
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +0 -981
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +0 -206
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +0 -368
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +0 -57
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +0 -98
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +0 -186
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +0 -116
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +0 -226
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +0 -138
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +0 -29
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.js +0 -108
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +0 -63
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/media/voiceModeOnboarding.css +0 -252
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +0 -178
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.d.ts +0 -47
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +0 -322
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +0 -146
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +0 -890
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.d.ts +0 -132
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +0 -237
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +0 -120
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +0 -234
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +0 -164
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.js +0 -122
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.d.ts +0 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.js +0 -213
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.js +0 -561
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.d.ts +0 -133
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.js +0 -1176
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.js +0 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.d.ts +0 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.js +0 -220
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.js +0 -184
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.js +0 -165
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.d.ts +0 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.js +0 -162
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.js +0 -129
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.d.ts +0 -166
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.js +0 -838
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.js +0 -604
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.d.ts +0 -289
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.js +0 -497
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.js +0 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.d.ts +0 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.js +0 -398
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.js +0 -296
- package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.d.ts +0 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.js +0 -361
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.d.ts +0 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.js +0 -198
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +0 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +0 -871
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.d.ts +0 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +0 -297
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +0 -118
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Sequencer, raceCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
3
|
-
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
4
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
5
|
-
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
6
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
|
-
import { AgentSession } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agent';
|
|
8
|
-
import { CLOUD_SANDBOX_AGENT_PROVIDER, CLOUD_SANDBOX_SESSION_SCHEME, CloudSandboxAutoConnectOnOpenSettingId, CloudSandboxRequestError, isRetryableCloudSandboxError } from '../../../../../platform/agentHost/common/cloudSandboxAgentHost.js';
|
|
9
|
-
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
10
|
-
import { RemoteAgentHostSessionsProvider } from '@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostSessionsProvider';
|
|
11
|
-
import { validateSessionConfigWrite } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/sessionConfigProperties';
|
|
12
|
-
import { RemoteAgentHostConnectionStatus } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService';
|
|
13
|
-
import { readSessionWorkspaceless } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
|
|
14
|
-
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
15
|
-
import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
|
|
16
|
-
|
|
17
|
-
class CloudSandboxSessionsProvider extends RemoteAgentHostSessionsProvider {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this._configurationUnavailable = derived(
|
|
21
|
-
this,
|
|
22
|
-
reader => !RemoteAgentHostConnectionStatus.isConnected(this.connectionStatus.read(reader)) || this.authenticationPending.read(reader) || this.passiveRelay.read(reader)
|
|
23
|
-
);
|
|
24
|
-
this.supportsWorkspaceSelection = false;
|
|
25
|
-
this._archiveSequencer = ( new Sequencer());
|
|
26
|
-
this._withheldSessions = ( new Set());
|
|
27
|
-
this._provisionalSessions = ( new Map());
|
|
28
|
-
this._pendingSessionTitles = ( new Map());
|
|
29
|
-
}
|
|
30
|
-
get supportsOfflineDrafts() {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
get environment() {
|
|
34
|
-
return {
|
|
35
|
-
id: "cloud",
|
|
36
|
-
label: ( localize(5144, "Cloud"))
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
get automations() {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
_adoptCachedSessionMeta(meta) {
|
|
43
|
-
const adopted = super._adoptCachedSessionMeta(meta);
|
|
44
|
-
return adopted?.session.scheme === CLOUD_SANDBOX_AGENT_PROVIDER && adopted.provider === CLOUD_SANDBOX_AGENT_PROVIDER ? {
|
|
45
|
-
...adopted,
|
|
46
|
-
session: adopted.session.with({
|
|
47
|
-
scheme: CLOUD_SANDBOX_SESSION_SCHEME
|
|
48
|
-
})
|
|
49
|
-
} : adopted;
|
|
50
|
-
}
|
|
51
|
-
static {
|
|
52
|
-
this.PROVISIONAL_GRACE_MS = 2 * 60_000;
|
|
53
|
-
}
|
|
54
|
-
async resolveInitialSessionConfig(sessionId, values, token) {
|
|
55
|
-
const rawId = this._sessionKeyFromChatId(sessionId);
|
|
56
|
-
const connection = this.connection;
|
|
57
|
-
if (!connection || !rawId || !( this._sessionCache.has(rawId))) {
|
|
58
|
-
throw ( new Error(( localize(5145, "The sandbox connection is unavailable. Your prompt was not sent."))));
|
|
59
|
-
}
|
|
60
|
-
const config = await raceCancellationError(connection.resolveSessionConfig({
|
|
61
|
-
provider: CLOUD_SANDBOX_AGENT_PROVIDER,
|
|
62
|
-
config: values
|
|
63
|
-
}), token);
|
|
64
|
-
for (const [key, value] of Object.entries(values)) {
|
|
65
|
-
validateSessionConfigWrite(config.schema, config.values, key, value, true);
|
|
66
|
-
if (config.values[key] !== value) {
|
|
67
|
-
throw ( new Error(( localize(
|
|
68
|
-
5146,
|
|
69
|
-
"The sandbox could not apply the selected {0}. Your prompt was not sent.",
|
|
70
|
-
key
|
|
71
|
-
))));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
...values
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
_adapterOptions() {
|
|
79
|
-
return {
|
|
80
|
-
...super._adapterOptions(),
|
|
81
|
-
preserveStatusWhenDisconnected: true,
|
|
82
|
-
useSessionTitleForDefaultChat: true,
|
|
83
|
-
isSessionTitlePlaceholder: (title, session) => session.scheme === CLOUD_SANDBOX_SESSION_SCHEME && title === AgentSession.id(session),
|
|
84
|
-
externalSessionState: (resource, store) => {
|
|
85
|
-
const key = this._localSessionStorageKey(AgentSession.id(resource));
|
|
86
|
-
store.add(this._chatService.onDidAcceptRequest((
|
|
87
|
-
{
|
|
88
|
-
chatSessionResource
|
|
89
|
-
}
|
|
90
|
-
) => {
|
|
91
|
-
if (isEqual(resource, chatSessionResource.with({
|
|
92
|
-
fragment: ""
|
|
93
|
-
}))) {
|
|
94
|
-
this._storageService.store(key, true, StorageScope.PROFILE, StorageTarget.MACHINE);
|
|
95
|
-
}
|
|
96
|
-
}));
|
|
97
|
-
return constObservable(false);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
_localSessionStorageKey(rawId) {
|
|
102
|
-
return `sessions.cloudSandbox.localSession.${this.id}.${rawId}`;
|
|
103
|
-
}
|
|
104
|
-
updateAdapter(adapter, meta) {
|
|
105
|
-
const changed = super.updateAdapter(adapter, meta);
|
|
106
|
-
const sessionKey = ( meta.session.toString());
|
|
107
|
-
this._provisionalSessions.delete(sessionKey);
|
|
108
|
-
const title = this._pendingSessionTitles.get(sessionKey);
|
|
109
|
-
if (title !== undefined && this.connection) {
|
|
110
|
-
this._pendingSessionTitles.delete(sessionKey);
|
|
111
|
-
void super.renameSession(adapter.sessionId, title).catch(error => {
|
|
112
|
-
this._logService.error(
|
|
113
|
-
`[CloudSandboxSessionsProvider] Failed to apply initial title for ${sessionKey}`,
|
|
114
|
-
error
|
|
115
|
-
);
|
|
116
|
-
});
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
return changed;
|
|
120
|
-
}
|
|
121
|
-
_onBackendSessionRemoved(rawId) {
|
|
122
|
-
super._onBackendSessionRemoved(rawId);
|
|
123
|
-
this._pendingSessionTitles.delete(rawId);
|
|
124
|
-
}
|
|
125
|
-
async prepareSessionForOpen() {
|
|
126
|
-
if (this._baseConfigurationService.getValue(CloudSandboxAutoConnectOnOpenSettingId) === true && !this.connection && RemoteAgentHostConnectionStatus.isDisconnected(this.connectionStatus.get())) {
|
|
127
|
-
void this.connect().catch(error => {
|
|
128
|
-
this._logService.warn(
|
|
129
|
-
"[CloudSandboxSessionsProvider] Background connection on open failed",
|
|
130
|
-
error
|
|
131
|
-
);
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
isSessionConfigResolving(sessionId) {
|
|
136
|
-
const resolving = super.isSessionConfigResolving(sessionId);
|
|
137
|
-
return derived(
|
|
138
|
-
this,
|
|
139
|
-
reader => this._configurationUnavailable.read(reader) || resolving.read(reader)
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
async setSessionConfigValue(sessionId, property, value) {
|
|
143
|
-
this._assertConfigurationAvailable();
|
|
144
|
-
await super.setSessionConfigValue(sessionId, property, value);
|
|
145
|
-
}
|
|
146
|
-
async replaceSessionConfig(sessionId, values) {
|
|
147
|
-
this._assertConfigurationAvailable();
|
|
148
|
-
await super.replaceSessionConfig(sessionId, values);
|
|
149
|
-
}
|
|
150
|
-
_assertConfigurationAvailable() {
|
|
151
|
-
if (this.passiveRelay.get()) {
|
|
152
|
-
throw ( new Error(( localize(5147, "This connection is read-only. Session settings cannot be changed."))));
|
|
153
|
-
}
|
|
154
|
-
if (this._configurationUnavailable.get()) {
|
|
155
|
-
throw ( new Error(( localize(5148, "Connect to the environment before changing session settings."))));
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
_resolveArchivedState(sessionKey, isArchived) {
|
|
159
|
-
return this._taskArchiveHandler?.sessionKey === sessionKey ? this._sessionCache.get(sessionKey)?.isArchived.get() ?? isArchived : super._resolveArchivedState(sessionKey, isArchived);
|
|
160
|
-
}
|
|
161
|
-
setTaskArchiveHandler(rawId, setArchived) {
|
|
162
|
-
this._taskArchiveHandler = {
|
|
163
|
-
sessionKey: ( AgentSession.uri(CLOUD_SANDBOX_SESSION_SCHEME, rawId).toString()),
|
|
164
|
-
setArchived
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
setTaskRenameHandler(rawId, rename) {
|
|
168
|
-
this._taskRenameHandler = {
|
|
169
|
-
sessionKey: ( AgentSession.uri(CLOUD_SANDBOX_SESSION_SCHEME, rawId).toString()),
|
|
170
|
-
rename
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
setInitialSessionTitle(sessionId, title) {
|
|
174
|
-
return this._renameSession(sessionId, title, true);
|
|
175
|
-
}
|
|
176
|
-
renameSession(sessionId, title) {
|
|
177
|
-
return this._renameSession(sessionId, title, false);
|
|
178
|
-
}
|
|
179
|
-
async _renameSession(sessionId, title, initial) {
|
|
180
|
-
const sessionKey = this._sessionKeyFromChatId(sessionId);
|
|
181
|
-
const session = sessionKey ? this._sessionCache.get(sessionKey) : undefined;
|
|
182
|
-
if (!session || !sessionKey) {
|
|
183
|
-
throw ( new Error(( localize(5149, "Sandbox session not found."))));
|
|
184
|
-
}
|
|
185
|
-
const handler = this._taskRenameHandler;
|
|
186
|
-
if (handler?.sessionKey !== sessionKey) {
|
|
187
|
-
if (!this.connection && !( this._provisionalSessions.has(sessionKey))) {
|
|
188
|
-
throw ( new Error(( localize(5150, "Connect to the environment to rename this session."))));
|
|
189
|
-
}
|
|
190
|
-
} else {
|
|
191
|
-
try {
|
|
192
|
-
await handler.rename(title);
|
|
193
|
-
} catch (error) {
|
|
194
|
-
if (!initial || !(error instanceof CloudSandboxRequestError) || !isRetryableCloudSandboxError(error)) {
|
|
195
|
-
throw error;
|
|
196
|
-
}
|
|
197
|
-
this._logService.warn(
|
|
198
|
-
`[CloudSandboxSessionsProvider] Failed to synchronize initial task title for ${sessionKey}; continuing with the first turn`,
|
|
199
|
-
error
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
if (this._store.isDisposed || this._sessionCache.get(sessionKey) !== session) {
|
|
203
|
-
throw ( new CancellationError());
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
if (( this._provisionalSessions.has(sessionKey))) {
|
|
207
|
-
this._pendingSessionTitles.set(sessionKey, title);
|
|
208
|
-
} else if (this.connection) {
|
|
209
|
-
return super.renameSession(sessionId, title);
|
|
210
|
-
}
|
|
211
|
-
session.setTitleFromUser(title);
|
|
212
|
-
this._onDidChangeSessions.fire({
|
|
213
|
-
added: [],
|
|
214
|
-
removed: [],
|
|
215
|
-
changed: [session]
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
async archiveSession(sessionId) {
|
|
219
|
-
await this._archiveSequencer.queue(() => this._setArchived(sessionId, true));
|
|
220
|
-
}
|
|
221
|
-
async unarchiveSession(sessionId) {
|
|
222
|
-
await this._archiveSequencer.queue(() => this._setArchived(sessionId, false));
|
|
223
|
-
}
|
|
224
|
-
async _setArchived(sessionId, isArchived) {
|
|
225
|
-
if (this._store.isDisposed) {
|
|
226
|
-
throw ( new CancellationError());
|
|
227
|
-
}
|
|
228
|
-
const sessionKey = this._sessionKeyFromChatId(sessionId);
|
|
229
|
-
const session = sessionKey ? this._sessionCache.get(sessionKey) : undefined;
|
|
230
|
-
if (!session || !sessionKey) {
|
|
231
|
-
throw ( new Error(( localize(5149, "Sandbox session not found."))));
|
|
232
|
-
}
|
|
233
|
-
const handler = this._taskArchiveHandler;
|
|
234
|
-
if (handler?.sessionKey !== sessionKey) {
|
|
235
|
-
if (!this.connection) {
|
|
236
|
-
throw ( new Error(( localize(5151, "Connect to the environment to change this session's archive state."))));
|
|
237
|
-
}
|
|
238
|
-
return isArchived ? super.archiveSession(sessionId) : super.unarchiveSession(sessionId);
|
|
239
|
-
}
|
|
240
|
-
await handler.setArchived(isArchived);
|
|
241
|
-
if (this._store.isDisposed || this._sessionCache.get(sessionKey) !== session) {
|
|
242
|
-
throw ( new CancellationError());
|
|
243
|
-
}
|
|
244
|
-
this.setSessionArchived(AgentSession.id(session.backendUri), isArchived);
|
|
245
|
-
}
|
|
246
|
-
setSessionArchived(rawId, archived) {
|
|
247
|
-
const session = this._sessionCache.get(( AgentSession.uri(CLOUD_SANDBOX_SESSION_SCHEME, rawId).toString()));
|
|
248
|
-
if (!session) {
|
|
249
|
-
throw ( new Error(( localize(5149, "Sandbox session not found."))));
|
|
250
|
-
}
|
|
251
|
-
if (session.isArchived.get() === archived) {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
session.isArchived.set(archived, undefined);
|
|
255
|
-
this._onDidChangeSessions.fire({
|
|
256
|
-
added: [],
|
|
257
|
-
removed: [],
|
|
258
|
-
changed: [session]
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
seedProvisionalSession(rawMeta) {
|
|
262
|
-
const meta = this._adoptSessionMeta(rawMeta);
|
|
263
|
-
const rawId = AgentSession.id(meta.session);
|
|
264
|
-
this._storageService.store(
|
|
265
|
-
this._localSessionStorageKey(rawId),
|
|
266
|
-
true,
|
|
267
|
-
StorageScope.PROFILE,
|
|
268
|
-
StorageTarget.MACHINE
|
|
269
|
-
);
|
|
270
|
-
if (( this._sessionCache.has(( meta.session.toString())))) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
const adapter = this.createAdapter(meta);
|
|
274
|
-
adapter.updateDiscoveryMetadata(meta, readSessionWorkspaceless(meta._meta) || undefined);
|
|
275
|
-
this._sessionCache.set(( meta.session.toString()), adapter);
|
|
276
|
-
this._withheldSessions.add(( meta.session.toString()));
|
|
277
|
-
this._provisionalSessions.set(( meta.session.toString()), undefined);
|
|
278
|
-
}
|
|
279
|
-
publishWithheldSession(rawId, options) {
|
|
280
|
-
if (!this._withheldSessions.delete(( AgentSession.uri(CLOUD_SANDBOX_SESSION_SCHEME, rawId).toString()))) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
const session = this.getCachedSession(rawId);
|
|
284
|
-
if (session && options?.announce !== false) {
|
|
285
|
-
this._onDidChangeSessions.fire({
|
|
286
|
-
added: [session],
|
|
287
|
-
removed: [],
|
|
288
|
-
changed: []
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
getCachedSession(rawId) {
|
|
293
|
-
return this._sessionCache.get(( AgentSession.uri(CLOUD_SANDBOX_SESSION_SCHEME, rawId).toString()));
|
|
294
|
-
}
|
|
295
|
-
getSessionModifiedTime(rawId) {
|
|
296
|
-
return this.getCachedSession(rawId)?.updatedAt.get().getTime();
|
|
297
|
-
}
|
|
298
|
-
removeDeletedSession(rawId) {
|
|
299
|
-
const cached = this.getCachedSession(rawId);
|
|
300
|
-
const key = cached ? this._sessionKeyFromChatId(cached.sessionId) : undefined;
|
|
301
|
-
const session = key ? this._removeCachedSession(key) : undefined;
|
|
302
|
-
const taskKey = ( AgentSession.uri(CLOUD_SANDBOX_SESSION_SCHEME, rawId).toString());
|
|
303
|
-
this._withheldSessions.delete(taskKey);
|
|
304
|
-
this._provisionalSessions.delete(taskKey);
|
|
305
|
-
this._pendingSessionTitles.delete(taskKey);
|
|
306
|
-
if (session) {
|
|
307
|
-
this._onDidChangeSessions.fire({
|
|
308
|
-
added: [],
|
|
309
|
-
removed: [session],
|
|
310
|
-
changed: []
|
|
311
|
-
});
|
|
312
|
-
session.dispose();
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
getSessions() {
|
|
316
|
-
const sessions = super.getSessions();
|
|
317
|
-
return this._withheldSessions.size === 0 ? sessions : sessions.filter(session => !( this._withheldSessions.has(this._sessionKeyFromChatId(session.sessionId) ?? "")));
|
|
318
|
-
}
|
|
319
|
-
_isSessionEvictable(rawId) {
|
|
320
|
-
if (!( this._provisionalSessions.has(rawId))) {
|
|
321
|
-
return true;
|
|
322
|
-
}
|
|
323
|
-
const deadline = this._provisionalSessions.get(rawId);
|
|
324
|
-
if (deadline === undefined || Date.now() < deadline) {
|
|
325
|
-
return false;
|
|
326
|
-
}
|
|
327
|
-
this._provisionalSessions.delete(rawId);
|
|
328
|
-
this._pendingSessionTitles.delete(rawId);
|
|
329
|
-
return true;
|
|
330
|
-
}
|
|
331
|
-
_onHostListedSessions(rawIds) {
|
|
332
|
-
if (this._provisionalSessions.size === 0) {
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
for (const [rawId, deadline] of [...this._provisionalSessions]) {
|
|
336
|
-
if (( rawIds.has(rawId))) {
|
|
337
|
-
this._provisionalSessions.delete(rawId);
|
|
338
|
-
} else if (deadline === undefined) {
|
|
339
|
-
this._provisionalSessions.set(rawId, Date.now() + CloudSandboxSessionsProvider.PROVISIONAL_GRACE_MS);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export { CloudSandboxSessionsProvider };
|