Skip to content

Commit 88a8628

Browse files
Merge pull request #80 from torlando-tech/pr2-app-services
Dual-backend 2/3 — app services + BLE bridge
2 parents 5461539 + f0090c0 commit 88a8628

68 files changed

Lines changed: 6025 additions & 934 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Sources/ColumbaApp/App/ColumbaApp.swift

Lines changed: 395 additions & 59 deletions
Large diffs are not rendered by default.

Sources/ColumbaApp/Models/CodecProfileInfo.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import LXSTSwift
10+
import RNSAPI
1011

1112
/// Display information for a telephony profile.
1213
struct CodecProfileInfo: Identifiable {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// DiscoveredDevice.swift
3+
// ColumbaApp
4+
//
5+
// A discovered BLE peripheral with metadata. Shared by the RNode wizard's
6+
// device-discovery step (COLUMBA_RNODE_ENABLED) and the BLE device picker
7+
// (COLUMBA_BLE_ENABLED). Lives here (ungated) so neither feature flag owns
8+
// the type — extracted from BLEDevicePickerSheet.swift, which used to define
9+
// it under COLUMBA_BLE_ENABLED only.
10+
//
11+
12+
import Foundation
13+
14+
/// A discovered BLE peripheral with metadata.
15+
struct DiscoveredDevice: Identifiable {
16+
/// Unique identifier for SwiftUI list deduplication.
17+
let id = UUID()
18+
19+
/// Peripheral identifier (used for deduplication).
20+
let peripheralId: UUID
21+
22+
/// Peripheral name.
23+
let name: String
24+
25+
/// Received signal strength indicator (dBm).
26+
var rssi: Int
27+
28+
/// Last discovery timestamp.
29+
var lastSeen: Date
30+
}

Sources/ColumbaApp/Models/LoRaPresets.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99

1010
import Foundation
11+
import RNSAPI
1112

1213
// MARK: - Regional Parameters
1314

Sources/ColumbaApp/Models/MicronDocument.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if COLUMBA_NOMADNET_ENABLED
12
import SwiftUI
3+
import RNSAPI
24

35
// MARK: - Document
46

@@ -159,3 +161,4 @@ extension MicronTextStyle {
159161
)
160162
}
161163
}
164+
#endif

Sources/ColumbaApp/Models/MicronParser.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#if COLUMBA_NOMADNET_ENABLED
12
import Foundation
3+
import RNSAPI
24

35
/// Parses micron markup text into a structured MicronDocument.
46
public struct MicronParser {
@@ -550,3 +552,4 @@ public struct MicronParser {
550552
return .samePage(path: trimmed)
551553
}
552554
}
555+
#endif

Sources/ColumbaApp/Models/MigrationData.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if COLUMBA_MIGRATION_ENABLED
12
//
23
// MigrationData.swift
34
// ColumbaApp
@@ -7,6 +8,7 @@
78
//
89

910
import Foundation
11+
import RNSAPI
1012

1113
/// Top-level migration bundle matching Android's MigrationBundle format.
1214
///
@@ -251,3 +253,4 @@ struct ImportResult {
251253
let interfacesImported: Int
252254
let settingsImported: Int
253255
}
256+
#endif

Sources/ColumbaApp/Models/TcpCommunityServer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import Foundation
10+
import RNSAPI
1011

1112
/// A public Reticulum TCP transport node.
1213
struct TcpCommunityServer: Identifiable {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import Foundation
2+
import RNSAPI
3+
4+
/// An `lxmf.delivery` announce surfaced from Python RNS to Swift.
5+
///
6+
/// Produced by `PythonBridge.Event.announce` after `rns_bridge._LXMFAnnounceHandler`
7+
/// receives one from the Python-side `RNS.Transport`. The original `app_data` from
8+
/// the announce packet has already been msgpack-decoded to `displayName`.
9+
///
10+
/// Named `PyAnnounce` (not `Announce`) so it doesn't collide with the old
11+
/// `ReticulumSwift.Announce` type during the Phase 1 transition.
12+
public struct PyAnnounce: Identifiable, Equatable, Sendable {
13+
public let destHash: String
14+
public var displayName: String
15+
public var firstSeen: Date
16+
public var lastSeen: Date
17+
18+
public var id: String { destHash }
19+
20+
public init(destHash: String, displayName: String, firstSeen: Date, lastSeen: Date) {
21+
self.destHash = destHash
22+
self.displayName = displayName
23+
self.firstSeen = firstSeen
24+
self.lastSeen = lastSeen
25+
}
26+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import Foundation
2+
import RNSAPI
3+
4+
/// A conversation-list row backed by the Python-owned SQLite store.
5+
///
6+
/// In Phase 2 this is what `MessageRepository` (the new Python-backed
7+
/// implementation) returns to ChatsView for the conversation list. The schema is
8+
/// owned in Python (`app/columba_store.py`) and read by Swift via GRDB-read or
9+
/// stdlib SQLite — see the migration plan for the columns.
10+
public struct PyConversation: Identifiable, Equatable, Sendable {
11+
public let destHash: String
12+
public var displayName: String
13+
public var lastMessage: String?
14+
public var lastMessageAt: Date?
15+
public var unreadCount: Int
16+
public var isFavorite: Bool
17+
public var isPinned: Bool
18+
19+
public var id: String { destHash }
20+
21+
public init(
22+
destHash: String,
23+
displayName: String,
24+
lastMessage: String? = nil,
25+
lastMessageAt: Date? = nil,
26+
unreadCount: Int = 0,
27+
isFavorite: Bool = false,
28+
isPinned: Bool = false
29+
) {
30+
self.destHash = destHash
31+
self.displayName = displayName
32+
self.lastMessage = lastMessage
33+
self.lastMessageAt = lastMessageAt
34+
self.unreadCount = unreadCount
35+
self.isFavorite = isFavorite
36+
self.isPinned = isPinned
37+
}
38+
}

0 commit comments

Comments
 (0)