Initial commit

This commit is contained in:
Adam Jones 2025-09-20 02:41:11 +00:00
commit e3f0af2f94
No known key found for this signature in database
3 changed files with 3857 additions and 0 deletions

15
src/config/groups.ts Normal file
View file

@ -0,0 +1,15 @@
import { defineGroups } from './utils';
// NOTE: For GitHub teams, only the first memberOf will be used as the parent team.
// GitHub only supports one parent team per team.
export const GROUPS = defineGroups([
{
name: 'test-parent',
description: 'All maintainers. Users should not be added directly to this group.',
},
{
name: 'test-child',
description: 'Registry maintainers',
memberOf: ['test-parent'],
},
] as const);

9
src/config/users.ts Normal file
View file

@ -0,0 +1,9 @@
import type { Member } from './utils';
export const MEMBERS: readonly Member[] = [
{
github: 'domdomegg',
email: 'adam@modelcontextprotocol.io',
memberOf: ['test-child'],
},
] as const;

37
src/config/utils.ts Normal file
View file

@ -0,0 +1,37 @@
import type { GROUPS } from './groups';
function isValidGroupName(name: string): boolean {
return /^[a-z][a-z0-9-]*[a-z]$/.test(name);
}
export function defineGroups<
const T extends readonly {
name: Lowercase<string>;
description: string;
memberOf?: readonly (T[number]['name'])[];
}[]
>(groups: T) {
for (const group of groups) {
if (!isValidGroupName(group.name)) {
throw new Error(
`Invalid group name: ${group.name}. Must be lowercase alphanumeric with dashes, starting with a letter.`
);
}
}
return groups;
}
export type GroupKey = (typeof GROUPS)[number]['name'];
export interface Group {
name: GroupKey;
description: string;
memberOf?: readonly GroupKey[];
}
export interface Member {
github?: string;
email?: `${string}@modelcontextprotocol.io`;
memberOf: readonly GroupKey[];
}