agentHostSyncOperationProvider.ts ×5

Frontier kind: Code frontier

unlabeled · c_eeacf6820a3e

485 tests · 19699 LOC · 90 files · introduces 0 tests · 51 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges51 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1816 ranges19699 lines · 90 files · Browse complete extent
All tests (intent)
485 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 51 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostSyncOperationHandler.ts 26 introduced LOC · 4 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- agentHostSyncOperationHandler.ts
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>,
25 @ILogService private readonly _logService: ILogService,
26 ) { }
28 > async invoke(params: InvokeChangesetOperationParams, token: CancellationToken): Promise<InvokeChangesetOperationResult> {
29 const parsed = parseChangesetUri(params.channel);
30 if (!parsed) {
72 return { message: { markdown: localize('agentHost.changeset.sync.synced', "Synced changes.") } };
73 }
75 > private _throwIfCancelled(token: CancellationToken): void {
76 if (token.isCancellationRequested) {
77 throw new ProtocolError(JsonRpcErrorCodes.InternalError, localize('agentHost.changeset.sync.cancelled', "Sync operation was cancelled."));
78 }
79 }
src/vs/platform/agentHost/node/agentHostSyncOperationProvider.ts 25 introduced LOC · 5 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- agentHostSyncOperationProvider.ts
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 { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js';
7 > import { localize } from '../../../nls.js';
8 > import { IInstantiationService } from '../../instantiation/common/instantiation.js';
9 > import type { IChangesetOperationContribution, IChangesetOperationContext, IChangesetOperationRegistry } from '../common/agentHostChangesetOperationService.js';
10 > import { ChangesetOperationScope, ChangesetOperationStatus, SessionLifecycle, type ChangesetOperation } from '../common/state/sessionState.js';
11 > import { AgentHostStateManager, IAgentHostStateManager } from './agentHostStateManager.js';
12 > import { AgentHostSyncOperationHandler } from './agentHostSyncOperationHandler.js';
13 >
14 > export class AgentHostSyncOperationContribution extends Disposable implements IChangesetOperationContribution {
15 >
16 > private _registry: IChangesetOperationRegistry | undefined;
17 >
18 > constructor(
19 @IAgentHostStateManager private readonly _stateManager: AgentHostStateManager,
20 @IInstantiationService private readonly _instantiationService: IInstantiationService,
22 super();
23 }
25 > registerHandlers(registry: IChangesetOperationRegistry): IDisposable {
26 this._registry = registry;
27 const store = new DisposableStore();
32 return store;
33 }
35 > getOperations({ sessionKey, gitState }: IChangesetOperationContext): ChangesetOperation[] | undefined {
36 // New Session
37 const state = this._stateManager.getSessionState(sessionKey);