feat(acp): add M0 ACP bridge — engine child + mentor pane (fixes #14)
CI / ci (push) Canceled after 0s
CI / ci (push) Canceled after 0s
Spawn hermes acp -p museion over NDJSON JSON-RPC stdio via a hand-rolled thin client (no Swift SDK exists). The mentor debug pane streams replies, renders fix-card tool calls as structured cards (ADR-0006), cancels via session/cancel, tears down on quit (willTerminate), and surfaces a restart prompt on engine crash — never data loss. Version verify against state.json is advisory. Fake ACP server test double (zsh speaking real NDJSON) covers handshake, streaming + fix-card, drift, crash latch, cancel, teardown. 36/36 tests green; finish-audit fixes included (wired binaryPath, focus-loss teardown bug, double onCrash latch). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
c0b2cb0b93
commit
f21d3a6844
12 files changed
+1271
-10
No files matched your search
@@ -18,6 +18,8 @@ final class AppGateState {
|
||||
var gateDismissed = false
|
||||
let gateModel = EngineGateModel()
|
||||
let provisioning = ProvisioningModel()
|
||||
/// #14: the app-scoped mentor bridge — the pane renders it; quit tears it down.
|
||||
let mentor = MentorSessionModel()
|
||||
}
|
||||
|
||||
@main
|
||||
@@ -28,6 +30,13 @@ struct MuseionApp: App {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
.environment(gate)
|
||||
// #14: app quit tears down the engine child cleanly (map
|
||||
// decision: child lifecycle). willTerminate is the real quit
|
||||
// signal on macOS — scenePhase .inactive also fires on plain
|
||||
// focus loss, which would kill the engine on every app switch.
|
||||
.onReceive(NotificationCenter.default.publisher(for: NSApplication.willTerminateNotification)) { _ in
|
||||
gate.mentor.shutdown()
|
||||
}
|
||||
}
|
||||
Window("About \(AppMetadata.name)", id: "about") {
|
||||
AboutEngineView()
|
||||
|
||||
Reference in new issue
Block a user