Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ DerivedData/
*.xcuserstate
node_modules/
.clawpatch/
build/
4 changes: 2 additions & 2 deletions Config/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.matt-nz.conductormobile.pair</string>
<string>com.matt-nz.pimobile.pair</string>
<key>CFBundleURLSchemes</key>
<array>
<string>conductor-companion</string>
<string>pi-companion</string>
</array>
</dict>
</array>
Expand Down
6 changes: 3 additions & 3 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Privacy Policy — Conductor Companion
# Privacy Policy — Pi Mobile

Conductor Companion does not collect, store, or transmit any personal data to us or any third party.
Pi Mobile does not collect, store, or transmit any personal data to us or any third party.

The app connects directly and exclusively to a companion server that you run on your own Mac, using an address and auth token you provide. Your chat history, project names, and code diffs travel only between your phone and your Mac over your own network (LAN or your private Tailscale tailnet). There are no analytics, no tracking, no third-party SDKs, and no accounts.

The auth token is stored in the iOS Keychain on your device.

Questions: open an issue at https://github.com/MRL-00/conductor-mobile
Questions: open an issue at https://github.com/MRL-00/pi-mobile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
objects = {

/* Begin PBXFileSystemSynchronizedRootGroup section */
A1000001 /* ConductorMobile */ = {
A1000001 /* PiMobile */ = {
isa = PBXFileSystemSynchronizedRootGroup;
path = ConductorMobile;
path = PiMobile;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */
Expand All @@ -18,29 +18,29 @@
A1000002 = {
isa = PBXGroup;
children = (
A1000001 /* ConductorMobile */,
A1000001 /* PiMobile */,
A1000003 /* Products */,
);
sourceTree = "<group>";
};
A1000003 /* Products */ = {
isa = PBXGroup;
children = (
A1000004 /* ConductorMobile.app */,
A1000004 /* PiMobile.app */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXFileReference section */
A1000004 /* ConductorMobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ConductorMobile.app; sourceTree = BUILT_PRODUCTS_DIR; };
A1000004 /* PiMobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PiMobile.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXNativeTarget section */
A1000005 /* ConductorMobile */ = {
A1000005 /* PiMobile */ = {
isa = PBXNativeTarget;
buildConfigurationList = A1000006 /* Build configuration list for PBXNativeTarget "ConductorMobile" */;
buildConfigurationList = A1000006 /* Build configuration list for PBXNativeTarget "PiMobile" */;
buildPhases = (
A1000007 /* Sources */,
A1000008 /* Resources */,
Expand All @@ -50,13 +50,13 @@
dependencies = (
);
fileSystemSynchronizedGroups = (
A1000001 /* ConductorMobile */,
A1000001 /* PiMobile */,
);
name = ConductorMobile;
name = PiMobile;
packageProductDependencies = (
);
productName = ConductorMobile;
productReference = A1000004 /* ConductorMobile.app */;
productName = PiMobile;
productReference = A1000004 /* PiMobile.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand All @@ -74,7 +74,7 @@
};
};
};
buildConfigurationList = A100000A /* Build configuration list for PBXProject "ConductorMobile" */;
buildConfigurationList = A100000A /* Build configuration list for PBXProject "PiMobile" */;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand All @@ -88,7 +88,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
A1000005 /* ConductorMobile */,
A1000005 /* PiMobile */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -159,11 +159,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = U5LM2CZXRN;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 10;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Config/Info.plist;
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
INFOPLIST_KEY_NSLocalNetworkUsageDescription = "Connects to the Conductor companion server on your Mac.";
INFOPLIST_KEY_NSLocalNetworkUsageDescription = "Connects to the Pi companion server on your Mac.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand All @@ -172,8 +172,9 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.matt-nz.conductormobile";
MARKETING_VERSION = 0.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.matt-nz.pimobile";
INFOPLIST_KEY_CFBundleDisplayName = "Pi Companion";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
Expand All @@ -187,11 +188,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = U5LM2CZXRN;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 10;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Config/Info.plist;
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
INFOPLIST_KEY_NSLocalNetworkUsageDescription = "Connects to the Conductor companion server on your Mac.";
INFOPLIST_KEY_NSLocalNetworkUsageDescription = "Connects to the Pi companion server on your Mac.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand All @@ -200,8 +201,9 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.matt-nz.conductormobile";
MARKETING_VERSION = 0.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.matt-nz.pimobile";
INFOPLIST_KEY_CFBundleDisplayName = "Pi Companion";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
Expand All @@ -211,7 +213,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
A1000006 /* Build configuration list for PBXNativeTarget "ConductorMobile" */ = {
A1000006 /* Build configuration list for PBXNativeTarget "PiMobile" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A100000D /* Debug */,
Expand All @@ -220,7 +222,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A100000A /* Build configuration list for PBXProject "ConductorMobile" */ = {
A100000A /* Build configuration list for PBXProject "PiMobile" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A100000B /* Debug */,
Expand Down
28 changes: 27 additions & 1 deletion ConductorMobile/APIClient.swift → PiMobile/APIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct MacServer: Codable, Identifiable, Hashable {
enum TokenStore {
private static func query(_ id: UUID) -> [String: Any] {
[kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: "conductor-mobile.mac-token",
kSecAttrService as String: "pi-mobile.mac-token",
kSecAttrAccount as String: id.uuidString]
}

Expand Down Expand Up @@ -177,6 +177,32 @@ final class APIClient {

func stop(sessionId: String) async throws { _ = try await post("/sessions/\(sessionId)/stop") }

private func delete(_ path: String) async throws {
guard let mac = activeMac, let url = URL(string: mac.baseURL + path) else { throw URLError(.badURL) }
var request = URLRequest(url: url)
request.httpMethod = "DELETE"
request.setValue("Bearer \(mac.token)", forHTTPHeaderField: "Authorization")
let (_, response) = try await URLSession.shared.data(for: request)
guard let http = response as? HTTPURLResponse, http.statusCode == 200 else {
throw URLError(.badServerResponse)
}
}

func deleteSession(_ id: String) async throws { try await delete("/sessions/\(id)") }
func deleteWorkspace(_ id: String) async throws { try await delete("/workspaces/\(id)") }

func addProject(path: String) async throws {
_ = try await post("/projects", body: ["path": path])
}

func browse(path: String?) async throws -> FolderListing {
var p = "/browse"
if let path, let enc = path.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
p += "?path=\(enc)"
}
return try await get(p)
}

func createWorkspace(repoId: String) async throws -> Workspace {
try decoder.decode(Workspace.self, from: try await post("/repos/\(repoId)/workspaces"))
}
Expand Down
26 changes: 14 additions & 12 deletions ConductorMobile/Models.swift → PiMobile/Models.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

// Shapes mirror the companion server's JSON API, which mirrors conductor.db.
// Shapes mirror the companion server's JSON API over Pi's session files.

struct Repo: Identifiable, Codable, Hashable {
let id: String
Expand Down Expand Up @@ -31,27 +31,23 @@ struct ChatSession: Identifiable, Codable, Hashable {
let agentType: String?
let updatedAt: Date

var isClaude: Bool { agentType == nil || agentType == "claude" }
var modelLabel: String { prettyModel(model) }
}

// One picker section, as Conductor model ids. Picking a model from a different
// harness switches the chat's agent, like the desktop.
// One picker section per Pi provider; ids are "provider/model" and pass
// straight through to `pi --model`.
struct ModelGroup: Codable, Hashable {
let title: String
let models: [String]
}

// The live groups come from the server's /models (scraped from the desktop
// app's bundle). This static list is only the fallback for older servers or
// before the fetch lands.
// The live groups come from the server's /models (Pi's own model catalog).
// This static list is only the fallback before the fetch lands.
enum HarnessModels {
static let fallback: [ModelGroup] = [
ModelGroup(title: "Claude Code", models: ["fable-5", "opus-4-8-1m", "opus-4-7-1m", "opus-4-6-1m",
"sonnet-5-1m", "sonnet-4-6-1m", "sonnet-4-6", "haiku-4-5"]),
ModelGroup(title: "Codex", models: ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4"]),
ModelGroup(title: "Cursor", models: ["auto", "composer-2.5", "grok-4.5"]),
ModelGroup(title: "OpenCode", models: ["opencode:openrouter/moonshotai/kimi-k2.7-code", "opencode:openrouter/z-ai/glm-5.2"]),
ModelGroup(title: "anthropic", models: ["anthropic/claude-fable-5", "anthropic/claude-opus-4-8",
"anthropic/claude-sonnet-5", "anthropic/claude-haiku-4-5"]),
ModelGroup(title: "openai-codex", models: ["openai-codex/gpt-5.6-sol", "openai-codex/gpt-5.5", "openai-codex/gpt-5.4"]),
]
}

Expand Down Expand Up @@ -89,6 +85,12 @@ struct WorkspaceDiff: Codable {
let diff: String
}

struct FolderListing: Codable {
let path: String
let parent: String?
let dirs: [String]
}

struct AgentStatus: Codable {
let running: Bool
let activity: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct DebugChatPush: View {
#endif

@main
struct ConductorMobileApp: App {
struct PiMobileApp: App {
@State private var api = APIClient()

var body: some Scene {
Expand All @@ -42,9 +42,9 @@ struct ConductorMobileApp: App {
}
.environment(api)
.preferredColorScheme(.dark)
// conductor-companion://pair?name=…&addr=…&token=… (QR printed by the server)
// pi-companion://pair?name=…&addr=…&token=… (QR printed by the server)
.onOpenURL { url in
guard url.scheme == "conductor-companion", url.host() == "pair",
guard url.scheme == "pi-companion", url.host() == "pair",
let items = URLComponents(url: url, resolvingAgainstBaseURL: false)?.queryItems,
let addr = items.first(where: { $0.name == "addr" })?.value,
let token = items.first(where: { $0.name == "token" })?.value else { return }
Expand Down
2 changes: 1 addition & 1 deletion ConductorMobile/Theme.swift → PiMobile/Theme.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftUI

// Design tokens from "Conductor Mobile.dc.html" (claude.ai/design).
// Design tokens from "Pi Mobile.dc.html" (claude.ai/design).
enum Theme {
static let bg = Color(red: 0.039, green: 0.039, blue: 0.043) // #0A0A0B
static let card = Color(red: 0.11, green: 0.11, blue: 0.125).opacity(0.6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct ChatView: View {
private var sessionId: String? { session?.id }
@State private var running = false
@State private var activity = ""
@State private var model: String? // Conductor model id; nil = session default
@State private var model: String? // Pi "provider/model" id; nil = session default

var body: some View {
VStack(spacing: 0) {
Expand Down Expand Up @@ -90,6 +90,19 @@ struct ChatView: View {
.padding(.horizontal, 12).padding(.vertical, 6)
.background(s.id == sessionId ? Color.white.opacity(0.09) : Color.white.opacity(0.03), in: Capsule())
}
.contextMenu {
Button("Delete Chat", systemImage: "trash", role: .destructive) {
Task {
try? await api.deleteSession(s.id)
sessions.removeAll { $0.id == s.id }
if s.id == sessionId {
session = nil
messages = []
if let next = sessions.first { select(next) }
}
}
}
}
}
Button {
Task {
Expand Down Expand Up @@ -158,8 +171,10 @@ struct ChatView: View {

private var modelPill: some View {
Menu {
// One submenu per provider — Menu drops Section titles on iOS 26,
// and providers like openrouter have hundreds of models.
ForEach(api.modelGroups ?? HarnessModels.fallback, id: \.title) { group in
Section(group.title) {
Menu(group.title) {
Picker(group.title, selection: $model) {
ForEach(group.models, id: \.self) { m in
Text(prettyModel(m)).tag(String?.some(m))
Expand Down Expand Up @@ -249,7 +264,7 @@ struct ChatView: View {
}
}

// Conductor embeds pasted files in message text as "@⟦name⟧(url-encoded-relative-path)".
// Desktop-pasted files may appear in message text as "@⟦name⟧(url-encoded-relative-path)".
struct Attachment: Identifiable {
let name: String
let path: String
Expand Down
File renamed without changes.
Loading