mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
41 lines
1.2 KiB
Swift
41 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct DeepLinkAgentPromptAlert: ViewModifier {
|
|
@Environment(NodeAppModel.self) private var appModel: NodeAppModel
|
|
|
|
private var promptBinding: Binding<NodeAppModel.AgentDeepLinkPrompt?> {
|
|
Binding(
|
|
get: { self.appModel.pendingAgentDeepLinkPrompt },
|
|
set: { _ in
|
|
// Keep prompt state until explicit user action.
|
|
})
|
|
}
|
|
|
|
func body(content: Content) -> some View {
|
|
content.alert(item: self.promptBinding) { prompt in
|
|
Alert(
|
|
title: Text("Run Bot agent?"),
|
|
message: Text(
|
|
"""
|
|
Message:
|
|
\(prompt.messagePreview)
|
|
|
|
URL:
|
|
\(prompt.urlPreview)
|
|
"""),
|
|
primaryButton: .cancel(Text("Cancel")) {
|
|
self.appModel.declinePendingAgentDeepLinkPrompt()
|
|
},
|
|
secondaryButton: .default(Text("Run")) {
|
|
Task { await self.appModel.approvePendingAgentDeepLinkPrompt() }
|
|
})
|
|
}
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func deepLinkAgentPromptAlert() -> some View {
|
|
self.modifier(DeepLinkAgentPromptAlert())
|
|
}
|
|
}
|