Review Feature Access
Nucleic-Session: 85A6233A-F3F6-44B2-AD0B-261D49EE9C35 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -843,3 +843,41 @@ extension Data {
|
||||
DeviceIdentity.fingerprint(ofStaticKey: self)
|
||||
}
|
||||
}
|
||||
|
||||
extension WireSessionSummary {
|
||||
/// A copy with selected fields overridden — the demo simulator's only way to "mutate" a
|
||||
/// summary, whose stored properties are all `let`. Nullable fields use a double optional so a
|
||||
/// caller can distinguish "keep" (omit) from "set to nil" (`.some(nil)`). `updatedAt` bumps
|
||||
/// to now unless given. Only the fields the simulator touches are exposed.
|
||||
func demoCopy(
|
||||
status: SessionStatus? = nil,
|
||||
disposition: TurnDisposition?? = nil,
|
||||
title: String? = nil,
|
||||
favorite: Bool? = nil,
|
||||
archived: Bool? = nil,
|
||||
pendingApprovalCount: Int? = nil,
|
||||
diffStat: DiffStat?? = nil,
|
||||
model: String?? = nil,
|
||||
effort: String?? = nil,
|
||||
auto: Bool? = nil,
|
||||
autoShip: Bool? = nil,
|
||||
shipBranch: String?? = nil,
|
||||
updatedAt: Date? = nil
|
||||
) -> WireSessionSummary {
|
||||
WireSessionSummary(
|
||||
sessionID: sessionID, projectID: projectID, projectName: projectName, backend: backend,
|
||||
status: status ?? self.status,
|
||||
disposition: disposition ?? self.disposition,
|
||||
title: title ?? self.title, branch: branch, lastSeq: lastSeq,
|
||||
diffStat: diffStat ?? self.diffStat,
|
||||
pendingApprovalCount: pendingApprovalCount ?? self.pendingApprovalCount,
|
||||
favorite: favorite ?? self.favorite,
|
||||
archived: archived ?? self.archived,
|
||||
queuedMessage: queuedMessage, queuedMessages: queuedMessages,
|
||||
model: model ?? self.model, effort: effort ?? self.effort,
|
||||
auto: auto ?? self.auto, autoShip: autoShip ?? self.autoShip,
|
||||
shipBranch: shipBranch ?? self.shipBranch,
|
||||
contextInputTokens: contextInputTokens,
|
||||
updatedAt: updatedAt ?? Date())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user