Skip to content

D-12: AgentChatUI package skeleton + apple/swift-markdown dependency #262

@kirich1409

Description

@kirich1409

Description

Create the AgentChatUI SPM package — the SwiftUI presentation layer for Dialogue. This is the consumer of AgentChat + DesignSystem and hosts the markdown renderer dependency.

Spec: Epic #250 §4.1, §8 (External dependencies).

Scope

Package skeleton

MacApp/Packages/AgentChatUI/Package.swift:

  • swift-tools-version: 6.3
  • .swiftLanguageMode(.v6)
  • Platforms: .macOS(.v26)
  • Targets: AgentChatUI (lib) + AgentChatUITests + AgentChatUISnapshotTests (separate target, if snapshot-testing lib used)
  • Dependencies:
    • AgentChat (domain + reducer)
    • DesignSystem
    • SharedModels
    • ComposableArchitecture
    • apple/swift-markdown — SHA-pinned or branch: "main" (Apple does not tag releases) — see dependency approval in description
    • pointfreeco/swift-snapshot-testing (dev-only, test target)

Dependency approval

Approval for apple/swift-markdown addition is a blocking prerequisite to merge.

  • Why swift-markdown: Apache-2.0, maintained by Apple, no bus factor risk. Chosen after deep-dive rejected Textual (3 critical open issues) and swift-markdown-ui (maintenance mode). See docs/architecture/dialogue.md §4 Dependencies.
  • Transitive: pulls swift-cmark (Apple fork, ветка gfm) — C library, statically linked.
  • Swift 6 concurrency: package declared swift-tools-version: 5.7, some types not explicitly Sendable. Mitigation — parse on @MainActor, never cross actor boundaries with Document. Confirmed feasible.
  • Pinning strategy: pin to a specific commit SHA initially; update SHA deliberately when upgrading.

Skeleton content

Sources/AgentChatUI/AgentChatUI.swift — public umbrella file re-exporting AgentChat types for consumers; empty stubs for DialogueView, DialogueMarkdownView (implemented in later tasks).

README stub documenting package purpose and ownership (agent-chat-api label for public API changes, analogous to ds-api).

Acceptance Criteria

  • Package compiles with no code in targets (skeleton) under Swift 6 strict.
  • apple/swift-markdown listed in Package.swift with pinned SHA.
  • Dependency approved by project owner (PR review step).
  • Added to Relay.xcodeproj as referenced package.
  • AgentChatUI/README.md exists with package purpose, owner, and API-change policy.
  • Integration into Relay.app target (empty use — placeholder import) verifies build works.

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