mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
Add external public IPC host/client and plugin SDK
Introduce a new LanMountainDesktop.Shared.IPC project implementing a public IPC host and client (LanMountainDesktopIpcClient, PublicIpcHostService), IPC constants and routed notify IDs, DTOs and DI helpers for registering public services. Update Plugin SDK to allow plugins to contribute public IPC services and registrations, add related descriptors/records and extension helpers. Migrate Launcher/App to use the new public IPC for startup/loading notifications and wiring (including TryConnect helper), switch LoadingStateReporter to use the external notification publisher, and add host-side public services (app info, shell control, plugin catalog). Include integration tests and spec/checklist/docs for the external IPC public API.
This commit is contained in:
@@ -684,3 +684,34 @@ if (!url.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
|
||||
- [组件开发指南](COMPONENT_DEVELOPMENT.md)
|
||||
- [API 参考](API_REFERENCE.md)
|
||||
- [架构文档](ARCHITECTURE.md)
|
||||
## Public IPC Extension
|
||||
|
||||
Plugins can now contribute external IPC capabilities through the Host public IPC entry point.
|
||||
|
||||
Recommended registration styles:
|
||||
|
||||
```csharp
|
||||
services.AddPluginPublicIpc<IMyPluginPublicService, MyPluginPublicService>(
|
||||
objectId: "default",
|
||||
notifyIds: ["lanmountain.plugin.my-plugin.status.changed"]);
|
||||
```
|
||||
|
||||
Or use the advanced contributor model:
|
||||
|
||||
```csharp
|
||||
public sealed class MyPluginPublicIpcContributor : IPluginPublicIpcContributor
|
||||
{
|
||||
public void ConfigurePublicIpc(IPluginPublicIpcBuilder builder)
|
||||
{
|
||||
builder.AddService<IMyPluginPublicService>(
|
||||
objectId: "default",
|
||||
notifyIds: ["lanmountain.plugin.my-plugin.status.changed"]);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Additional notes:
|
||||
|
||||
- Public IPC contracts must be interfaces marked with `[IpcPublic]`.
|
||||
- External .NET clients can reference the plugin contract assembly and create strong-typed proxies through the Host public pipe.
|
||||
- Plugins can inject `IExternalIpcNotificationPublisher` to push live events outward through routed notifications.
|
||||
|
||||
Reference in New Issue
Block a user