Skip to content

D-6: SharedModels — introduce SessionSurface enum #256

@kirich1409

Description

@kirich1409

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

  • SessionSurface.swift with enum, AgentKind enum, public computed helpers.
  • AgentSession extended with immutable surface: SessionSurface.
  • Codable roundtrip test for .shell, .agentTerminal(.claudeCode), .agentDialogue(.claudeCode).
  • Equatable works as expected (different surfaces on the same agent kind are distinct).
  • AgentKind.allCases usable for enumerating supported kinds (CaseIterable).
  • Swift 6 strict concurrency — all types Sendable.

Relationships

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions