@codingame/monaco-vscode-chat-cloud-service-override 0.0.0-stage → 38.1.1

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.
Files changed (29) hide show
  1. package/common.d.ts +2 -0
  2. package/common.js +29 -0
  3. package/index.d.ts +3 -0
  4. package/index.js +9 -0
  5. package/package.json +52 -3
  6. package/session.d.ts +3 -0
  7. package/session.js +11 -0
  8. package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +9 -0
  9. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.d.ts +67 -0
  10. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.js +695 -0
  11. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.d.ts +4 -0
  12. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.js +39 -0
  13. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.d.ts +1 -0
  14. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +59 -0
  15. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +1 -0
  16. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +83 -0
  17. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +87 -0
  18. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +176 -0
  19. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +422 -0
  20. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +2444 -0
  21. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.d.ts +91 -0
  22. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.js +620 -0
  23. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.d.ts +1 -0
  24. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +5 -0
  25. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +46 -0
  26. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +321 -0
  27. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +104 -0
  28. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +345 -0
  29. package/README.md +0 -3
@@ -0,0 +1,422 @@
1
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
2
+ import { IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent";
3
+ import { Disposable, IDisposable, IReference } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { IObservable, ISettableObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
5
+ import { ThemeIcon } from "@codingame/monaco-vscode-api/vscode/vs/base/common/themables";
6
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
7
+ import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
8
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
9
+ import { IAgentSession } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel";
10
+ import { IAgentSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service";
11
+ import { AgentSessionTarget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions";
12
+ import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
13
+ import { IChatSessionProviderOptionItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
14
+ import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
15
+ import { AutomationModelConfiguration } from "@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/automations/browser/automationModelConfiguration";
16
+ import { ChatModelSource, ISession, IChat, ISessionWorkspace, ISideChatSelection, SessionStatus, IGitHubInfo, ISessionArtifact, ISessionType, ISessionWorkspaceBrowseAction, ISessionFileChange, IChatCheckpoints, ISessionChangesSummary, ISessionCreationReference, ISessionPreparationProgress } from "@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/session";
17
+ import { IAutomationSessionConfiguration, IDeleteChatOptions, ISendRequestOptions, ISessionChangeEvent, ISessionConfigProvider, ISessionConfigurationSnapshot, ISessionModelPickerOptions, ISessionModelsSnapshot, ISessionsProvider, ISessionsProviderCreateSessionOptions } from "@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/sessionsProvider";
18
+ import { ISessionOptionGroup } from "../../../chat/browser/newSession.js";
19
+ import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
20
+ import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
21
+ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
22
+ import { IChatRequestVariableEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries";
23
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
24
+ import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
25
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
26
+ import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
27
+ import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
28
+ import { IGitHubService } from "@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/github/browser/githubService.service";
29
+ import { IPullRequestIconCache } from "@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/github/browser/pullRequestIconCache.service";
30
+ import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
31
+ import { CloudSandboxAgentHostContribution } from "../../remoteAgentHost/browser/cloudSandboxAgentHostContribution.js";
32
+ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
33
+ import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService";
34
+ import { ResolveSessionConfigResult } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/commands";
35
+ import { CloudAutomationStore } from "./cloudAutomationStore.js";
36
+ /** Copilot Cloud session type - cloud-hosted agent. */
37
+ export declare const CopilotCloudSessionType: ISessionType;
38
+ export declare const CopilotSandboxSessionType: ISessionType;
39
+ export interface ICopilotChatSession {
40
+ /** Globally unique session ID (`providerId:localId`). */
41
+ readonly sessionId: string;
42
+ /** Resource URI identifying this session. */
43
+ readonly resource: URI;
44
+ /** ID of the provider that owns this session. */
45
+ readonly providerId: string;
46
+ /** Session type ID (e.g., 'copilot-cloud-agent', 'copilot-cloud-sandbox'). */
47
+ readonly sessionType: string;
48
+ readonly application: ISession["application"];
49
+ /** Icon for this session. */
50
+ readonly icon: ThemeIcon;
51
+ /** When the session was created. */
52
+ readonly createdAt: Date;
53
+ /** Workspace this session operates on. */
54
+ readonly workspace: IObservable<ISessionWorkspace | undefined>;
55
+ readonly isQuickChat?: IObservable<boolean>;
56
+ /** Session display title (changes when auto-titled or renamed). */
57
+ readonly title: IObservable<string>;
58
+ /** When the session was last updated. */
59
+ readonly updatedAt: IObservable<Date>;
60
+ /** Current session status. */
61
+ readonly status: IObservable<SessionStatus>;
62
+ /** Summary of file changes produced by the session. */
63
+ readonly changesSummary?: IObservable<ISessionChangesSummary | undefined>;
64
+ /** File changes produced by the session. */
65
+ readonly changes: IObservable<readonly ISessionFileChange[]>;
66
+ /** Currently selected model identifier. */
67
+ readonly modelId: IObservable<string | undefined>;
68
+ readonly modelSource: IObservable<ChatModelSource | undefined>;
69
+ /** Currently selected mode identifier and kind. */
70
+ readonly mode: IObservable<{
71
+ readonly id: string;
72
+ readonly kind: string;
73
+ } | undefined>;
74
+ /** Whether the session is still initializing. */
75
+ readonly loading: IObservable<boolean>;
76
+ readonly preparationProgress?: IObservable<ISessionPreparationProgress | undefined>;
77
+ readonly isNewSessionRequestInProgress?: IObservable<boolean>;
78
+ /** Whether the session is archived. */
79
+ readonly isArchived: IObservable<boolean>;
80
+ /** Whether the session has been read. */
81
+ readonly isRead: IObservable<boolean>;
82
+ /** Status description shown while the session is active (e.g., current agent action). */
83
+ readonly description: IObservable<IMarkdownString | undefined>;
84
+ /** Timestamp of when the last agent turn ended, if any. */
85
+ readonly lastTurnEnd: IObservable<Date | undefined>;
86
+ /** GitHub information associated with this session, if any. */
87
+ readonly gitHubInfo: IObservable<IGitHubInfo | undefined>;
88
+ readonly artifacts?: IObservable<readonly ISessionArtifact[]>;
89
+ /** Checkpoints associated with this session, if any. */
90
+ readonly checkpoints: IObservable<IChatCheckpoints | undefined>;
91
+ readonly createdBySession?: IObservable<ISessionCreationReference | undefined>;
92
+ /** Whether this session is still treated as external to VS Code. Absent means `false`. */
93
+ readonly isExternal?: IObservable<boolean>;
94
+ readonly initialAutomationSessionConfiguration?: IAutomationSessionConfiguration;
95
+ setModelId(modelId: string | undefined, source: ChatModelSource): void;
96
+ /**
97
+ * Settable observable holding the {@link IChat} representation of this chat.
98
+ * For committed chats, the value is stable.
99
+ */
100
+ readonly mainChat: ISettableObservable<IChat>;
101
+ }
102
+ /** Provider ID for the Copilot Chat Sessions provider. */
103
+ export declare const COPILOT_PROVIDER_ID = "default-copilot";
104
+ /**
105
+ * Remote new session for Cloud agent sessions.
106
+ * Implements {@link ICopilotChatSession} (session facade) and provides
107
+ * pre-send configuration methods for the new-session flow.
108
+ */
109
+ export declare class RemoteNewSession extends Disposable implements ICopilotChatSession {
110
+ readonly resource: URI;
111
+ readonly sessionWorkspace: ISessionWorkspace | undefined;
112
+ readonly target: AgentSessionTarget;
113
+ readonly initialAutomationSessionConfiguration: IAutomationSessionConfiguration | undefined;
114
+ readonly isAutomationDraft: boolean;
115
+ private readonly chatSessionsService;
116
+ private readonly contextKeyService;
117
+ readonly application: IObservable<import("@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/session").ISessionApplication>;
118
+ readonly lifetimeToken: CancellationToken;
119
+ readonly sessionId: string;
120
+ readonly providerId: string;
121
+ readonly sessionType: string;
122
+ readonly icon: ThemeIcon;
123
+ readonly createdAt: Date;
124
+ private readonly _title;
125
+ readonly title: IObservable<string>;
126
+ private readonly _updatedAt;
127
+ readonly updatedAt: IObservable<Date>;
128
+ private readonly _status;
129
+ readonly status: IObservable<SessionStatus>;
130
+ private readonly _workspaceData;
131
+ readonly workspace: IObservable<ISessionWorkspace | undefined>;
132
+ readonly isQuickChat: IObservable<boolean>;
133
+ readonly changes: IObservable<readonly ISessionFileChange[]>;
134
+ readonly checkpoints: IObservable<IChatCheckpoints | undefined>;
135
+ private readonly _modelIdObservable;
136
+ readonly modelId: IObservable<string | undefined>;
137
+ protected readonly _modelSourceObservable: ISettableObservable<ChatModelSource | undefined, void>;
138
+ readonly modelSource: IObservable<ChatModelSource | undefined>;
139
+ readonly mode: IObservable<{
140
+ readonly id: string;
141
+ readonly kind: string;
142
+ } | undefined>;
143
+ readonly loading: IObservable<boolean>;
144
+ readonly preparationProgress: ISettableObservable<ISessionPreparationProgress | undefined, void>;
145
+ readonly isNewSessionRequestInProgress: IObservable<boolean>;
146
+ private readonly _preparationCts;
147
+ private _preparationActivities;
148
+ private readonly _isArchived;
149
+ readonly isArchived: IObservable<boolean>;
150
+ readonly isRead: IObservable<boolean>;
151
+ readonly description: IObservable<IMarkdownString | undefined>;
152
+ readonly lastTurnEnd: IObservable<Date | undefined>;
153
+ readonly gitHubInfo: IObservable<IGitHubInfo | undefined>;
154
+ readonly mainChat: ISettableObservable<IChat>;
155
+ private _repoUri;
156
+ private _project;
157
+ private _modelId;
158
+ private _query;
159
+ private _attachedContext;
160
+ private readonly _onDidChangeOptionGroups;
161
+ readonly onDidChangeOptionGroups: Event<void>;
162
+ readonly selectedOptions: Map<string, IChatSessionProviderOptionItem>;
163
+ readonly createdBySession: ISettableObservable<ISessionCreationReference | undefined, void>;
164
+ get project(): ISessionWorkspace | undefined;
165
+ get selectedModelId(): string | undefined;
166
+ /**
167
+ * The repository this session targets, as `owner/repo`. A GitHub workspace root carries a ref
168
+ * (`/<owner>/<repo>/HEAD`, see {@link CopilotChatSessionsProvider._browseForRepository}), so this
169
+ * takes only the first two path segments rather than the whole path.
170
+ */
171
+ get repoNwo(): string | undefined;
172
+ get query(): string | undefined;
173
+ get attachedContext(): IChatRequestVariableEntry[] | undefined;
174
+ setCreatedBySession(reference: ISessionCreationReference | undefined): void;
175
+ get disabled(): boolean;
176
+ private readonly _whenClauseKeys;
177
+ readonly modelConfiguration: AutomationModelConfiguration;
178
+ constructor(resource: URI, sessionWorkspace: ISessionWorkspace | undefined, target: AgentSessionTarget, providerId: string, initialAutomationSessionConfiguration: IAutomationSessionConfiguration | undefined, isAutomationDraft: boolean, chatSessionsService: IChatSessionsService, contextKeyService: IContextKeyService, languageModelsService: ILanguageModelsService);
179
+ setModelId(modelId: string | undefined, source: ChatModelSource): void;
180
+ setTitle(title: string): void;
181
+ setStatus(status: SessionStatus): void;
182
+ startPreparation(): IReference<CancellationToken>;
183
+ reportPreparationProgress(message: string): void;
184
+ private clearPreparation;
185
+ setArchived(archived: boolean): void;
186
+ setOption(optionId: string, value: IChatSessionProviderOptionItem | string): void;
187
+ getModelOptionsSnapshot(): {
188
+ readonly modelOption: ISessionOptionGroup | undefined;
189
+ readonly isResolved: boolean;
190
+ };
191
+ getOtherOptionGroups(): ISessionOptionGroup[];
192
+ getOptionValue(groupId: string): IChatSessionProviderOptionItem | undefined;
193
+ setOptionValue(groupId: string, value: IChatSessionProviderOptionItem): void;
194
+ private _getOptionGroups;
195
+ private _isOptionGroupVisible;
196
+ private _updateWhenClauseKeys;
197
+ private _getValueForGroup;
198
+ update(_session: IAgentSession): void;
199
+ }
200
+ /**
201
+ * Default sessions provider for Copilot Cloud sessions.
202
+ * Wraps the existing session infrastructure into the extensible provider model.
203
+ */
204
+ export declare class CopilotChatSessionsProvider extends Disposable implements ISessionsProvider {
205
+ private readonly providerMode;
206
+ private readonly agentSessionsService;
207
+ private readonly chatService;
208
+ private readonly chatSessionsService;
209
+ private readonly commandService;
210
+ private readonly instantiationService;
211
+ private readonly languageModelsService;
212
+ private readonly configurationService;
213
+ private readonly logService;
214
+ private readonly notificationService;
215
+ private readonly gitHubService;
216
+ private readonly pullRequestIconCache;
217
+ private readonly labelService;
218
+ private readonly uriIdentityService;
219
+ private readonly fileService;
220
+ private readonly pathService;
221
+ private readonly storageService;
222
+ readonly environment: {
223
+ id: string;
224
+ label: string;
225
+ };
226
+ /**
227
+ * How long the first sandbox turn waits for the session's model catalog to arrive before
228
+ * dispatching without the user's model. Long enough to cover the gap between the relay
229
+ * connecting and the host publishing its models, short enough not to strand a send behind a
230
+ * catalog that is never coming. Exceeding it is reported to the user, not only logged.
231
+ */
232
+ private static readonly SANDBOX_MODEL_WAIT_MS;
233
+ get id(): string;
234
+ get label(): string;
235
+ readonly icon: ThemeIcon;
236
+ readonly order = 0;
237
+ get sessionTypes(): readonly ISessionType[];
238
+ private readonly _onDidChangeSessionTypes;
239
+ readonly onDidChangeSessionTypes: Event<void>;
240
+ private readonly _onDidChangeCapabilities;
241
+ readonly onDidChangeCapabilities: Event<void>;
242
+ private readonly _onDidChangeSessions;
243
+ readonly onDidChangeSessions: Event<ISessionChangeEvent>;
244
+ private readonly _onDidReplaceSession;
245
+ readonly onDidReplaceSession: Event<{
246
+ readonly from: ISession;
247
+ readonly to: ISession;
248
+ }>;
249
+ /** Cache of adapted sessions, keyed by resource URI string. */
250
+ private readonly _sessionCache;
251
+ /**
252
+ * Resources of committed sessions that are currently in-flight (i.e.
253
+ * between {@link _sendFirstChat} entering the send and the replace
254
+ * event firing). Protected from spurious removal by
255
+ * {@link _refreshSessionCache} so that a concurrent model re-resolve
256
+ * cannot transiently drop them.
257
+ */
258
+ private readonly _inFlightCommits;
259
+ private readonly _sandboxSends;
260
+ private readonly _repositoryPicker;
261
+ private readonly _sandboxCatalog;
262
+ private readonly _onDidChangeSandboxModels;
263
+ private readonly _sandboxConfigs;
264
+ private readonly _onDidChangeSessionConfig;
265
+ readonly onDidChangeSessionConfig: Event<string>;
266
+ readonly sessionConfig: ISessionConfigProvider;
267
+ /** Cache of ISession wrappers, keyed by session ID. */
268
+ private readonly _sessionWrapperCache;
269
+ private readonly _localGitRepositoryState;
270
+ private readonly _localGitRepositoryResolutionStarted;
271
+ get supportsLocalWorkspaces(): boolean;
272
+ readonly automations: CloudAutomationStore | undefined;
273
+ get supportsAutomationSessionConfiguration(): boolean;
274
+ get supportsQuickChats(): boolean;
275
+ constructor(providerMode: "default" | "sandbox", agentSessionsService: IAgentSessionsService, chatService: IChatService, chatSessionsService: IChatSessionsService, commandService: ICommandService, instantiationService: IInstantiationService, languageModelsService: ILanguageModelsService, configurationService: IConfigurationService, logService: ILogService, notificationService: INotificationService, gitHubService: IGitHubService, pullRequestIconCache: IPullRequestIconCache, labelService: ILabelService, uriIdentityService: IUriIdentityService, fileService: IFileService, pathService: IPathService, storageService: IStorageService);
276
+ get browseActions(): readonly ISessionWorkspaceBrowseAction[];
277
+ getSessionTypes(workspaceUri: URI): ISessionType[];
278
+ getSessions(): ISession[];
279
+ private readonly _newSessions;
280
+ private readonly _createdBySessions;
281
+ private readonly _storedCreatedBySessions;
282
+ private _createdBySession;
283
+ private _setCreatedBySession;
284
+ private _deleteCreatedBySession;
285
+ private _loadCreatedBySessions;
286
+ private _saveCreatedBySessions;
287
+ /**
288
+ * Clear the tracked new session with the given session's id, but only if
289
+ * the map still holds exactly that instance. Async flows (commit wait,
290
+ * cache population) may complete after the entry was already replaced or
291
+ * removed — acting unconditionally would dispose an unrelated session.
292
+ *
293
+ * @param session The session that initiated the async flow.
294
+ * @param leak When `true` use {@link DisposableMap.deleteAndLeak}
295
+ * (the session is still referenced elsewhere, e.g. the session
296
+ * cache); otherwise use {@link DisposableMap.deleteAndDispose}.
297
+ */
298
+ private _clearCurrentNewSessionIfMatch;
299
+ deleteNewSession(sessionId: string): void;
300
+ getSession(sessionId: string): ICopilotChatSession | undefined;
301
+ createNewSession(workspaceUri: URI, sessionTypeId: string, options?: ISessionsProviderCreateSessionOptions): ISession;
302
+ private _createDraftSession;
303
+ private _getCloudWorkspaceForLocalRepository;
304
+ getAutomationModelConfiguration(sessionId: string): AutomationModelConfiguration | undefined;
305
+ getAutomationSessionConfiguration(sessionId: string): Promise<IAutomationSessionConfiguration | undefined>;
306
+ createQuickChat(sessionTypeId: string, options?: ISessionsProviderCreateSessionOptions): ISession;
307
+ private _applyAutomationSessionConfiguration;
308
+ get onDidChangeModels(): Event<void>;
309
+ getModelsSnapshot(sessionId: string, desiredModelId?: string): ISessionModelsSnapshot;
310
+ getModelsSnapshotForCreation(_workspaceUri: URI, sessionTypeId: string, desiredModelId?: string): ISessionModelsSnapshot;
311
+ getModelPickerOptions(sessionId: string): ISessionModelPickerOptions;
312
+ private _usesSandbox;
313
+ private _getSandboxCatalog;
314
+ private _sandboxModelsSnapshot;
315
+ getSessionConfig(sessionId: string): ResolveSessionConfigResult | undefined;
316
+ getCreateSessionConfig(sessionId: string): Record<string, unknown> | undefined;
317
+ isSessionConfigResolving(_sessionId: string): IObservable<boolean>;
318
+ setSessionConfigValue(sessionId: string, property: string, value: unknown): Promise<void>;
319
+ private _toSyntheticModel;
320
+ setModel(sessionId: string, chatResource: URI, modelId: string, source: ChatModelSource): void;
321
+ getNewSessionConfig(sessionId: string): Promise<ISessionConfigurationSnapshot | undefined>;
322
+ archiveSession(sessionId: string): Promise<void>;
323
+ unarchiveSession(sessionId: string): Promise<void>;
324
+ setSessionReadState(sessionId: string, isRead: boolean): Promise<void>;
325
+ deleteSession(sessionId: string): Promise<void>;
326
+ deleteSessions(sessionIds: readonly string[]): Promise<void>;
327
+ renameChat(_sessionId: string, _chatUri: URI, _title: string): Promise<void>;
328
+ renameSession(_sessionId: string, _title: string): Promise<void>;
329
+ deleteChat(_sessionId: string, _chatUri: URI, _options?: IDeleteChatOptions): Promise<boolean>;
330
+ forkChat(sessionId: string, _sourceChat: URI, _turnId: string): Promise<IChat>;
331
+ createSideChat(sessionId: string, _sourceChat: URI, _turnId: string, _selection?: ISideChatSelection): Promise<IChat>;
332
+ startNewSessionRequest(sessionId: string): IDisposable | undefined;
333
+ createNewChat(sessionId: string, _prompt?: string): Promise<IChat>;
334
+ /** Test seam: the contribution registry is global, so tests override this with a stub. */
335
+ protected _getCloudSandboxContribution(): Pick<CloudSandboxAgentHostContribution, "provisionSession" | "prepareSession" | "trackSessionCreationProgress">;
336
+ /** Test seam: overridden so a test can reach the timeout without waiting out the real budget. */
337
+ protected get _sandboxModelWaitMs(): number;
338
+ /**
339
+ * Commit a cloud new-session into a GitHub-managed sandbox instead of the server-run cloud
340
+ * agent: provision the sandbox, then hand the session over to the remote-agent-host provider
341
+ * that owns it and send the first turn there.
342
+ *
343
+ * The committed session belongs to that other provider, which is why this fires
344
+ * `onDidReplaceSession` across providers — the same swap {@link _sendFirstChat} performs, just
345
+ * landing outside this provider. Mission Control starts no run for the task it creates, so the
346
+ * first turn has to be dispatched here rather than being picked up server-side.
347
+ */
348
+ private _sendFirstChatToSandbox;
349
+ /** Reveal the sandbox session that {@link CloudSandboxAgentHostContribution.provisionSession} withheld from listings. */
350
+ private _publishSandboxSession;
351
+ /** Carries the raw model ID and its preferences across the draft and connected host's identifier spaces. */
352
+ private _selectedCloudModel;
353
+ /**
354
+ * Apply the model the user picked in the composer to the sandbox session before its first turn.
355
+ *
356
+ * Mission Control starts no run, so this client sends that turn — and a session that has never
357
+ * run has no model of its own to restore. Without this the turn carries no model at all and
358
+ * runs on whatever the agent host defaults to.
359
+ *
360
+ * A freshly connected sandbox publishes its models asynchronously, so an empty catalog is "not
361
+ * yet" rather than "no": resolution is awaited while it reports `pending`, bounded because the
362
+ * turn cannot be held indefinitely.
363
+ *
364
+ * Every path that gives up tells the user: an absent `Message.model` means "host decides", so
365
+ * nothing downstream would report running at a capability and price they did not choose.
366
+ */
367
+ private _carryModelToSandbox;
368
+ /** Name the model so the substitution is attributable. A warning: the turn still runs. */
369
+ private _notifySandboxModelNotApplied;
370
+ /** Retire the optimistic placeholder in favour of the session that now exists. */
371
+ private _retirePlaceholder;
372
+ sendRequest(sessionId: string, chatResource: URI, options: ISendRequestOptions): Promise<ISession>;
373
+ private _sendFirstChat;
374
+ private _createChatSession;
375
+ private _updateChatSessionState;
376
+ /**
377
+ * Waits for the committed (real) URI for a session by listening to the
378
+ * {@link IChatSessionsService.onDidCommitSession} event.
379
+ *
380
+ * Cloud sessions defer their commit behind a confirmation round-trip and
381
+ * network delegation. Response completion fires early (at the confirmation)
382
+ * and is not a signal that the commit won't come, so the wait is bounded by
383
+ * a generous timeout and by the response being cancelled instead.
384
+ */
385
+ private _waitForCommittedSession;
386
+ /**
387
+ * Waits for an {@link AgentSessionAdapter} with the given resource to appear
388
+ * in the session cache (populated by {@link _refreshSessionCache}).
389
+ * Only called once during session initialisation (after the commit event),
390
+ * so the timeout has no performance impact on steady-state operations.
391
+ */
392
+ private _waitForSessionInCache;
393
+ private _pickRepository;
394
+ private _browseForRepository;
395
+ private _supportsLocalRepositoryActions;
396
+ private _cloneRepository;
397
+ private _browseForGitHubContext;
398
+ resolveWorkspace(uri: URI): ISessionWorkspace | undefined;
399
+ private _getLocalGitRepository;
400
+ private _getLocalGitRepositoryState;
401
+ private _resolveLocalGitRepository;
402
+ private _labelFromUri;
403
+ private _descriptionFromUri;
404
+ private _iconFromUri;
405
+ private _ensureSessionCache;
406
+ /**
407
+ * Cleans up a temp session (one that hasn't been committed) from the cache.
408
+ * Used when delete/archive is invoked on a session that is still pending
409
+ * commit (e.g. was stopped before the cloud agent picked it up).
410
+ */
411
+ private _cleanupTempSession;
412
+ private _refreshSessionCache;
413
+ private _findChatSession;
414
+ private _findAgentSession;
415
+ private _localIdFromSessionId;
416
+ /**
417
+ * Wraps an {@link ICopilotChatSession} into an {@link ISession} with a single chat.
418
+ * Wrappers are cached per session so repeated lookups return the same instance.
419
+ */
420
+ private _chatToSession;
421
+ private _withChangesets;
422
+ }