Description
Add a SessionSurface enum and related types to SharedModels. Immutable after session creation; differentiates shell vs terminal-rendered agent vs chat-rendered agent. Foundation for all downstream routing (PaneManager, AgentSessionFeature, MainFeature).
Spec: Epic #250 §5 (Session surface model).
Scope
Add MacApp/Packages/SharedModels/Sources/SharedModels/SessionSurface.swift:
```swift
public enum SessionSurface: Equatable, Sendable, Codable {
case shell
case agentTerminal(AgentKind)
case agentDialogue(AgentKind)
}
public enum AgentKind: String, Equatable, Sendable, Codable, CaseIterable {
case claudeCode
// future: codex, aider, acpGeneric
}
public extension SessionSurface {
var isAgent: Bool { switch self { case .shell: false; default: true } }
var agentKind: AgentKind? { /* extract kind or nil / }
var isDialogue: Bool { / ... */ }
}
```
Extend AgentSession (value type in SharedModels) to include surface: SessionSurface — immutable let-property set at creation.
Codable: derive default coding; ensure roundtrip for all cases. For Tab.kind (SessionKind enum: .default / .userCreated) — keep untouched, surface is orthogonal.
Acceptance Criteria
Relationships
Description
Add a
SessionSurfaceenum and related types toSharedModels. Immutable after session creation; differentiates shell vs terminal-rendered agent vs chat-rendered agent. Foundation for all downstream routing (PaneManager, AgentSessionFeature, MainFeature).Spec: Epic #250 §5 (Session surface model).
Scope
Add
MacApp/Packages/SharedModels/Sources/SharedModels/SessionSurface.swift:```swift
public enum SessionSurface: Equatable, Sendable, Codable {
case shell
case agentTerminal(AgentKind)
case agentDialogue(AgentKind)
}
public enum AgentKind: String, Equatable, Sendable, Codable, CaseIterable {
case claudeCode
// future: codex, aider, acpGeneric
}
public extension SessionSurface {
var isAgent: Bool { switch self { case .shell: false; default: true } }
var agentKind: AgentKind? { /* extract kind or nil / }
var isDialogue: Bool { / ... */ }
}
```
Extend
AgentSession(value type inSharedModels) to includesurface: SessionSurface— immutable let-property set at creation.Codable: derive default coding; ensure roundtrip for all cases. For
Tab.kind(SessionKindenum:.default/.userCreated) — keep untouched,surfaceis orthogonal.Acceptance Criteria
SessionSurface.swiftwith enum,AgentKindenum, public computed helpers.AgentSessionextended with immutablesurface: SessionSurface..shell,.agentTerminal(.claudeCode),.agentDialogue(.claudeCode).Equatableworks as expected (different surfaces on the same agent kind are distinct).AgentKind.allCasesusable for enumerating supported kinds (CaseIterable).Sendable.Relationships