feat(macos): show Anthropic auth mode + OAuth connect

This commit is contained in:
Peter Steinberger
2025-12-17 19:14:54 +00:00
parent a0c4b1e061
commit 1a4540d386
8 changed files with 556 additions and 210 deletions

View File

@@ -12,6 +12,25 @@ struct PiOAuthStoreTests {
#expect(PiOAuthStore.anthropicOAuthStatus(at: url) == .missingFile)
}
@Test
func usesEnvOverrideForPiAgentDir() throws {
let key = "PI_CODING_AGENT_DIR"
let previous = ProcessInfo.processInfo.environment[key]
defer {
if let previous {
setenv(key, previous, 1)
} else {
unsetenv(key)
}
}
let dir = FileManager.default.temporaryDirectory
.appendingPathComponent("clawdis-pi-agent-\(UUID().uuidString)", isDirectory: true)
setenv(key, dir.path, 1)
#expect(PiOAuthStore.oauthDir().standardizedFileURL == dir.standardizedFileURL)
}
@Test
func acceptsPiFormatTokens() throws {
let url = try self.writeOAuthFile([