refactor(domain): the shared types where MAX says the same thing - #254
Merged
Merged
Conversation
Step 4 of the layer design, first half. src/domain/models.ts re-exports 17 types from @leemour/cli-messaging (Id, Chat, ChatKind, Contact, Member, Page, ChatCard, PersonCard, ChatEvent(s), AccountSession, …) and declares only what MAX says differently or alone. Types only: nothing max prints changes, and every test passes unedited. Kept as MAX's own until T6: Attachment (fileId, videoId, event, userIds, poll), Message and every type built on it, Poll, GroupMember, Inbox, Review. Moving the attachment fields would change max's --json. The MAX facts measured on the shared types stay as notes beside the re-export. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
Step 4 of the layer design, first half (the plan in the private repository): one domain model for max and tg.
Why
max-cli kept a copy of cli-messaging's domain types, and copies drift. Every type that says the same thing now comes from one place. That is the ground the move onto the shared services (T6) stands on.
What
src/domain/models.tsre-exports 17 types from@leemour/cli-messaging(0.49.0, the pinned version):Id,Chat,ChatKind,Contact,Member,Page,ChatCard,PersonCard,ChatEvent,ChatEvents,AccountSession,AttachmentLink,Pin,Deletion,ReadMark,Reactions,Profile. It declares only what MAX says differently or alone (380 → about 250 lines).Attachment: itsfileId,videoId,event,userIdsandpollwould move underproviderRef, and that changesmax … --json.Message, and every type built on it.Poll,GroupMember,Inbox,Review.Testing
pnpm lint && pnpm typecheck && pnpm test && pnpm docs:check: 1190 tests pass, and no test was edited. The change is types only, so nothing max prints can change.🤖 Generated with Claude Code