Skip to content

Commit bdcb188

Browse files
committed
ship: iteration 1 - restore iOS intent bridge
1 parent 122d06b commit bdcb188

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

apps/ios/ADE/App/ADEApp.swift

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ struct ADEApp: App {
2020
.environmentObject(syncService)
2121
.environmentObject(dictationController)
2222
.task {
23+
await MainActor.run {
24+
ADEIntentCommandRegistry.register(ADESyncIntentBridge.shared)
25+
}
2326
guard !didBootstrapSync else { return }
2427
didBootstrapSync = true
2528
lastActivationSyncAt = Date()
@@ -62,3 +65,28 @@ struct ADEApp: App {
6265
}
6366
}
6467
}
68+
69+
// MARK: - Live Activity / Control Widget command bridge
70+
71+
/// Maps the cross-target intent commands to main-app remote commands.
72+
/// Kept in the main ADE target so widgets never link `SyncService`.
73+
@MainActor
74+
private final class ADESyncIntentBridge: ADEIntentCommandBridge {
75+
static let shared = ADESyncIntentBridge()
76+
77+
private init() {}
78+
79+
func dispatch(_ kind: ADEIntentCommandKind, payload: [String: Any]) async {
80+
let mapped: RemoteCommandKind
81+
switch kind {
82+
case .approveSession: mapped = .approveSession
83+
case .denySession: mapped = .denySession
84+
case .pauseSession: mapped = .pauseSession
85+
case .replyToSession: mapped = .replyToSession
86+
case .restartSession: mapped = .restartSession
87+
case .retryPrChecks: mapped = .retryPrChecks
88+
case .openPr: mapped = .openPr
89+
}
90+
await SyncService.shared?.sendRemoteCommand(mapped, payload: payload)
91+
}
92+
}

apps/ios/ADE/Views/Work/WorkNewChatScreen.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ struct WorkNewChatScreen: View {
152152
selectedLaneId == workAutoCreateLaneSentinelId
153153
}
154154

155+
private var autoCreateToolsLane: LaneSummary? {
156+
if let preferredLaneId, let lane = lanes.first(where: { $0.id == preferredLaneId }) {
157+
return lane
158+
}
159+
return lanes.first
160+
}
161+
155162
/// Fast mode only applies to in-app chat sessions on fast-tier models — the
156163
/// CLI launcher has no fast-mode parameter — so the lightning toggle (and the
157164
/// value we send) is gated on both. The picker's option can only *add* support

0 commit comments

Comments
 (0)