import * as S from "effect/Schema"; import { defineAspect, type Aspect } from "../Aspect.ts"; export interface Channel< Name extends string = string, References extends any[] = any[], > extends Aspect {} export type ChannelId = string; export const ChannelId = S.String.annotate({ description: "The ID of the channel", }); export const Channel = defineAspect< ( name: Name, ) => ( template: TemplateStringsArray, ...references: References ) => Channel >("channel"); export const channelContext = Channel.plugin.context.succeed({ context: (channel) => `#${channel.id}`, });