@kitlangton
Problem
SessionMessage.ID is currently defined indirectly through a standalone session-message-id.ts module:
import { SessionMessageID } from "./session-message-id"
export const ID = SessionMessageID.ID
export type ID = SessionMessageID.ID
The schema package has the real ID module, and Core adds a second two-line wrapper for it. Unlike session-id.ts and workspace-id.ts, this split is not preventing a circular dependency: session-message.ts does not depend on session-event.ts or session-input.ts.
This leaves an extra module and forwarding aliases without a dependency-boundary benefit.
Proposed solution
- Define the branded
ID schema and its create() static directly in packages/schema/src/session-message.ts.
- Update schema consumers (
session-event.ts and session-input.ts) to use SessionMessage.ID.
- Update Core's
session/context-epoch.ts to use SessionMessage.ID.create().
- Delete both wrappers:
packages/schema/src/session-message-id.ts
packages/core/src/session/message-id.ts
Keep session-id.ts and workspace-id.ts separate: those are shared leaf modules whose inlining would introduce dependency cycles.
@kitlangton
Problem
SessionMessage.IDis currently defined indirectly through a standalonesession-message-id.tsmodule:The schema package has the real ID module, and Core adds a second two-line wrapper for it. Unlike
session-id.tsandworkspace-id.ts, this split is not preventing a circular dependency:session-message.tsdoes not depend onsession-event.tsorsession-input.ts.This leaves an extra module and forwarding aliases without a dependency-boundary benefit.
Proposed solution
IDschema and itscreate()static directly inpackages/schema/src/session-message.ts.session-event.tsandsession-input.ts) to useSessionMessage.ID.session/context-epoch.tsto useSessionMessage.ID.create().packages/schema/src/session-message-id.tspackages/core/src/session/message-id.tsKeep
session-id.tsandworkspace-id.tsseparate: those are shared leaf modules whose inlining would introduce dependency cycles.