Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/agentHost/common/agentHostClientFileSystemProvider.ts
13394 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 { URI } from '../../../base/common/uri.js';
7
import { AHPFileSystemProvider } from './agentHostFileSystemProvider.js';
8
import { fromAgentClientUri } from './agentClientUri.js';
9
10
/**
11
* Read-only filesystem provider for accessing client-side files from the
12
* agent host. Registered under the `vscode-agent-client` scheme.
13
*
14
* This is the inverse of {@link AgentHostFileSystemProvider}: where that
15
* provider lets a client read agent host files, this one lets the agent
16
* host read files from a connected client.
17
*
18
* ```
19
* vscode-agent-client://[clientId]/[originalScheme]/[originalAuthority]/[originalPath]
20
* ```
21
*
22
* Connections are registered per client ID. The connection implementation
23
* must proxy `browseDirectory`/`fetchContent` calls back to the client
24
* (e.g. via a reverse JSON-RPC request over the WebSocket transport).
25
*/
26
export class AgentHostClientFileSystemProvider extends AHPFileSystemProvider {
27
28
protected _decodeUri(resource: URI): URI {
29
return fromAgentClientUri(resource);
30
}
31
}
32
33