Files
hapi/ios/Packages/HapiKit/Sources/HapiProtocol/Pairing/SessionListLink.swift
T
14f2dd763e feat(ios): session citations, custom Claude models and chat status polish
- Copy a session citation from the list (native parity with the web
  reference text) and open the paired session list via
  hapicompanion://sessions.
- Load hub-wide custom Claude models in New Session with machine-catalog
  fallback, and show the transcript-resolved model in chat chrome.
- Render synthetic Claude API failures as error events instead of leaking
  the <synthetic> model or zero usage into the context meter.
- Refresh the session list returning from chat, request the list from Home,
  and update the home widget surfaces.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-08 20:24:30 +08:00

25 lines
971 B
Swift

import Foundation
/// `hapicompanion://sessions` — opens the paired session list rather than a
/// specific chat. Home-screen widgets use it for their blank/card tap; row
/// links keep the existing `hapicompanion://sessions/<id>` route.
public enum SessionListLink {
public static let scheme = SessionLink.scheme
public static let host = SessionLink.host
public static var url: URL? {
var components = URLComponents()
components.scheme = scheme
components.host = host
return components.url
}
public static func matches(_ raw: String) -> Bool {
let trimmed = raw.trimmingCharacters(in: .whitespacesAndNewlines)
guard let components = URLComponents(string: trimmed),
components.scheme?.lowercased() == scheme,
components.host?.lowercased() == host else { return false }
return components.percentEncodedPath.isEmpty || components.percentEncodedPath == "/"
}
}