tpmjs/apps/omega-mac/OmegaMac/Views/Chat/StreamingIndicator.swift
Thomas Davis 1cd44b4e97 feat: add Omega Mac native macOS SwiftUI chat app
Native macOS counterpart to the web Omega agent, connecting directly
to the OpenAI API and TPMJS tool registry (1M+ AI-ready tools).

- SwiftUI app targeting macOS 15+ with dark theme
- Full agentic loop: auto-discover tools via BM25, stream OpenAI
  responses, execute tools via remote sandbox, loop up to 10x
- SwiftData persistence for conversations, messages, tool runs
- Keychain storage for API keys and environment variables
- SSE streaming via URLSession.bytes with custom parser
- Actor-based services (OpenAIService, TPMJSRegistryService)
- NavigationSplitView layout with sidebar + chat detail
- MarkdownUI for rendering assistant responses
- Settings: API key, model picker, env vars, custom system prompt
- Keyboard shortcuts: Cmd+N new chat, Cmd+, settings, Enter send

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 21:29:39 +10:00

24 lines
729 B
Swift

import SwiftUI
struct StreamingIndicator: View {
@State private var dotCount = 0
private let timer = Timer.publish(every: 0.4, on: .main, in: .common).autoconnect()
var body: some View {
HStack(spacing: 6) {
Image(systemName: "sparkles")
.foregroundStyle(.accent)
.font(.caption)
Text("Omega is thinking" + String(repeating: ".", count: dotCount))
.font(.callout)
.foregroundStyle(.secondary)
}
.padding(12)
.background(.quaternary.opacity(0.5))
.clipShape(RoundedRectangle(cornerRadius: 12))
.onReceive(timer) { _ in
dotCount = (dotCount + 1) % 4
}
}
}