feat(sdk,plugins): API publique d'accès fichiers/workspace + analyse structure (#124,#129)
This commit is contained in:
@ -13,10 +13,21 @@ import type {
|
||||
EmbeddedServerStatus,
|
||||
GatewayError,
|
||||
PluginAdmin,
|
||||
PluginCommandTask,
|
||||
PluginConfigDocument,
|
||||
PluginConfigDocumentWriteResult,
|
||||
PluginEventBatch,
|
||||
PluginEventSubscription,
|
||||
PluginInstallResult,
|
||||
PluginToolchainDiagnostic,
|
||||
PluginProjectStructure,
|
||||
PluginReview,
|
||||
PluginRuntimeContributionCatalog,
|
||||
PluginUninstallResult,
|
||||
PluginWorkspaceBinaryFile,
|
||||
PluginWorkspaceDirectoryListing,
|
||||
PluginWorkspaceStat,
|
||||
PluginWorkspaceTextFile,
|
||||
ServerExposurePreview,
|
||||
ServerExposureSettings,
|
||||
Unsubscribe,
|
||||
@ -25,7 +36,24 @@ import type {
|
||||
DesktopServerGateway,
|
||||
FocusedProject,
|
||||
FocusedProjectGateway,
|
||||
PluginConfigDocumentReadInput,
|
||||
PluginConfigDocumentUpdateInput,
|
||||
PluginConfigGateway,
|
||||
PluginEventGateway,
|
||||
PluginEventPollInput,
|
||||
PluginEventSubscribeInput,
|
||||
PluginEventUnsubscribeInput,
|
||||
PluginGateway,
|
||||
PluginProjectStructureQuery,
|
||||
PluginRunCommandInput,
|
||||
PluginTaskGateway,
|
||||
PluginTaskStatusInput,
|
||||
PluginToolchainDiagnosticRequest,
|
||||
PluginToolchainGateway,
|
||||
PluginWorkspaceGateway,
|
||||
PluginWorkspacePathInput,
|
||||
PluginWorkspaceWriteBinaryInput,
|
||||
PluginWorkspaceWriteTextInput,
|
||||
RemoteGateway,
|
||||
ReviewPluginPackageInput,
|
||||
ViewWindowClosed,
|
||||
@ -160,3 +188,78 @@ export class WebPluginGateway implements PluginGateway {
|
||||
return unsupportedOnWeb("Plugin management");
|
||||
}
|
||||
}
|
||||
|
||||
/** Web stub: public plugin workspace services are only meaningful where plugins run. */
|
||||
export class WebPluginWorkspaceGateway implements PluginWorkspaceGateway {
|
||||
async readText(_input: PluginWorkspacePathInput): Promise<PluginWorkspaceTextFile> {
|
||||
return unsupportedOnWeb("Plugin workspace access");
|
||||
}
|
||||
async readBinary(_input: PluginWorkspacePathInput): Promise<PluginWorkspaceBinaryFile> {
|
||||
return unsupportedOnWeb("Plugin workspace access");
|
||||
}
|
||||
async writeText(_input: PluginWorkspaceWriteTextInput): Promise<void> {
|
||||
return unsupportedOnWeb("Plugin workspace access");
|
||||
}
|
||||
async writeBinary(_input: PluginWorkspaceWriteBinaryInput): Promise<void> {
|
||||
return unsupportedOnWeb("Plugin workspace access");
|
||||
}
|
||||
async listDir(_input: PluginWorkspacePathInput): Promise<PluginWorkspaceDirectoryListing> {
|
||||
return unsupportedOnWeb("Plugin workspace access");
|
||||
}
|
||||
async stat(_input: PluginWorkspacePathInput): Promise<PluginWorkspaceStat> {
|
||||
return unsupportedOnWeb("Plugin workspace access");
|
||||
}
|
||||
async queryProjectStructure(
|
||||
_input: PluginProjectStructureQuery,
|
||||
): Promise<PluginProjectStructure> {
|
||||
return unsupportedOnWeb("Plugin workspace access");
|
||||
}
|
||||
}
|
||||
|
||||
/** Web stub: plugin command tasks are desktop-hosted in this runtime. */
|
||||
export class WebPluginTaskGateway implements PluginTaskGateway {
|
||||
async runCommand(_input: PluginRunCommandInput): Promise<PluginCommandTask> {
|
||||
return unsupportedOnWeb("Plugin command tasks");
|
||||
}
|
||||
|
||||
async getStatus(_input: PluginTaskStatusInput): Promise<PluginCommandTask | null> {
|
||||
return unsupportedOnWeb("Plugin command tasks");
|
||||
}
|
||||
}
|
||||
|
||||
/** Web stub: plugin toolchain diagnostics run on the desktop host. */
|
||||
export class WebPluginToolchainGateway implements PluginToolchainGateway {
|
||||
async diagnose(
|
||||
_input: PluginToolchainDiagnosticRequest,
|
||||
): Promise<PluginToolchainDiagnostic> {
|
||||
return unsupportedOnWeb("Plugin toolchain diagnostics");
|
||||
}
|
||||
}
|
||||
|
||||
/** Web stub: plugin public events are sourced from the desktop host. */
|
||||
export class WebPluginEventGateway implements PluginEventGateway {
|
||||
async subscribe(_input: PluginEventSubscribeInput): Promise<PluginEventSubscription> {
|
||||
return unsupportedOnWeb("Plugin public events");
|
||||
}
|
||||
|
||||
async poll(_input: PluginEventPollInput): Promise<PluginEventBatch> {
|
||||
return unsupportedOnWeb("Plugin public events");
|
||||
}
|
||||
|
||||
async unsubscribe(_input: PluginEventUnsubscribeInput): Promise<PluginEventSubscription> {
|
||||
return unsupportedOnWeb("Plugin public events");
|
||||
}
|
||||
}
|
||||
|
||||
/** Web stub: plugin config documents are read/written by the desktop host. */
|
||||
export class WebPluginConfigGateway implements PluginConfigGateway {
|
||||
async readDocument(_input: PluginConfigDocumentReadInput): Promise<PluginConfigDocument> {
|
||||
return unsupportedOnWeb("Plugin structured config documents");
|
||||
}
|
||||
|
||||
async updateDocument(
|
||||
_input: PluginConfigDocumentUpdateInput,
|
||||
): Promise<PluginConfigDocumentWriteResult> {
|
||||
return unsupportedOnWeb("Plugin structured config documents");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user