You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle status aliases in JSON deserialization: idle → Running, exited → Completed, gone → Lost.
AgentVariant.cs
Match macOS AgentVariant.swift: Claude, Codex, OpenCode, Terminal, Worktree with display names, icons, and prompt delivery methods.
REST Client (Services/PpgApiClient.cs)
HttpClient with Bearer token auth. Same 13+ endpoints as Linux issue #132.
publicclassPpgApiClient{privatereadonlyHttpClient_http;publicasyncTask<Manifest>GetStatusAsync()=>awaitGetAsync<Manifest>("/api/status");publicasyncTaskSpawnAsync(SpawnRequestrequest)=>awaitPostAsync("/api/spawn",request);// ... all 13 endpoints}
WebSocket Client (Services/WebSocketClient.cs)
System.Net.WebSockets.ClientWebSocket with:
Token auth via query param (/ws?token=...)
Exponential backoff reconnect (1s base, 30s max)
30s ping keepalive via Task.Delay
Event dispatch to UI thread via Dispatcher.InvokeAsync
Observable singleton that holds the current manifest and raises PropertyChanged on updates:
publicpartialclassManifestStore:ObservableObject{[ObservableProperty]privateManifest?_manifest;[ObservableProperty]privateConnectionState_state;// Updated by WebSocketClient events or REST polling}
Token Storage (Services/TokenStorage.cs)
Use System.Security.Cryptography.ProtectedData (DPAPI) to encrypt bearer tokens at rest.
Store in %APPDATA%/PPG Desktop/credentials.dat.
References
Server API: src/server/index.ts, src/server/routes/, src/server/ws/
Manifest types: src/types/manifest.ts
Acceptance Criteria
All manifest types deserialize correctly from ppg serve JSON
REST client connects and fetches status
WebSocket connects, reconnects, dispatches events to UI thread
Overview
Implement C# models mirroring the ppg manifest JSON, plus HTTP REST and WebSocket clients for ppg serve.
Data Models (Models/)
Manifest.cs
Handle status aliases in JSON deserialization:
idle→Running,exited→Completed,gone→Lost.AgentVariant.cs
Match macOS
AgentVariant.swift: Claude, Codex, OpenCode, Terminal, Worktree with display names, icons, and prompt delivery methods.REST Client (Services/PpgApiClient.cs)
HttpClientwith Bearer token auth. Same 13+ endpoints as Linux issue #132.WebSocket Client (Services/WebSocketClient.cs)
System.Net.WebSockets.ClientWebSocketwith:/ws?token=...)Task.DelayDispatcher.InvokeAsyncManifestStore (Services/ManifestStore.cs)
Observable singleton that holds the current manifest and raises PropertyChanged on updates:
Token Storage (Services/TokenStorage.cs)
Use
System.Security.Cryptography.ProtectedData(DPAPI) to encrypt bearer tokens at rest.Store in
%APPDATA%/PPG Desktop/credentials.dat.References
src/server/index.ts,src/server/routes/,src/server/ws/src/types/manifest.tsAcceptance Criteria