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
Relationships
Description
Create the
AgentChatUISPM package — the SwiftUI presentation layer for Dialogue. This is the consumer ofAgentChat+DesignSystemand 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).macOS(.v26)AgentChatUI(lib) +AgentChatUITests+AgentChatUISnapshotTests(separate target, if snapshot-testing lib used)AgentChat(domain + reducer)DesignSystemSharedModelsComposableArchitectureapple/swift-markdown— SHA-pinned orbranch: "main"(Apple does not tag releases) — see dependency approval in descriptionpointfreeco/swift-snapshot-testing(dev-only, test target)Dependency approval
Approval for
apple/swift-markdownaddition is a blocking prerequisite to merge.docs/architecture/dialogue.md§4 Dependencies.swift-cmark(Apple fork, веткаgfm) — C library, statically linked.swift-tools-version: 5.7, some types not explicitlySendable. Mitigation — parse on@MainActor, never cross actor boundaries withDocument. Confirmed feasible.Skeleton content
Sources/AgentChatUI/AgentChatUI.swift— public umbrella file re-exportingAgentChattypes for consumers; empty stubs forDialogueView,DialogueMarkdownView(implemented in later tasks).README stub documenting package purpose and ownership (
agent-chat-apilabel for public API changes, analogous tods-api).Acceptance Criteria
apple/swift-markdownlisted inPackage.swiftwith pinned SHA.Relay.xcodeprojas referenced package.AgentChatUI/README.mdexists with package purpose, owner, and API-change policy.Relay.apptarget (empty use — placeholder import) verifies build works.Relationships