AGENTS.md@packages/chat-gateway/src/shared · git:20261005.ee19c85 · 2026-10-05 · sha256 5ae0e9b60886e30a

AGENTS.md@packages/chat-gateway/src/shared git:20261005.ee19c85A

Immutable. This exact content never changes and is served at /api/v1/blob/5ae0e9b60886e30a.

# DOX — packages/chat-gateway/src/shared

Files in this directory. One row per source file. See change: add-chat-gateway.

| File | Purpose |
|------|---------|
| `types.ts` | The pure shared contract (no I/O, no host import): `ChatGatewayConfig` (mirrors `../configSchema.json`) + `ResolvedConfig` + `CONFIG_DEFAULTS`, `InboundMessage` (incl. `parentChannelId` — L4 treats an opted-in parent as opting in its threads), `BindingSource` (precedence-ordered), `Binding` (a THREAD binding also persists `parentChannelId`, so the bound channel's workspace and mirror level still resolve) + `bindingKey({platform,channelId,threadId})` (canonical, collision-free; thread keyed separately from its parent channel), `AuthAction`/`AuthDecision`. Also the TEAM-CONTROLS SURFACE wire shape + its two browser message names: `SurfaceRoleAssigners` (`assigners` | `unavailable{missingPermission}` — never an empty list meaning "cannot tell"), `SurfaceRoleMapping`, `SurfaceFolder` (with `inert`), `SurfaceBinding`, `SurfaceLogEntry`, `TeamSurfaceView`, and the `TEAM_SURFACE_MESSAGE`/`TEAM_CONFIG_MESSAGE` constants (defined here, not in the server entry, so the panel imports no server code). Every union is spelled out rather than imported to keep this file import-free. Imported by both the server component and the settings panel. `sessionVisibility?: "hidden"|"shown"` (resolved: required, `CONFIG_DEFAULTS.sessionVisibility = "hidden"`). See change: hide-chat-gateway-sessions. `threadPerConversation` (default true); `InboundMessage.messageId?`. See change: chat-gateway-thread-per-conversation. `mirrorDashboardSessions?: boolean` (default false). See change: chat-gateway-attach-dashboard-sessions. |
| `index.ts` | Barrel re-export of `./types.js` — the `./shared` export subpath. |