Let the lead walk the user through permission and tool setup
This commit is contained in:
@@ -26,6 +26,8 @@ private let leadWelcome = """
|
||||
Start in [Settings](byre-app://tab?name=settings): \(leadSettings)
|
||||
"""
|
||||
|
||||
private let leadSetup = "Walk me through setting up byre: the tools its agents need, signing in to their vendors, and the macOS permissions on the server's Mac and on my Macs."
|
||||
|
||||
struct AttentionGroup: Identifiable {
|
||||
let id: String
|
||||
let label: String
|
||||
@@ -501,6 +503,20 @@ final class ChatModel {
|
||||
}
|
||||
}
|
||||
|
||||
func askSetup(_ overlays: Overlays) {
|
||||
let sendID = newID("snd")
|
||||
let cancel = builder.showPending(leadSetup, [], sendID)
|
||||
Task {
|
||||
do {
|
||||
try await send(sessionId: liveSession?.id, text: leadSetup, images: nil, model: nil, firstModel: store.defaultModel, sendID: sendID)
|
||||
} catch {
|
||||
if cancel() {
|
||||
overlays.showAlert(errorText(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func withdraw(_ p: PendingSend, _ overlays: Overlays) async {
|
||||
guard let taskId, let inputId = p.inputId else {
|
||||
return
|
||||
@@ -802,6 +818,7 @@ private struct ScrollMetrics: Equatable {
|
||||
private struct TranscriptScroll: View {
|
||||
let model: ChatModel
|
||||
@Environment(Store.self) private var store
|
||||
@Environment(Overlays.self) private var overlays
|
||||
@Environment(\.paneAccent) private var accent
|
||||
@ViewState private var position = ScrollPosition(edge: .bottom)
|
||||
@ViewState private var scrolling = false
|
||||
@@ -835,6 +852,12 @@ private struct TranscriptScroll: View {
|
||||
if model.welcome {
|
||||
MarkdownView(blocks: parseMarkdown(leadWelcome))
|
||||
.padding(.top, 12)
|
||||
Button("Walk me through setup") {
|
||||
model.askSetup(overlays)
|
||||
}
|
||||
.buttonStyle(WebButtonStyle())
|
||||
.help("Ask your lead to check and set up the tools and permissions byre's agents need")
|
||||
.padding(.top, 12)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user